file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./libs/Address.sol"; import "./abstracts/BEP20WithBotProtection.sol"; import "./interfaces/IUniswapV2Factory.sol"; import "./interfaces/IUniswapV2Router02.sol"; contract Wormoon is BEP20WithBotProtection("Worminator v2 Protocol", "WRMNTOR") { using A...
--==[ Public functions ]==--
function addPairToTrack(address pair) external onlyOwner { _addPairToTrack(pair); rewardsExcluded[pair] = true; _addSystemAddress(getPairVault(pair)); }
12,835,590
./full_match/1/0xa617206663343b6353acF27566586eE9b53DFb2b/sources/contracts/helpers/converter/ConverterRegistry.sol
Variables / Mapping from pool type to the address of converter. Public View Functions / @inheritdoc IConverterRegistry
function getTokenPair(uint256 _route) external view override returns (address, address) { uint256 _poolType = _route & 255; return ITokenConverter(converters[_poolType]).getTokenPair(_route); }
2,971,206
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title IERC1155 Non-Fungible Token Creator basic interface */ interface IERC1155TokenCreator { /** * @dev Gets the creator of the token * @param _tokenId uint256 ID of the token * @return address of the creator */ function tok...
IERC1155 Non-Fungible Token Creator basic interface/
interface IERC1155TokenCreator { function tokenCreator(uint256 _tokenId) external view returns (address payable); }
242,666
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "fungible_CDPToken.sol"; import "inheritingForTestPurpose.sol"; // Uniswap Pair Interface interface UniswapV2PairLike { function getReserves() external view returns ( uint112 reserve0, uint112 reserv...
CDPId => UrnHandler
function urns(uint256) external returns(address);
7,218,913
./full_match/5/0xC4EA0B17F4e8a019Bb30336cb2B4B58099b4302D/sources/contracts/k.sol
Check if Merkle root has been already addedMint a NFT
function whitelistMint(bytes32[] calldata _merkleProof, uint256 _mintAmount) public payable { require(supply.current() + _mintAmount <= maxSupply,"Max supply already reached"); require(!mintPaused, "Minting is paused"); require(!publicMint, "Public mint is live"); require (merkleRoot...
11,621,795
pragma solidity 0.8.7; // SPDX-License-Identifier: MIT import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeEIP20.sol"; import "./Ownable.sol"; import "./Pausable.sol"; import "./Lockable.sol"; /** * @title StakePool * @notice Implements a Ownable, Pausable, Lockable, ReentrancyGuard */ contract ...
A method to distribute daily rewards to all stakeholders./check if staking period for stakeholder has not expired
function distributeDailyRewards() public payable onlyOwner { uint256 _totalRewards = 0; for (uint256 s = 0; s < stakeholders.length; s += 1) { address stakeholder = stakeholders[s]; Stake storage stake = stakes[stakeholder]; if(stake.valid){ ...
927,693
./full_match/1/0xa9d0146388BDc91A252F39f309690633A242C0cF/sources/contracts/JayDeriv.sol
Will be set to 100m eth value after 1 hr
function setMax(uint256 _max) external onlyOwner { MAX = _max; emit MaxUpdated(_max); }
9,683,278
./partial_match/1/0x5F094ECD2714e5Da4927CEda9c4E3db04293D3D8/sources/BabyBullCoin.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function symbol() external view returns (string memory); function name() external view returns (string memory); function decimals() external view returns (uint8); }
4,151,533
pragma solidity ^0.4.18; /** * @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) { if (a == 0) { return 0; ...
no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure
function burn(uint256 _value) public onlyOwner { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); }
13,773,303
pragma solidity ^0.5.10; contract testSuicide { string s = "dd"; string a; constructor() public { a = "ee"; } function finish() public { s = "1111111111"; a = "222222222222"; //add selfdestruct here. } }
add selfdestruct here.
function finish() public { s = "1111111111"; a = "222222222222"; }
15,832,046
./partial_match/1313161554/0xb40460B89979225DD0fA4D8bD391200795750c9b/sources/StrategyBastionUsdt.sol
Return 99.99% of the time just incase
function getRedeemable() public returns (uint256) { uint256 supplied = getSupplied(); uint256 borrowed = getBorrowed(); (, uint256 colFactor) = IComptroller(comptroller).markets(cToken); return supplied.sub(borrowed.mul(1e18).div(colFactor)).mul(9999).div( ...
16,913,512
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
pool token (TUSD) stake token (TRU) join pool 1. Transfer TUSD from sender 2. Mint pool tokens based on value to sender/ exit pool 1. Transfer pool tokens from sender 2. Burn pool tokens 3. Transfer value of pool tokens in TUSD to sender/ borrow from pool 1. Transfer TUSD to sender 2. Only lending pool should be al...
interface ITrueRatingAgencyV2 { function getResults(address id) external view returns ( uint256, uint256, uint256 ); function submit(address id) external; function retract(address id) external; function resetCastRatings(address id) e...
13,431,887
// Defines the compiler version pragma solidity ^0.4.24; import "./contracts/token/ERC20/SafeERC20.sol"; import "./contracts/ownership/Ownable.sol"; import "./contracts/token/ERC20/IERC20.sol"; import "./contracts/utils/ReentrancyGuard.sol"; import "./contracts/math/SafeMath.sol"; // The slot machine game contract co...
Pay the prize to the player Calculate the prize based on player bet Send prize in tokens to the player
function payPrize(address _player, uint _index) internal returns (uint) { uint prize = calculatePrize(bets[_player], _index); if (prize > 0) { casinoToken.safeTransfer(_player, prize); } return prize; }
6,407,656
./full_match/40/0x4682FE03c0734ffae6606D7A4894f7129EA0bed5/sources/contracts/ElkV2FarmFactory_flattened.sol
Return the vested coverage in coverage token amount for the given HODL and OUT values since the provided timestamp. _hodlValue the value (in WETH) if the tokens making up the LP were kept unpaired _outValue the value (in WETH) of the LP token position _lastTimestamp the start timestamp (when the LP token position wa...
) private view returns (uint256) { uint256 timeElapsed = block.timestamp - _lastTimestamp; uint256 wethCov = _hodlValue > _outValue ? _hodlValue - _outValue : 0; uint256 tokenCoverage = wethCov == 0 ? 0 : oracle.consult(oracle.weth(), wethCov, coverageTokenAddress); function vestedCovera...
9,548,937
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IReserve.sol"; import "./interfaces/ISortedOracles.sol"; import "../common/FixidityLib.sol"; import "../common/Initializable.sol"; import "../common...
Set the ratio of reserve that is spendable per day. ratio Spending ratio as unwrapped Fraction./
function setDailySpendingRatio(uint256 ratio) public onlyOwner { spendingRatio = FixidityLib.wrap(ratio); require(spendingRatio.lte(FixidityLib.fixed1()), "spending ratio cannot be larger than 1"); emit DailySpendingRatioSet(ratio); }
2,528,219
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/con...
fetch items user bought
function fetchUserBoughtItems() public view returns (ListingItem[] memory) { uint _userItemCount = 0; for (uint i = 0; i < _itemIds.current(); i++) { if(_listingItems[i].sold && _listingItems[i].owner == address(msg.sender)){ _userItemCount++; } } ...
12,855,253
./partial_match/1/0x94CFF60496C71a0302ABAba0Da1A1f21626f9613/sources/FPIControllerPool.sol
Needed as a FRAX AMO Dummy values here. FPI is not FRAX and should not be treated as FRAX collateral
function dollarBalances() public view returns (uint256 frax_val_e18, uint256 collat_val_e18) { frax_val_e18 = 1e18; collat_val_e18 = 1e18; }
2,635,610
pragma solidity 0.4.24; pragma experimental "v0.5.0"; pragma experimental ABIEncoderV2; import { EVMConstants } from "solevm-truffle/EVMConstants.sol"; import { EVMAccounts } from "solevm-truffle/EVMAccounts.slb"; import { EVMStorage } from "solevm-truffle/EVMStorage.slb"; import { EVMMemory } from "solevm-truffle/EVM...
Transfer value. TODO if callcode is added If there is no code to run, just continue. TODO
function _call(EVMInput memory evmInput, CallType callType) internal pure returns (EVM memory evm) { evm.context = evmInput.context; evm.handlers = evmInput.handlers; if (evmInput.staticExec) { evm.accounts = evmInput.accounts; evm.logs = evmInput.logs; ev...
5,515,946
./full_match/42/0xE6dCd31f820156572C8F436fD12CD692360d32e2/sources/browser/AyMaTrading.sol
Deposit Ether./
function deposit(uint256 amount) external payable { require(msg.value==amount, "Deposit failed!"); }
9,565,108
pragma solidity ^0.4.24; contract FlyToTheMoonEvents { // buy keys during first stage event onFirStage ( address indexed player, uint256 indexed rndNo, uint256 keys, uint256 eth, uint256 timeStamp ); // become leader during second stage event onSecSta...
Award by rndNo. 0x80ec35ff 0x80ec35ff0000000000000000000000000000000000000000000000000000000000000001/ event
function awardByRndNo(uint256 _rndNo) onlyHuman() public { require(_rndNo <= rndNo, "You&#39;re running too fast"); require(now > round_m[_rndNo].endTime, "Wait patiently"); require(round_m[_rndNo].leader == msg.sender, "The prize is not yours"); require(round_m[_...
7,825,170
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.6.0 (governance/TimelockControllerWith46Migration.sol) pragma solidity ^0.8.0; import "./TimelockControllerUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of the TimelockController that includes an additional * function ...
Migration function. Running it is necessary for upgradeable instances that were initially setup with code <4.6 and that upgraded to >=4.6./
function __TimelockControllerWith46Migration_init_unchained( uint256, address[] memory, address[] memory function migrateTo46() public virtual { require( getRoleAdmin(PROPOSER_ROLE) == TIMELOCK_ADMIN_ROLE && getRoleAdmin(CANCELLER_ROLE) == DEFAULT_ADMIN_ROLE, ...
7,234,453
./full_match/80001/0xA7f1B8e063C878F8799D4d164478dB1c35491f9e/sources/project_/contracts/token/Minter.sol
Set Bonus params. bonus will start to accu on the next block that this function executed See the calculation and counting in test file.
function setBonus( uint256 _bonusMultiplier, uint256 _bonusEndBlock, uint256 _bonusLockRatio ) external onlyOwner { require(_bonusEndBlock > block.number, "setBonus: bad bonusEndBlock"); require(block.number < derpfi.endReleaseBlock(), "setBonus: bad block"); require(_bonusMultiplier > 1, "s...
850,996
/** *Submitted for verification at Etherscan.io on 2022-01-22 */ // SPDX-License-Identifier: MIT // File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information ab...
require(bytes(_uris[id]).length == 0, "Cannot set uri twice");concat URI with id and .json to give uri_
function setTokenUri( uint256 id, string memory URI) internal{ string memory uri_ = URI; _uris[id]= uri_; }
7,620,302
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "../governance/Managed.sol"; import "../upgrades/GraphUpgradeable.sol"; import "../utils/TokenUtils.sol"; impo...
The arbitrator accepts a dispute as being valid. This function will revert if the indexer is not slashable, whether because it does not have any stake available or the slashing percentage is configured to be zero. In those cases a dispute must be resolved using drawDispute or rejectDispute. Accept a dispute with ID `_...
function acceptDispute(bytes32 _disputeID) external override onlyArbitrator { Dispute memory dispute = _resolveDispute(_disputeID); (, uint256 tokensToReward) = _slashIndexer(dispute.indexer, dispute.fisherman, dispute.disputeType); TokenUtils.pushTokens(graphToken(), dispute.f...
5,347,893
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Counters.sol // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that ca...
See {IERC721-getApproved}./
function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; }
8,025,884
./full_match/3/0x69bCEa453980b0cFeFb4CDe05e365670c3f487DA/sources/browser/hack/cal.sol
arbNum = sub(_sqrt, a); arbNum = arbNum / b;
function calArberNum(address token, uint tokenSold, bool EtoT) public view returns(uint arbNum, uint a, uint b) { (uint ethBalanceV1, uint tokenBalaceV1, uint ethBalanceV2, uint tokenBalaceV2) = getBalance(token, tokenSold, EtoT); uint _x1 = EtoT ? ethBalanceV1 : tokenBalaceV1...
8,249,348
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; contract DistributedDictionary { constructor(){ initWithWords(); } struct Post { uint id; string wordMeaning; int votes; address author; } struct Word{ Post[] posts; } mapping (string...
returnes word by index
function getWordByIndex(uint index) view public returns (string memory){ return wordsArray[index]; }
12,827,482
pragma solidity ^0.5.10; contract Oracle { /** Contract Constructor * @param ethPrice the starting price of ETH in USD, represented as 150000000 = 150.00 USD * @dev The message sender is assigned as the contract administrator */ constructor (uint ethPrice) public { admins[msg.sender] ...
Return the entire current price array for a given asset id the asset id of the desired asset return currentPrices the price array for the asset only the admin and addresses granted readership may call this function/
function getCurrentPrices(uint id) public view returns (uint[8] memory currentPrices) { require (admins[msg.sender] || readers[msg.sender]); currentPrices = prices[id]; }
7,307,215
./full_match/1/0xaf50C9Cf53e1063AAaB84F089Da78b19f0a222a4/sources/contracts/strategies/balancer/BaseBalancerStrategy.sol
Sets max deposit deviation that is considered when adding liquidity to Balancer pools. _maxDepositDeviation Max deposit deviation denominated in wad (number with 18 decimals): 1e18 == 100%, 1e16 == 1% IMPORTANT Minimum maxDepositDeviation will default to 1% (1e16) for production usage. Vault value checker in co...
function setMaxDepositDeviation(uint256 _maxDepositDeviation) external onlyVaultOrGovernorOrStrategist { require(_maxDepositDeviation <= 1e18, "Deposit dev. out of bounds"); emit MaxDepositDeviationUpdated( maxDepositDeviation, _maxDepositDeviation ...
3,150,150
./full_match/1/0xf7E49a9D1dfeD8E533e3C6d2A5977e6d240e07f5/sources/contracts/Quest.sol
Function that allows either the protocol fee recipient or the owner to withdraw the remaining tokens in the contract Every receipt minted should still be able to claim rewards (and cannot be withdrawn). This function can only be called after the quest end time
function withdrawRemainingTokens() external onlyProtocolFeeRecipientOrOwner onlyWithdrawAfterEnd { require(!hasWithdrawn, 'Already withdrawn'); uint unclaimedTokens = (this.receiptRedeemers() - redeemedTokens) * rewardAmountInWei; uint256 nonClaimableTokens = rewardToken.balanceOf(address(t...
4,968,842
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ABDKMath64x64.sol";...
Lets a user withdraw all their tokens from this smart contract A fee is charged on all withdrawals We make sure to track the state of [totalPrincipal, numUsersWithDeposits]/
function withdrawTokens() external { require(_balances[msg.sender] > 0, "TokenBalance: no tokens available to be withdrawn"); uint totalBalance = 0; if(block.number <= compound.depositEndBlock) { totalBalance = _balances[msg.sender]; totalBalance = compoundInterestByBlock(_balances[msg.sende...
1,068,555
./full_match/1/0x8C874963E95128C48151a53d1A39826CcC9835Cc/sources/src/core/coins/ShortDurationYieldCoin.sol
Sets the management fee for the token _managementFee is the management fee (18 decimals). ex: 2 10 18 = 2%/
function setManagementFee(uint256 _managementFee) external { _checkOwner(); if (_managementFee > 100 * FEE_MULTIPLIER) revert BadFee(); emit ManagementFeeSet(managementFee, _managementFee); managementFee = _managementFee; }
2,926,623
//pragma solidity ^0.3.6; contract Token { function balanceOf(address user) constant returns (uint256 balance); function transfer(address receiver, uint amount) returns(bool); } // A Sub crowdfunding contract. Its only purpose is to redirect ether it receives to the // main crowdfunding contract. This mecanism is u...
Set the value of BCY gave by the SOG network. Only our BCY escrow can modify it.
function setBCY(uint newValue) onlyBy(bitCrystalEscrow){ if (now < startDate || now > endDate) throw; else throw; }
7,313,873
pragma solidity 0.4.24; // File: @tokenfoundry/sale-contracts/contracts/interfaces/DisbursementHandlerI.sol interface DisbursementHandlerI { function withdraw(address _beneficiary, uint256 _index) external; } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operatio...
Called by the owner if the sale has ended.
function close() external atState(State.Success) onlyOwner { state = State.Closed; nextDisbursement = now; emit Closed(); }
10,610,648
// SPDX-License-Identifier: MIT pragma solidity ^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() external view returns (uint256); /** * @dev Returns the amount o...
@inheritdoc IKCompound/
function compound_underwrite(CToken _cToken, uint256 _tokens) external payable override onlyJITU whenNotUnderwritten { LibCompound.underwrite(_cToken, _tokens); }
118,174
./full_match/1/0x9d764bcf1AFFd83554B7626F22EAB2ffC60590C7/sources/contracts/nfts/TokenIdCutoff.sol
The cutoff can only increase cutoff The invalid cutoff/
function cutoffTokenId() public view virtual returns (uint256) { return _cutoffTokenId; }
4,968,083
/** *Submitted for verification at Etherscan.io on 2020-10-12 */ /** *Submitted for verification at Etherscan.io on 2020-08-27 */ pragma solidity ^0.5.8; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure retu...
inject PUBLIC FUNC TO EXTERNAL
function changeOperator(address _newOperator) public onlyOperator {
5,531,585
./full_match/1/0x0F07685A92c9B5c63a9e9Af205948BECeb8eb5f6/sources/contracts/priceProviders/balancerV2/BalancerV2PriceProvider.sol
Returns price for a given asset Balancer docs: | Some pools (WeightedPool2Tokens and MetaStable Pools) have optional Oracle functionality. | This means that they can be used as sources of on-chain price data. | Note from balancer docs: that you can only call getWeightedTimeAverage after the buffer is full,...
function getPrice(address _asset) public view override returns (uint256 price) { if (_asset == quoteToken) { return 10 ** _QUOTE_TOKEN_DECIMALS; } BalancerPool storage pool = assetsPools[_asset]; address priceOracle = pool.priceOracle; if (priceOracle == address(...
2,931,404
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/t...
ETH balance of this contract. ETH balance is equal to the cETH balance multiplied by the Exchange Rate.
function syncBalance() external override returns (uint256) { uint256 ethBalance = ICEth(cEth).balanceOfUnderlying(address(this)); return ethBalance; }
2,560,760
./partial_match/4/0x4104F207A8Db114083c396dD1e96C5fAeb3d5E61/sources/Issuer.sol
liquidation requires dUSD to be already settled / not in waiting period Remove liquidated debt from the ledger synth.burn does a safe subtraction on balance (so it will revert if there are not enough synths). Store their debtRatio against a feeperiod to determine their fee/rewards % for the period
function _burnSynthsForLiquidation( address burnForAddress, address liquidator, uint256 amount, uint256 existingDebt, uint256 totalDebtIssued ) internal { _removeFromDebtRegister( burnForAddress, amount, existingDebt, ...
8,559,163
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/lib/ReentrancyGuard.sol
Internal view function to ensure that the sentinel value indicating native tokens may be received during execution is currently set./ Ensure that the reentrancy guard is not currently set.
function _assertAcceptingNativeTokens() internal view { if (_reentrancyGuard != _ENTERED_AND_ACCEPTING_NATIVE_TOKENS) { _revertInvalidMsgValue(msg.value); } }
4,300,984
./partial_match/1/0x1Fa85cbB83B065E5Eb3Ea302Dc49A9Cde7a5D47f/sources/Registry.sol
_isEmergency True if emergency is happening/
function setEmergency(bool _isEmergency) external auth { db.setBooleanValue("isEmergency", _isEmergency); }
2,760,135
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol"; import "@openzeppelin/cont...
Updates fee. Only callable by owner.
function setFeeBps(uint256 _feeBps) external onlyOwner { feeBps = _feeBps; emit SetFeeBps(_feeBps); }
955,781
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // 'IVNT1' token contract // // Deployed to : 0x7c0bd45E0716Ed8D4cead2cec3B2183AB7E5542f // Symbol : IVNT1 // Name : IVNT1 Token // Total supply: 96900000000 // Decimals : 18 // ---------------------...
------------------------------------------------------------------------ Owner can transfer out any accidentally sent ERC20 tokens ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); }
1,426,688
/** *Submitted for verification at Etherscan.io on 2022-03-31 */ // SPDX-License-Identifier: MIT pragma solidity =0.6.12; // /* * @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.d...
Update reward end status
function updateRewardEndStatus(bool _status, uint256 _rewardEndBlock) public onlyOwner { require(rewardEndStatus != _status, "Already same status"); rewardEndBlock = _rewardEndBlock; rewardEndStatus = _status; emit RewardEndStatus(_status, _rewardEndBlock); }
2,416,990
./full_match/1/0x5B7B8b487D05F77977b7ABEec5F922925B9b2aFa/sources/contracts/AlphaProVault.sol
Used to change deposit cap for a guarded launch or to ensure vault doesn't grow too large relative to the pool. Cap is on total supply rather than amounts of token0 and token1 as those amounts fluctuate naturally over time./
function setMaxTotalSupply(uint256 _maxTotalSupply) external onlyManager { maxTotalSupply = _maxTotalSupply; emit UpdateMaxTotalSupply(_maxTotalSupply); }
16,419,094
/** *Submitted for verification at Etherscan.io on 2021-03-25 */ pragma solidity ^0.4.26; /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } ...
This creates an array with all balances / This generates a public event on the blockchain that will notify clients / This notifies clients about the amount burnt / This notifies clients about the amount frozen / This notifies clients about the amount unfrozen / Initializes contract with initial supply tokens to the cre...
function Byte() { owner = msg.sender; }
6,764,095
./partial_match/56/0x7A79900560DF1C7Ac3dde38D7e0FfaC7c45E23a2/sources/VaiVaultStrategy.sol
Harvests yields generated and reinvests into the underlying. This function call will fail if deposits are paused./
function doHardWork() external onlyNotPausedInvesting restricted { vaiVault.claim(); _liquidateReward(); investAllUnderlying(); }
11,038,343
pragma solidity ^0.5.0; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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(uint25...
override of assign tokens prerequisit of possible features.
function _assignTokensPrerequisit() internal view returns (bool) { return (_isTokenAssignmentControl() && _isActiveOrDraftState()); }
1,083,340
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/...
loop through each bucket of Wolves with the same alpha score 5 = 8 -3 if the value is not inside of that bucket, keep going get the address of a random Wolf with that alpha score
function randomVampireOwner(uint256 seed) external view override returns (address) { if (totalPredatorScoreStaked == 0) return address(0x0); uint256 cumulative; seed >>= 32; for (uint8 i = 5; i <= 8; i++) { cumulative += scoreStakingMap[i].length * i; if (buc...
9,980,067
// File: @aragon/os/contracts/lib/token/ERC20.sol // See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/a9f910d34f0ab33a1ae5e714f69f9596a02b4d91/contracts/token/ERC20/ERC20.sol pragma solidity ^0.4.24; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC2...
Received when a vote is challenged _voteId Identification number of the vote _challengeId Identification number of the challenge associated to the vote on the attached Agreement/
function _onDisputableActionChallenged(uint256 _voteId, uint256 _challengeId, address /* _challenger */) internal { Vote storage vote_ = _getVote(_voteId); require(_isNormal(vote_), ERROR_CANNOT_PAUSE_VOTE); vote_.status = VoteStatus.Paused; vote_.pausedAt = getTimestamp64(); ...
15,422,830
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint25...
Set the address of the minter _minter address to be set as minter. Note: We also need to implement "mint" method./
function setMinter(address _minter) public onlyOwner { minter = _minter; }
923,358
// contracts/Gaia_Location.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; // import "@openzeppelin/contracts/utils/Counters.sol"; // import "./Integers.sol"; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters tha...
get OwnedLocations within bounds
function getOwnedLocationsInBounds( address _owner, uint16 minOwnedLat, uint16 minOwnedLng, uint16 maxOwnedLat, uint16 maxOwnedLng ) external view returns (Loc[] memory ownedLocs) { if (balanceOf[_owner] == 0) { return ownedLocs; }
1,764,633
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../common/implementation/FixedPoint.sol"; // Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below). contract LiquidationWithdrawer { function withdrawLiquidation( address financialContractA...
Adds an address to the whitelist. newElement the new address to add./ Ignore if address is already included Only append new addresses to the array, never a duplicate
function addToWhitelist(address newElement) external nonReentrant() onlyOwner { if (whitelist[newElement] == Status.In) { return; } if (whitelist[newElement] == Status.None) { whitelistIndices.push(newElement); } whitelist[newElement] = Status.In; ...
99,390
pragma solidity ^0.4.15; interface TokenInterface { function mint(address _to, uint256 _amount) public returns (bool); function finishMinting() public returns (bool); function totalSupply() public constant returns (uint); function balanceOf(address _address) public constant returns (uint); function burn(address b...
Delegates request for refund of soft cap to payment module/
function refundSoftCap() public { DAOProxy.delegatedRefundSoftCap(paymentModule); }
12,948,314
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* ...
Credits payouts to insurees/ Get the key then multiply the profit for all passengers
function creditInsurees( address airline, string flight, uint256 timestamp ) external onlyAuthorizedCaller() { bytes32 key = getFlightKey(airline, flight, timestamp); Purchase[] memory assured = purchases[key]; for (uint i = 0; i < assured.length; i++) { address cust...
12,684,323
//Address: 0xf3845122100b623323d6108bbd4cdefcab68a2d6 //Contract name: EthMessage //Balance: 0.01 Ether //Verification Date: 10/11/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.15; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control...
This is only for messed up things people put.
function removeMessage() onlyOwner public { message = ""; }
915,888
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.6.11; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() exte...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); fu...
1,334,382
./full_match/1/0x70588Eb4626600e6b9cD49b140E39e5a814D9535/sources/erc721bo/contracts/Assets.sol
Returns ownership flags by `owner` and `pageNo`./
function page(Pages storage pages, address owner, uint256 pageNo) internal view returns (uint256) { return pages._inner[getPageKeyBy(pageNo, owner)]; }
3,053,351
/* This contract is the distribution funnel for Doppler. It acts as a sort of payments routing interface between users and the app marketplace. It takes a micropayment from a user, holds it while a prediction is taking place, and then distributes the payment according to the results of the prediction. */ // ...
Creates a payment object and holds it in escrow while waiting for the result. If user already has a payment, delete it TODO: allow for more than 1 payment in escrow per user.
function createPayment(uint _pipelineId, uint amountSent) public payable{ address userAddr = msg.sender; uint pipelineIdentifier = _pipelineId; if(escrowMapping[userAddr].isValue) { delete escrowMapping[userAddr]; } escrowMapping[userAddr] = Payment( { amount: amountSent, ...
12,916,519
./full_match/4/0xE224454FF33D5d0324b6Ae35c2824066a4129B1A/sources/contracts/IronChef.sol
Update reward variables of the given pool. pid The index of the pool. See `poolInfo`. return pool Returns the pool that was updated.
function updatePool(uint256 pid) public returns (PoolInfo memory pool) { pool = poolInfo[pid]; if (block.timestamp > pool.lastRewardTime) { uint256 lpSupply = lpToken[pid].balanceOf(address(this)); if (lpSupply > 0) { uint256 time = block.timestamp - pool.last...
685,427
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/drafts/IERC20Permit.sol"; import {IOilerRegistry} from "./interfaces/IOilerRegistry.sol"; import {IOilerOptionBase} from "./interfaces/IOilerOptionBase.so...
writes options where: 1. original msg.sender receives the options 2. router receives writer rights
function _writeOnBehalfOf(IOilerOptionBase _option, uint256 _amount) internal { require( _option.collateralInstance().transferFrom(msg.sender, address(this), _amount), "OilerOptionsRouter.write, ERC20 transfer failed" ); _option.write(_amount, msg.sender); }
5,934,619
./full_match/44787/0x0c5F8B9F2e21f8023981140e4BA59C6314b5E987/sources/contracts/StarFarm.sol
Withdraw LP tokens from MasterChef.uint256 lpSupply = pool.lpToken.balanceOf(address(this)).add(pool.extraAmount);emit GetReward(lpSupply, multiplier, starReward, accStarPerShare,pool.allocPoint,totalAllocPoint, pool.lastRewardBlock, block.number);uint256 pending = _amountGain.mul(accStarPerShare).div(1e12);
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_msgSender()]; require(user.amount >= _amount, "withdraw: amount error"); updatePool(_pid); (uint256 _selfGain, uint256 _parentGain) = sta...
13,269,739
./partial_match/1/0xd745A68c705F5aa75DFf528540678288ed2aD9eE/sources/contracts/src/state/shared/PendingAdministratorAddress.sol
Sets the Pending Administrator Address _newValue New Pending Administrator Address
function set(address _newValue) internal { LibUnstructuredStorage.setStorageAddress(PENDING_ADMINISTRATOR_ADDRESS_SLOT, _newValue); }
9,396,101
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "./TokenBase/Base.sol"; /** * @title dForce's Lending Protocol Contract. * @notice iTokens which wrap an EIP-20 underlying. * @author dForce Team. */ contract iToken i...
Calculates interest and update total borrows and reserves. Updates total borrows and reserves with any accumulated interest./
function updateInterest() external override returns (bool) { _updateInterest(); return true; }
133,164
pragma solidity 0.5.0; import "./ERC.sol"; import "./ItemContract.sol"; contract ERC165Implementation is ERC165 { constructor () public { //store that contract implements ERC165 supportedInterfaces[bytes4(keccak256("supportsInterface(bytes4)"))] = true; //Store that te contract im...
Transfers the ownership of an item from one address to another address. _from The current owner of the item. _to The new owner. _id The item to transfer.
function safeTransferFrom(address _from, address _to, uint256 _id) external payable { this.safeTransferFrom(_from, _to, _id, ""); }
1,805,110
pragma solidity ^0.4.15; library DateTime { /* * Date and Time utilities for ethereum contracts * */ struct _DateTime { uint16 year; uint8 month; uint8 day; uint8 hour; uint8 minute; ...
-1 n1 < n2 0 n1 == n2 1 n1 > n2
function compareInts(int n1, int n2) internal constant returns (int res) { if (n1 == n2) { res = 0; } else if (n1 < n2) { res = -1; } else if (n1 > n2) { res = 1; } }
2,385,487
./full_match/5/0xa7Be4B4Bca2F64c6C9CB6f49D7F53824Fa4ABFb4/sources/project_/contracts/modules/wrapper/mandatory/EnforcementModule.sol
Freezes an address. account the account to freeze reason indicate why the account was frozen./
function freeze( address account, string calldata reason ) public onlyRole(ENFORCER_ROLE) returns (bool) { return _freeze(account, reason); }
1,954,870
./full_match/1/0xaBCF57EB168f65841964fa410F48370c5AF057A5/sources/src/L1/BattleRoyaleL1.sol
Sets the protocol fee beneficiary It can be called by an authorized address _beneficiary New protocol fee beneficiary/
function setProtocolFeeBeneficiary(address payable _beneficiary) external authorized { protocolFeeBeneficiary = _beneficiary; }
17,168,395
/* Copyright (c) 2018-present evan GmbH. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
owner of identity can approve
function approveVerification( KeyHolderLibrary.KeyHolderData storage _keyHolderData, Verifications storage _verifications, bytes32 _verificationId ) public returns (bool success) { require(_verifications.byId[_verificationId].issuer != address(0), "No verifi...
13,120,525
pragma solidity ^0.4.11; /** * @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 owner; address public ethAddress; /** * @dev...
Cancels an auction unconditionally. Get a reference to the auction struct
function _cancelAuction(address _tokenAddress, uint256 _auctionNumber) internal { Auction storage auction = tokensAuction[_tokenAddress][_auctionNumber]; address seller = auction.seller; uint256 tokenQuantity = auction.tokenQuantity; _removeAuction(_tokenAddress, _auctionNumber); ...
5,493,961
pragma solidity ^0.6.0; interface ERC20 { function totalSupply() external view returns (uint256 supply); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, a...
Converts a number to 18 decimal percision _joinAddr Join address of the collateral _amount Number to be converted
function convertTo18(address _joinAddr, uint256 _amount) internal returns (uint256) { return mul(_amount, 10 ** (18 - Join(_joinAddr).dec())); }
337,155
./full_match/100/0x394E4e8D97Fcf9E2dDA613437618f6D88023b41D/sources/contracts/official/IRO1/ImpactTokenRaiarOffer.sol
Returns the current rate for the token/
function getRate() public pure virtual returns (uint256 rate) { return TOKEN_BASE_RATE; }
14,277,301
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; /// @title A contract for selecting the kth smallest element in an array of uints. /// @author Sasa Milic - <sasa@api3.org> contract SelectK { // maximum length of an array that `_medianSmallArray` can handle uint256 public constant SMALL_ARRAY_MAX_LENGTH = 16...
condSwap two elements of an array iff the first element is greater than the second. arr an array of unsigned integers i the first index j the second index
function condSwap( int256[] memory arr, uint256 i, uint256 j ) private pure { assert(i < j); if (arr[i] > arr[j]) { (arr[i], arr[j]) = (arr[j], arr[i]); } }
5,386,898
pragma solidity 0.5.11; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; requ...
upgraded isAdmin function: return true if account is owner/minter/admin./
function isAdmin(address account) public view returns (bool) { return(super.isAdmin(account) || isMinter(account)); }
5,469,731
//SPDX-License-Identifier: MIT pragma solidity 0.8.2; import "../common/interfaces/IERC20.sol"; import "../common/interfaces/Medianizer.sol"; import "../common/interfaces/IERC1155TokenReceiver.sol"; import "../common/BaseWithStorage/WithAdmin.sol"; import "../asset/ERC1155ERC721.sol"; /// @title PolygonBundleSandSale...
Buys Sand Bundle with DAI saleId id of the bundle numPacks the amount of packs to buy to The address that will receive the SAND/
function buyBundleWithDai( uint256 saleId, uint256 numPacks, address to ) external { require(saleId > 0, "invalid saleId"); uint256 saleIndex = saleId - 1; uint256 numPacksLeft = sales[saleIndex].numPacksLeft; require(numPacksLeft >= numPacks, "not enough ...
15,781,043
./full_match/1/0x73Fa244cCd2021D1c99243BABff95eCe1deED7F6/sources/contracts/TokenPass/MomoPass.sol
Supports the following `interfaceId`s: - IERC165: 0x01ffc9a7 - IERC1155: 0xd9b67a26 - IERC1155MetadataURI: 0x0e89341c - IERC2981: 0x2a55205a
function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC1155, ERC2981) returns (bool) { return ERC1155.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); }
2,968,322
./full_match/42220/0xD3b0E4928D4c8Ba7c3037d7F05E56DF8CC78b450/sources/out/ProtocolFeePercentagesProvider_flat.sol
The main purpose of the `actionIdDisambiguator` is to prevent accidental function selector collisions in multi contract systems. There are two main uses for it: - if the contract is a singleton, any unique identifier can be used to make the associated action identifiers unique. The contract's own address is a good ...
function getProtocolFeesCollector() external view returns (IProtocolFeesCollector); function setPaused(bool paused) external; function WETH() external view returns (IWETH); } } } } } constructor(bytes32 actionIdDisambiguator) { _actionIdDisambiguator = ...
16,349,463
pragma experimental ABIEncoderV2; import "./DummyERC20A.sol"; interface IERC20WithDummyFunctionality { function transfer(address to, uint amt) external; function transferFrom(address from, address to, uint amt) external; function balanceOf(address who) external returns (uint); function allowance(addre...
either the handler defines a ETH_ADDRESS function or it does not. If it does not then just return address(0)
function getWethAddress(address handler) public returns (address) { address eth = nondetWeth; try WithEthAddress(handler).WETH() returns (address x) { eth = x; eth = nondetWeth; } return eth; } IERC20WithDummyFunctionality public erc20A; IERC20Wi...
2,520,707
./full_match/97/0x2a52e2c15f95018913bBc25EF43680d862b1FA77/sources/contracts/helpers/TokenDistributor.sol
Rewrites Signer Address _newSigner new singers's address All signatures made by the old singer will no longer be valid. Only Owner can execute this function
function setSigner(address _newSigner) external onlyOwner{ singer = _newSigner; }
3,282,077
./partial_match/1/0x7378318e4343117188F40377F4E2F50409B6EC31/sources/contracts/PropTokens/PropToken0.sol
require servicer is calling
function mintPropToken( address to, uint256 lienValue, uint256[] memory seniorLienValues, uint256 propValue, string memory propAddress, string memory propPhotoURI ) public { require(isApprovedServicer(msg.sender)); Lien memory newLien = Lien(l...
2,658,534
pragma solidity ^0.6.2; import './Memory.sol'; /** * @dev Interface poseidon hash function */ contract PoseidonUnit { function poseidon(uint256[] memory) public pure returns(uint256) {} } /** * @dev Rollup helper functions */ contract RollupHelpers { using Memory for *; PoseidonUnit insPoseidonUnit; s...
build entry for the exit tree leaf amount amount token token type Ax x coordinate public key babyJub Ay y coordinate public key babyJub ethAddress ethereum address nonce nonce parameter return entry structure/ build element 1 build element 2 build element 3 build element 4 build element 5
function buildTreeState(uint256 amount, uint32 token, uint256 Ax, uint Ay, address ethAddress, uint48 nonce) internal pure returns (Entry memory entry) { entry.e1 = bytes32(bytes4(token)) >> (256 - 32); entry.e1 |= bytes32(bytes6(nonce)) >> (256 - 48 - 32); entry.e2 = bytes32(amount); entry.e3 = b...
12,971,281
./partial_match/1/0x83DA40F54fCEeF249ec2fB1e51D3874a9Ac8FD76/sources/root/xusd/contracts/XUSD/XUSD.sol
Remove a pool Delete from the mapping 'Delete' from the array by setting the address to 0x0
function removePool(address pool_address) public onlyByOwnerOrGovernance { require(xusd_pools[pool_address] == true, "address doesn't exist already"); delete xusd_pools[pool_address]; for (uint i = 0; i < xusd_pools_array.length; i++){ if (xusd_pools_array[i] == pool_a...
9,309,618
./full_match/80001/0xb1b2d67fE48E85882e943437439c20050fe574D4/sources/Sweeeps-Raffle-main.sol
GET TICKET PRICE PER GAME
function getTicketPrice(string memory _gameReference) public view returns (uint256) { return games[_gameReference].ticketPrice; }
838,416
./full_match/1/0x76903FFb27C4B6B39dA2BFa0d1E04b60029aA492/sources/contracts/GenArt721Core.sol
Verify whitelist requirements
function whitelistMint(uint256 _mintAmount, bytes32[] calldata _merkleProof) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) { require(whitelistMintEnabled, 'The whitelist sale is not enabled!'); require(!whitelistClaimed[_msgSender()], 'Address already claimed!'); bytes32 leaf ...
2,972,951
./full_match/1/0xA16bE8d32934a9AaB272102AC4BB890481F4074E/sources/src/PrivatePool.sol
Sets the change fee. Can only be called by the owner. The change fee is used to calculate the fixed fee amount when changing or flashloaning NFTs. The fee rate is to 4 decimals of accuracy. For example, 0.0025 ETH = 25. 500 USDC = 5_000_000. _newChangeFee The new pay change fee. set the pay royalties flag emit the set...
function setChangeFee(uint56 _newChangeFee) public onlyOwner { changeFee = _newChangeFee; emit SetChangeFee(changeFee); }
9,718,459
./full_match/1/0xcb2A7b8a1fCeB097e8Fd2D85fAE9582f16a5a8C7/sources/browser/caesar.sol
Return reward weight on NFTs staked and users invited
function getWeight(uint256 _nksn, uint256 _nkcn, uint256 _nkcm, uint256 _inviteAmount) public view returns (uint256) { uint256 weight = _inviteAmount.mul(1e10).add(1e12); if(weight > 120e10){ weight = 120e10; } if(_nksn >= 5){ weight = weight.add(levelBonus[5]...
3,086,108
pragma solidity 0.5.16; pragma experimental ABIEncoderV2; import "./inherited/ERC20Token.sol"; import "./inherited/ERC721Basic.sol"; // Kofi Added to make this contract upgradeable //import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/upgrades-core/contracts/Initializable.sol";...
acceptFulfillment(): Allows any of the approvers to accept a given submission _sender the sender of the transaction issuing the bounty (should be the same as msg.sender unless the txn is called by the meta tx relayer) _bountyId the index of the bounty _fulfillmentId the index of the fulfillment to be accepted _appr...
function acceptFulfillment( address _sender, uint _bountyId, uint _fulfillmentId, uint _approverId, uint[] memory _tokenAmounts) public senderIsValid(_sender) validateBountyArrayIndex(_bountyId) validateFulfillmentArrayIndex(_bountyId, _fulfillmentId) isApprover(_sender, _bount...
2,558,208
./full_match/42/0xf0266Af3224995F5d057D86381bf00aAaE0Aa405/sources/dex/Main.sol
Weth= WETH(_WETH); Weth.approve(address(this),Weth.balanceOf(address(this)));
function setWETH(address _WETH) public{ Token0= _WETH; }
16,208,284
/*** * https://rugby.show * MIT License * =========== * * Copyright (c) 2020 rugby * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, ...
Internal function to transfer ownership of a given token ID to another address. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. from current owner of the token to address to receive the ownership of the given token ID tokenId uint256 ID of the token to be transferred by usership/
function _usershipTransfer(address from, address to, uint256 tokenId) internal { require(usershipOf(tokenId) == from, "ERC908: transfer of token that is not own"); require(to != address(0), "ERC908: transfer to the zero address"); _clearUsershipApproval(tokenId); _usershipTokensCo...
7,242,510
./partial_match/1/0x99B52db75A2C37efA07C3867eC5811B9D878D4e3/sources/VaultStaking.sol
Sets the maximum number of NFTs that can be staked from a single collection
function updateMaxNftsStaked(uint256 _newMax) external onlyOwner { maxStakedNftsAllowed = _newMax; }
3,734,960
pragma solidity ^0.5.0; import "../common/ReentrancyGuard.sol"; import "../common/SafeMath.sol"; import "../model/Governable.sol"; import "../proposal/base/IProposal.sol"; import "../verifiers/IProposalVerifier.sol"; import "../proposal/SoftwareUpgradeProposal.sol"; import "./Proposal.sol"; import "./Constants.sol"; i...
check that some weight has changed due to recounting
function recountVote(address voterAddr, address delegatedTo, uint256 proposalID) nonReentrant external { Vote storage v = _votes[voterAddr][delegatedTo][proposalID]; Vote storage vSuper = _votes[delegatedTo][delegatedTo][proposalID]; require(v.choices.length > 0, "doesn't exist"); re...
998,189
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/acc...
Rarible specific royalties id tokenid to lookup/
function getRaribleV2Royalties(uint256 id) external view returns (address payable, uint96){ return (royaltyBeneficiaries[id], royaltyBasisPoints[id]); }
12,882,343
pragma solidity ^0.4.24; // File: oraclize-api/usingOraclize.sol // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in th...
Determine if the Oracle was queried _date Daily unix timestamp of key storing value (GMT 00:00:00)return true or false based upon whether an API query has beeninitialized (or completed) for given date/
function getQuery(uint _date) public view returns(bool){ QueryInfo storage currentQuery = info[queryIds[_date]]; return currentQuery.queried; }
6,078,619
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IChildToken { function deposit(address user, bytes calldata depositData) external; } pragma solidity ^0.6.12; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contr...
Calculate tokens to be burned
function _calculateBurnAmount(address from, uint256 amount) internal view returns (uint256) { if (whitelisted[from]) return 0; uint256 _burnAmount = 0; if (totalSupply() > minimumSupply) { _burnAmount = amount.mul(burnRate).div(10000); uint256 _tryToBurn = totalSuppl...
13,005,875
pragma solidity ^0.5.9; import "./ERC1077.sol"; // ! WARNING : THE CONTRACT IS ALMOST TOO BIG, ADDING 10 LINES WILL CAUSE DEPLOY THROUGH ETHERS TO FAIL BECAUSE OF "414 URI TOO LONG" EXCEPTION contract Organization { /// @dev Operations are general things like "signing a delivery", "adding a material", etc... ...
Approve function : will add one approval to a given action, if the action does not exist it will be created, and if the current approval let the action reach its quorum, then the action tx will be triggered if action doesn't exists create it if action has reach quorum, execute it
function approve( bytes32 hash, uint256 operationId, address payable to, uint256 value, bytes calldata data ) external operationShouldExists(operationId) operationIsActive(operationId) onlyAuthorizedUser(operationId, hash) { if(!actionExists(hash)) { actions[hash] = Action(operatio...
13,027,801
./full_match/97/0x952e848EFfC5eF30193B81A0ec68628160177655/sources/contracts/COINTEST.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, address(liquidityWallet), block.timestamp ); }
5,037,550
pragma solidity ^0.8.8; // SPDX-License-Identifier: MIT /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE`...
Transfer the ownership of NFT/
function upgradeNFTCoreOwner(address newOwner_) external onlyRole(CONTRACT_UPGRADER) { nftCore.transferOwnership(newOwner_); }
1,129,214
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract CoralNFT ...
Returns royalties recipient and amount for a certain token and sale value,/
function royaltyInfo(uint256 _tokenId, uint256 _saleValue) external view returns (address receiver, uint256 royaltyAmount) { RoyaltyInfo memory royalty = _royalties[_tokenId]; return (royalty.recipient, (_saleValue * royalty.amount) / 10000); }
12,979,840
// contracts/Arbitrator.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import '@openzeppelin/contracts/utils/Address.sol'; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./Token.sol"; contract Arbitrator { using Address for address payable; using SafeMath for uint256; address pay...
transfer funds in wei (limited to int values)
function transfer(address receiver, uint256 weiAmount) public { require(balances[msg.sender] >= weiAmount, "Insufficient funds"); emit Transfer(msg.sender, receiver, weiAmount); balances[msg.sender] = balances[msg.sender].sub(weiAmount); balances[receiver] = balances[receiver].add(w...
5,508,198