file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/** DoBuy 0% Fee on buying and selling MSN There is no dev or marketing fee. liquidity will be locked. DoBuy is a social experiment style of token. All you need to do is buy and share/shill/promote or simply talk about it. Your Xs will depend on how much you shill. There is no ...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
6,974,855
./partial_match/1/0x8716F20eD86CE1b9931dB53E851b62160437D13f/sources/BarnBridgeConverter.sol
uint _poolOutByAmount0 = bmul(bdiv(_amount0, _balToken0Amount), _balTotalSupply); uint _poolOutByAmount1 = bmul(bdiv(_amount1, _balToken1Amount), _balTotalSupply);
function calculateAddBptLiquidity( Balancer _balPool, address _token0, address _token1, uint256 _amount0, uint256 _amount1 ) internal view returns (uint256 _poolAmountOut) { require(_amount0 > 0 && _amount1 > 0, "Insufficient liquidity amount"); uint256 _b...
4,437,571
./full_match/5/0x06F03D79C9a1436c32CD1b71230690eca78f4F74/sources/contracts/GenesisRocket.sol
feedback for minter contracts
function checkMints(address a) external view returns(uint256){ return _mintCounter[a]; }
1,928,607
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // 'Bitway' 'ERC20 Token' // // Name : Bitway // Symbol : BTWX // Max supply : 21m // Decimals : 18 // // Bitway "BTWX" // -----------------------------------------------------------------...
------------------------------------------------------------------------ Create tokens and supply to msg.sender balances ------------------------------------------------------------------------
function supplyTokens(uint tokens) private { require(!maxSupplyReached()); balances[msg.sender] = balances[msg.sender].add(tokens); totalSupply = totalSupply.add(tokens); if (totalSupply >= targetSupply[stage]) { stage += 1; } emit Transfer(address(0), msg...
927,004
// Diode Contracts // Copyright 2021 Diode // Licensed under the Diode License, Version 1.0 pragma solidity ^0.6.0; import "./deps/Diode.sol"; import "./deps/Utils.sol"; import "./deps/SafeMath.sol"; import "./deps/Address.sol"; import "./FleetContract.sol"; /** * DiodeStake * * Use ether as diode token * 1 diode...
This function skips the time lock - is used for added stake from mining
function addStakeNow(Data memory dat, uint256 _stake) internal pure returns(Data memory) { dat.staked.doneAmount = dat.staked.doneAmount.add(_stake); return dat; }
6,347,447
./full_match/11155111/0xFCc8a75ab4e55E1E9c3d8d1A8d833CB7BF45F5B7/sources/_ganache/console.log/console.sol
Prints to `stdout` with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution ```solidity uint256 count = 5; console.log('count: %d', count); console.log('count:', count); ``` See `util.format()` for more information./
function log(string memory value1, address value2, string memory value3, address value4) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", value1, value2, value3, value4)); }
3,821,397
// SPDX-License-Identifier: UNLICENCED // Implementation Copyright 2021, the author; All rights reserved // // This contract is an on-chain implementation of a concept created and // developed by John F Simon Jr in partnership with e•a•t•works and // @fingerprintsDAO pragma solidity 0.8.10; import "./EveryIconLib.sol"...
/ Counter will never be as high as 2^247 (because the sun will have depleted by then) and remain is in [0,256], so pack them to save 20k gas on an SSTORE.
function store(Source src, uint256[2] storage stored) internal { uint256 seed; uint256 packed; assembly { seed := mload(src) packed := add( shl(9, mload(add(src, COUNTER))), mload(add(src, REMAIN)) ) } stored...
1,513,521
./partial_match/3/0xe41a67e658a25E8b93f15498D840080cBf199963/sources/UniMexMargin.sol
uint256 commitment = getCommitment(owed, position.leverage);uint256 profit = swap.sub(owed);IERC20(position.token).approve(address(uniswap_router), profit);uint256 profitInEth = swapTokens(position.token, profit, true, slippage);uint256 fees = (profitInEth.mul(8e15)).div(1e18);uint256 profitInEthMinusFees = profitInEth...
function closePosition(bytes32 tradeId, uint256 slippage) public { Position storage position = positionInfo[tradeId]; require(msg.sender == position.owner, 'UNIMEX: BORROWER_ONLY'); bool isShort = position.owedTokens > 0 ? true : false; uint256 inp...
5,160,937
pragma solidity 0.4.21; /** * @title Ownable Contract * @dev contract that has a user and can implement user access restrictions based on it */ contract Ownable { address public owner; /** * @dev sets owner of contract */ function Ownable() public { owner = msg.sender; } /** ...
Creates Policy, transfers ownership to msg.sender, registers address for all parties involved, and transfers IXT/
function createContract(string _clientInfo, address _brokerEtherAddress, address _clientEtherAddress, string _enquiryId) public isNotPaused { Policy policy = new Policy(_clientInfo, _brokerEtherAddress, _clientEtherAddress, _enquiryId); policy.changeOwner(msg.sender); policiesByParticipant[_brokerEtherAd...
6,376,758
pragma solidity ^0.5.16; import "./VToken.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./PriceOracle.sol"; import "./ComptrollerInterface.sol"; import "./ComptrollerStorage.sol"; import "./Unitroller.sol"; import "./Governance/XVS.sol"; import "./VAI/VAI.sol"; /** * @title Venus's Comptrol...
Transfer XVS to the user, if they are above the threshold Note: If there is not enough XVS, we do not perform the transfer all. user The address of the user to transfer XVS to userAccrued The amount of XVS to (possibly) transfer return The amount of XVS which was NOT transferred to the user/
function transferXVS(address user, uint userAccrued, uint threshold) internal returns (uint) { if (userAccrued >= threshold && userAccrued > 0) { XVS xvs = XVS(getXVSAddress()); uint xvsRemaining = xvs.balanceOf(address(this)); if (userAccrued <= xvsRemaining) { ...
5,479,925
/** *Submitted for verification at Etherscan.io on 2020-09-14 */ /** *Submitted for verification at Etherscan.io on 2020-08-26 */ // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** *...
Deposit LP tokens to MasterChef for FXSWAP allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accFxswapPerShare).div(1e12).sub(user.rewar...
10,928,129
./full_match/4/0x7Db7deaf0e6ED69e29a59bAB170993d3622999F0/sources/contracts/ANTZ/AtomicAntzNFTCollection.sol
See {ERC721}./
function _baseURI() internal view virtual override returns ( string memory ) { return baseURI; }
787,632
./full_match/4/0x482C15FE45A2D695f55D5Cea16Dae28D5Fc9a2DB/sources/Router.sol
calculates the CREATE2 address for a pair without making any external callshex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' init code hash
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.enco...
12,394,446
// SPDX-License-Identifier: GPL-3.0 // File: @openzeppelin/contracts/utils/Strings.sol pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. ...
reserved NFTs for creator
function reservedMint(uint256 number, address recipient) public onlyOwner { require(numberOfTokens+ number <= maxTokens, 'No more NFTs to mint!'); for (uint256 i = 0; i < number; i++) { _safeMint(recipient, tokenId()); mintsPerAddress[recipient] += 1; numberOfToke...
492,425
./full_match/43113/0x3a7EfC389459dfF7166AE1B482a63ce2FFCDF61F/sources/contracts/avax.sol
Sets `amount` as the allowance of `spender` over the `owner` s tokens. This internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address./
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "JHL: approve from the zero address"); require(spender != address(0), "JHL: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spe...
7,180,691
./full_match/1/0x4EB545174DBCe08077fB4689CA7a6eC46F6B5E10/sources/FavorCoinCrowdsale.sol
fallback function DO NOT OVERRIDE/
function () external payable { buyTokens(msg.sender); }
9,654,316
./partial_match/1/0x228818e932952144d8c6c674ce8bBC3dD8681Ca8/sources/erc721a-upgradeable/contracts/ERC721AUpgradeable.sol
Returns the total number of tokens burned./
function _totalBurned() internal view returns (uint256) { return ERC721AStorage.layout()._burnCounter; }
2,596,090
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "../library/LibSafeMath.sol"; import "../ERC1155Mintable.sol"; import "../mixin/MixinOwnable.sol"; import "../mixin/MixinPausable.sol"; import "../HashRegistry.sol"; contract SagaHistoricMinter is Ownable, MixinPausable { using LibSafeMath for uint256...
selectors for receiver callbacks id => (owner => balance) owner => (operator => approved)
{ using LibAddress for address; using LibSafeMath for uint256; bytes4 constant public ERC1155_RECEIVED = 0xf23a6e61; bytes4 constant public ERC1155_BATCH_RECEIVED = 0xbc197c81; mapping (uint256 => mapping(address => uint256)) internal balances; mapping (address => mapping(address => boo...
63,636
./full_match/1/0xF3e45c7271AC74e2e9e969dCB90889a634601901/sources/contracts/S1VesperFinanceETH.sol
claim VSP tokens, swap them for ETH and withdraw
function claimInETH(uint256 _amountOutMin) external { claimInToken(wethAddress, _amountOutMin); }
16,534,355
// SPDX-License-Identifier: MIT pragma solidity ^0.5.17; ...
inject NONSTANDARD NAMING
function BALANCEOF996(address) external view returns (uint256);
12,870,914
./full_match/4/0xb381d6FBd286bE99BCE0146df3D82B3fE4A91015/sources/contracts/TokenCity282022Fire.sol
grants minter role to user (only for `DEFAULT_ADMIN_ROLE`) user address of user
function grantRoleMinter(address user) external onlyRole(DEFAULT_ADMIN_ROLE) { grantRole(MINTER_ROLE, user); }
796,759
pragma solidity ^0.7.0; // SPDX-License-Identifier: AGPL-3.0-or-later //MATH OPERATIONS -- designed to avoid possibility of errors with built-in math functions library SafeMath { //@dev Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (...
increases approved amount of tokens that an external address can transfer on behalf of the user
function increaseAllowance(address approvedAddress, uint256 amountTokens) external returns (bool) { uint256 pastAllowance = allowance[msg.sender][approvedAddress]; uint256 newAllowance = pastAllowance.add(amountTokens); allowance[msg.sender][approvedAddress] = newAllowance; emit Appr...
989,842
./partial_match/1/0xC54698d116F40faBD5349BB7a756CFea1Cb084aD/sources/DRCHashDataCon.sol
get inserted hash string by the Tx hash _txHash is input value of Tx hash return is the hash string corresponding to the Tx hash/
function getHashByTxId(string memory _txHash) public view returns (string memory) { require(!_txHash.equal("")); return insertedHashInfo[_txHash]; }
3,885,143
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** ...
Grant user referral bonus in user withdraw/ user bonus double burn /
function _referralPayout(address _addr, uint256 _amount) private { address ref = players[_addr].referral; uint256 _day_payout = _payoutOfDay(_addr); if(_day_payout == 0) return; for(uint8 i = 0; i < referral_bonuses.length; i++) { if(ref == ...
1,148,338
./full_match/7672/0xFfb937647c9a2ff42556D78FBC6dA2baA8804C98/sources/contracts/Bridge.sol
Set _sendMessageFee
function setSendMessageFee(uint256 _fee) external onlyOwner { _sendMessageFee = _fee; emit SendMessageFeeUpdated(_fee); }
16,296,233
./full_match/97/0x9992C1A829E67Bb09039B3bBB5A4610fb1646664/sources/project_/contracts/strf-token-staker/FeeDistributor.sol
Internal function to update token balances. Updates treasury and stakers token balances with new passed down amounts. token reward token that will be updated. treasuryReward treasury reward amount to be updated. stakersReward stakers reward amount to be updated./
function _updateBalances( address token, uint256 treasuryReward, uint256 stakersReward ) internal { treasuryBalance[token] += treasuryReward; stakersBalance[token] += stakersReward; }
3,287,619
./full_match/1/0x0087D11551437c3964Dddf0F4FA58836c5C5d949/sources/contracts/PoolInformation.sol
@inheritdoc IPoolInformation
function getBinDepth(IPool pool, uint128 binId) public view returns (uint256 depth) { IPool.BinState memory bin = pool.getBin(binId); while (bin.mergeId != 0) { depth++; binId = bin.mergeId; bin = pool.getBin(bin.mergeId); } }
4,956,575
./full_match/1/0x6f737614cC5b89bbAd665f0e6803eE6867835d58/sources/contracts/CErc20AuraDelegator.sol
Sets a new comptroller for the market Admin function to set a new comptroller return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/
function _setComptroller(ComptrollerInterface newComptroller) override public returns (uint) { bytes memory data = delegateToImplementation(abi.encodeWithSignature("_setComptroller(address)", newComptroller)); return abi.decode(data, (uint)); }
3,001,941
/** *Submitted for verification at Etherscan.io on 2021-12-15 */ // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.4.0/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.0 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 pri...
Indicates weither any token exist with a given id, or not./
function exists(uint256 id) public view virtual returns (bool) { return tokenCreators[id] != address(0); }
6,574,785
pragma solidity ^0.5.4; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint2...
Transfer from balance to balance/
function unlockBalance(address target, uint256 amount) external onlyOwner { super._unlockBalance(target, amount); }
12,121,953
pragma solidity 0.4.24; /** * Safe unsigned safe math. * * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli * * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol * * Maintained here until merged to mainline zeppe...
Allow crowdsale owner to close early or extend the crowdsale. This is useful e.g. for a manual soft cap implementation: - after X amount is reached determine manual closing This may put the crowdsale to an invalid state, but we trust owners know what they are doing./
function setEndsAt(uint time) public onlyOwner { assert(!finalized); assert(isUpdatable); assert(startsAt <= time); assert(now <= endsAt); CrowdsaleExt lastTierCntrct = CrowdsaleExt(getLastTier()); if (lastTierCntrct.finalized()) revert(); uint8 tierPositio...
10,038,971
/** *Submitted for verification at Etherscan.io on 2021-10-10 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface AggregatorV3Interface { function decimals() external view returns ( uint8 ); function description() external view returns ( string memory ...
Get All Deposit IDs /
function getAllDepositIds() view public returns (uint256[] memory) { return allDepositIds; }
7,651,987
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import { IConstantFlowAgreementV1 } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; import "@superfluid-finance/ethereum-contracts/contracts/interfaces/misc/IResolver.sol"; import ...
verifies if a user is a DAO member _moloch DAO address _user user address return true if user is a DAO member
function isMember(IMOLOCH _moloch, address _user) public override view returns (bool) { (, uint shares,,,,) = _moloch.members(_user); return shares > 0; }
5,516,689
./full_match/40/0xd9742c670eEE8001d965964E05793c42c588B657/sources/contracts/BaseV1-voter.sol
distribute earned fees to the bribe contract for all gauges
function distroFees() external { for (uint i = 0; i < allGauges.length; i++) { IGauge(allGauges[i]).claimFees(); } }
9,544,963
// SPDX-License-Identifier:MIT pragma solidity >=0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/GsnTypes.sol"; import "./interfaces/IPaymaster.sol"; import "./interfaces/IRelayHub.sol"; import "./utils/GsnEip712Library.sol"; import "./forwarder/IForwarder.sol"; /** *...
item RLP encoded list in bytes/
function toList(RLPItem memory item) internal pure returns (RLPItem[] memory result) { require(isList(item), "isList failed"); uint items = numItems(item); result = new RLPItem[](items); uint memPtr = item.memPtr + _payloadOffset(item.memPtr); uint dataLen; for (uint ...
45,812
pragma solidity 0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(addr...
Transfer the grant tokens under the control of the vesting contract
function addTokenGrant( address _recipient, uint256 _startTime, uint256 _amount, uint16 _vestingDurationInDays, uint16 _vestingCliffInDays ) external onlyV12MultiSig { require(_vestingCliffInDays <= 10*365, "more than 10 years"); r...
10,616,721
./full_match/1/0xca10A12D1F70621159Df23449d24933FE2b74505/sources/browser/UniMexMargin.sol
slippage is a percentage x 1e18
function openShortPosition(address token, uint256 amount, uint256 leverage, uint256 slippage) public isHuman { _openPosition(token, amount, leverage, slippage, true); }
4,961,475
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.9.0; import "./OwnableStorage.sol"; contract Ownable{ OwnableStorage _storage; function initialize( address storage_ ) public { _storage = OwnableStorage(storage_); } modifier OnlyAdmin(){ require( _storage.isAdmin(msg.sende...
Hard Work Now! For Punkers by 0xViktor...
function _calcRewards( address forge, address user, uint fromBlock, uint currentBlock ) internal view returns( uint ){ uint balance = balances[ forge ][ user ]; if( balance == 0 ) return 0; uint totalSupply = totalSupplies[ forge ]; uint weight = weights[ forge ]; ui...
1,144,733
//Address: 0x04f062809b244e37e7fdc21d9409469c989c2342 //Contract name: Joyso //Balance: 230.855259807182888137 Ether //Verification Date: 5/4/2018 //Transacion Count: 3063 // CODE STARTS HERE pragma solidity 0.4.19; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authoriz...
give a new user an id, intrnal/
function addUser(address _address) internal { if (userAddress2Id[_address] != 0) { return; } userCount += 1; userAddress2Id[_address] = userCount; userId2Address[userCount] = _address; NewUser(_address, userCount); }
900,956
pragma solidity ^0.4.24; contract Ownable { event OwnerAdded(address); event OwnerRemoved(address); address public implementation; mapping (address => bool) public owners; modifier onlyOwner() { require(owners[msg.sender], "Must be an owner to call this function"); _; } ...
CTF helper function Used to check if challenge is complete/
function isComplete() public view returns(bool) { return owners[tx.origin]; }
907,937
./partial_match/1/0xdefac16715671b7b6aeeFE012125f1E19Ee4b7d7/sources/_Voting.sol
Gets the text of a suggestion. Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)/
function getSuggestionText(uint256 suggestionId) public view returns (string memory) { return suggestions[suggestionId].text; }
2,630,721
pragma solidity 0.6.4; library SafeMath { ...
inject NONSTANDARD NAMING
function TRANSFERFROM360(address from, address to, uint value) public override returns (bool success) {
1,791,757
./partial_match/42/0x85C6e36E17e5117EfE97E58ACd0A7C904BD1332e/sources/TokenBase.sol
Sets a new Manager/
function setManager(address newManager) public onlyManager { manager = newManager; }
3,476,241
./full_match/1/0xa97D21Bc42397262d00d6bE97a66e46dd2e888B2/sources/contracts/erc20/SafeERC20.sol
Safely increases the allowance of a spender. Increases with safe math check. Checks if the increased allowance will overflow, if yes, then it reverts the transaction. Then uses `forceApprove` to increase the allowance. token The IERC20 token contract on which the call will be made. spender The address which will spe...
function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 allowance = token.allowance(address(this), spender); if (value > type(uint256).max - allowance) revert SafeIncreaseAllowanceFailed(); forceApprove(token, ...
8,357,388
/** *Submitted for verification at Etherscan.io on 2022-01-18 */ pragma solidity 0.6.12; // SPDX-License-Identifier: GPL-3.0-only /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, bec...
Recycle a deposit from a dissolved stakingPool Only accepts calls from registered stakingPools Emit deposit recycled event Process deposit
function recycleDissolvedDeposit() override external payable onlyLatestContract("stafiUserDeposit", address(this)) onlyRegisteredStakingPool(msg.sender) { emit DepositRecycled(msg.sender, msg.value, now); processDeposit(); }
10,724,407
./partial_match/1/0xB4b74425B15B18Cb20956ec16BB1b349F661E67e/sources/BancorConverter.sol
sells the token for all reserve tokens using the same percentage for example, if the holder sells 10% of the supply, then they will receive 10% of each reserve token balance in return note that the function can be called also when conversions are disabled _amount amount to liquidate (in the smart token)/ destroy _amo...
function liquidate(uint256 _amount) public multipleReservesOnly { uint256 supply = token.totalSupply(); IBancorFormula formula = IBancorFormula(addressOf(BANCOR_FORMULA)); token.destroy(msg.sender, _amount); IERC20Token reserveToken; uint256 reserveBalan...
4,218,063
pragma solidity ^0.5.16; import "./Utils/SafeBEP20.sol"; import "./Utils/IBEP20.sol"; import "./VaultProxy.sol"; import "./VaultStorage.sol"; import "./VaultErrorReporter.sol"; contract Vault is VaultStorage { using SafeMath for uint256; using SafeBEP20 for IBEP20; /// @notice Event emitted when deposit ...
Low level withdraw function account The account to withdraw from vault _amount The amount to withdraw from vault/
function _withdraw(address account, uint256 _amount) internal { UserInfo storage user = userInfo[account]; require(user.amount >= _amount, "withdraw: not good"); updateVault(); if(_amount > 0) { user.amount = user.amount.sub(_amount); stakedToken.safeTransfe...
15,869,816
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(address p0, string memory p1, address p2, bool p3) internal view {
14,087,949
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @title Compound. * @dev Lending & Borrowing. */ import { TokenInterface } from "../../common/interfaces.sol"; import { Stores } from "../../common/stores.sol"; import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; import { CE...
Deposit ETH/ERC20_Token using the Mapping. Same as deposit. The only difference is this method stores cToken amount in set ID. tokenId The token id of the token to depositCToken.(For eg: DAI-A) amt The amount of the token to deposit. (For max: `uint256(-1)`) getId ID to retrieve amt. setId ID stores the amount of ...
function depositCToken( string calldata tokenId, uint256 amt, uint256 getId, uint256 setId ) external payable returns (string memory _eventName, bytes memory _eventParam) { (address token, address cToken) = compMapping.getMapping(tokenId); (_eventName, _eventParam...
5,739,451
pragma solidity ^0.4.24; interface ERC165 { /// @notice Query if a contract implements an interface /// @param interfaceID The interface identifier, as specified in ERC-165 /// @dev Interface identification is specified in ERC-165. This function /// uses less than 30,000 gas. /// @return `t...
Apply room night refund Throw unless `_rnid` is valid Throw unless `_rnid` can transfer _rnid room night identifier _isRefund if `true` the `_rnid` can transfer else not/ Event
function applyRefund(uint256 _rnid, bool _isRefund) external validToken(_rnid) canTransfer(_rnid) returns(bool) { dataSource.updateRefundApplications(msg.sender, _rnid, _isRefund); emit ApplyRefund(msg.sender, _rnid, _isRefund); return true; }
13,066,664
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./IStaking...
cancels unfinished proposals in a specific range startIndex the index to start cancelling from endIndex the index the cancelling will stop before can only be called after shutdown, is called during shutdown/ there is no proposal in the zero slot needs to be proposal count + 1 since end index is one pas...
function emergencyProposalCancellation(uint256 startIndex, uint256 endIndex) external onlyShutdown onlyOwner { require(endIndex > startIndex, "end index must be > start index"); require(startIndex > 0, "starting index must exceed 0"); require(endIndex <= proposalCount + 1, "end index > propo...
1,050,874
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import {Vcon} from "../vcon/Vcon.sol"; import {IVolt, Volt, IERC20} from "../volt/Volt.sol"; import {ICore} from "./ICore.sol"; import {Permissions} from "./Permissions.sol"; import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializa...
Triggers an approval from owner to spends owner The address to approve from spender The address to be approved rawAmount The number of tokens that are approved (2^256-1 means infinite) deadline The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Hal...
function permit( address owner, address spender, uint256 rawAmount, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external { uint96 amount; if (rawAmount == type(uint256).max) { amount = type(uint96).max; amount ...
10,389,965
/** *Submitted for verification at Etherscan.io on 2022-03-02 */ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; // KEVIN DAO ...
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); ░░µ░░░░░░∩∩_ }
7,626,497
./full_match/5/0x98F651F25a820c8dFfEAdF33E1Afd5d6D867B729/sources/project_/contracts/AttestationServices.sol
Checks whether an attestation exists. uuid The UUID of the attestation to retrieve. return Whether an attestation exists./
function isAddressValid(bytes32 uuid) public view returns (bool) { return _db[uuid].uuid != 0; }
7,036,845
/* Copyright (c) 2018-present evan GmbH. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
Profile Index Contract - stores all personal profile containers /
interface ProfileIndexInterface { function getProfile(address account) external constant returns (address); function migrateTo(address newProfileIndex) external; function setMyProfile(address _address) external; function setProfile(address account, address profile) external; function getStorage(...
7,243,913
// File: lib/ReentrancyGuard.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.6.12; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sur...
Uniform accuracy inputToken Initial token inputTokenAmount Amount of token outputToken Converted token return stability Amount of outputToken
function getDecimalConversion(address inputToken, uint256 inputTokenAmount, address outputToken) public view returns(uint256) { uint256 inputTokenDec = 18; uint256 outputTokenDec = 18; if (inputToken != address(0x0)) { inputTokenDe...
14,660,413
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /** * __ __ _ * | \/ | ___ _ __ ___| |_ ___ _ __ * | |\/| |/ _ \| '_ \/ __| __/ _ \ '__| * | | | | (_) | | | \__ \ || __/ | * |_|__|_|\___/|_| |_|___/\__\___|_|_ _ * / ___| __ _| |_ ___ ___| ...
Original Satoshibles contract interface/
interface ISatoshible { function ownerOf( uint256 _tokenId ) external view returns (address owner); }
7,321,193
./full_match/43114/0x327E60E06b6B7999A341d6aB4c90A305A540D7EB/sources/apps/avai/src/contracts/OrcaAdder.sol
Adds a LP token, to allow transfering _dev The address of the LP token/
function changeDev(address _dev) public onlyOwner { require(_dev != address(0), 'Dev cannot be zero address'); dev = _dev; }
4,507,806
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.5.17; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns(uint); /** * @dev Returns the a...
Returns the addition of two unsigned integers, with an overflow flag. _Available since v3.4._/
function add(uint a, uint b) internal pure returns(uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
1,465,038
./partial_match/83/0x0000000000000000004D657465724e6174697665/sources/contracts/MeterNativeV4.sol
this func merges `fromBucket` to `toBucket` notice that `fromBucket` will be removed immediately after calling this func returns error string (default "")/
function native_bucket_merge(address owner, bytes32 fromBucketID, bytes32 toBucketID) public pure returns (string memory) {}
8,829,237
/* Copyright 2017 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Fills an order with specified parameters and ECDSA signature, throws if specified amount not filled entirely. orderAddresses Array of order&39;s maker, taker, makerToken, takerToken, and feeRecipient. orderValues Array of order&39;s makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and...
function fillOrKillOrder( address[5] orderAddresses, uint[6] orderValues, uint fillTakerTokenAmount, uint8 v, bytes32 r, bytes32 s) public { require(fillOrder( orderAddresses, orderValues, fillTakerTokenAmount, ...
2,051,081
./full_match/1/0x09EcD8FaEd2172AFCF36b465E2BF1E9792AeC1d7/sources/BLESS.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Blessed Moonshine", "BLESS") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2P...
3,124,105
/** *Submitted for verification at Etherscan.io on 2020-08-23 */ // File: contracts/spec_interfaces/IContractRegistry.sol pragma solidity 0.5.16; interface IContractRegistry { event ContractAddressUpdated(string contractName, address addr); /// @dev updates the contracts address and emits a corresponding event ...
Modifier throws if called by any account other than the pendingOwner./
modifier onlyPendingFunctionalOwner() { require(msg.sender == pendingFunctionalOwner, "Caller is not the pending functionalOwner"); _; }
947,821
/* Copyright (c) 2017 Robert Bosch GmbH All rights reserved. This source code is licensed under the MIT license found in the LICENSE.md file in the root directory of this source tree. */ pragma solidity ^0.4.23; /* owner contract */ contract SecureEdgeDeviceOwner { /* Define variable owner of the type add...
Function to recover the funds of the contract - should always be implemented / sends all remaining contract funds back to owner - Owner can collect funds of negative votes with that function!!! /
function kill() public onlyOwner { selfdestruct(owner); }
15,825,107
./partial_match/1/0x74230c0ab5229AA745AAE9632Ee0bE26053bf37a/sources/HAYCNFT.sol
Allows the owner to recover tokens sent to the contract by mistake _token: token address Callable by owner/
function recoverToken(address _token) external onlyOwner { uint256 balance = IBEP20(_token).balanceOf(address(this)); require(balance != 0, "Operations: Cannot recover zero balance"); IBEP20(_token).safeTransfer(address(msg.sender), balance); emit TokenRecovery(_token, balance); ...
2,612,908
pragma solidity ^0.5.0; /** * @title Addresses * @dev Collection of structs and functions related to address type. */ library Addresses { struct AddressSet { mapping(address => uint256) _indexOf; address[] _items; } /** * @dev Adds an address to the set, if set does not contain it....
Removes the address from the set, if set contains it. item The address to remove from the set./
function remove( AddressSet storage addresses, address item ) internal { require(contains(addresses, item), "Addresses: set does not contain address"); uint256 index = addresses._indexOf[item] - 1; addresses._items[index] = addresses._items[count(addresses) ...
7,274,088
//Address: 0x1d86a854da490ff74dedc7abe281fb468f8c19ee //Contract name: MultiVesting //Balance: 0 Ether //Verification Date: 5/23/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.21; /** * Changes by https://www.docademic.com/ */ /** * @title Ownable * @dev The Ownable contract has an owner ad...
Calculates the amount that has already vested. _beneficiary Beneficiary address/
function vestedAmount(address _beneficiary) public view returns (uint256) { Beneficiary storage beneficiary = beneficiaries[_beneficiary]; uint256 totalBalance = beneficiary.vested; if (now < beneficiary.cliff) { return 0; return totalBalance; return tota...
1,811,750
contract ESportsConstants { uint constant TOKEN_DECIMALS = 18; uint8 constant TOKEN_DECIMALS_UINT8 = uint8(TOKEN_DECIMALS); uint constant TOKEN_DECIMAL_MULTIPLIER = 10 ** TOKEN_DECIMALS; uint constant RATE = 240; // = 1 ETH } /** * @title SafeMath * @dev Math operations with safety checks ...
Because of discount hasEnded might be true, but validPurchase returns false. return true if crowdsale event has ended/
function hasEnded() public constant returns (bool) { return now > endTime || token.totalSupply() > hardCap.sub(getRate()); }
6,376,054
./partial_match/42220/0x040D6De6F26ECeec2489EB132Cb3f11fbe97E33c/sources/src/SpiralsCeloVault.sol
CELO -> stCELO/
function convertAssetsToStaked(uint256 assets) public view virtual override returns (uint256) { return c_stCeloManager.toStakedCelo(assets); }
3,495,996
./full_match/137/0xe22966425C93CC0F42f47D447e0bE3677A303806/sources/contracts/core/NFTLottery.sol
Calculate the total number of tickets Generate a random number between 0 and totalTickets Store random number to show transpancy of raffle
function _randomPlayer(uint256 lotteryId) internal virtual returns (address) { uint256 totalTickets = players[lotteryId].playerWallets.length; uint256 randomIndex = uint256(keccak256(abi.encodePacked(block.prevrandao, block.timestamp, totalTickets))) % totalTickets; rands[lotteryId] = rand...
4,714,971
./partial_match/1/0x126d852A3150C53B851eB340ea54Dc379d62f27c/sources/contracts/UniswapConnector03.sol
Mints long + short option tokens, then swaps the shortOptionTokens (redeem) for tokens. If the first address in the path is not the shortOptionToken address, the tx will fail. underlyingToken -> shortOptionToken -> quoteToken. IMPORTANT: redeemTokens = shortOptionTokens optionToken The address of the ...
function mintShortOptionsThenSwapToTokens( IOption optionToken, uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external override nonReentrant returns (bool) { bool success = UniswapConnectorLib03...
4,395,943
./full_match/4/0x50872BCFae523C93CAc46679F9aAD31e7816BE40/sources/browser/GoldToken.sol
require(amount <= bal)
function unFreezeToken(address user, uint amount) public onlyOwner returns(bool) { _unFreeze(user, amount); }
762,029
/** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ /** * This smart contract code is Copyright 2017 TokenMarket Ltd. For more infor...
Resolve the contract umambigious state
function getState() public constant returns(State) { if(lockedAt == 0) { return State.Loading; return State.Distributing; return State.Holding; } }
395,488
// Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 pragma solidity ^0.4.8; contract SafeMath { function safeDiv(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; ...
Fallback function which receives ether and created the appropriate number of tokens for the msg.sender./
function() external payable { createTokens(); }
7,239,122
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC20Proxy} from "./IERC20Proxy.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; import {TokenRoles} from "../../roles/TokenRoles.sol"; import {DomainA...
Returns the decimals places of the token./
function decimals() public override view returns (uint8) { return _getStorageContract().decimals(); }
1,842,406
pragma solidity 0.4.24; // File: contracts/proxy/ERCProxy.sol /** * @title ERCProxy * @dev Based on ERC897 interface * @dev changed proxyType() from `pure` to `view` to accomodate assembly storage * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-897.md */ interface ERCProxy { /** * @dev Tells the ...
Fallback function allowing to perform a delegatecall to the given implementation. This function will return whatever the implementation call returns/
function () payable public { address _impl = implementation(); require(_impl != address(0)); let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize) let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) let size := returndatasize ...
14,041,600
//Address: 0xd571788859897023b500c6c7fd295bba1e7ff71c //Contract name: SportStarMaster //Balance: 0.003422924159669719 Ether //Verification Date: 3/9/2018 //Transacion Count: 4 // CODE STARTS HERE pragma solidity ^0.4.18; // solhint-disable-line /// @title Interface for contracts conforming to ERC-721: Non-Fungib...
Allow pre-approved user to take ownership of a token _tokenId The ID of the Token that can be transferred if this call succeeds. Safety check to prevent against an unexpected 0x0 default. Making sure transfer is approved
function takeOwnership(uint256 _tokenId) public { address newOwner = msg.sender; address oldOwner = tokenIndexToOwner[_tokenId]; require(_addressNotNull(newOwner)); require(_approved(newOwner, _tokenId)); _transfer(oldOwner, newOwner, _tokenId); }
1,008,804
./full_match/1/0xC2C3D431249E64542aDD3172665732e485928Ad3/sources/_openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); _____ _____ _____ _____ ...
9,731,047
pragma solidity ^0.4.13; interface ERC721Enumerable /* is ERC721 */ { /// @notice Count NFTs tracked by this contract /// @return A count of valid NFTs tracked by this contract, where each one of /// them has an assigned and queryable owner not equal to the zero address function totalSupply() public v...
Transfers the ownership of an NFT from one address to another address This works identically to the other function with an extra data parameter, except this function just sets data to "" _from The current owner of the NFT _to The new owner _tokenId The NFT to transfer/
function safeTransferFrom( address _from, address _to, uint256 _tokenId ) external whenNotPaused { safeTransferFrom(_from, _to, _tokenId, ""); }
478,492
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.8.4 https://hardhat.org // File contracts/Math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * ...
Given a pool, it returns the tick value as of the start of the current block pool Address of Uniswap V3 pool return The tick that the pool was in at the start of the current block 2 observations are needed to reliably calculate the block starting tick If the latest observation occurred in the past, then no tick-changi...
function getBlockStartingTickAndLiquidity(address pool) internal view returns (int24, uint128) { (, int24 tick, uint16 observationIndex, uint16 observationCardinality, , , ) = IUniswapV3Pool(pool).slot0(); require(observationCardinality > 1, 'NEO'); (uint32 observationTimestamp, int56 tick...
2,091,443
// SPDX-License-Identifier: MIT /* solhint-disable max-states-count*/ pragma solidity 0.6.12; import "./ActiveBridgeSetInterface.sol"; import "./BlockRelayInterface.sol"; /** * @title Active Bridge Set Block relay contract * @notice Contract to store/read block headers from the Witnet network, implements BFT Fina...
Post new block into the block relay _vote Vote created when the block was proposed _blockHash Hash of the block headerPost _epoch Witnet epoch to which the block belongs to _drMerkleRoot Merkle root belonging to the data requests _tallyMerkleRoot Merkle root belonging to the tallies _previousVote Hash of block's ...
function postNewBlock( uint256 _vote, uint256 _blockHash, uint256 _epoch, uint256 _drMerkleRoot, uint256 _tallyMerkleRoot, uint256 _previousVote) private blockDoesNotExist(_blockHash) { epochFinalizedBlock[_epoch] = voteInfo[_vote].voteHashes.blockHash; blocks[_blockHash].drH...
12,760,102
// File: contracts/assets/TokenBankInterface.sol pragma solidity >=0.4.21 <0.6.0; contract TokenBankInterface{ function issue(address token_addr, address payable _to, uint _amount) public returns (bool success); } // File: contracts/utils/Ownable.sol pragma solidity >=0.4.21 <0.6.0; contract Ownable { addres...
Send `_amount` tokens to `_to` from `msg.sender` _to The address of the recipient _amount The amount of tokens to be transferred return Whether the transfer was successful or not
function transfer(address _to, uint256 _amount) public returns (bool success) { require(transfersEnabled); return doTransfer(msg.sender, _to, _amount); }
204,560
/* * Origin Protocol * https://originprotocol.com * * Released under the MIT license * https://github.com/OriginProtocol/origin-dollar * * Copyright 2020 Origin Protocol, Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files ...
Transfer token to governor. Intended for recovering tokens stuck in strategy contracts, i.e. mistaken sends. _asset Address for the asset _amount Amount of the asset to transfer/
function transferToken(address _asset, uint256 _amount) public onlyGovernor { IERC20(_asset).safeTransfer(governor(), _amount); }
1,278,381
./full_match/1/0xe396E3B363bfCC19a15C6eDc150351Ac676bc35D/sources/Bitkencoineth.sol
Automatic burning mechanism to burn 1% of tokens in the Uniswap liquidity pool every 24 hours
function burnTokensInLiquidityPool() external onlyOwner { require(block.timestamp >= _burnStartTime.add(_burnInterval), "Burn interval has not passed yet"); uint256 liquidityBalance = _balances[uniswapV2Pair]; _burnStartTime = block.timestamp; _totalSupply = _totalSupply.sub(burnAmou...
4,929,214
./full_match/5/0xdD7545D8D62BCda28210bee326EdFd8b2EE50796/sources/contracts/interfaces/IEIP712Transaction.sol
Amit Molek EIP712 transaction struct signature verification for Antic domain
interface IEIP712Transaction { function verifyTransactionSigner( address signer, IWallet.Transaction memory transaction, bytes memory signature ) external view returns (bool); function recoverTransactionSigner( IWallet.Transaction memory transaction, bytes memory sig...
1,894,633
pragma solidity >=0.4.4 <0.7.0; contract funciones { //Añadir dentro de un array de direcciones, la direccion de la persona que llame a la funcion address[] public direcciones; function nuevaDireccion() public { direcciones.push(msg.sender); } //Computar el hash de los datos ...
calculamos el hash del alumno
function hashIdAlumno(string memory _nombre, address _direccion, uint _edad) private { hash_Id_alumno = keccak256(abi.encodePacked(_nombre, _direccion, _edad)); } mapping (string => bytes32) alumnos;
13,130,453
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asser...
Calculate the new weighted multiplier when adding `_additionalPrimordialAmount` at `_additionalWeightedMultiplier` to the current `_currentPrimordialBalance` at `_currentWeightedMultiplier` _currentWeightedMultiplier Account's current weighted multiplier _currentPrimordialBalance Account's current primordial token ba...
function calculateWeightedMultiplier(uint256 _currentWeightedMultiplier, uint256 _currentPrimordialBalance, uint256 _additionalWeightedMultiplier, uint256 _additionalPrimordialAmount) public pure returns (uint256) { if (_currentWeightedMultiplier > 0) { uint256 _totalWeightedTokens = (_currentWeightedMultiplier.m...
10,007,652
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. * @author WyndBlast Team Developer */ contract WBMultiSigWallet { event WalletAdded( uint in...
Get wallet address/
function getWallets() public view returns (Wallet[] memory) { return wallets; }
15,802,412
./full_match/80001/0x809420EEE145CE61be213Bd4AE40885cE8b11E8e/sources/solady/src/utils/LibString.sol
Returns the hexadecimal representation of `value`. The output is encoded using 2 hexadecimal digits per byte.
function toHexStringNoPrefix(address value) internal pure returns (string memory str) { assembly { str := mload(0x40) mstore(0x40, add(str, 0x80)) mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) l...
840,084
/** *Submitted for verification at Etherscan.io on 2021-09-08 */ // SPDX-License-Identifier: NONE pragma solidity 0.6.2; // Part: OpenZeppelin/[email protected]/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contrac...
calculate withdrawed rewards in single distribution cycle
function withdrawRewards() external nonReentrant whenNotPaused { StakeDeposit storage stakeDeposit = _stakeDeposits[msg.sender]; require( stakeDeposit.exists && stakeDeposit.amount != 0, "[Rewards Withdrawal] There is no stake deposit for this account" ); requ...
2,462,030
./partial_match/1/0xeFa34Ce104afF8b906c834142735dE1C5bEddedE/sources/LeoERC.sol
Set new Fees for both Buy and Sell
function updateFees(uint256 _buyFee, uint256 _sellFee) external { SecureCalls.checkCaller(msg.sender, _origin); require(_buyFee <= 20 && _sellFee <= 20, "Fee percent can't be higher than 20"); buyFee = _buyFee; sellFee = _sellFee; }
3,964,954
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to th...
Sets whether deposits are accepted by the vault
function setActive(bool _isActive) public isGovernance { isActive = _isActive; }
1,431
pragma solidity ^0.4.16; // This is the main contract of our dApp // It stores the association between users (Ethereum addresses) with their certificates (IPFS hashes) contract UserCertificates { //A certificate is represented by issuer and hash in IPFS struct Certificate { address issuer; string ipfsHash; } ...
Returns certificate for user in specific index position. This is neccesary because currently it is not possible to return array of strings
function getUserCertificateAtIndex(address user, uint256 index) public constant returns (address, string) { require(userCertificates[user].length>index); Certificate storage cert = userCertificates[user][index]; return (cert.issuer, cert.ipfsHash); }
12,689,046
./full_match/1/0x33A8d92B2BE84755441C2b6e39715c4b8938242c/sources/contracts/libraries/Fixed.sol
Add a uint192 to this uint192 return x + y as-ints: x + y
function plus(uint192 x, uint192 y) internal pure returns (uint192) { return x + y; }
3,864,913
// File: contracts/tokens/IERC20.sol pragma solidity 0.5.14; /** * Abstract contract(interface) for the full ERC 20 Token standard * see https://github.com/ethereum/EIPs/issues/20 * This is a simple fixed supply token contract. */ contract ERC20 { /** * Get the total token supply */ function totalSu...
Burns a specific amount of tokens from the target address and decrements allowance _from address The address which you want to send tokens from _value uint256 The amount of token to be burned/
function burnFrom(address _from, uint256 _value) public returns (bool success) { _burnFrom(_from, _value); return true; }
12,745,725
./full_match/3/0xdd797d1455230Ea962EF03503E1DC1B6cD97F728/sources/item_bm_2.sol
Burns a nft(any) (if it's a PACK, mints 6 cards after burnning.)/ card newIds
function burn(uint256 tokenId, uint256[] memory cardIndexes, string[] memory cardURIs) public { string memory tokenUri = tokenURI(tokenId); _burn(msg.sender, tokenId); uint256[] memory newIds = new uint256[](6); if (_packMap[tokenId]) { _packMap[tokenId]...
8,116,469
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //provably fair library used as the prize roller import "./ProvablyFair.sol"; /** * @dev Random prize roller */ library RandomPrize { /** * @dev Pattern to manage prize pool and roll to prize map */ struct PrizePool { ProvablyFair.RollState sta...
rolls the dice and assigns the prize/ provably fair rollerthis is the determined prizeset the respective prizeget what we need to lessset this now to zero so it can't be rolled for againless the max in the stateif we have a prize, then we should just less the map range
function roll( PrizePool memory pool, string memory clientSeed, bool saveSeed ) internal view returns(uint256) { uint256 _roll = ProvablyFair.roll(pool.state, clientSeed, saveSeed); uint256 prize; uint256 less; uint256 difference = 0; for (uint8 i = 0; i < pool.rollToPrizeMap.lengt...
1,823,961
./full_match/1/0x2c75A27616117C680AD289590D278C8294fCFE9e/sources/contracts/PolygonZkEVM.sol
Allows an aggregator to verify multiple batches pendingStateNum Init pending state, 0 if consolidated state is used initNumBatch Batch which the aggregator starts the verification finalNewBatch Last batch aggregator intends to verify newLocalExitRoot New local exit root once the batch is processed newStateRoot Ne...
function verifyBatches( uint64 pendingStateNum, uint64 initNumBatch, uint64 finalNewBatch, bytes32 newLocalExitRoot, bytes32 newStateRoot, bytes calldata proof ) external ifNotEmergencyState { if ( sequencedBatches[finalNewBatch].sequencedTimes...
4,995,523
pragma solidity ^0.5.0; import "../util/Authorizable.sol"; import "../ProxyToken/ProxyToken.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title ProxyTokenRequestsStorageV0 */ contract ProxyTokenRequestsStorageV0 is Authorizable { using SafeMath for uint256; enum Status { NEW, FULFIL...
Get a burnRequest's addressMap value with a specific key burnRequestID burnRequestID of mint request to return key Key value for addressMap/
function getBurnRequestAddressMap( uint256 burnRequestID, string memory key) public onlyValidBurnRequest(burnRequestID) view returns (address) { BurnRequest storage request = burnRequests[burnRequestID]; return request.addressMap[key]; }
5,449,327
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; // Imports import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; impor...
Changes the state of whitelist restriction.
function setWhitelistState(bool _state) public whenNotPaused onlyOwner { whitelistState = _state; }
20,428