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.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20...
Gets the the claim index for for the users claim at an indexed position claimer address of of the user orderIndex uint256, numeric value for index return uint256
function claimOfOwnerIndexAt(address claimer, uint256 orderIndex) external view override returns (uint256) { return _myClaims[claimer].at(orderIndex); }
5,469,917
pragma solidity 0.4.25; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the c...
Internal function to remove a token ID from the list of a given address This function is internal due to language limitations, see the note in ERC721.sol. It is not intended to be called by custom derived contracts: in particular, it emits no Transfer event, and doesn't clear approvals. from address representing the p...
function _removeTokenFrom(address from, uint256 tokenId) internal { super._removeTokenFrom(from, tokenId); uint256 tokenIndex = _ownedTokensIndex[tokenId]; uint256 lastTokenIndex = _ownedTokens[from].length.sub(1); uint256 lastToken = _ownedTokens[from][lastTokenIndex]; _ow...
911,795
/** *Submitted for verification at Etherscan.io on 2020-09-02 */ /** * Copyright 2017-2020, bZeroX, LLC <https://bzx.network/>. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface IWeth { function deposit() external pa...
NOTE: Reentrancy is allowed here to allow flashloan use cases
function borrow( uint256 withdrawAmount, address borrower, address receiver, public payable { return _borrow( loanId, withdrawAmount, initialLoanDuration, collateralTokenSent, collateralTokenAddress, ...
2,510,389
/** Copyright (c) 2018, ZSC Dev Team 2018-10-19: v0.00.01 */ pragma solidity ^0.4.25; // pragma experimental ABIEncoderV2; import "./ownable.sol"; contract Hashmap is Ownable { struct Data { uint8 position_; string data0_; address data1_; uint data2_; } uint private...
[desc] Swap data. [param] _key1: key using for mapping data. [param] _key2: key using for mapping data. [return] none./
function _swap(string _key1, string _key2) private { uint id1 = 0; uint id2 = 0; id1 = ids_[_key1]; id2 = ids_[_key2]; keys_[id1] = _key2; keys_[id2] = _key1; ids_[_key1] = id2; ids_[_key2] = id1; }
15,883,428
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/TokenHandler.sol"; import "../utility/ContractRegistryClient.sol"; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterFactory.sol"; import "./interfaces/IConverterRegistry.sol"; import "./interfaces/IC...
utility to get the converter type (including from older converters that don't support the new converterType function)
function getConverterType(IConverter _converter, uint256 _reserveTokenCount) private view returns (uint16) { (bool success, bytes memory returnData) = address(_converter).staticcall(abi.encodeWithSelector(CONVERTER_TYPE_FUNC_SELECTOR)); if (success && returnData.length == 32) return abi...
5,387,358
./full_match/4/0xc72B8e60662E492a5983152A953DdC2497F2808F/sources/_aave/core-v3/contracts/dependencies/openzeppelin/contracts/SafeMath.sol
Returns x / y, reverts if overflows - no specific check, solidity reverts on division by 0 x The numerator y The denominator return z The product of x and y
function div(uint256 x, uint256 y) internal pure returns (uint256 z) { return x / y; }
647,526
/** *Submitted for verification at Etherscan.io on 2022-02-17 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.0; // Part: OpenZeppelin/[email protected]/Context /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are gen...
View all rewards claimable by a staker staker Address of the staker return Number of $CELL claimable by the staker
function getAllRewards(address staker) external view returns (uint256) { uint256[] memory tokenIds = stakerToTokenIds[staker]; uint256 totalRewards = 0; for (uint256 i = 0; i < tokenIds.length; i++) { totalRewards = totalRewards + ((block.timestam...
2,204,228
//SPDX-License-Identifier: Unlicense pragma solidity >=0.7.6; pragma abicoder v2; import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol'; import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; import '@uniswap/v3-core/contracts/libr...
Calculates the sqrt ratio for given price token0 The address of token0 token1 The address of token1 price The amount with decimals of token1 for 1 token0 return sqrtPriceX96 The greatest tick for which the ratio is less than or equal to the input ratio
function getSqrtRatioAtPrice( address token0, address token1, uint256 price ) internal pure returns (uint160 sqrtPriceX96) { uint256 base = 1e18; if (token0 > token1) { (token0, token1) = (token1, token0); (base, price) = (price, base); } uint256 priceX96 = (price << 192) / b...
10,104,430
pragma solidity ^0.5.12; import "../common/Base.sol"; import "../interfaces/core/CoreInterface.sol"; import "../utils/AddressMap.sol"; contract Pool is Base, CoreInterface { /* Short description */ string public name; string public description; address public founder; /* Modules map */ Add...
Get next module _current is an current address return next address/
function next(address _current) public view returns (address) { return modules.items.next(_current); }
6,363,445
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../libs/AddressSet.sol"; import "./ComplexPoolLib.sol"; import "../interfaces/INFTGemMultiToken.sol"; import "../interfaces/INFTCompl...
set all the token hashes for this pool/
function setTokenHashes(uint256[] memory _tokenHashes) external override onlyController { poolData.tokenHashes = _tokenHashes; }
1,040,352
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./libraries/BoringMath.sol"; import "./libraries/SignedSafeMath.sol"; import "./libraries/BoringERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; ...
View function to see pending rewards on frontend. _pid The index of the pool. See `poolInfo`. _user Address of user. return pending rewards for a given user.
function pendingRewards(uint256 _pid, address _user) external view returns (uint256 pending) { PoolInfo memory pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accRewardsPerShare = pool.accRewardsPerShare; uint256 lpSupply = pool.lpSupply; if (block.number > pool.la...
348,525
pragma solidity ^0.8.0; import './access/Ownable.sol'; import './token/BEP20/IBEP20.sol'; import './token/BEP20/SafeBEP20.sol'; import './utils/ReentrancyGuard.sol'; contract WAGStakingPoolInitializable is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeBEP20 for IBEP20; // The address o...
It allows the admin to update start and end blocks This function is only callable by owner. _startTimestamp: the new start block _bonusEndTimestamp: the new end block/ Set the lastRewardTimestamp as the startTimestamp
function updateStartAndEndBlocks(uint256 _startTimestamp, uint256 _bonusEndTimestamp) external onlyOwner { require(block.timestamp < startTimestamp, "Pool has started"); require(_startTimestamp < _bonusEndTimestamp, "New startTimestamp must be lower than new endBlock"); require(block.timesta...
1,068,771
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "../presets/OwnablePausableUpgradeable.sol"; import "./ERC20PermitUpgradeable.sol"; /** * @title StakeWiseToken */ contract StakeWiseToken is OwnablePausableUpgradeable...
See {ERC20-_transfer}./
function _transfer(address sender, address recipient, uint256 amount) internal override whenNotPaused { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(...
12,026,743
./partial_match/1313161554/0x596cDF5D33486b035e8482688c638E7dcAf25a7b/sources/_contracts/ReaperStrategyCompoundLeverage.sol
Deleverages one step/collat ration should never be 0. if it is something is very wrong... but just incaseredeemTokens = redeemAmountIn 1e18 / exchangeRate. must be more than 0a rounding error means we need another small additionour borrow has been increased by no more than maxDeleverage
function _leverDownStep(uint256 maxDeleverage) internal returns (uint256 deleveragedAmount) { uint256 minAllowedSupply = 0; uint256 supplied = cWant.balanceOfUnderlying(address(this)); uint256 borrowed = cWant.borrowBalanceStored(address(this)); (, uint256 collateralFactorMantissa, )...
16,915,343
./partial_match/4/0x2ee5d491a390DdFe7eC10bb1A01F46f326823b5A/sources/DigitalaxGenesisStaking.sol
Stake multiple Genesis NFTs and claim reward tokens.
function unstakeBatch( uint256[] memory tokenIds ) public { claimReward(msg.sender); for (uint i = 0; i < tokenIds.length; i++) { if (tokenOwner[i] == msg.sender) { _unstake(msg.sender, tokenIds[i]); } } }
8,697,711
/** *Submitted for verification at Etherscan.io on 2022-05-02 */ // File: contracts/Initializable.sol pragma solidity ^0.8.0; contract Initializable { bool inited = false; modifier initializer() { require(!inited, "already inited"); _; inited = true; } } // File: contracts/EI...
Mints a token to an address without a tokenURI. _amount amount of tokens to mint/ sale started check amount of tokens to mint between 1 and 5 check that a single address hasn't minted more than 5 nfts check the amount is correct max amount of 5 token mints per address ??
function mintTo(uint256 _amount) public payable { require(saleStarted == true, 'The sale is paused'); require( _amount >= 1 && _amount <= 5, 'Amount should be between 1 and 5' ); require(msg.value == _amount * _price, 'Must send correct price'); uin...
7,730,766
./full_match/69/0x8EB5A8B9732022F20ab4d3128DDf3a50a6dAa7A2/sources/contracts/PoolHedger.sol
Returns short balance and collateral. short The short contract./
function getShortPosition(ICollateralShort short) public view returns (uint shortBalance, uint collateral) { if (!shortingInitialized) { return (0, 0); } return short.getShortAndCollateral(address(this), shortId); }
13,238,390
./full_match/1/0x1485297e942ce64E0870EcE60179dFda34b4C625/sources/contracts/MoonRunners.sol
Set maxByWallet. newMaxByWallet New max by wallet
function setMaxByWallet(uint256 newMaxByWallet) external onlyOwner { maxByWallet = newMaxByWallet; }
3,189,943
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeER...
This is from Timelock contract./
function executeTransaction( address target, uint256 value, string memory signature, bytes memory data ) external onlyTimelock returns (bytes memory) { bytes memory callData; if (bytes(signature).length == 0) { callData = data; callData = ...
6,398,811
// 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 contract using {_mint}. * For a generic mechanism see {ERC20PresetMint...
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 contract using {_mint}. For a generic mechanism see {ERC20PresetMinterPauser}. TIP: For a detailed writeup see our guide to implement supply mechanisms...
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint...
534,541
./full_match/1/0x64b86B2856A4284763eE684418813B817E4D557B/sources/contracts/sellCampaignWliti.sol
withdraw token and bonus if the hold period has passed
function withdraw() external { require(isPparticipant[msg.sender], "User has not participated"); UserData memory data = balances[msg.sender]; uint256 amount = uint256(data.amount); require(amount != 0, "Nothing to withdraw"); Campaign memory c = _campaign; uint256 bo...
17,148,941
//Address: 0x3e516824a408c7029c3f870510d59442143c2db9 //Contract name: Version //Balance: 0 Ether //Verification Date: 2/23/2018 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.13; interface FundInterface { // EVENTS event PortfolioContent(uint holdings, uint price, uint decimals); even...
Executes active investment and redemption requests, in a way that minimises information advantages of investor Distributes melon and shares according to the request id Index of request to be executed Active investment or redemption request executed PriceFeed Module: No recent updates for fund asset list sharePrice q...
{ Request request = requests[id]; require(module.pricefeed.hasRecentPrice(address(request.requestAsset))); function executeRequest(uint id) external pre_cond(!isShutDown) pre_cond(requests[id].status == RequestStatus.active) pre_cond( totalSupply == 0...
12,885,105
//Address: 0x10a5f6dbd1f9e56fe09df25b1163cd299d5d2413 //Contract name: EthernautsExplore //Balance: 0.251 Ether //Verification Date: 4/24/2018 //Transacion Count: 727 // CODE STARTS HERE pragma solidity ^0.4.19; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Ethernauts con...
Checks if a given address currently has transferApproval for a particular Asset. _tokenId asset UniqueId
function approvedFor(uint256 _tokenId) public view onlyGrantedContracts returns (address) { return assetIndexToApproved[_tokenId]; }
1,044,174
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; //import "hardhat/console.sol"; import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; /// @title Blocklist /// @notice This contract can be used to ...
Returns array of addresses that are blocked WARNING: Use as view function only, not for state-changing functions. see EnumerableSet.values for more details on the warning above/
function getBlocklist() external view returns (address[] memory recipients) { return _blocklist.values(); }
14,884,250
./partial_match/42/0xb67e3087b617C68F81b6A85a086C3F6833a7334B/sources/astronaut7/acap-pw/42/0xb67e3087b617C68F81b6A85a086C3F6833a7334B/Agreement.sol
Lock additional erc-20 tokens as collateral ilk collateral type in bytes32 format cdp cdp id wadC collateral amount to be locked in cdp contract transferFrom collateral tokens should be transfered from caller/
function _lockERC20(bytes32 ilk, uint cdp, uint wadC, bool transferFrom) internal { (address collateralJoinAddr,) = _getCollateralAddreses(ilk); proxy().execute( proxyLib, abi.encodeWithSignature( "lockGem(address,address,uint256,uint256,bool)", ...
9,085,754
./partial_match/42/0x837602acF0D6ba7A15583DcB9BE6a06DB707367c/sources/Depot.sol
Exchange ETH to PNX while insisting on a particular set of rates. This allows a user to exchange while protecting against frontrunning by the contract owner on the exchange rates. guaranteedEtherRate The ether exchange rate which must be honored or the call will revert. guaranteedPynthetixRate The pynthetix e...
function exchangeEtherForPNXAtRate(uint guaranteedEtherRate, uint guaranteedPynthetixRate) external payable rateNotInvalid(PNX) rateNotInvalid(ETH) notPaused returns ( ) { require(guaranteedEtherRate == exchangeRates().rateForCurrency(ETH), "Guaran...
3,450,230
./partial_match/8453/0xB32736f385dF63Ced0B10D2b392c5874C73CbF55/sources/XToken.sol
Returns the name of the token./
function name() public view virtual returns (string memory) { return unicode"𝕏Ðoge"; }
16,800,856
pragma solidity 0.5.11; // optimization runs: 200, evm version: petersburg /** * @title DTokenInterface * @author 0age * @notice Interface for dTokens (in addition to the standard ERC20 interface). */ interface DTokenInterface { // Events bear similarity to Compound's supply-related events. event Mint(address...
Internal pure function to supply the address of the underlying token. return The address of the underlying token./
function _getUnderlying() internal pure returns (address underlying) { underlying = address(_USDC); }
1,547,878
./full_match/100/0x0675f76b8342e311108170fC97db70e27F53a85c/sources/contracts/library/LiqiMathLib.sol
Calcula x y / z, de forma que não estoure o limite/
function mulDiv( uint256 x, uint256 y, uint256 z ) internal pure returns (uint256) { (uint256 l, uint256 h) = fullMul(x, y); require(h < z); uint256 mm = mulmod(x, y, z); if (mm > l) h -= 1; l -= mm; uint256 pow2 = z & -z; z /= pow2...
14,269,713
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; import "./interfaces/IERC20.sol"; import './interfaces/IRewardToken.sol'; import './libraries/SafeMath.sol'; import './modules/Configable.sol'; import "./modules/ReentrancyGuard.sol"; import './modules/Pausable.sol'; import './modules/Initializable.sol'; // ...
Deposit tokens to SwitchFarm for reward allocation.
function deposit(uint _pid, uint _amount, address _to) external validatePoolByPid(_pid) whenNotPaused nonReentrant returns(uint, uint) { PoolInfo storage pool = poolInfo[_pid]; require(pool.paused == false, "pool is paused"); UserInfo storage user = userInfo[_pid][_to]; updatePool(_p...
1,184,230
// SPDX-License-Identifier: MIT pragma solidity ^0.6.7; import "../strategy-joe-farm-base.sol"; import "../../interfaces/JoeBar.sol"; contract StrategyJoexJoe is StrategyJoeFarmBase { uint256 public joeBar_poolId = 24; address public joeBar = 0x57319d41F71E81F3c65F2a47CA4e001EbAFd4F33; constructor...
Anyone can harvest it at any given time. I understand the possibility of being frontrun But AVAX is a dark forest, and I wanna see how this plays out i.e. will be be heavily frontrunned? if so, a new strategy will be deployed. Collects Joe tokens 10% is sent to treasury
function harvest() public override onlyBenevolent { IMasterChefJoeV2(masterChefJoeV2).deposit(poolId, 0); uint256 _joe = IERC20(joe).balanceOf(address(this)); if (_joe > 0) { uint256 _keep = _joe.mul(keep).div(keepMax); uint256 _amount = _joe.sub(_keep); ...
968,020
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract ColorThatNFT is ERC1155, P...
encodes the position and color data inside bytes32 0x0000000000xxxxyyyyrrggbb
function encode( uint16 x, uint16 y, uint8 r, uint8 g, uint8 b ) external pure returns (bytes32 out) { assembly { let t := 0 mstore(0x7, b) mstore(0x6, g) mstore(0x5, r) mstore(0x4, y) mstore(...
6,192,584
./full_match/1/0x61e0749C835f7Eca584DD83f93358C75712752E6/sources/browser/arb03.sol
Returns contract's particular token balance
function getTokenBalance(address _address) external view returns (uint) { return IERC20(_address).balanceOf(address(this)); }
3,101,803
./partial_match/1/0xD3ec656617f61324Bc2a2711DBa591295DD0306d/sources/contracts/ERC721SeaDrop.sol
Transfers `tokenId` from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - The operator must be allowed. Emit...
function transferFrom( address from, address to, uint256 tokenId ) public override payable onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); }
3,926,965
pragma solidity ^0.4.23; library StaticCallProxy { function read(address _destination, bytes memory _calldata) public returns (bytes32) { assembly { let _calldatasize := calldatasize() calldatacopy(0, 0, _calldatasize) // 0x9569bf28 = keccak256(readInternal(...
0x9569bf28 = keccak256(readInternal(address,bytes))
function read(address _destination, bytes memory _calldata) public returns (bytes32) { assembly { let _calldatasize := calldatasize() calldatacopy(0, 0, _calldatasize) mstore8(0, 0x95) mstore8(add(0, 1), 0x69) mstore8(add(0, 2), 0xbf) ...
5,850,826
pragma solidity ^0.6.12; /** * @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 of tokens owned by `account`. ...
helper for sell pool in Bancor network for old converter version _poolToken address of bancor relay _amount amount of bancor relay/ get Bancor Converter instance liquidate relay return connectors addresses
function sellPoolViaBancorOldV(IERC20 _poolToken, uint256 _amount) private returns(address[] memory connectorsAddress) { address converterAddress = getBacorConverterAddressByRelay(address(_poolToken), 0); BancorConverterInterface converter = BancorConverterInterface(converterAddress); converter.l...
6,512,859
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.6; import "./interfaces/IMerkleDistributor.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Owned.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./Pausable.sol"; contract MerkleDistributor is Owned, ...
Verify the merkle proof. Mark it claimed and send the token.
function claim( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external override { require(!isClaimed(index), "MerkleDistributor: Drop already claimed."); bytes32 node = keccak256(abi.encodePacked(index, account, amount)); ...
12,868,974
./full_match/42/0xDBB2ff9ec8bB422B26402D3Ebd20A09b42fE2f85/sources/contracts/SimpleMerkleProof.sol
Look up the given key. the value returns if it is foundLeafBRANCH_WITHOUT_MASK_NO_EXT BRANCH_WITH_MASK_NO_EXT
function lookUp( bytes32 root, bytes memory key, Item[] memory db ) internal view returns (bytes memory v) { bytes32 hash = root; bytes memory partialKey = key; while (true) { bytes memory nodeData = getNodeData(hash, db); if (nodeData.leng...
16,250,773
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.3.2 (token/ERC1155/ERC1155.sol) // Cowri Labs, Inc., modifications licensed under: MIT pragma solidity =0.8.4; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; im...
See {IERC1155-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override nonReentrant { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner...
14,033,196
pragma solidity ^0.5.16; interface IERC20 { function TOTALSUPPLY344() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF995(address account) external view returns (uint256); //inject NONSTANDARD NAMING function ...
inject NONSTANDARD NAMING
function DEPOSIT98() external {
5,414,278
./full_match/1/0x5C189aEdEcBc07830B64Ec8CAE51ce38E4365286/sources/src/AggregatorsFactory.sol
Upgrades the template (blank aggregator) contract updateId The id of the upgrade proposal to execute/ Clear timelock
function upgrade(uint256 updateId) external onlyOperator { require(updateId == upgradesCount, "Invalid updateId"); uint256 timeLockTimestamp = upgrades[updateId].timestamp; require(timeLockTimestamp != 0, "TimeLock not set"); require(block.timestamp >= timeLockTimestamp, "TimeLock n...
16,549,857
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {DistributionTypes} from '../libraries/types/DistributionTypes.sol'; import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IE...
Claims reward for an user on behalf, on all the assets of the lending pool, accumulating the pending rewards. amount Amount of rewards to claim user Address to check and claim rewards to Address that will be receiving the rewards return Rewards claimed/
function _claimRewards( address[] calldata assets, uint256 amount, address claimer, address user, address to ) internal returns (uint256) { if (amount == 0) { return 0; } uint256 unclaimedRewards = _usersUnclaimedRewards[user]; DistributionTypes.UserStakeInput[] memory use...
5,349,542
// SPDX-License-Identifier: ISC pragma solidity ^0.8.4; import "../interfaces/IERC20.sol"; import "../utils/Context.sol"; import "../interfaces/IBollycoinPriceFeed.sol"; import "../utils/ReentrancyGuard.sol"; /** * @title - Bollycoin Presale Contract V2 * @author - Nodeberry Pvt Ltd */ contract BollycoinPresaleV...
used to purchase bollycoin using ETH. ETH is sent to the buyer./
function purchaseWithETH(string memory uid) public payable nonReentrant virtual returns (bool) { uint256 ethCmp = IBollycoinPriceFeed(_oracle).getLatestETHPrice(); uint256 bollyToTransfer = _msgValue() * ethCmp / bollycoinPrice; require(s...
14,915,393
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.13; // OpenZeppelin Contracts (last updated v4.6.0-rc.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) t...
Completes the 2-step process of setting the administrator. The pending admin must be set and the caller must be the pending admin. After this function is successfully executed, the admin will be set to the pending admin and the pending admin will be reset.
function acceptAdmin() external { if (pendingAdmin == address(0)) { revert IllegalState("Pending admin unset"); } if (pendingAdmin != msg.sender) { revert Unauthorized("Not pending admin"); } admin = pendingAdmin; pendingAdmin = address(0); ...
10,193,498
./full_match/1/0xC3469B8e50745FB46d4940eC0cfDDd8e608762B9/sources/home/aaron/eth/TheSink/thesink/contracts/Tickets.sol
This is o(n) but will never be more than 1.
function _emptyPool() private { for(uint i = 0 ; i < pooled.length ; i++) { delete pool[pooled[i]]; TransferHelper.safeTransfer(pooled[i], msg.sender, IERC20(pooled[i]).balanceOf(address(this))); } delete pooled; msg.sender.transfer(address(this).balance.sub(rol...
3,192,467
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import '@openzeppelin/contracts/math/SafeMath.sol'; import './interfaces/IAmeso.sol'; import './interfaces/IAmesoToken.sol'; import 'hardhat/console.sol'; contract Employer { using SafeMath for uint256; IAmeso public amsApp; constructor(address _am...
Cancel the job/
function cancelJob( string memory _ipfsID ) public { require(amsApp.jobExists(_ipfsID), "Employer::cancelJob: Invalid ipfs ID"); amsApp.cancelJob(_ipfsID, msg.sender); }
13,095,217
./partial_match/1/0x1062F023771E15367A9cde84652E62Fdc046f32f/sources/LenderDeployer.sol
required depends reserve tranches coordinator implements epoch ticker interfacerestricted tokenallow tinlake contracts to hold drop/tin tokens operator coordinator assessor assessorAdmin
function deploy() public { require(coordinator != address(0) && assessor != address(0) && reserve != address(0) && seniorTranche != address(0)); DependLike_2(reserve).depend("assessor", assessor); AuthLike_2(reserve).rely(seniorTranche); AuthLike_2(reserve).rely(juni...
9,349,443
./full_match/5/0x082A7daac615Fbbfd0CF39FB3e366255723C7fd5/sources/contracts/INFI/PowerfulERC20.sol
IERC1363Spender Interface Interface for any contract that wants to support approveAndCall from ERC1363 token contracts as defined in/
interface IERC1363Spender { function onApprovalReceived( address sender, uint256 amount, bytes calldata data ) external returns (bytes4); } }
1,867,524
// File: contracts\lib\TransferHelper.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.6; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) intern...
Modify configuration config Configuration object
function setConfig(Config calldata config) override external onlyGovernance { _config = config; }
52,658
pragma solidity ^0.4.23; import "../../libs/math/SafeMath.sol"; import "./ERC888.sol"; import "./IERC888Sec.sol"; import "../Cassette/ICassette.sol"; /** * @title Multitoken token with dividends distribution support */ contract ERC888Sec is IERC888Sec, ERC888, ICassette { using SafeMath for uint; uint const...
release dividends rights _tokenId subtoken identifier _value The amount of dividends to be transferred./
function releaseDividendsRights(uint _tokenId, uint _value) external returns (bool) { return releaseDividendsRights_(_tokenId, msg.sender, _value); }
999,101
./full_match/4/0x1860dd76F270706965489457830Fe4633d334E46/sources/contracts/NostraSwapRouter.sol
refund dust eth, if any
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) returns (uint[] memory amounts) { require(path[0] == WETH, 'NostraSwapRouter: INVALID_PATH'); amou...
13,370,288
// File: contracts/lib/interface/IRouterRegistry.sol pragma solidity ^0.5.5; interface IRouterRegistry { enum RouterOperation { Add, Remove, Refresh } function REGISTERROUTER662() extern...
inject NONSTANDARD NAMING
function REGISTERROUTER662() external;
999,576
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/mixins/SettleLayer.sol
Returns true if the flow represents a credit owed from the exchange to the user. /
function isCredit (int128 flow) private pure returns (bool) { return flow < 0; }
4,651,368
./full_match/84531/0xd7149865d07cCfdfB10f858AFAb297A8251882Cc/sources/contracts/stores/OrderStore.sol
Returns trigger orders length Amount of trigger orders to return offset Offset to start
function getTriggerOrders(uint256 length, uint256 offset) external view returns (Order[] memory) { uint256 _length = triggerOrderIds.length(); if (length > _length) length = _length; Order[] memory _orders = new Order[](length); for (uint256 i = offset; i < length + offset; i++) { ...
11,525,623
pragma solidity 0.4.23; /** * this is a test-contract * to run tests against it * so we can be sure the code works together with ethereum tools */ contract TestContract { uint public onePublicValue = 1337; /** * hashes the given values * should be equal to own hash()-function in js */ ...
recovers the signer from the message instead of the messageHash/
function recoverSignatureFromMessage( string _message, uint8 v, bytes32 r, bytes32 s ) public constant returns (address) { bytes32 hash = hashString(_message); address signer = ecrecover( hash, v, r, s ); return ...
12,796,919
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC20Proxy} from "./IERC20Proxy.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; import {TokenRoles} from "../../roles/TokenRoles.sol"; import {DomainA...
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ...
function decreaseAllowance(address spender, uint256 subtractedValue) public override virtual returns (bool) { (bool result,) = _forwardCurrentCall(); if (result) { uint256 allowanceAmount = _getStorageContract().allowance(_msgSender(), spender); emit Approval(_msgSender(), sp...
1,842,422
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 of tokens owned by `account`. ...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `to` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); }
97,493
pragma solidity ^0.4.24; // File: @0xcert/ethereum-erc721/contracts/tokens/ERC721Enumerable.sol /** * @dev Optional enumeration extension for ERC-721 non-fungible token standard. * See https://goo.gl/pc9yoS. */ interface ERC721Enumerable { /** * @dev Returns a count of valid NFTs tracked by this contract, wh...
Returns expiration date from 0 index of token config values. _tokenId Id of the NFT we want to get expiration time of./
function tokenExpirationTime( uint256 _tokenId ) validNFToken(_tokenId) external view returns(bytes32) { return config[_tokenId][0]; }
461,795
/// @title MarketplaceProxy: A proxy contract for testing functions in Marketplace.sol /// @author John McCrae /// @notice Unused test functions have been commented out to prevent 'Out of Gas' error /// @dev This contract requires solidity compiler version 0.5 or higher. pragma solidity ^0.5.0; /// @dev This contrac...
getTarget() A function to get the target address defined in the constructor return marketplace
function getTarget() public view returns (Marketplace) { return marketplace; }
12,552,536
pragma solidity 0.6.4; library SafeMath { ...
inject NONSTANDARD NAMING
function BALANCEOF898(address account) external view returns (uint);
5,439,879
./partial_match/56/0x747fC4988FC7f6250e1207835B3317e63DF854B8/sources/FlaskMasterFarmer.sol
File: contracts\@interface\IMigratorToFlaskSwap.sol Perform LP token migration from legacy UniswapV2 to FlaskSwap. Take the current LP token address and return the new LP token address. Migrator should have full access to the caller's LP token. Return the new LP token address. XXX Migrator must have allowance access to...
interface IMigratorToFlaskSwap { function migrate(IERC20 token) external returns (IERC20); }
11,328,133
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Entity treasury helper facet logic. */ interface IEntityTreasuryBridgeFacet { /** * @dev Transfer assets from the internal balance to the treasury balance. * * @param _unit Asset to move. * @param _amount Amount to move. */ functio...
Entity treasury helper facet logic./
interface IEntityTreasuryBridgeFacet { function transferToTreasury(address _unit, uint256 _amount) external; function transferFromTreasury(address _unit, uint256 _amount) external; event TransferToTreasury ( address indexed caller, address indexed unit, uint256 indexed amount ); event TransferF...
12,609,690
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starti...
Get the claimable balance of a token ID./
function claimableBalanceOfTokenId(uint256 tokenId) public view returns (uint256) { return _claimableEth[tokenId]; }
14,503,906
/** *Submitted for verification at Etherscan.io on 2021-07-25 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.6; contract MintyProxy { uint256[9] private _other; string private _baseURI = "ipfs://"; // An existing deployment of [Minty](https://github.com/yusefnapora/minty) address private co...
Handle supportsInterface in this contract without delegation, so that it can work without requiring interfaceId values to be in contract storage.
function supportsInterface(bytes4 interfaceId) external pure returns (bool) { return interfaceId == _INTERFACE_ID_ERC165 || interfaceId == _INTERFACE_ID_ERC721 || interfaceId == _INTERFACE_ID_ERC721_METADATA || interfaceId == _INTERFACE_ID_ERC721_ENUMERABLE; }
15,309,260
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "./libraries/StringUtils.sol"; import "./VanityNameRegistrar.sol"; import "./VanityNamePrices.sol"; contract VanityNameController is Ownable { using StringUtils for *; VanityNamePrices prices; ...
Withdraw amounts that are payed for names/
function withdraw() public onlyOwner { payable(msg.sender).transfer(address(this).balance - lockedAmountSum); }
15,873,647
pragma solidity ^0.4.18; contract DogCoreInterface { address public ceoAddress; address public cfoAddress; function getDog(uint256 _id) external view returns ( //冷却期索引号 uint256 cooldownIndex, //本次冷却期结束所在区块 uint256 nextActionAt, //配种的公狗ID ...
/ require contract address is final lottery
function rewardLottery(bool isMore) external { require(msg.sender == finalLottery); uint256 term = CLotteries.length - 1; CLotteries[term].isReward = true; CLotteries[term].noFirstReward = isMore; }
7,663,524
pragma solidity 0.4.24; // File: 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 pu...
Set previously listed token to delisted
function delistToken(address _tokenAddress) public onlyOwner { require(doesEntityExist(_tokenAddress, tokenMap[_tokenAddress])); setEntityActiveValue(tokenMap[_tokenAddress], false); emit TokenStatusChanged(_tokenAddress, false); }
7,300,821
./full_match/3/0x5d9FD5d6AC6f81379173b16C3ac0b0f520E55F66/sources/contracts/PIER-BIM-v7.sol
Make sure the file hash exists Make sure drawing number exists
function newCorrespondence(address[] memory _receiver, string memory _letterNumber, string memory _letterTitle, string memory _fileIpfsHash) checkForWallet(msg.sender) public { require(bytes(_fileIpfsHash).length > 0); require(bytes(_letterNumber).length > 0); updatesCount ++; ...
8,168,410
./full_match/4/0xC4E7D388C1Ba2694545a41f7447f62c87e478DA5/sources/contracts/Staking.sol
@inheritdoc IStaking/
function unstake(address tokenAddress, uint256 tokenId) external virtual override { _unstake(tokenAddress, tokenId); }
13,314,113
pragma solidity ^0.5.2; library SafeMath { function MUL349(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING // Gas optimization: this is cheaper than requiring 'a' not being zero, but the...
inject NONSTANDARD NAMING
function _TRANSFER715(address from, address to, uint256 value) internal {
1,088,884
// SPDX-License-Identifier: MIT pragma solidity >=0.8.7 <0.9.0; //import "../../utils/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.sender and msg.data, they should not be acces...
--------------------------------------------------- [external] ユーザー情報の確認:引ける回数--------------------------------------------------- キャンペーンを跨いでいなければ持ち越し(キャンペーンIDが逆戻ることはない想定)
function checkNumMintable( address target ) external view returns (uint256) { uint256 minted = 0; if( _last_campaign[target] >= _campaign_id ){ minted = _num_minted[target]; } IERC721 lynxContract = IERC721( LYNX_ADDRESS ); uint256 numLynx = lynxContract.balance...
10,122,824
pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high l...
Check if goal was reached Checks if the goal or time limit has been reached and ends the campaign/
function checkGoalReached() public afterDeadline returns(bool) { if (amountRaised >= fundingGoal){ fundingGoalReached = true; emit GoalReached(beneficiary, amountRaised); } crowdsaleClosed = true; return crowdsaleClosed; }
15,882,403
./full_match/1/0x60dEdF890FeA161ab51C048a492Dd62d8d6C9826/sources/TheBookShop.sol
publicgeneral publicpresale
function mint(address _to, uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(!paused); require(_mintAmount > 0); require(_mintAmount <= maxMintAmount); require(supply + _mintAmount <= maxSupply); if (msg.sender != owner()) { if...
16,530,793
/** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev 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 to, uint256 value...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance.
function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); ...
4,804,532
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization...
return true if `msg.sender` is the owner of the contract./
function isOwner() public view returns(bool) { return msg.sender == owner; }
14,106,216
pragma solidity ^0.4.0; import "../Owned.sol"; import "../Utils.sol"; import "../interfaces/IEflRegistry.sol"; import "../interfaces/IEflBountyManager.sol"; import "../interfaces/IEflContract.sol"; import "../interfaces/ISmartToken.sol"; /* EFL Registry v0.1 Needed for handling connections between FanToken, E...
Adds EFL Contract to registry
function addEflContract(IEflContract _eflContract) public ownerOnly validAddress(_eflContract) { eflContracts[_eflContract] = true; }
12,904,720
./full_match/1/0xd4Aa6370DeB717eF707f9F62677B90b5Df4349D0/sources/AaveDelegate.sol
Stable: 1, Variable: 2
function _withdraw(IyVault _vault, address token, uint amount, uint maxLoss, uint rateMode) internal { safeTransferFrom(address(_vault), msg.sender, address(this), amount); uint _amount = _vault.withdraw(amount, address(this), maxLoss); IERC20(token).approve(address(lendingPool), _amount); ...
2,901,459
/** *Submitted for verification at Etherscan.io on 2021-08-21 */ pragma solidity ^0.6.10; // SPDX-License-Identifier: UNLICENSED /* * @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...
Transfer token for a specified address to The address to transfer to. value The amount to be transferred./
function transfer(address to, uint256 value) public virtual override returns (bool) { _transfer(msg.sender, to, value); return true; }
205,662
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import "../IOracle.sol"; import "./ICollateralizationOracle.sol"; import "../../refs/CoreRef.sol"; import "../../pcv/IPCVDepositBalances.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/mat...
removes a list of multiple PCV deposits. See removeDeposit.
function removeDeposits(address[] memory _deposits) external onlyGovernorOrAdmin { for (uint256 i = 0; i < _deposits.length; i++) { _removeDeposit(_deposits[i]); } }
1,735,372
/* * The MIT License * * Copyright (c) 2017-2018 , Akropolis Decentralised Ltd (Gibraltar), http://akropolis.io * */ pragma solidity ^0.4.24; pragma experimental "v0.5.0"; import "./Board.sol"; import "./Ticker.sol"; import "./NontransferableShare.sol"; import "./Registry.sol"; import "./interfaces/PensionFund.sol"; ...
This is sent from the registry and already deleted on their end
function cancelMembershipRequest(address candidate) public onlyRegistry onlyNotMember(candidate) { delete membershipRequests[candidate]; }
12,761,918
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) 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 exis...
Set a multiplier for how many tokens to earn each time a block passes.
function setRate(uint256 _rate) public onlyOwner() { rate = _rate; }
160,351
./partial_match/1/0x7917b6f2C5deC4021Ed5D0ff3e5bb27A69B2eaCf/sources/contracts/interfaces/IAssetHolder.sol
The IAssetHolder interface calls for functions that allow assets to be transferred from one channel to other channel and/or external destinations, as well as for guarantees to be claimed./
interface IAssetHolder { function transfer( bytes32 fromChannelId, bytes calldata allocationBytes, uint256[] memory indices ) external; function claimAll( bytes32 guarantorChannelId, bytes calldata guaranteeBytes, bytes calldata allocationBytes ) external...
9,354,516
pragma solidity ^ 0.4 .24; library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also test...
Executed when a purchase has been validated and is ready to be executed. Doesn't necessarily emit/send tokens. beneficiary Address receiving the tokens tokenAmount Number of tokens to be purchased/
function _processPurchase( address beneficiary, uint256 tokenAmount ) internal { _deliverTokens(beneficiary, tokenAmount); }
12,638,114
pragma solidity >=0.6.0; interface IPoolFactory { function createNewPool( address _rewardToken, address _rover, uint256 _duration, address _distributor ) external returns (address); } pragma solidity >=0.6.0; interface IBasedGod { function getSellingSchedule() external v...
ensure that at least one full period has passed since the last update overflow is desired, casting never truncates cumulative price is in (uq112x112 price seconds) units so we simply wrap it after division by time elapsed
function update() internal { (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(address(pair)); require(timeElapsed >= PERIOD, 'ExampleOracleSimple: PERIOD_NOT_ELAPSED'); price0Average = FixedPoint.uq112x112(ui...
5,950,411
/** *Submitted for verification at Etherscan.io on 2021-03-25 */ pragma solidity =0.6.6; interface IBoxswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (ad...
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal virtual { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = BoxswapV2Library.sortTokens(input, output); IBoxswapV2...
10,838,958
pragma solidity ^0.4.19; contract ADM312 { address public COO; address public CTO; address public CFO; address private coreAddress; address public logicAddress; address public superAddress; modifier onlyAdmin() { require(msg.sender == COO || msg.sender == CTO || msg.sender == CFO); ...
Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST Throws unless `msg.sender` is the current owner, an authorized operator, or the approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to...
function transferFrom(address _from, address _to, uint256 _tokenId) external payable{ require(msg.sender == CaDataContract.ownerOf(_tokenId) || ownerOperators[CaDataContract.atomOwner(_tokenId)][msg.sender] == true || msg.sender == tokenApprovals[_tokenId]); require(_from == CaDataContra...
5,503,476
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/...
See {IERC721Metadata-tokenURI}. Requirements: - `tokenId` must exist./ require that token should exist if there is no base URI, return the token URI. if both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "KDZTokens: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = baseURI(); ...
13,032,351
/* Keep4r – kp4r.network - 2020 */ pragma solidity 0.6.6; 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 owne...
calculates the amount purchasedfor a given amount of eth /
function calculateAmountPurchased(uint256 _value) public view returns (uint256) { uint256 _kp4r = _value.div(unitPrice).mul(1e18); if (_value > bonusTrigger) { uint256 _bonus = _kp4r.mul(bonusPercentage).div(1000); if (_kp4r.add(_bonus) <= KP4R.balanceOf(address(this))) { ...
13,914,166
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; /** * @title Remove Putin Bounty * @dev This contract is made to incentivize Russians to remove Putin from power by any mean necessary. * It is also made to incentivize Putin to stop his agression against Ukraine. * It is not affiliated with the state...
Transfer tokens on behalf of another account. sender The account the tokens should be sent from. recipient The account to receive the tokens. amount The amount of tokens to send./
function transferFrom( address sender, address recipient, uint amount ) external returns (bool) { allowance[sender][msg.sender] -= amount; balanceOf[sender] -= amount; balanceOf[recipient] += amount; emit Transfer(sender, recipient, amount); return...
234,118
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title A base MisBlock token contract /// @author Anderson L /// @notice This contract is inherited by MisBlockETH and MisBlockBSC token contracts. /// @dev All functions requiring onlyOwner are also pausable. import "@openzeppelin/contracts/token/ERC20/ERC...
Internal function for addLiquidity./ approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approveBase(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, owner(), block.timestamp ); emit SwapAndLiquify(token, eth, liquidity); ...
5,426,077
pragma solidity ^0.6.6; import "github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol"; import {Randomness_interface} from "./Randomness_interface.sol"; import {governance_interface} from "./governance_interface.sol"; contract Lottery is ChainlinkClient { enum LOTTERY_STATE {OPEN, CLOSED...
add a require here so that only the oracle contract can call the fulfill alarm method
function fulfill_alarm(bytes32 _requestId) public recordChainlinkFulfillment(_requestId) { require( lottery_state == LOTTERY_STATE.OPEN, "The lottery hasn't even started!" ); lottery_state = LOTTERY_STATE.CALCULATING_WINNER; lotteryId = lot...
6,345,677
pragma solidity ^0.4.24; /** * @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; /** * @dev The Ownable constructor s...
maxHatch = _maxHatch; default 99
function initParams(uint64 _alphaEggCnt) public onlyOwner { require(eggs.length==0); batchNumToCount[1]=_alphaEggCnt; batchNumToCount[2]=batchNumToCount[1]*2; batchNumToCount[3]=batchNumToCount[2]*2; batchNumToCount[4]=batchNumToCount[3]*2; calcBatchCnt(5,50); }
14,049,496
./partial_match/1/0x8AF415b607e8383D5Dee3948404699D23dbD10C1/sources/ReverseDAO.sol
Executor(proposals[id].executor).execute(id, _for, _against, _quorum);
function execute(uint id) public returns(bool){ (uint _for,uint _against , uint _quorum) = getStats(id); require(proposals[id].quorumRequired < _quorum, "need Minimal quorum"); require(proposals[id].end < block.number , "Voting not end yet"); if (proposals[id].open == true) { ...
15,537,367
./full_match/80001/0xc346Bce9AffD346AdD35B18Af9516Cd2F8107722/sources/contracts/mojito/sothebys/Marketplace.sol
Update the Platform Fee Percentage _platformFeePercentage The Platform fee percentage
function updatePlatformFeePercentage(uint256 _platformFeePercentage) external onlyOwner { require( _platformFeePercentage <= 10_000, "platformFee should not be more than 100 %" ); platformFeePercentage = _platformFeePercentage; emit UpdateF...
5,668,594
./partial_match/1/0x3C01af36cCd6bAe6f5CDaf99b7d54D3585AeE475/sources/contracts/ERC721.sol
See {IERC721-balanceOf}./
function balanceOf(address owner) public view virtual override returns (uint256) { return _balanceOf(owner); }
3,556,089
pragma solidity ^0.4.24; contract F3Devents { // 注册 event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, bytes32 affiliateNa...
使用小金库购买核心逻辑 未结束 取出玩家小金库
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, F3Ddatasets.EventReturns memory _eventData_) private { uint256 _rID = rID_; uint256 _now = now; if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_...
1,012,014
pragma solidity 0.4.19; import "./utils/Secured.sol"; contract Store is Secured { /**** Storage Types *******/ mapping(bytes32 => uint256) private uintStorage; mapping(bytes32 => string) private stringStorage; mapping(bytes32 => address) private addressStorage; mapping(bytes32 => bytes)...
_key The key for the record
function deleteAddress(bytes32 _key) onlyAuthorized external { delete addressStorage[_key]; }
12,567,423
./partial_match/1/0xF98bb4943eb8a3eB6234a9f6B1Fa758714381753/sources/src/contracts/IncentivizingLiquidityAMO.sol
Pause/Unpause liquidity pool _poolAddress Address of liquidity pool _isPaused bool
function pausePool(address _poolAddress, bool _isPaused) external onlyByOwnerOperator { if (poolInitialized[_poolAddress]) { poolInfo[_poolAddress].isPaused = _isPaused; emit ChangePauseStatusPool(_poolAddress, _isPaused); } }
4,404,912
pragma solidity ^0.7.6; pragma experimental ABIEncoderV2; import "./core/wallet_data.sol"; import "./features/guardians.sol"; import "./features/daily_limit.sol"; import "./features/recovery.sol"; contract TOTPWallet { using Guardians for Core.Wallet; using DailyLimit for Core.Wallet; using Recovery for ...
TODO: Drain ERC20 tokens too
function drain(bytes16[] calldata confirmMaterial, bytes20 sides) external onlyValidTOTP(confirmMaterial, sides) { wallet.drainAddr.transfer(address(this).balance); }
12,568,847
// -------------------------------- INTRODUCTION ---------------------------------------- // // This is a sample contract for a race in which contestants can authorize // their own transactions. (See ProvidedRace.sol for an example of a race where a third // party - an app producer/provider - manages transactions on be...
Returns integer value of player's last completed step
function getState(address player) constant returns (uint8 state){ return players[player].state; }
12,756,857