file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.13; import "zeppelin-solidity/contracts/token/MintableToken.sol"; contract MomLifeToken is MintableToken { string public name = "Bloom"; string public symbol = "BLM"; uint8 public decimals = 18; /** * @dev Address for accumulation of tokens that incoming to service contract...
Check if given address is instance of MomLifeInputWallet contract and owned by parentTransferAddress addr address/
function isMomlifeInputWalletOwner(address _addr) internal constant returns (bool result) { uint size = 0; assembly { size := extcodesize(_addr) } if(size > 0) { return _addr.call.gas(500)(bytes4(sha3("checkMomLifeInputWalletOwner(address)")), parentTransferAd...
912,686
./full_match/4/0x615B158848A6C9903C8bdfa50e47100E3411Fea1/sources/GunPool.sol
取款,只能一次全部取出。 因为价格在波动,_amountMin 代表最低收入金额。 require(UserDepositAmountOf[msg.sender][_token] > 0); 1, 计算利息计算 1.1, 得到投入值和当前值 1.2, 更新用户数据2, 先从pool取钱,然后遍历bridgepair取款(删除流动性),要保证用户一定能够取款成功.2.1, 从pool取钱 注意:循环不能太大,否则gas耗尽无法取出钱来do nothing
function withdrawToken(address _token, uint _amountMin) external lock returns (bool) { require(_token != address(0)); uint CurrentTokenAmount = getTokenCountAmount(_token); uint UserOldAmount = UserDepositAmountOf[msg.sender][_token]; uint UserNewAmount = UserOldAmount * Token1e1...
12,495,492
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import "../interfaces/IControllable.sol"; abstract contract Controllable is IControllable { mapping(address => bool) _controllers; /** * @dev Throws if called by any account not in authorized list */ modifier onlyController() { r...
number of quantized addresses/
function allNFTGemPoolsLength() external view override returns (uint256) { return _allNFTGemPools.length; }
11,794,057
./partial_match/1/0x38783106Dc9D2a9b004f7e17F018E6794c35Dd0E/sources/AToken.sol
Transfer `number` tokens from `msg.sender` to `dst`
function transfer(address _dst, uint256 _number) external nonReentrant returns (bool) { return transferTokens(msg.sender, msg.sender, _dst, _number) == uint(Error.SUCCESS); }
3,975,688
// File: contracts\sakeswap\interfaces\ISakeSwapFactory.sol // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.5.0; interface ISakeSwapFactory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSett...
SWAP requires the initial amount to have already been sent to the first pair
function _swap( uint256[] memory amounts, address[] memory path, address _to ) internal virtual { for (uint256 i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0, ) = SakeSwapLibrary.sortTokens(input, o...
11,797,887
./partial_match/1/0x363B4B1ADa52E50353f746999bd9E94395190d2C/sources/contracts/libraries/trie/MerkleTrie.sol
Utility; determines the number of nibbles shared between two nibble arrays. _a First nibble array. _b Second nibble array. return Number of shared nibbles./
function _getSharedNibbleLength(bytes memory _a, bytes memory _b) private pure returns (uint256) { uint256 shared; uint256 max = (_a.length < _b.length) ? _a.length : _b.length; for (; shared < max && _a[shared] == _b[shared]; ) { unchecked { ...
15,919,126
//SPDX-License-Identifier: MIT pragma solidity 0.8.5; import "../interfaces/ERC20.sol"; import "../interfaces/ERC918.sol"; import "../interfaces/Owned.sol"; import "../interfaces/ApproveAndCallFallBack.sol"; // ---------------------------------------------------------------------------- // Test Spring Token contr...
we target a median interval of 10 minutes multiplied by log(2) ~ 61/88 this gives a mean interval of 10 minutes per reward
function _adjustDifficulty(uint256 _miningTarget, uint256 _lastRewardBlockTime, uint256 rewardsGivenNow, uint256 currentTime) public pure returns (uint256){ uint256 timeSinceLastReward = currentTime - _lastReward...
2,547,207
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. * * Subtraction and addition only here. */ library SafeMath { /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). ...
METHOD: Core logic of comfirming request of issuetoken to a specified receiver. Admin can issue an ammout of BICA only. _requesterAccount The address of request account. _requestValue The value of requester. _marginAccount The address of margin account. _marginValue The value of token to pay to margin account. _i...
function issue(address _requesterAccount, uint256 _requestValue, address _marginAccount, uint256 _marginValue, address _interestAccount, uint256 _interestValue, address _otherFeeAddress, uint256 _otherFeeValue) public adminOperations { require(_requesterAccount != address(0)); ...
2,479,125
./full_match/5/0xb93278af83Ab7FC2A9d08EF096f49EE8616C95A2/sources/contracts/Miratashi.sol
Allows the whitelist people to mint a NFT./ Check if Whitelist phase (1 = Whitelist) Check if whitelist phase is active Check if wallet was in whitelist Max supply Mint only once during the first 30 minutes (1800 seconds) Max mint 2 times Require whitelist started Require whitelist not ended Require enough ETH Increase...
function mintWhitelist() external payable callerIsUser { require(phase == 1, "Miratashi: You are not in Whitelist phase."); require(isWhitelistActive, "Miratashi: Whitelist phase is not active."); require( walletWhitelist[msg.sender], "Miratashi: You are not Whiteli...
11,588,434
./partial_match/5/0x633F37A7e0b36E9c67157722fBDe0F85F57BedcD/sources/SharedDeposit.sol
This needs to be called once per validator
function depositToEth2(bytes calldata pubkey, bytes calldata withdrawal_credentials, bytes calldata signature, bytes32 deposit_data_root) external onlyOwner nonReentrant { uint256 amount = 32 ether; validatorsCreated = validatorsCreated.add(1); }
16,826,892
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/finance/PaymentSplitter.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@open...
Minting by any caller Enables "lazy" minting by any user who can provide an agent's signature for the specified params and value id The intended token Id uri The intended token URI signature The ERC712 signature of the hash of message value, id, and uri/
function mint( uint256 id, string memory uri, bytes calldata signature ) external payable { require(mintable(msg.value, id, uri, signature)); _mint(_msgSender(), id, uri); }
14,015,102
pragma solidity ^0.4.23; import "../libraries/StateMachine.sol"; import "../pandora/IPandora.sol"; import "../jobs/IComputingJob.sol"; import "./IWorkerNode.sol"; /** * @title Worker Node Smart Contract * @author "Dr Maxim Orlovsky" <orlovsky@pandora.foundation> * * @dev # Worker Node Smart Contract * * Worker ...
No arguments @fixme onlyOwner /
function acceptValidData( requireState(ValidatingData) transitionToState(ReadyForComputing) { require(activeJob != IComputingJob(0)); activeJob.dataValidationResponse(IComputingJob.DataValidationResponse.Accept); }
14,102,304
./partial_match/3/0x93aE15BC2454C138e79F3F9EB26F9743c0c25C77/sources/pool.sol
buyers claim all ETH profits/ send ether back to sender's address transfer ETH to msg.sender try best to update the price;
function claimProfits() external { uint amountETH = _buyerEtherProfits[msg.sender]; _buyerEtherProfits[msg.sender] = 0; msg.sender.transfer(amountETH); if (!_hasPrice() && block.timestamp >= _earliestExpiryDate) { _recordPrice(_getEtherPrice()); } }
5,151,236
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./IFactoryERC721.sol"; import "./Token.sol"; /** * @title The Mike Tyson NFT Collection by Cory Van Lew * An NFT powered by Ether Cards - https:/...
Mints a token to an address with a tokenURI. _to address of the future owner of the token/
function mintTo(address _to, uint256 collection) public ownerOrOperator { require(collection < collections.length, "Invalid Collection"); uint256 newTokenId = _getNextTokenId(collection); _mint(_to, newTokenId); tokenToSeries[newTokenId] = collection; }
592,986
/** *Submitted for verification at Etherscan.io on 2021-12-23 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
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); pragma solidity ^0.8.9; }
6,665,724
./full_match/1/0x541a2378589E280FDfDde6e53Fb5ECf98a853fC2/sources/src/BunniLpZapIn.sol
Wraps the user's ETH input into WETH Should be used as part of a multicall to convert the user's ETH input into WETH so that it can be swapped into other tokens.
function wrapEthInput() external payable { }
16,404,808
./full_match/1313161554/0xEF72330b252490648D01B242eCfFbb10b3C01B61/sources/contracts/JetStaking/JetStakingV2.sol
move all the streams rewards for a user to the pending tokens account is the staker address
function _moveAllRewardsToPending(address account) internal virtual { uint256 streamsLength = streams.length; for (uint256 i = 1; i < streamsLength; i++) { if (streams[i].status == StreamStatus.ACTIVE) _moveRewardsToPending(account, i); } }
13,233,226
/** *Submitted for verification at Etherscan.io on 2022-03-16 */ // SPDX-License-Identifier: MIT /** * @title T.O.T.A Contract by 7K Labs - Props to Chiru Labs for that erc721A goodness * * __________________________________________________________ * /\____/\\\\\\\\\\\\\\\___/\\\______/\\\_____/\\\___...
sets the max amount per wallet in the public sale/
function setMaxPubSalePerWallet(uint256 _maxMintAmount) public onlyOwner { require(_maxMintAmount > 0, "Must be greater than zero"); maxPubSalePerWallet = _maxMintAmount; }
10,965,978
./full_match/137/0x462ab8E39886a2F94D8DDa274a0f4BDdee6CE634/sources/contracts/Administerable.sol
Remove oneself from the admin role.
function renounceGameControl() public virtual { renounceRole(_GAME_CONTROL_ROLE, msg.sender); }
4,725,811
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.11; import "./spool/SpoolExternal.sol"; /** * @notice Implementation of the central Spool contract. * * @dev * The Spool implementation is the central part of the system. * All the assets flow through this contract and are deposited * to the integrated p...
Decode revert message _returnData Data returned by delegatecall return Revert string/ if the _res length is less than 68, then the transaction failed silently (without a revert message) slice the sig hash
function _getRevertMsg(bytes memory _returnData) internal pure returns (string memory) { if (_returnData.length < 68) return "SILENT"; assembly { _returnData := add(_returnData, 0x04) } }
11,832,637
// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/Reen...
Allows the operator owner to update the name. _name new operator name. uint256 operatorId = getOperatorId(msg.sender); NodeOperator storage no = operators[operatorId];
function setOperatorName(string memory _name) external override whenNotPaused { (uint256 operatorId, NodeOperator storage no) = getOperator(0); NodeOperatorStatus status = getOperatorStatus(no); checkCondition( status == NodeOperatorStatus.ACTIVE || s...
6,084,892
./full_match/3/0x59aec3305557eE4Bf33727B354fECad2B4a491b7/sources/polkalink.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
{ require(blockNumber < block.number, "Poll::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; function delegates(address delegator) external view returns (address) } } function delegateBySig( address delegatee, ...
8,166,372
// SPDX-License-Identifier: UNLICENSED /// @title PerfectPunks /// @notice Perfect Punks /// @author CyberPnk <[email protected]> // __________________________________________________________________________________________________________ // _____/\/\/\/\/\______________/\/\_______________________________...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; import "../utils/Context.sol"; constructor() { _setOwner(_msgSender())...
5,843,656
./partial_match/1/0x7Ba3b4473d314c17398969864CA13C4d0C3336B4/sources/lib/cross-margin-engine/lib/core-physical/src/libraries/PhysicalActionUtil.sol
tokenId option token id to mint amount amount of token to mint (6 decimals) recipient account to receive minted option/
function createTransferShortAction(uint256 tokenId, uint256 amount, address recipient) internal pure returns (ActionArgs memory action) { }
15,964,204
// TIME TO HODL @ carpedao.org // File @openzeppelin/contracts/math/SafeMath.sol@v3.4.1 // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily ...
Claim CARPE token rewards for a given HODL vault deposit.
function claimTokens(uint256 _depositIndex) public { require( depositClaimedTimestamp[_depositIndex] == 0, "Governance tokens already claimed for that deposit" ); require( msg.sender == hodlVaults.ownerOf(_depositIndex), "User is not the owner...
14,793,959
./partial_match/4/0x2304Cef25f71F7cbfF0B96c3AA4f6C88766E42f7/sources/MolVault.sol
check if fundingCollector
function purchase(address _tokenAddress, uint256 _tokenId) public payable { bytes memory tokenKey = getTokenKey(_tokenAddress, _tokenId); require(sale[tokenKey].forSale == 1, "!sale"); require(sale[tokenKey].sender != msg.sender, 'Sender cannot buy!'); require(!isOwner[msg.sender], "...
8,753,950
./partial_match/1/0x15E2768B99Ff8F70AA6131e6705af250511003df/sources/ConflictResolution.sol
Set User Timeout _userTimeOut new user time./
function setUserTimeOut(uint _userTimeOut) public onlyOwner { USER_TIMEOUT = _userTimeOut; }
4,181,625
./full_match/1/0x3B0422605E7471e3ad6fF0D3F5Ef6527ddAbB48A/sources/4_sage_sarvie/AuctionHouse.sol
Settle an auction, finalizing the bid and paying out to the owner. If there are no bids, the Oasis is burned./ if winner, mint and refunde diff if any, update Bids if not winner, refund
function settleBidder(address[] memory _bidders) external onlyOwner nonReentrant { require(block.timestamp > auctionEndDateTime, "Auction hasn't ended."); require(auctionWinnersSet == true && raffleWinnersSet == true, "Auction winners not set"); for (uint256 i = 0; i < _bidders.length; i++)...
17,091,459
./partial_match/1/0x34A542aCD8A717B5933228Ae3C554B1328F36e14/sources/ERC20ByMetadrop.sol
See {IERC20-balanceOf}./
function balanceOf( address account ) public view virtual override returns (uint256) { return _balances[account]; }
2,631,684
./full_match/42161/0x17f299C62810f0ed485B5e0a6A92Dc63E439C54C/sources/project_/contracts/kabosufamilyERC20.sol
Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balance...
function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(blacklist[from] == false,"ERC20: from ...
16,302,669
// SPDX-License-Identifier: MIT // solhint-disable /* This is copied from OZ preset: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v3.0.0/contracts/presets/ERC721PresetMinterPauserAutoId.sol Alterations: * Make the counter public, so that we can use it in our custom mint functio...
You must have just done your first drawdown Active loan that has entered a new period, so return the next nextDueTime. But never return something after the termEndTime Your paid off, or have not taken out a loan yet, so no next due time. Active loan in current period, where we've already set the nextDueTime correctly, ...
function calculateNextDueTime(CreditLine cl) internal view returns (uint256) { uint256 secondsPerPeriod = cl.paymentPeriodInDays().mul(SECONDS_PER_DAY); uint256 balance = cl.balance(); uint256 nextDueTime = cl.nextDueTime(); uint256 curTimestamp = currentTime(); if (nextDueTime == 0 && balance > 0...
6,235,637
./partial_match/1/0x5BB837766F98dF4e761E63e33ea5C46292d6fA82/sources/contracts/AriaLand.sol
Internal method to fetch random number between 1 to 10k/
function _setRandomBlindNumber(uint256 input) public returns (uint256) { require( input >= 1 && input <= 10000, "Input must be between 1 and 10000." ); uint256 randomNumber = uint256( keccak256( abi.encodePacked( block....
3,539,658
./full_match/4/0x690DBCBcD018871668F8ED69f42247b77eE65C77/sources/contracts/3_Ballot.sol
Calls winningProposal() function to get the index of the winner contained in the proposals array and then return winnerName_ the name of the winner/
function winnerName() public view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name; }
661,046
pragma solidity ^0.5; import './base/openzeppelin/math/SafeMath.sol'; import './base/openzeppelin/token/ERC20/IERC20.sol'; import './Macros.sol'; import './Nonpayable.sol'; import './IMarket.sol'; /// @title ERC20 token "proxy" contract for upcity resources. /// @author lawrence forman (me@merklejerk.com) /// @dev Mo...
Transfer tokens from the caller's wallet. Reverts if the caller does not have the funds to cover the transfer. to The recipient. amt The number of tokens to send (in wei) Let the market handle it. This call should revert on failure.
function transfer(address to, uint256 amt) external returns (bool) { _transfer(msg.sender, to, amt); return true; }
1,043,224
./full_match/1/0x567c09B55294998d7a6F2A3A948e8fD331531B88/sources/contracts/UMA/common/implementation/FixedPoint.sol
Whether `a` is less than `b`. a a FixedPoint. b a FixedPoint. return True if `a < b`, or False./
function isLessThan(Unsigned memory a, Unsigned memory b) internal pure returns (bool) { return a.rawValue < b.rawValue; }
9,749,016
./full_match/1/0xb30044cFF3c3a2FB362646f20b396567C04c297f/sources/project:/contracts/MTokenAdmin.sol
Reduces reserves for mToken by transferring to admin Requires fresh interest accrual mToken The mToken whose reserves to reduce reduceAmount Amount of reduction to reserves return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Check caller is admin We fail gracefully unless market's block n...
function _reduceReservesFresh(uint240 mToken, uint reduceAmount) internal returns (uint) { MathError mathErr; uint totalReservesNew; uint totalCashNew; address payable admin = getAdmin(); if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.REDU...
17,163,265
// SPDX-License-Identifier: MIT pragma solidity^0.8.0; import "./openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./openzeppelin/contracts/access/Ownable.sol"; import "./openzeppelin/contracts/utils/math/SafeMath.sol"; import "./openzeppelin/contracts/utils/Address.sol"; import "./openzeppe...
If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId)); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); string memory json = ".json"; if (bytes(base).length == 0) { retu...
7,026,162
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "sol-temple/src/tokens/ERC721.sol"; import "sol-temple/src/utils/Auth.sol"; import "sol-temple/src/utils/Pausable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; /** * @titl...
Authorize a call with `data_` to the address `to_`.
function forbid(address to_, bytes memory data_) public onlyOwner { require(_isAuthorized[to_][data_], "Auth: unauthorized calls cannot be forbidden"); delete _isAuthorized[to_][data_]; emit AuthorizationForbidden(to_, data_); }
5,470,702
pragma solidity ^0.6.0; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import './interfaces/IOracle.sol'; import './utils/Epoch.sol'; /** * @title Basis Cash Treasury contract * @notice Monetary policy logic to adjust supplies of basis cash assets * @author Summer Smith & Rick Sanchez */ contract Tr...
circulating supply add cash transfer fee
function allocateReward() external checkStartTime checkEpoch { _updateCashPrice(); uint256 cashPrice = _getCashPrice(oracle); uint256 cashSupply = IERC20(cash).totalSupply(); uint256 totalPoints = IMasterChef(shareMasterChef).totalAllocPoint(); uin...
12,740,478
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title SafeBEP20 * @dev Wrappers around BEP20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * ...
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public validatePoolByPid(_pid) { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRe...
12,946,827
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelinBase/contracts/access/Ownable.sol"; import "@openzeppelinBase/contracts/GSN/Context.sol"; import "@openzeppelinBase/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelinBase/contracts/token/ERC20/IERC20.sol"; import "@openzeppe...
return Computes the total supply adjustment in response to the exchange rate and the targetRate./
function computeSupplyDelta(uint256 rate, uint256 targetRate) public view returns (int256) { int256 targetRateSigned = targetRate.toInt256Safe(); int256 supply = (IERC20(cash).totalSupply() .sub(IERC20(cash).balanceOf(address(this))) .sub(I...
1,798,226
./full_match/5/0x232b57323b4179969DeeA3d85395041040CBF200/sources/contracts/Counter.sol
Function to increment the counter and return the updated value
function incrementCounter() public returns (uint256) { }
1,930,496
./full_match/137/0x78a486306D15E7111cca541F2f1307a1cFCaF5C4/sources/contracts/Peronio.sol
Swap the given amount of tokens from the given "from" address to the given "to" address via QuickSwap, and return the amount of "to" tokens swapped fromAddress Address to get swap tokens from toAddress Address to get swap tokens to amount Amount of tokens to swap (from) return swappedAmount Amount of tokens depo...
function _swapTokens( address fromAddress, address toAddress, uint256 amount ) internal returns (uint256 swappedAmount) { address[] memory path = new address[](2); (path[0], path[1]) = (fromAddress, toAddress); swappedAmount = IUniswapV2Router02(quickSwapRouterAd...
4,798,463
./full_match/1/0xF41f8965967D645913D0eed58cef2F6C2a7c44Cc/sources/contracts/nft721_contract.sol
Hook that is called after a set of serially-ordered token ids have been transferred. This includes minting. startTokenId - the first token id to be transferred quantity - the amount to be transferred Calling conditions: - when `from` and `to` are both non-zero. - `from` and `to` are never both zero./ Mint Burn
function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal override virtual { require(quantity < 2 ** 64); uint64 _quantity = uint64(quantity); if(from != address(0)){ _addressData[from].balance ...
2,934,810
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract ERC20 { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); //transfers _value to an address _to from msg.sender, ...
Tells us the balance of the value stored for transfer
function checkAllowance(address _owner, address _spender) internal view returns (uint256 remaining) { return allowance[_owner][_spender]; } mapping (address => mapping (address => uint256)) allowance; uint256 public totalSupply;
12,978,471
pragma solidity ^0.5.16; /** * @title Careful Math * @author Compound * @notice Derived from OpenZeppelin's SafeMath library * https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract CarefulMath { /** * @dev Possible error codes that we can return...
Multiply an Exp by a scalar, returning a new Exp./
function mulScalar(Exp memory a, uint256 scalar) internal pure returns (MathError, Exp memory) { (MathError err0, uint256 scaledMantissa) = mulUInt(a.mantissa, scalar); if (err0 != MathError.NO_ERROR) { } }
1,271,118
./full_match/10/0xF6a6C4573099E6F6b9D8E1186a2C089B4d0fDf91/sources/home/sol-op/lib/erc20/SafeERC20.sol
bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { (bool success, bytes memory data) = address(token).call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), '!TRANSFER_FROM_FAILED'); }
3,779,868
pragma solidity ^0.4.24; import "../contracts/ErrorReporter.sol"; import "../contracts/MoneyMarket.sol"; contract MoneyMarketHarness is MoneyMarket { mapping (address => uint) public cashOverrides; mapping (address => bool) accountsToFailLiquidity; mapping (address => Exp) liquidityShortfalls; mapp...
TODO: RENAME to include harness in name Sets the price of a given asset Oracle function to set the price of a given asset asset Asset to set the price of assetPriceMantissa Price of asset-wei in terms of eth-wei, scaled by 1e18. return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Set the...
function _setAssetPrice(address asset, uint assetPriceMantissa) public returns (uint) { return uint(Error.NO_ERROR); }
13,089,028
./full_match/1/0x4CaE5458f76Fced0552FDd765DA5200565406841/sources/contracts/MultiVesting.sol
Returns amount of funds that beneficiary can withdraw, vestingId should be specified (default is 0) _beneficiary - address of the beneficiary _vestingId - the ID of the vesting (default is 0)
function getAvailableAmount(address _beneficiary, uint256 _vestingId) public view returns (uint256) { return getAvailableAmountAtTimestamp(_beneficiary, _vestingId, block.timestamp); }
3,861,656
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "../interfaces/IStrategy.sol"; import "../interfaces/IVault.sol"; import "../interfaces/IPancakeRouter02.sol"; import "../interfaces/IWaultSwapRouter02.sol"; import "../interfaces/ISwap.sol"; import "../interfaces/IWaultPair.sol"; import "../interfaces/...
Swaps BETH for ETH on Pancake Router
function _swapBETHforETH(uint256 _amount) private returns (uint256 _amountETH) { uint256[] memory _amounts = _swapExactTokensForTokens( address(BETH), address(ETH), _amount ); _amountETH = _amounts[1]; }
6,472,809
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ShackledStructs.sol"; import "./ShackledRenderer.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; contract ShackledIcons is ERC721Enumerable, Ownable { string...
map a number from one range into another/
function mapRangeToRange( int256 num, int256 inMin, int256 inMax, int256 outMin, int256 outMax ) internal pure returns (int256 res) { assembly { res := add( sdiv( mul(sub(outMax, outMin), sub(num, inMin)), ...
278,844
./full_match/80001/0xEe448D42C6870009eA2F334f2F427cEe178D027A/sources/contracts/access-condition/ERC721/VWBL.sol
Get minter of NFT by tokenId tokenId The Identifier of NFT/
function getMinter(uint256 tokenId) public view returns (address) { return tokenIdToTokenInfo[tokenId].minterAddress; }
869,795
// SPDX-License-Identifier: MIT // // / / // ) ) // //____ ___ ___ //___/ / // ___ ___ / ___ // / ____ // ) ) (( ) ) // / / / __ ( // // ) ) // ) ) //\ \ // // // / / \ \ ((___/ / // ) ) // // / / ...
STATE MANIPULATIONS PRE Send developer their money Send seller their money STATE MANIPULATIONS POST Increase reward pool Decrease new investments
function sellBackShares(uint256 _shareAmount) external { require(isSellAllowed, "Sell is not allowed"); require( _shareAmount <= shareCount[msg.sender], "Not enough shares to sell" ); require( _shareAmount <= getMaxAmountOfSharesToBeSold(), ...
12,762,908
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/ISaver.sol"; import...
Validate and update rebalancer allocations
function openRebalance(address token_, uint256[] calldata _newAllocations) external returns (bool, uint256 avgApr) { uint256 initialAPR = getRate(token_); address reblancerAddr = getTokenRebalancer[token_]; IRebalancer(reblancerAddr).setAllocations(_newAllocations, allAdaptors); ...
1,836,724
./full_match/4/0xA513B3b0E4430Dd466860E3e7C58E5Cad22594a4/sources/_thirdweb-dev/contracts/extension/BatchMintMetadata.sol
Returns the id for the batch of tokens the given tokenId belongs to.
function getBatchIdAtIndex(uint256 _index) public view returns (uint256) { if (_index >= getBaseURICount()) { revert("Invalid index"); } return batchIds[_index]; }
809,855
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/c...
Returns the ether balance/
function balanceEther() public view returns(uint256) { return address(this).balance - _interestAmount; }
5,480,364
./full_match/1/0x748A0F458B9E71061ca0aC543B984473F203E1CB/sources/contracts/core/LiqLocker.sol
Lookup a value in a list of (sorted) checkpoints. Copied from oz/ERC20Votes.sol/
function _checkpointsLookup(DelegateeCheckpoint[] storage ckpts, uint256 epochStart) private view returns (DelegateeCheckpoint memory) { uint256 high = ckpts.length; uint256 low = 0; while (low < high) { uint256 mid = AuraMath.average(low, high); ...
9,644,503
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name...
get user info return pending withdraw amount,referral,rreferral num etc./
function userInfo(address _addr) view external returns ( address _referral, uint256 _referral_num, uint256 _is_supernode, uint256 _dividends, uint256 _referral_bonus, uint256 _match_bonus, uint256 _supernode_bonus,uint256 _last_payout )...
12,749,414
./partial_match/1/0x34317e2Da45FeC7c525aCa8dAbF22CbC877128a3/sources/VidyaFLUX.sol
Maintenance balance 1% from amount (amount 1 / 100) This amount goes to Inventory Set maintenance balance to 0 Send to Inventory Send to caller Returns the amounts for UI or w/e
function feedInventory() public returns(uint256, uint256) { uint256 amount = referralBalance_[maintenanceAddress]; uint256 bonus = SafeMath.div(SafeMath.mul(amount, 1), 100); uint256 toInventory = SafeMath.sub(amount, bonus); referralBalance_[maintenanceAd...
4,276,599
./full_match/82/0xA3F51Bb79793AC7ca38956f4928E080822814708/sources/contracts/base/vote/VoltVoterUpgradeable.sol
Add a token to a gauge/bribe as possible reward.
function registerRewardToken( address _token, address _gaugeOrBribe, uint _tokenId ) external { require(_tokenId > 0, "!token"); require(msg.sender == IERC721(ve).ownerOf(_tokenId), "!owner"); require(IVe(ve).balanceOfNFT(_tokenId) > _listingFee(), "!power"); ...
7,094,253
./full_match/137/0x0b54E16978F40540143EBaff5D69F7248d8432b5/sources/TaxDistributor.sol
if (taxes[i].taxName == taxName) {
function setBuyTax(string memory taxName, uint256 taxPercentage) public override onlyToken { bool updated; for (uint256 i = 0; i < taxes.length; i++) { if (compareStrings(taxes[i].taxName, taxName)) { taxes[i].buyTaxPercentage = taxPercentage; updated = tr...
4,670,294
./partial_match/1/0x16448014A29484b82E3A5A6cF254E5C563A28929/sources/ERC20.sol
Change the minter address minter_ The address of the new minter/
function setMinter(address minter_) external { require(_msgSender() == minter, "ERC20: only the minter can change the minter address"); emit MinterChanged(minter, minter_); minter = minter_; }
2,845,216
// File: contracts\core\nameVerifiers\IIdeaTokenNameVerifier.sol // SPDX-License-Identifier: MIT pragma solidity 0.6.9; /** * @title IIdeaTokenNameVerifier * @author Alexander Schlindwein * * Interface for token name verifiers */ interface IIdeaTokenNameVerifier { function verifyTokenName(string calldata nam...
Verifies whether a string matches the required format name The input string (Twitter handle) return Bool; True=matches, False=does not match/
function verifyTokenName(string calldata name) external pure override returns (bool) { bytes memory b = bytes(name); if(b.length < 2 || b.length > 16) { return false; } return false; }
13,726,862
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IUniswapV2Router02.sol"; import "./libraries/SafeMath.sol"; import "./libraries/SafeERC20.sol"; contract Multiswap { using SafeMath for uint256; using SafeERC20 for IERC20; // WETH Address address private immutable WETH; ...
Internal function to calculate the output from one token swap./
function calcOutputToken(address[] memory _path, uint256 _value) internal view returns (uint256[] memory expected) { expected = uniswapRouter.getAmountsOut(_value, _path); return expected; }
548,217
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import './AbstractERC1155Factory.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract OmniPass is AbstractERC1155Factory, ReentrancyGuard { // ======== ERC1155 Token Id ========= uint256 constant MINT_PASS_ID = 0; // ======...
======== State Management =========
function flipSaleStatus() public onlyOwner { saleIsActive = !saleIsActive; }
6,145,487
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 a...
Note: the ERC-165 identifier for this interface is 0x150b7a02.
interface ERC721TokenReceiver { function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes _data) external returns(bytes4); } }
580,721
./full_match/5/0xD718950E7429a3eD40485b776D3d45597f5EB462/sources/contracts/Contract.sol
first count the number of bokemons the user has
function getMetaDataBokemonPerUser(address _user) public view returns (string[] memory) { uint256 count = 0; for (uint i = 0; i < _tokenIds.current(); i++) { if (balanceOf(_user, i) == 1) { count++; } } uint256 index = 0; for (uint i = ...
1,878,498
./full_match/10/0x7A2Cf54897345b5f6a9006e2dA19B3739c4f5DCE/sources/contracts/rubiconPools/BathToken.sol
returns the amount of underlying ERC20 tokens in this pool in addition to any tokens that may be outstanding in the Rubicon order book
function underlyingBalance() public view returns (uint256) { require(initialized, "BathToken not initialized"); uint256 _pool = IERC20(underlyingToken).balanceOf(address(this)); return _pool.add(outstandingAmount); }
3,777,969
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {n...
Function allows admin to pause all in game AURA transfactions./
function pauseGameAURA(bool _pause) public onlyOwner { isPaused = _pause; }
12,192,168
// SPDX-License-Identifier: MIT pragma solidity >=0.4.25; // This is just a simple example of a coin-like contract. // It is not standards compatible and cannot be expected to talk to other // coin/token contracts. If you want to create a standards-compliant // token, see: https://github.com/ConsenSys/Tokens. Cheers! ...
gets all accounts/addresses on the network
function getAccounts() public view returns (address[] memory) { return datingAccounts; }
12,738,628
pragma solidity >=0.5.0; //Interfaces import './interfaces/IAddressResolver.sol'; import './interfaces/ISettings.sol'; import './interfaces/IERC20.sol'; import './interfaces/IBaseUbeswapAdapter.sol'; import "./interfaces/IStableCoinStakingRewards.sol"; import './interfaces/IUniswapV2Pair.sol'; import './interfaces/ISt...
Opens a new leveraged position; swaps cUSD for specified asset User needs to approve cUSD for StableCoinStakingRewards contract before calling this function tokenA Address of first token in pair tokenB Address of second token in pair collateral Amount of cUSD to use as collateral amountToBorrow Amount of cUSD to b...
function openPosition(address tokenA, address tokenB, uint collateral, uint amountToBorrow, address farmAddress) public override { address settingsAddress = ADDRESS_RESOLVER.getContractAddress("Settings"); address baseUbeswapAdapterAddress = ADDRESS_RESOLVER.getContractAddress("BaseUbeswapAdapter");...
2,548,264
./full_match/43114/0x465eC7aD0C007721E83048C3d91e0Edb6A5F0b06/sources/avax.sol
Returns the subtraction of two unsigned integers, reverting with custom message on overflow (when the result is negative). CAUTION: This function is deprecated because it requires allocating memory for the error message unnecessarily. For custom revert reasons use {trySub}. Counterpart to Solidity's `-` operator. Requi...
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } }
4,513,578
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.6; import "ds-test/test.sol"; import "./contracts/ERC721.sol"; import "./utils/Ownable.sol"; import "./utils/ECDSA.sol"; import "./utils/Counters.sol"; contract ZombsteinDapp is ERC721, Ownable { using ECDSA for bytes32; using Strings for uint2...
Gift multiple NFTs to an address giftReceiver Address to receive the gift, set as uint8 to help control limit to be below 256 per tx. Will limit if exploited number Number of NFTs to gift the individual
function giftMultipleNFTs(address giftReceiver, uint8 number) external onlyOwner { require(_tokenSupply.current() + number <= maxAmount, "Max amount exceeded"); require(giftedAmount + number <= internalWitholdLimit, "No more gifts left"); for (uint8 i = 0; i < number; i++) { gif...
12,898,755
./partial_match/1/0xA53de764935d71968c7B5d311E6E76Ba22109a11/sources/DharmaTradeReserveV17ImplementationStaging.sol
Get the balance of this contract of the provided token before transferring. Transfer the token from the caller and revert on failure.
function tradeTokenForTokenWithFeeOnTransferSpecifyingFee( ERC20Interface tokenProvided, address tokenReceived, uint256 tokenProvidedAmount, uint256 quotedTokenReceivedAmount, uint256 quotedTokenReceivedAmountAfterTransferFee, uint256 deadline, bool routeThroughEther ) external returns (...
9,400,943
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper ...
Check if the fee is paid by main token ser_data Serialized withdrawal data return fETH Is the fee paid in ETH or DGO/
function _isWithdrawalFeeETH(bytes memory ser_data) internal pure returns (bool fFeeETH) { fFeeETH = (ser_data.toUint8(WITHDRAWAL_SIZE - 39) & _MASK_IS_ETH != 0); }
15,834,846
./partial_match/42/0xC31518D4fbA20E3618F6e7B24D1Bada43837Ed45/sources/GebProxyDebtAuctionActions.sol
Joins COIN amount into the safeEngine Paybacks debt to the SAFE and unlocks token amount from it Moves the amount from the SAFE handler to proxy's address Exits token amount to the user's wallet as a token
function repayAllDebtAndFreeTokenCollateral( address manager, address collateralJoin, address coinJoin, uint safe, uint collateralAmount ) public { address safeEngine = ManagerLike(manager).safeEngine(); address safeHandler = ManagerLike(manager).safes(saf...
3,338,829
/** *Submitted for verification at Etherscan.io on 2022-02-19 */ // File: @openzeppelin/contracts/security/ReentrancyGuard.sol // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from...
File: Shroomates.sol@@@@@@@..,@@@@@@@@@@@@@@@@@@....[email protected]@@@@@@@@@@@@@@@@@@@@..@@,,@([email protected]@@@@@@&[email protected]@@@[email protected]@@[email protected]%@@@@@[email protected]@@@@@@[email protected]@@@@@......[email protected]%@@@....../@[email protected]%@@@@@[email protected]@@@@@@[email prot...
interface IGnarCoin { function burn(address _from, uint256 _amount) external; function updateReward(address _from, address _to) external; }
10,821,830
pragma solidity >=0.5.0 <0.7.0; import "./Creator.sol"; import "./UserAccount.sol"; import "../cryptography/ECDSA.sol"; contract UserAccountFactory is Creator { constructor() public { } function create(uint256 _salt) external returns(address) { // return newUserAccount(_salt, msg.sender); } ...
return _create2(0, abi.encodePacked(type(UserAccount).creationCode, _owner, address(0), address(0)), bytes32(keccak256(abi.encodePacked(_owner, _salt))));
function newUserAccount(uint256 _salt, address _owner) internal returns(address) { }
13,077,350
// SPDX-License-Identifier: MIT // File: contracts/NormieLib.sol pragma solidity ^0.8.9; // @author TheNormiesNFT (https://twitter.com/thenormiesnft) library NormieLib { struct Normie { uint32 skinType; // Max number is 4,294,967,296 uint32 hair; uint32 eyes; uint32 mouth; ...
Adds traits to specific location. Good to use for reusing assets in another collection. (Ex. Reusing skinType assets). traitIndex The index to add these traits to. traitID Array of integers representing the traits to add to the given collectionNumber and traitIndex./
function addTraitsToCurrentCollection(uint256 traitIndex, uint256[] memory traitID) external onlyOwner { require(currentCollectionTraits[traitIndex].length + traitID.length <= traitRarity[traitIndex].length, "Trait array mismatch"); for (uint256 i = 0; i < traitID.length; i++){ currentCo...
12,603,913
./full_match/43114/0x096F07be24Fb85528bf67f2790a3B72F764D4540/sources/artifacts/MasterChef.sol
1/x Test reciprocal(0) fails Test reciprocal(fixed1()) returns fixed1()/
function reciprocal(int256 x) internal pure returns (int256) { assert(x != 0); }
4,572,081
pragma solidity ^0.4.18; import './DDNSBanking.sol'; import './common/SafeMath.sol'; import './common/Destructible.sol'; contract DDNSCore is DDNSBanking, Destructible { using SafeMath for uint256; event LogNewDomain( bytes32 domainName, bytes32 ipAddress, address indexed domainOwner, bytes1...
solium-disable-next-line security/no-block-members /
function registerDomain( bytes32 _domainName, bytes32 _ipAddress, bytes12 _topLevelDomain ) public payable nameLengthRestricted(_domainName) ipAddressLengthRestricted(_ipAddress) topLevelDomainLengthRestricted(_topLevelDomain) nameLengthPriced(_domainName) { bytes32 key = getDomainKey(_domainName...
979,883
./full_match/1/0x0000000304aAD016bA7a745da3cE64f6198B76B3/sources/lib/solady/src/utils/FixedPointMathLib.sol
Returns `x / y`, returning 0 if `y` is zero.
function rawSDiv(int256 x, int256 y) internal pure returns (int256 z) { assembly { z := sdiv(x, y) } }
3,200,589
pragma solidity ^0.4.19; import "./crowdsale/PreSaleCrowdsale.sol"; import "./math/SafeMath.sol"; import "./OneSmartToken.sol"; /** * In 2018 and in real world a huge amount of conditions required to success processing * private round investments. * * We do not want to * 1. Do any kind of non blockchain related inves...
Investor should call this method to claim they tokens from deposit/ First time range Second time range
function claimTokens() public onlyKYCPassed { require(isFinalized); address investor = msg.sender; DealDeposit storage deposit = depositMap[investor]; require(deposit.depositedTokens > 0); DepositTimeLock storage timeLock = depositTimeLockMap[investor]; uint256 depositedToken = deposi...
12,616,562
./full_match/1/0x79480634dc632cdf68295CdEBF07E217dCB6743f/sources/ThePepeCartel.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("ThePepeCartel", "DONPEPE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Fact...
3,120,526
./partial_match/5/0xDb671DD4ad1Ce8dbB403690ab5510A849dE777A9/sources/MainTokenContract.sol
This function returns the total supply or maximum supply of the ERC20 token
function totalSupply() public view virtual returns (uint256){ return _totalSupply; }
16,849,497
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/interfaces/IERC165.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "./Controllable.sol"; import "./ITokenSale.sol"; /// tokensale implementation contract TokenSale is ITokenSale, Controllable, Ini...
get the total list of purchasers return _list - total list of purchasers
function purchaserList() external view override returns (TokenMinting[] memory _list) { _list = _purchasers; }
15,835,814
./full_match/1313161554/0x8535bC7a55E090DACc9c201A758CD035672f5e10/sources/contracts/marketplace/Marketplace.sol
Tax txn by transfering fees to Farandole and royalties to the rightsowner if applicable grossSaleValue - the price at which the asset will be sold tokenId - used to fetch the rightsowner and royalties amount return netSaleAmount - the value that will go to the seller after deducting fees and royalties
function _taxTxn(address sender, IERC721 token, uint tokenId, uint grossSaleValue, ERC20 currency) internal virtual returns (uint) { uint paidFees = _payFees(sender, grossSaleValue, currency); (uint paidRoyalties, address receiver) = _payRoyalties(sender, token, tokenId, grossSaleValue, currency); ...
13,233,567
./full_match/80001/0x2A78c15604a0ff4D368d7BE13ade78C5362B6Ce1/sources/project_/contracts/Token.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniSwapV2Router.WETH(); _approve(address(this), address(uniSwapV2Router), tokenAmount); uniSwapV2Router.swapExactTokensForETHSupportingFeeOn...
836,475
./full_match/1/0xA694b177C957F3a440e3FDEe8Caefb9C8ae74f52/sources/browser/contract.sol
---------- ADMINISTRATOR ONLY FUNCTIONS ----------/ administrator can manually disable the ambassador phase./
function disableInitialStage() public { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "EthPire: must have administrator role"); onlyAmbassadors = false; }
3,049,650
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./SwapUtils.sol"; /** * @title AmplificationUtils library * @notice A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct. * This library assumes the struct is ...
A simple method to calculate amount of each underlying tokens that is returned upon burning given amount of LP tokens account the address that is withdrawing tokens amount the amount of LP tokens that would be burned on withdrawal return array of token balances that the user will receive/
function calculateRemoveLiquidity(address account, uint256 amount) external view returns (uint256[] memory) { return swapStorage.calculateRemoveLiquidity(account, amount); }
970,662
./partial_match/1/0xD59BcAbd00721B754aCB79FE668faE4B6A063fF8/sources/contracts/carbon/CarbonController.sol
@inheritdoc ICarbonController/ don't allow unnecessary eth
function createStrategy( Token token0, Token token1, Order[2] calldata orders ) external payable nonReentrant whenNotPaused onlyProxyDelegate returns (uint256) { _validateInputTokens(token0, token1); if (msg.value > 0 && !token0.isNative() && !token1.isNative()) { ...
2,647,151
./partial_match/1/0x6e1781678ffE6CDc109fd3bC0833c47BD0F23de1/sources/contracts/L1/ValidatorPool.sol
Sends reward message to ValidatorRewardVault contract on L2 using Portal. _output The finalized output./ Pay out rewards via L2 Vault now that the output is finalized.
function _sendRewardMessageToL2Vault(Types.CheckpointOutput memory _output) private { PORTAL.depositTransactionByValidatorPool( Predeploys.VALIDATOR_REWARD_VAULT, VAULT_REWARD_GAS_LIMIT, abi.encodeWithSelector( ValidatorRewardVault.reward.selector, ...
16,157,664
./partial_match/4/0x2F674500a367583D6Aaef312478a7cC1941a1977/sources/FECORE.sol
Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role./
function grantRole(bytes32 role, address account) public virtual { require( hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant" ); _grantRole(role, account); }
8,664,341
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.1; interface IMoonCatRescue { function rescueOrder(uint256 tokenId) external view returns (bytes5); function catOwners(bytes5 catId) external view returns (address); } interface IReverseResolver { function claim(address owner) external returns (byt...
Convert an integer/numeric value into a string of that number's decimal value./
function uint2str (uint value) public pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); ...
394,128
pragma solidity 0.4.23; /** * @title Utility interfaces * @author Biglabs Pte. Ltd. * @dev Smart contract with owner */ contract Owner { /** * @dev Get smart contract's owner * @return The owner of the smart contract */ function owner() public view returns (address); //c...
Get Rate: number of wei to buy 0.01 Mozo token/
function getRate() public view returns (uint) { return rate; }
1,016,458
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract Faucet { mapping(address => uint256) private _withdrawBlockNumber; function withdraw(uint256 amount) external { _withdrawTo(msg.sender, amount); } function withdrawTo(address to, uint256 amount) external { _withdrawTo(t...
Check Effect Interaction
function _withdrawTo(address to, uint256 amount) internal { require( amount <= 1 ether && (_withdrawBlockNumber[to] == 0 || block.number < _withdrawBlockNumber[to] + 10), "TOO_GREEDY" ); _withdrawBlockNumber[to] = block.number; ...
5,344,020
/** *Submitted for verification at Etherscan.io on 2021-03-24 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply()...
return the duration of the token vesting./
function duration() public view returns (uint256) { return _cliff + _releaseDuration; }
7,791,672
./partial_match/42/0x2097364Ba2ec75bcE70Ef498B476Bb40A167057F/sources/assignmentToken.sol
TODO: transfer mintership to newminter NOTE: only incumbent minter can transfer mintership NOTE: should emit `MintershipTransfer` event
function transferMintership(address newMinter) public returns (bool) { require(newMinter != address(0)); require(msg.sender == minter); emit MintershipTransfer(minter,newMinter); minter = newMinter; return true; }
8,870,737
// SPDX-License-Identifier: MIT /* ██████╗ ██████╗ ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗ ██╔════╝ ██╔═══██╗██║ ██╔══██╗ ██╔══██╗██╔═══██╗██╔═══██╗████╗ ████║ ██║ ███╗██║ ██║██║ ██║ ██║ ██████╔╝██║ ██║██║ ██║██╔████╔██║ ██║ ██║██║ ██║██║ ██║ ██║ ██╔══██╗██║ ██║██...
Sets the Xau_BNB Uniswap oracle address
function setSynthBnbOracle(address _xau_oracle_addr, address _wbnb_address) public onlyByOwnerGovernanceOrController { require((_xau_oracle_addr != address(0)) && (_wbnb_address != address(0)), "Zero address detected"); xau_bnb_oracle_address = _xau_oracle_addr; xauBnbOracle = UniswapPairOra...
952,498
./partial_match/1/0x67c5F13c56aEb40fd9a937214E5429dAf8A0CfC9/sources/contracts/Oracle.sol
Updates the pricing data for a given round _roundData is the data to be updated/
function updateRoundData(uint80 roundId, RoundData calldata _roundData) public onlyTraderAdmin { oracleData[roundId] = _roundData; }
15,753,090