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.5.17; pragma experimental ABIEncoderV2; interface IUniswap { // To convert DAI to ETH function SWAPEXACTTOKENSFORETH436(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[]...
inject NONSTANDARD NAMING
function SAFETRANSFERFROM510(IERC20 token, address from, address to, uint256 value) internal {
977,137
./full_match/4/0x3415e14C239cbDD43cFA0DA2a7841c8a7e24Ea76/sources/browser/Token.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...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "VUI::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0...
737,750
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IER...
Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC asset The address of the underlying asset to withdraw amount The underlying amount to be withdrawn - Send the value type(uint256).ma...
function withdraw( address asset, uint256 amount, address to ) public virtual override(ILendingPool, LendingPool) onlyDepositors(msg.sender) returns (uint256) { return super.withdraw(asset, amount, to); }
1,599,876
pragma solidity ^0.4.24; /** * @title Utility contract to allow pausing and unpausing of certain functions */ contract Pausable { event Pause(uint256 _timestammp); event Unpause(uint256 _timestamp); bool public paused = false; /** * @notice Modifier to make a function callable only when the co...
Get the description of the Module/
function getDescription() public view returns(string) { return "Capped STO"; }
15,257,146
./full_match/1/0xff368E106EA8782FaB6B2D4AD69739a60C66400E/sources/contracts/Stabilizer/Stabilizer.sol
Repays Sweep Burns the sweep amount to reduce the debt (senior tranche). sweepAmount Amount to be burnt by Sweep. Decreases the sweep borrowed./
function repay(uint256 sweepAmount) external onlyBorrower nonReentrant { _repay(sweepAmount); }
3,205,022
./full_match/97/0x2e3faeA1c9fD8a6A2C7F7c5A5820596C560bc30D/sources/project_/contracts/OrderbookV4.sol
Place buy order./ if has order in sell book, and price >= min sell price/ Check if order alredy cancelled
function placeBuyOrder(uint256 amountOfBaseToken) external nonReentrant { require(amountOfBaseToken != 0, "Invalid amount!"); IERC20Upgradeable(baseToken).safeTransferFrom( msg.sender, address(this), amountOfBaseToken ); uint256 ordFee = takeDexFe...
3,267,421
./full_match/1/0x2B7F2621DB4007f99775d1B4039Ded661F347b3c/sources/contracts/ZodiakBeings.sol
Send the referral payment to the referrer _amount the amount of USDC to pay _ref the address of the referrer/
function _sendReferralPaymentUSDC(uint256 _amount, address _ref) internal { uint256 amount = _amount / REFERRAL; usdc.safeTransfer(_ref, amount); }
9,722,960
pragma solidity 0.5.16; 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 (uint...
Calculates all unclaimed reward data, finding both immediately unlocked rewards and those that have passed their time lock. _account User address return amount Total units of unclaimed rewards return first Index of the first userReward that has unlocked return last Index of the last userReward that has unlocked/
function unclaimedRewards(address _account) external view returns ( uint256 amount, uint256 first, uint256 last ) { (first, last) = _unclaimedEpochs(_account); (uint256 unlocked, ) = _unclaimedRewards(_account, first, last); ...
5,881,938
contract Owner { address public owner; modifier onlyOwner() { require(msg.sender == owner); _; } function Owner(address _owner) public { owner = _owner; } function changeOwner(address _newOwnerAddr) public onlyOwner { require(_newOwnerAddr != addre...
Pick the winner. Check game players, depends on player count provides next logic: - if in the game is only one player, by game rules the whole jackpot without commission returns to him. - if more than one player smart contract randomly selects one player, calculates commission and after that jackpot transfers to t...
function pickTheWinner() internal { uint winner; uint toPlayer; if (players[game].length == 1) { toPlayer = jackpot[game]; players[game][0].transfer(jackpot[game]); winner = 0; winner = randomNumber( 0, players[g...
5,343,167
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
Mint in public sale/
function mint(uint quantity) external payable { require(saleStatus == 2, "FinalBosu: sale is not active"); require(quantity > 0, "FinalBosu: invalid quantity"); require(quantity <= MAX_MINT, "FinalBosu: quantity exceeds max mint"); require(totalSupply().add(quantity) <= MAX_SUPPLY, "...
546,185
pragma solidity ^0.4.25; /* ( ( ) ) ( ( ( * ) * ) )\ ) )\ ) ( /( ( /( ( )\ ) ( )\ )\ ` ) /(` ) /((()/( ( (()/( )\()) )\()) )\ (()/( ( )((_)((((_)( ( )(_))( )(_))/(_)) )\ ...
registers a name. UI will always display the last name you registered. but you will still own all previously registered names to use as affiliate links. - must pay a registration fee. - name must be unique - names will be converted to lowercase - name cannot start or end with a space - cannot have more than 1 space in...
function registerNameAffId(string _nameString, uint256 _affCode) onlyHumans() external payable { require (msg.value >= registrationFee, "Value below the fee"); bytes32 name = _processName(_nameString); address addr = msg.sender; bool isNewPlayer = _determinePlayerId(addr); ...
12,634,105
pragma solidity ^0.6.12; //SPDX-License-Identifier: MIT License /** _____ __ __ | __ \ | \/ | | | | | ___ ___ _ __ | \ / | __ _ _______ | | | |/ _ \/ _ \ '_ \| |\/| |/ _` |_ / _ \ | |__| | __/ __/ |_) | | | | (_| |/ / __/ ...
once ownership is denounced, this can't be changed.
function setLiquidityThreshold(uint256 _liquidityThreshold) public onlyOwner { liquidityThreshold = _liquidityThreshold; emit liquidityThresholdSet(liquidityThreshold); } event PreSaleEnded(uint256 TokensLeft,uint256 TokensBurned,uint256 TokensAdded,uint256 LT_Set);
2,566,516
./full_match/1/0xDB094c58278501a87f3df5f17a0F0EC58a1DeE61/sources/ICOtpc__1_.sol
Override to extend the way in which ether is converted to tokens. tokens Value in wei to be converted into tokens _referralCode referral code return Number of tokens that can be purchased with the specified _weiAmount/
function _getRBonusAmount(uint256 tokens, uint256 _referralCode) internal view returns (uint256) { return tokens.mul(_referrer[_referralCode].referralBonus).div(100); }
4,915,604
./full_match/80001/0xC5175391470dA0CD3BfD2EAC79123C331Ff7a541/sources/_xaya/eth-delegator-contract/contracts/NamePermissions.sol
Retrieves the address permissions tied to a given place in the permissions hierarchy, operator and fallback status./
function retrieve (uint256 tokenId, address owner, string[] memory path, address operator, bool fallbackOnly) private view returns (MovePermissions.AddressPermissions storage) { MovePermissions.PermissionsNode storage node = retrieve (tokenId, owner, path); return (fallbac...
5,564,575
./full_match/1/0xc1BB6B6ae3b161AB145758D34D1FbfE91a3823ae/sources/contracts/Sale.sol
Remove an investor from the whitelist user The address of the investor that needs to be removed/
function _removeWhitelisted(address user) internal { require(user != address(0), "WhiteList:_removeWhitelisted - Not a valid address"); require(_isWhitelisted[user] == true, "Whitelist-_removeWhitelisted: account was not whitelisted"); _isWhitelisted[user]...
3,114,376
./full_match/56/0x569bDE4d1720f078Ad8460Cf7dF2F5EEb80c6395/sources/contracts/ERC20Prismatic.sol
Defines `agent` as address that receives easing mints from market transactions (buys, sells) Requirements: - the caller must have admin role./
function setTreasurer(address agent) public onlyRole(DEFAULT_ADMIN_ROLE) { treasurer = agent; }
3,250,339
//Address: 0x861825daa0068136a55f6effb3f4a0b9aa17f51f //Contract name: Token //Balance: 0 Ether //Verification Date: 1/17/2018 //Transacion Count: 167 // CODE STARTS HERE // Copyright (c) 2017, 2018 EtherJack.io. All rights reserved. // This code is disclosed only to be used for inspection and audit purposes. // ...
Internal function for burning tokens _sender The token sender (whose tokens are being burned) _value The amount of tokens to burn
function _burnFromAccount(address _sender, uint256 _value) internal { Burn(_sender, _value); }
15,810,052
./partial_match/80001/0xB83B47ca885A5811a16801A3Fc48384A9A6aF894/sources/SoapPunkCollectiblesChild.sol
register the supported interfaces to conform to ERC1155 via ERC165 register the supported interfaces to conform to ERC1155MetadataURI via ERC165
function __ERC1155_init_unchained(string memory uri) internal initializer { _setURI(uri); _registerInterface(_INTERFACE_ID_ERC1155); _registerInterface(_INTERFACE_ID_ERC1155_METADATA_URI); }
8,803,845
/** *Submitted for verification at Etherscan.io on 2020-08-18 */ /** *Submitted for verification at Etherscan.io on 2020-08-18 */ // guard.sol -- simple whitelist implementation of DSAuthority // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under t...
Warning: you should absolutely sure you want to give up authority!!!
function disableOwnership() public onlyOwner { owner = address(0); emit OwnerUpdate(msg.sender, owner); }
1,083,542
./full_match/43114/0x80A2b679f8CD8DC5879AE7ADC2A34BB677cd7BD6/sources/contracts/gorilla.sol
Safe gorilla transfer function, just in case if rounding error causes pool to not have enough GORILLAs.
function safeGorillaTransfer(address _to, uint256 _amount) internal { uint256 gorillaBal = gorilla.balanceOf(address(this)); if (_amount > gorillaBal) { gorilla.transfer(_to, gorillaBal); gorilla.transfer(_to, _amount); } }
4,540,718
/** *Submitted for verification at Etherscan.io on 2022-01-09 */ /**************************************************************************** $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$\ $$ __$$\ $$\ $$ __$$\ $$ __$$\ $$ __$$\ \__/ $$ | $$ | \__/...
Flip the mint state active/inactive
function flipState() public onlyOwner { isActive = !isActive; emit RolledOver(isActive); }
8,003,376
/** *Submitted for verification at Etherscan.io on 2021-05-24 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contr...
Hook that is called before any transfer of tokens. This includes minting and burning. Calling conditions: - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens will be to transferred to `to`. - when `from` is zero, `amount` tokens will be minted for `to`. - when `to` is zero, `amount` of ``from``'s to...
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
2,185,745
pragma solidity ^0.4.18; import '../base/math/SafeMath.sol'; import '../base/lifecycle/Pausable.sol'; /** * @title RequestEthereumCollect * * @dev RequestEthereumCollect is a contract managing the fees for ethereum currency contract */ contract RequestEthereumCollect is Pausable { using SafeMath for uint256; /...
set the request burner address _requestBurnerContract address of the contract that will burn req token (probably through Kyber) return/
function setRequestBurnerContract(address _requestBurnerContract) external onlyOwner { requestBurnerContract=_requestBurnerContract; }
14,019,247
./partial_match/1/0x882dA60A19c67E481481BACE4c0aa93080CDe3D7/sources/MintedEthCappedCrowdsale.sol
Calculate the current price for buy in amount. This investor is coming through pre-ico
function calculatePrice(uint value, uint weiRaised, uint tokensSold, address msgSender, uint decimals) public constant returns (uint) { uint multiplier = 10 ** decimals; if(preicoAddresses[msgSender] > 0) { return safeMul(value, multiplier) / preicoAddresses[msgSender]; } uint price = getCurr...
2,660,536
// SPDX-FileCopyrightText: © 2020 Velox <code@velox.io> // SPDX-License-Identifier: BSD-3-Clause pragma solidity 0.8.0; interface IVeloxSwap { function sellTokenForETH( address seller, address token, uint256 tokenAmount, uint256 minEthOut, uint256 deadline) external; } a...
This function should ONLY be executed when algorithmic conditons are met function sellTokenForETH seller address token address tokenAmount uint256 minEthOut uint256 deadline uint256 - UNIX timestamp/ Wrapped Ether Sanity check Be 100% sure there's available allo...
function sellTokenForETH( address seller, address token, uint256 tokenAmount, uint256 minEthOut, uint256 deadline ) override public { require(msg.sender == ADMIN_ADDRESS, "VELOXSWAP: NOT_ADMIN"); address tokenWETH = router.WETH(); require (seller...
11,988,565
./full_match/80001/0xe7Ebc638409b8f4f0DAde04c16e843a94bBc667e/sources/src/Access.sol
Toggles the allowlist status of a specific token. _tokenId The ID of the token. _status The new allowlist status of the token./
function toggleAllowlist(uint256 _tokenId, bool _status) public onlyRole(ADMIN_ROLE()) { tokenAllowlistStatus[_tokenId] = [++allowlistCounter, bool2uint(_status)]; }
5,606,048
./full_match/1/0x8b5cd3DdA28bD2Ab32cE012ebFa91aF5c3bbd8f3/sources/project_/contracts/WasabiOptionArbitrageV2.sol
withdraws any stuck ERC20 in this contract/
function withdrawERC20(IERC20 _token, uint256 _amount) external onlyOwner { _token.transfer(msg.sender, _amount); }
3,862,972
./full_match/11155111/0x32f5a54738E5C3Edac4218ef25618cf793D8da1a/sources/project_/contracts/DocScheduler.sol
todo add plausichecks
function createDoctorsOffice(Doctor memory newDoctor) public { _appointmentCounter[_counter] = 0; _doctors.push( Doctor( _counter++, msg.sender, newDoctor.firstName, newDoctor.name, newDoctor.street, newDoctor.zipCode, newDoctor.city, newDo...
3,792,885
/** *Submitted for verification at Etherscan.io on 2021-12-15 */ // File: contracts/IWoofpackNFTToken.sol // SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity ^0.8.0; /** * @dev Required interface of an ERC721 compliant contract. */ interface IWoofpackNFTToken { /** * @dev ...
enables token transfers, called when owner calls finalize()/
function finalization() public onlyOwner { token().renounceMinter(); }
2,234,363
// SPDX-License-Identifier: MIT import './abstract/ReaperBaseStrategy.sol'; import './interfaces/IUniswapRouter.sol'; import './interfaces/IMasterChef.sol'; import './interfaces/IUniswapV2Pair.sol'; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; pragma solidity 0.8.11; /** ...
Removes all allowance that were given/
function _removeAllowances() internal { IERC20Upgradeable(want).safeDecreaseAllowance(MASTER_CHEF, IERC20Upgradeable(want).allowance(address(this), MASTER_CHEF)); IERC20Upgradeable(PROTO).safeDecreaseAllowance(PROTOFI_ROUTER, IERC20Upgradeable(PROTO).allowance(address(this), PROTOFI_ROUTER)); ...
1,757,674
./full_match/1/0x253BA7cf994ec46845F8f2799f5F53777366Ca70/sources/contracts/staking/EventStaking.sol
Returns the NFT addresses and tokens that were staked by a user _owner user to get staked NFT addresses and tokens for/
function tokensStakedByOwner(address _owner) public view returns (TokensStakedByOwner memory) { uint256 totalTokens = 0; for(uint256 i = 0; i < ownerTokenAddresses[_owner].length(); i++) { address addr = ownerTokenAddresses[_owner].at(i); totalTokens += stakedTokens[_owner][addr].length(); }...
9,793,005
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openz...
Reject swap by receiver of NFT _swapId Swap ID/
function rejectSwap(bytes32 _swapId) public whenNotPaused { Swap storage _swap = _swaps[_swapId]; require(_swap.toUser == _msgSender(), "Not token owner"); _swap.saleStatus = SaleStatus.Reject; emit SwapRejected(_swapId, _swap.toUser); }
7,212,231
./full_match/42/0x4eE6E6687276928099f729baA7825c081089Dce9/sources/3.sol
Protocol for LexDAO to set canonical wETH for a chain. _wETH Account to set as wETH.
function setWeth(address _wETH) external { require(msg.sender == lexDAO, "not LexDAO"); require(!wethSet, "wETH set"); wETH = _wETH; wethSet = true; }
9,567,508
pragma solidity >=0.5.8; /* MMMMZ$..?ZOMMMMMMMMMMMMMMMMMOZ?~~IZMMMMM MMMZ~.~~,..ZOMMMMMMMMMMMMMDZ~~~~~~+ZMMMM MMDZ.~====~.:ZMMMMMMMMMMMO7~======~$8MMM MMO.,=======.:7~.......+$=~=======~~OMMM MMO.=====...............~~~~~~=====~ZMMM MMZ.==~.................~~~~~~~~===~ZMMM MMO.=~..................:~~~~~~~~~~~ZM...
gets winning pick set by admin. Will return 999 prior to
function getWPck() public view returns(uint256) { return(wPck); }
14,085,766
./full_match/1/0xDcEa155282451B5fd9faCf58Eb65B73092aC54b4/sources/contracts/OTSea.sol
If there's a whitelisted address, ensure it is the sender Calculate how many tokens the fulfiller receives based on the ratio of requestedTokenAmount to requestedETHAmount Check if the order is fully fulfilled
function fulfillOrder( bytes32 orderId, uint256 expectedPricePerToken ) external payable nonReentrant whenNotPaused { Order storage order = orders[orderId]; require(order.requester != address(0), "Order doesn't exist"); require(order.pricePerToken == expectedPricePerToken...
2,956,055
./partial_match/97/0x7632B0d0ae2a3197F252dc933843B2c3392bcf84/sources/SyrupBar.sol
Safe bold transfer function, just in case if rounding error causes pool to not have enough BOLDs.
function safeBoldTransfer(address _to, uint256 _amount) public onlyOwner { uint256 boldBal = bold.balanceOf(address(this)); if (_amount > boldBal) { bold.transfer(_to, boldBal); bold.transfer(_to, _amount); } }
11,387,491
./full_match/77/0x3Db753B1E2b48A5fefaE23F2434C1FBEDbE0769e/sources/project_/contracts/IOffer_v1.sol
IOffer is the base interface for all offers in the platform/
interface IOffer { function getInitialized() external view returns (bool); function getFinished() external view returns (bool); function getSuccess() external view returns (bool); function getTotalBought(address _investor) external view returns (uint256); function getTotalCashedOut(address _inve...
5,046,410
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import {DSTest} from "ds-test/test.sol"; import {Caller} from "../test/utils/Caller.sol"; import {Pausable} from "../pausable/Pausable.sol"; contract PausableInstance is Pausable { // This is set to true if execution was successful. // Use to chec...
Create a user Grant ability to pause/unpause to user Should be be able to pause Contract is paused Should be able to unpause Contract is unpaused
function test_authorizedUser_canPauseUnpause() public { Caller user = new Caller(); pausable.allowCaller(pausable.pause.selector, address(user)); pausable.allowCaller(pausable.unpause.selector, address(user)); user.externalCall( address(pausable), abi.encode...
7,223,078
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "../../../interfaces/IMarketController.sol"; import "../../../interfaces/IMarketConfig.sol"; import "../../../interfaces/IMarketClerk.sol"; import "../../diamond/DiamondLib.sol"; import "../MarketControllerBase.sol"; import "../MarketControlle...
Get the Escrow Ticketer to be used for a given consignment If a specific ticketer has not been set for the consignment, the default escrow ticketer will be returned. Reverts if consignment doesn't exist _consignmentId - the id of the consignment return ticketer = the address of the escrow ticketer to use/
function getEscrowTicketer(uint256 _consignmentId) external override view consignmentExists(_consignmentId) returns (address) { MarketControllerLib.MarketControllerStorage storage mcs = MarketControllerLib.marketControllerStorage(); Ticketer specified = mcs.consignmentTickete...
1,280,860
/************************************************************************** * ____ _ * / ___| | | __ _ _ _ ___ _ __ * | | _____ | | / _` || | | | / _ \| '__| * | |___|_____|| |___| (_| || |_| || __/| | * ...
defineOperator _role operator role _address operator address/
function defineOperator(string memory _role, address _address) public onlyOwner { require(!operators_[_address], "OP03"); operators_[_address] = true; emit OperatorDefined(_role, _address); } event OperatorRemoved(address address_); event OperatorDefined( string role, address address_...
6,414,740
pragma solidity ^0.4.26; import "./Owned.sol"; import "./SNSToken.sol"; contract SNSSynth is ERC20Token { using SafeMath for uint256; //mint & burn event event Mint(address indexed to, uint256 indexed amount, uint256 indexed locked); event Burn(address indexed from, uint256 indexed amount, uint256 in...
synthetic assets minting rate setting up newRate The minting rate./
function setMintingRate(uint256 newRate) onlyOwner public { require(newRate != 0); require(mintingRate != newRate); emit ChangeRate(mintingRate, newRate); mintingRate = newRate; }
12,747,549
/** *Submitted for verification at Etherscan.io on 2022-01-09 */ // SPDX-License-Identifier: MIT /** !Disclaimer! These contracts have been used to create tutorials, and was created for the purpose to teach people how to create smart contracts on the blockchain. please review this code on ...
solhint-disable-next-line max-line-length
function transferFrom( address from, address to, uint256 tokenId ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId)...
2,403,240
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one...
Set rate for updates
function setUpdateRate(uint256 rate) external onlyOwnerExec { UPDATE_RATE_PERMIL = rate; }
563,908
//Address: 0x5890301587c4f9099d5ed4041cfc4bff332357a9 //Contract name: ICOContract //Balance: 0 Ether //Verification Date: 2/13/2018 //Transacion Count: 8 // CODE STARTS HERE pragma solidity ^0.4.16; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; ...
Adds a milestone. _etherAmount amount of Ether needed for the added milestone _tokenAmount amount of tokens which will be released for added milestone _startTime field for start timestamp of added milestone _duration assumed duration of the milestone _description description of added milestone _result result desc...
function addMilestone(uint _etherAmount, uint _tokenAmount, uint _startTime, uint _duration, string _description, string _result) notSealed only(operator) public returns(uint) { totalEther += _etherAmount; totalToken += _tokenAmount; return milestones.push(Milestone(_etherAmo...
14,122,534
./full_match/5/0xaF58A878F9D9E4580476936EEB1Cb7D5Dd18cA7d/sources/contracts/ERC721Drop.sol
Collects and distributes the primary sale value of NFTs being claimed.
function _collectPriceOnClaim( address _primarySaleRecipient, uint256 _quantityToClaim, uint256 _quantityForFree, address _currency, uint256 _pricePerToken ) internal virtual override { if (_pricePerToken == 0) { return; } if (_curren...
11,591,966
/** *Submitted for verification at Etherscan.io on 2021-12-14 */ pragma solidity 0.8.9; // SPDX-License-Identifier: MIT /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @...
Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner
function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(msg.value >= NFTPrice, "insufficient amount"); require( ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own" ); requi...
6,784,364
./partial_match/1/0x1ab217c5d5B4F3B1d9b18B514729f3eB6dD148A5/sources/AggregatedefiFarm.sol
+++ Return reward multiplier over the given _from to _to block./
function _getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) { if (_from >= bonusEndBlock) { return 0; return _to.sub(_from); return bonusEndBlock.sub(_from); } }
15,733,422
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ // File: contracts/AJINU.sol /** *Submitted for verification at Etherscan.io on 2022-03-28 */ // File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol pragma solidity >=0.6.2; interface IUniswapV2Router01 { function factory() ...
Get a breakdown of send and tax amounts amount The amount to tax in wei return send The raw amount to send return reflect The raw reflection tax amount return treasury The raw treasury tax amount
function _getTaxAmounts(uint256 amount, uint8 taxReliefInterval) internal view returns ( uint256 send, uint256 reflect, uint256 treasury ) { uint256 taxRelief = 1000; if(taxReliefInterval == 1) { taxRelief = 833; taxRelief = 666; ...
6,546,630
./full_match/100/0x2535A407Be4b907D3B99BBe13d66d3CE6DDE8D53/sources/contracts/PoolBetting.sol
Oracle: Set `startsAt` as new condition `conditionId` start time. conditionId the match or game id startsAt new condition start time/
function shiftCondition(uint256 conditionId, uint64 startsAt) external { Condition storage condition = _getCondition(conditionId); _onlyOracle(condition); if (_isConditionCanceled(conditionId)) revert ConditionCanceled_(); if (startsAt <= block.timestamp + expireTimer) r...
14,280,257
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./INonFungibleHeroesComicToken.sol"; import "@openzeppelin/contracts/...
Allows the dev team to mint tokens _to The address where minted tokens should be sent _reserveAmount the amount of tokens to mint
function mintTeamTokens(address _to, uint256 _reserveAmount) public onlyOwner isSupplyAvailable(_reserveAmount) { token.mint(_reserveAmount, _to); }
14,790,191
./partial_match/1/0x15303930Fd4eaE93D6A7FdE787b0d249ace92F39/sources/contracts/interfaces/IPhuturePriceOracle.sol
Phuture price oracle interface Aggregates all price oracles and works with them through IPriceOracle interface
interface IPhuturePriceOracle is IPriceOracle { function initialize(address _registry, address _base) external; function setOracleOf(address _asset, address _oracle) external; function removeOracleOf(address _asset) external; function convertToIndex(uint _baseAmount, uint8 _indexDecimals) external vi...
11,001,531
./partial_match/42220/0x56E44A9f86C2e3a53e816335cBE6deaE440b0856/sources/WitnetPriceFeedBypass.sol
Decode a `CBOR` structure into a `fixed32` value. Due to the lack of support for floating or fixed point arithmetic in the EVM, this method offsets all values by 9 decimal orders so as to get a fixed precision of 9 decimal positions, which should be OK for most `fixed64` use cases. In other words, the output of this m...
function readFloat32(CBOR memory cbor) internal pure isMajorType(cbor, MAJOR_TYPE_CONTENT_FREE) returns (int) { if (cbor.additionalInformation == 26) { return cbor.buffer.readFloat32(); revert UnsupportedPrimitive(cbor.additionalInformation); } }
3,498,282
./full_match/1/0xFb4DE84c4375d7c8577327153dE88f58F69EeC81/sources/contracts/registries/PoolRegistry.sol
@inheritdoc IPoolRegistry Check token addresses Check meta swap deposit address add combinations of tokens to eligible pairs map i reprents the indexes of the underlying tokens of metaLPToken. j represents the indexes of MetaSwap level tokens that are not metaLPToken. Example: tokens = [sUSD, baseLPToken] under...
function addCommunityPool(PoolData memory data) external payable override { require( hasRole(COMMUNITY_MANAGER_ROLE, msg.sender), "PR: Only managers can add pools" ); for (uint8 i = 0; i < data.tokens.length; i++) { for (uint8 j = 0; j < i; j++) { ...
4,822,786
./full_match/1/0x017CBF62b53313d5eE3aD1288daA95CD39AA11fE/sources/vesper-strategies/contracts/strategies/aave/v2/AaveV2.sol
Generate report for pools accounting and also send profit and any payback to pool./
function _generateReport() internal returns (uint256 _profit, uint256 _loss, uint256 _payback) { uint256 _excessDebt = IVesperPool(pool).excessDebt(address(this)); uint256 _totalDebt = IVesperPool(pool).totalDebtOf(address(this)); uint256 _collateralHere = collateralToken.balanceOf(address(...
9,823,480
./full_match/5/0x8956E81d76FDdAbF0de54D8Da0d06c2474DeA340/sources/contracts/flatten.sol
return info - full deposit information of given account return the deposit (for gas payment) of the account add to the deposit of the given account/ add to the account's stake - amount and delay any pending unstake is first cancelled. _unstakeDelaySec the new lock duration before the deposit can be withdrawn./ attempt...
interface IEntryPoint is IStakeManager, INonceManager { event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed); event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, ...
11,606,049
./full_match/137/0x9E40a8A535D4875848e1821e3C59AB5C5dd86135/sources/contracts/core/connext/libraries/SwapUtils.sol
swap two tokens in the pool self Swap struct to read from and write to tokenIndexFrom the token the user wants to sell tokenIndexTo the token the user wants to buy dy the amount of tokens the user wants to buy maxDx the max amount the user would like to send. return amount of token user have to transfer on swap/ T...
function swapOut( Swap storage self, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dy, uint256 maxDx ) internal returns (uint256) { require(dy <= self.balances[tokenIndexTo], ">pool balance"); uint256 dx; uint256 dxFee; uint256[] memory balances = self.balances; (dx, dxF...
4,795,471
pragma solidity ^0.4.24; // File: contracts\openzeppelin-solidity\contracts\ownership\Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address p...
set milestone policy applies to a user. _to address The address which _value The amount to apply _policy index of milestone policy to apply./
function _setMilestoneTo(address _to, uint256 _value, uint8 _policy) internal { uint8 policyIndex = _getAppliedPolicyIndex(_to, _policy); if (policyIndex < MAX_POLICY) { milestoneLocks[_to].standardBalances[policyIndex] = milestoneLocks[_to].standardBalances[policyIn...
13,627,757
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; // import "strings.sol"; contract QodReward { // using strings for *; struct DataProvider { address payable providerAddress; string[] ipfsDataHash; string aesKey; string qodScore; uint pmoney; uint qodVote; //对qod验证结...
清空此次交易consumer选择的数据,避免上一次交易数据成为下一次的交易数据
function clearLastTrans() public { delete dataProviderAddresses; emit ClearLastTrans(true); }
6,448,524
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; /// @title Claimable contract interface interface IClaimable { function owner() external view returns (address); function transferOwnership(address newOwner) external; function acceptOwnership() external; } // SPDX-License-Identifier: MIT pragma ...
returns the BNT manager role/
function roleBNTManager() external pure returns (bytes32) { return ROLE_BNT_MANAGER; }
1,286,843
./full_match/1/0x27a7296A9d282E55Bdf7Ac3A7B768763dD65dE1E/sources/contracts/DutchAuction.sol
Calculates price during the auction. return Current auction price./
function _currentPrice() private view returns (uint256) { MarketInfo memory _marketInfo = marketInfo; MarketPrice memory _marketPrice = marketPrice; uint256 priceDiff = block.timestamp.sub(uint256(_marketInfo.startTime)).mul( uint256(_marketPrice.startPrice.sub(_marketPrice.minim...
3,869,962
./full_match/73799/0x2338baf37ca44f946ebe12061F773E296Ba27f60/sources/contracts/libraries/LibMetaToken.sol
issueMetaToken - Issues new token units of metaceritificate parentCertificateID - ID of the parent certificate amount - Amount of meta tokens to be issued receiver - Address of the receiver of the issued tokens/
function issueMetaToken( uint256 parentCertificateID, uint256 amount, address receiver, string memory tokenUri ) internal { address metaTokenAddress = getMetaTokenAddress(); IMetaToken(metaTokenAddress).issueMetaToken(parentCertificateID, amount, receiver, tokenU...
16,362,837
/* ____ _ _ _ ___ _ _ / ___|| |_ _ __ __ _| |_| |_ ___ _ __ / _ \ __ _| | ___ __ ___ ___ _ __ | |_ \___ \| __| '__/ _` | __| __/ _ \| '_ \ | | | |/ _` | |/ / '_ ` _ \ / _ \| '_ \| __| ___) | |_| | | (_| | |_| || (_) | | | | | |_| | (_| ...
Deposit LP tokens to MasterChef for WOLF 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.accWOLFPerShare).div(1e12).sub(user.rewardD...
1,146,353
./full_match/137/0x0BD08DcbDCB26240399F6E9573A6e404C2C3177a/sources/contracts/PrizeSavingToken.sol
2. get 20% of addresses for small consolation prize
function payout( uint256 _tokenId, uint256 _time, address[] memory _receivers, uint256[] memory _amounts ) external onlyAdmin { require(statusDrawed[_tokenId] == uint256(2), "The round already drawed"); require(timeDrawed[_tokenId] == _time, "Invalid time and toke...
4,798,284
./full_match/80001/0xb6D23ea1244CeF11a1f97bF545843e69f6124AeB/sources/project_/contracts/Election.sol
Get election start and end values
function getStart() public view returns (bool) { return start; }
858,765
./partial_match/4/0x90b353612aaC7c3c90F3207b57c00487828Edd02/sources/Lock.sol
Returns lock token address/
function getLockToken() external view returns(address) { return address(_lockToken); }
8,747,201
/** * Gets child of ForValTestF(ForValTestF,a). */ function getChildForValTestF(bytes[] memory _inputs, bytes[] memory challengeInputs) private view returns (types.Property memory) { bytes[] memory notInputs = new bytes[](1); notInputs[0] = challengeInputs[0]; return types.Prop...
Gets child of ForValTestF(ForValTestF,a)./
function getChildForValTestF(bytes[] memory _inputs, bytes[] memory challengeInputs) private view returns (types.Property memory) { bytes[] memory notInputs = new bytes[](1); notInputs[0] = challengeInputs[0]; return types.Property({ predicateAddress: notAddress, inpu...
12,991,135
./full_match/5/0xfAe93901d38CE9A2F6A14F21d731826F32dE30B9/sources/contracts/Controller.sol
Getter for the ProtocolInfo struct _vaultNumber Number of the vault _protocolNum Protocol number linked to protocol vault
function getProtocolInfo( uint256 _vaultNumber, uint256 _protocolNum ) external view override returns (ProtocolInfoS memory) { return protocolInfo[_vaultNumber][_protocolNum]; }
1,903,016
./partial_match/1/0x829BDfd41d517f57E5eBf13AD0E181351cb16a96/sources/NectarReputationRedeemer.sol
getRepRewardPerBatch function the calculation is done the following formula: RepReward = repRewardConstA (repRewardConstB_batchIndex) _batchIndex the index of the batch to calc rep reward of return repReward/
function getRepRewardPerBatch(uint256 _batchIndex) public view returns(uint256 repReward) { if (_batchIndex <= batchesIndexCap) { repReward = mul(repRewardConstA, repRewardConstB.pow(_batchIndex)); } }
3,928,606
pragma solidity ^0.4.8; import "zeppelin-solidity/contracts/token/ERC20/PausableToken.sol"; import "zeppelin-solidity/contracts/token/ERC20/MintableToken.sol"; import "zeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol"; import "zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol"; import "zeppelin-solidit...
add addresses to the whitelist override from WhiteList contract to allow calling from owner or operators addresses addrs addresses return true if at least one address was added to the whitelist, false if all addresses were already in the whitelist/
function addAddressesToWhitelist(address[] addrs) isOwnerOrOperator public returns(bool success) { for (uint256 i = 0; i < addrs.length; i++) { if (addAddressToWhitelist(addrs[i])) { success = true; } } }
13,007,060
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../token/ITokenContract.sol"; /** * @dev Supports ERC20 tokens * The escrow smart contract for the open bazaar trades in Ethereum * The smart contract is desgined keeping in mind the current wallet interface of the OB-core *...
Check whether given address was a beneficiary of transaction execution or not scriptHash script hash of the transaction beneficiary Beneficiary address to be checked/
function checkBeneficiary( bytes32 scriptHash, address beneficiary ) external view returns (bool check) { check = transactions[scriptHash].beneficiaries[beneficiary]; }
2,478,296
pragma solidity ^0.5.0; contract TLRToken { uint public totalSupply; string public name; string public symbol; uint8 public decimals =18; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint)) public allowance; //this mapping keeps track which addresses ...
add report to ReportHub
function addReport(uint _latitude, uint _longitude,string memory message) public { noOfReports+=1; Reports[noOfReports]=Report(msg.sender,_latitude,_longitude,message,0,false); emit newReport(msg.sender,_latitude,_longitude,message); }
5,372,080
pragma solidity ^0.4.20; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract owned { address public owner; constructor () public{ owner = msg.sender; } modifier onlyOwner { require ...
避免转帐的地址是0x0检查发送者是否拥有足够余额检查是否溢出保存数据用于后面的判断从发送者减掉发送额给接收者加上相同的量通知任何监听该交易的客户端判断买、卖双方的数据是否和转换前一致
function _transfer(address _from, address _to, uint256 _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; balanceOf[_from] -= _value; balanceOf[...
11,858,411
pragma solidity 0.4.24; /** * @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(address who) public view returns (uint256); function transfer(address t...
If the transferrer has purchased tokens, they must be unlocked before they can be used.
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3 * 32) canTransfer returns (bool success) { Member storage fromMember = members[_from]; int256 transferValue = fromMember.transferred + int(_value); fromMember.transferred = transferValue; }
2,058,786
/** *Submitted for verification at Etherscan.io on 2021-02-16 */ pragma solidity ^0.5.17; contract CloneFactory { function createClone(address target) internal returns (address result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d39...
enough NIF or a wildcard? then there won't be no fee
function newFarm( uint256 _periodStart, uint256 _minStake, uint256 _maxStake, address _controller, IERC20 _tokenAddress, string calldata _uri ) external payable { require(!isCloned, "Not callable from clone"); uint256 nifBalance = IERC20(nifAddress).balanceOf(msg.sender); ...
10,638,169
// SPDX-License-Identifier: MIT pragma solidity ^0.7.2; import "./ERC20.sol"; contract HedgerParty { enum HedgerStatus {NEW, FUNDED, WITHDRAWN} HedgerStatus public status = HedgerStatus.NEW; // OpenHedge Primary Contract Address address public contractAddr; // User Ethereum Address address p...
Set address of hedger party
function setUserAccount(address _user) public { require(status == HedgerStatus.NEW); account = _user; }
6,444,201
./full_match/41/0x09A497ec0e6ac038e686970448Bc636cac0AD8a2/sources/contracts/GasDistributor.sol
Split GAS to multiple addresses
function split(address payable[] calldata addresses) external payable { require(msg.value > 0, "No value provided"); require(addresses.length > 0, "No addresses provided"); uint256 amount = msg.value / addresses.length; for (uint256 i = 0; i < addresses.length; i++) { re...
16,376,324
./full_match/1/0xd6917250af0Fe5cF76c6420b9aE2c8d9625E37B5/sources/sniperrouter.sol
Show the contract WETH balance
function balanceOfWETH() external view onlyOwner returns (uint){ uint wethBalance = IWETH(WETH).balanceOf(address(this)); return wethBalance; }
3,062,735
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/IUniswapV2Router02.sol"; import "../interfaces/IERC20.sol"; contract SimpleArbitrage { address public owner; address public wethAddress; address public daiAddress; address public uniswapRouterAddress; address public su...
uniswap & sushiswap have 0.3% fee for every exchange so gain made must be greater than 2 0.3% arbitrage_amount difference in ETH
function _checkIfArbitrageIsProfitable( uint256 amountIn, uint256 higherPrice, uint256 lowerPrice ) internal pure returns (bool) { uint256 difference = ((higherPrice - lowerPrice) * 10**18) / higherPrice; uint256 payed_fee = (2 * (amountIn * 3)) / 1000; ...
14,021,742
//SPDX-License-Identifier: UNLICENSED pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner...
See {IERC721-safeTransferFrom}./safeTransferFrom(from, to, tokenId, "");
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { }
1,151,251
./full_match/137/0x742F2c5D96c0858d00860039c22D2805bed420E8/sources/contracts/helpers/MathHelpers.sol
Returns the average of two numbers. The result is rounded towards zero./
function average(uint256 a, uint256 b) external pure returns (uint256) { return (a & b) + (a ^ b) / 2; }
4,699,078
./full_match/1/0x99775ec83523F1013e3d4389CB229260237e2Bd8/sources/src/contracts/tokens/erc721/custom-erc721/ERC721A.sol
Returns the number of tokens minted by `owner`./
function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; }
8,493,761
./full_match/4/0xE0987FC9EDfcdcA3CB9618510AaF1D565f4960A6/sources/_aave/core-v3/contracts/protocol/tokenization/StableDebtToken.sol
Calculates the increase in balance since the last user interaction user The address of the user for which the interest is being accumulated return The previous principal balance return The new principal balance return The balance increase/
function _calculateBalanceIncrease(address user) internal view returns ( uint256, uint256, uint256 ) { uint256 previousPrincipalBalance = super.balanceOf(user); if (previousPrincipalBalance == 0) { return (0, 0, 0); } uint256 newPrincipalBalance = balanceOf(...
771,956
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import "@openzep...
Update the given pool's APW allocation point. Can only be called by the owner. _lpTokenId The lpTokenId of the pool _allocPoint New AP of the pool. _rewarder Address of the rewarder delegate. overwrite True if _rewarder should be `set`. Otherwise `_rewarder` is ignored. TODO: Slipping zero check for allocPoint, tha...
function set( uint256 _lpTokenId, uint256 _allocPoint, IRewarder _rewarder, bool overwrite, bool _withUpdate ) external onlyOwner { _set(_lpTokenId, _allocPoint, _rewarder, overwrite, _withUpdate); }
1,359,807
./partial_match/42/0xee075797ccbb43b07790CBDb67088968158A870B/sources/MasterChef.sol
update reward vairables for pools. Be careful of gas spending!
function massUpdatePools() public{ if(block.number < stageOneWithdrawEndBlock){ stageOne.massUpdatePools(); } else{ uint256 poolCountInRank = rankPoolIndex.length; if(poolCountInRank > 0){ mintNTS(address(this), block.number); }...
3,387,782
pragma solidity 0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public...
Fountain contract address could change over time, so we need the ability to update its address
function changeFountainContractAddress(address _newAddress) external onlyOwner returns (bool) { require(isContract(_newAddress)); require(_newAddress != address(this)); require(_newAddress != owner); fountainContractAddress = _newAddress; return true; }
12,860,536
//SPDX-License-Identifier: MIT //Copyright 2021 Louis Sobel pragma solidity ^0.8.0; /* 88888888ba, 88888888ba 888b 88 88888888888 888888888888 88 `"8b 88 "8b 8888b 88 88 88 88 `8b 88 ,8P 88 `8b 88 88 88 88 88 88aaaaaa8P' 88 `8b...
Renders the token and returns an estimate of the gas used and the bitmap data itself tokenId the token to render/
function renderToken(uint256 tokenId) public view returns (uint256, bytes memory) { address addr = _addressForToken(tokenId); return Drawing.render(addr); }
13,463,222
./full_match/1/0x0d7c7F47c77212c4538fFdFEF1Acd425c7857f02/sources/contracts/ZingArt_NFT721.sol
Freeze Metadata for a token
function freezeMetaData( uint256 _tokenId, string memory _tokenURI ) public onlyOwner { _requireMinted(_tokenId); require( !_fronzenTokens[_tokenId], "ZingNFT_721: Metadata is already frozen" ); _fronzenTokens[_tokenId] = true; _tok...
9,710,990
./full_match/1/0xBcbba981bFf1E9530CbcA0f40F67Aa85F8944038/sources/src/x-key/XKeys.sol
if the full supply allocated for this round is not claimed release it back
function _closeRound(bool checkSupply) private { RoundType _round = currentRound; if (_round == RoundType.None) { revert InvalidRound(); } currentRound = RoundType.None; uint8 _roundId = roundId; if (_round == RoundType.Raffle) { if (raffles[...
9,610,503
./full_match/3/0x3DB64E99649BEa69Ce7b3ee0d4Fe3f20FfEb6979/sources/contracts/14_ECDSA_interface_lite.sol
sig array1 - owner2 - r3 - s4 - v bytes32
function lite_verify_array(address token, bytes32 hash, address[] memory owner, uint8[] memory v, bytes32[] memory r, bytes32[] memory s) public returns (bool) { require(owner.length > 0, "Empty owner array"); bool result = true; for (uint i=0; i<owner.length; i++){ if(owner[i] !...
8,251,733
// SPDX-License-Identifier: MIT //o 8 o o o //8 8 `b d' 8 //8 .oPYo. .oPYo. .oPYo. 8 .oPYo. `bd' 8 //8 8oooo8 8 8 .oooo8 8 .oooo8 .PY. 8 //8 8. 8 8 8 8 8 8 8 ....
See {IERC721-setApprovalForAll}./
function setApprovalForAll(address operator, bool approved) public override { require(operator != _msgSender(), 'ERC721Mod: approve to caller'); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); }
1,395,910
pragma solidity ^0.4.23; import "./ERC721.sol"; import "./ERC721BasicToken.sol"; /** * @title Full ERC721 Token * This implementation includes all the required and some optional functionality of the ERC721 standard * Moreover, it includes approve all functionality using operator terminology * @dev see https://git...
Internal function to burn a specific token Reverts if the token does not exist _owner owner of the token to burn _tokenId uint256 ID of the token being burned by the msg.sender/ Clear metadata (if any)
function _burn(address _owner, uint256 _tokenId) internal { super._burn(_owner, _tokenId); if (bytes(tokenURIs[_tokenId]).length != 0) { delete tokenURIs[_tokenId]; } uint256 lastTokenIndex = allTokens.length.sub(1); uint256 lastToken = allTokens[lastTokenIndex]; allTokens[tokenIndex]...
12,887,877
./full_match/5/0xBE77D57D04B85F7d9741d8149675D9bA7358f5A0/sources/contracts/GenArt721CoreV3.sol
Updates maximum invocations for project `_projectId` to `_maxInvocations`. Maximum invocations may only be decreased by the artist, and must be greater than or equal to current invocations. New projects are created with maximum invocations of 1 million by default. _projectId Project ID. _maxInvocations New maximum in...
function updateProjectMaxInvocations( uint256 _projectId, uint24 _maxInvocations ) external { _onlyArtist(_projectId); Project storage project = projects[_projectId]; uint256 _invocations = project.invocations; require( (_maxInvocations < project.maxIn...
11,613,994
./full_match/8453/0x8b294CCF764500358d29A0d267b38f1581Af6011/sources/DUPE.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Duplicate", "DUPE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0xfCD3842f85ed87ba2889b4D35893403796e67FF1 ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUn...
11,560,182
pragma solidity ^0.4.13; contract IERC20 { function balanceOf( address whom ) external view returns (uint); function transfer( address _to, uint256 _value ) external returns (bool); function transferFrom( address _from, address _to, ...
Internal setter function to store how much stable coins were added to fund this campaign campaignPlasma is plasma campaign address amountOfStableCoins is the amount used for campaign funding/
function setAmountOfStableCoinsUsedToFundCampaign( address campaignPlasma, uint amountOfStableCoins ) internal { setUint( keccak256(_campaignPlasma2amountOfStableCoins, campaignPlasma), amountOfStableCoins ); }
13,574,465
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.0; import "./interfaces/BridgeAdminInterface.sol"; import "./interfaces/BridgePoolInterface.sol"; import "../oracle/interfaces/SkinnyOptimisticOracleInterface.sol"; import "../oracle/interfaces/StoreInterface.sol"; import "../oracle/interfaces/FinderInter...
Reward relayers if a pending relay price request has a price available on the OptimisticOracle. Mark the relay as complete. We use the relayData and depositData to compute the ancillary data that the relay price request is uniquely associated with on the OptimisticOracle. If the price request passed in does not match ...
function settleRelay(DepositData memory depositData, RelayData memory relayData) public nonReentrant() { bytes32 depositHash = _getDepositHash(depositData); _validateRelayDataHash(depositHash, relayData); require(relayData.relayState == RelayState.Pending, "Already settled"); uint32 ...
1,302,927
//SPDX-License-Identifier: Unlicense pragma solidity 0.5.17; import "./interfaces/IOpportunity.sol"; import "./libraries/Initializable.sol"; import "./interfaces/IStorage.sol"; // Remove hardhat/console.sol for production import "hardhat/console.sol"; contract MyOpportunity is IOpportunity, Initializable { byte...
Fallback function to receive Ether Required to receive Ether from MyOpportunity upon withdrawal
function() external payable { }
12,882,735
/* Copyright 2021 Empty Set Squad <emptysetsquad@protonmail.com> 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 ...
Registers a new address for cUSDC Owner only - governance hook newValue New address to register/
function setCUsdc(address newValue) external validate(newValue) onlyOwner { cUsdc = newValue; emit Registration("CUSDC", newValue); }
5,461,254
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; // ,--------.,------.,------. ,------.,--. ,--. // '--. .--'| .---'| .-. \ | .-. \\ `.' / // | | | `--, | | \ :| | \ :'. / // | | | `---.| '--' /| '--' / | | // `--' `------'`-------' `-------' `--' // ,-----. ,-----...
gift a single token to each address passed in through calldata _recipients Array of addresses to send a single token to
function gift(address[] calldata _recipients) external onlyOwner { uint256 recipients = _recipients.length; require( recipients + _owners.length <= MAX_SUPPLY, "_quantity exceeds supply" ); for (uint256 i = 0; i < recipients; i++) { _safeMint(_rec...
13,961,399
pragma solidity ^0.5.0; import './KudosToken.sol'; import '@openzeppelin/contracts/lifecycle/Pausable.sol'; import '@openzeppelin/contracts/ownership/Ownable.sol'; /// @title A list of Tasks /// @author Andy Bell andy.bell@displaynote.com /// @notice You can use this contract to create and complete tasks set contract ...
Andy Bell andy.bell@displaynote.com Complete a task Only the owner can complete a task _id A 32 character hash which would point to the task _winner Address of the hunter Rewind. I am thinking if we return false it is a revert which would wind this back anyhow. TODO - check this and remove line below if not needed
function completeTask(bytes32 _id, address _winner) public whenNotPaused { Task storage t = tasks[_id]; require(t.owner == msg.sender, 'Invalid task'); require(_winner != address(0x0), 'Invalid hunter'); require(t.hunters[_winner], 'No hunters'); require(t.tok...
12,785,654
/** *Submitted for verification at Etherscan.io on 2021-03-12 */ pragma solidity 0.6.6; // File: @openzeppelin/contracts/GSN/Context.sol /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.send...
Transfer ETH to this contract and allow this contract to pay ETH when exchanging./
function depositEth() external payable { _addEthAllowance(msg.sender, msg.value); }
6,770,814