file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/42/0xa814bfa2669B7E20b58Bf2458DBFeaB9C8913Af9/sources/transferFNX.sol
emit __addRRwinner(msg.sender);
function addrrwinners() internal{ addRRwinner(msg.sender); allrrwinners.push(msg.sender); }
9,570,351
./partial_match/1/0x889B5b0e389762BA516baCc8Dd675b46986F1639/sources/WorldMillionaireChallengeGame.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20MetadataUpgradeable is IERC20Upgradeable { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } }
4,338,143
pragma solidity ^0.4.11; /* * 'LOOK' token sale contract * * Refer to https://lookscoin.com/ for more information. * * Developer: LookRev * */ /* * ERC20 Token Standard */ contract ERC20 { function totalSupply() constant returns (uint256 supply); function balanceOf(address _who) constant re...
Transferring the contract ownership to the new owner. _newOwner new contractor owner/
function transferOwnership(address _newOwner) onlyOwner { if (_newOwner != address(0)) { newOwner = _newOwner; } }
15,809,679
./full_match/5/0x7743b0c6bDC91AAdCad4300B76178e74AbcFffc1/sources/src/SeaDrop.sol
Returns the public drop data for the nft contract. nftContract The nft contract./
function getPublicDrop(address nftContract) external view returns (PublicDrop memory) { return _publicDrops[nftContract]; }
1,957,422
pragma solidity ^0.5.6; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be ap...
withdraw tokens remaining in the operator contract
function withdraw(address tokenAddr) public onlyOwner { uint balance = 0; if(tokenAddr == address(0)){ balance = (address(this)).balance; if(balance > 0){ (bool res, ) = owner.call.value(balance)(""); require(res); } } ...
1,055,875
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.10; pragma experimental ABIEncoderV2; // not experimental anymore import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contract...
Get all positions of a pool. _pool The MarginLiquidityPool. return The positions./
function getPositionsByPool(MarginLiquidityPoolInterface _pool) external view returns (Position[] memory) { return positionsByPool[_pool]; }
7,323,910
// Copyright (C) 2021 Argent Labs Ltd. <https://argent.xyz> // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // T...
Lets the guardians start the execution of the recovery procedure. Once triggered the recovery is pending for the security period before it can be finalised. Must be confirmed by N guardians, where N = ceil(Nb Guardians / 2). _wallet The target wallet. _recovery The address to which ownership should be transferred./
function executeRecovery(address _wallet, address _recovery) external onlySelf() notWhenRecovery(_wallet) { validateNewOwner(_wallet, _recovery); uint64 executeAfter = uint64(block.timestamp + recoveryPeriod); recoveryConfigs[_wallet] = RecoveryConfig(_recovery, executeAfter, uint32(guardian...
2,524,175
./full_match/44787/0x624b6b937b9c2Eb0Dc63A12AF538AF8075B11566/sources/contracts/StarNFT.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, cateUri[tokenInfo[tokenId].cateId])) : ''; }...
13,248,250
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) p...
Overrides ERC20 transfer function with modifier that prevents the ability to transfer tokens until after transfers have been enabled./
function transfer(address _to, uint256 _value) public validDestination(_to) returns (bool) { return super.transfer(_to, _value); }
1,281,681
./full_match/1/0xDf7D56E526eD37834be0e4D2C8aecE552f54cFea/sources/contracts/L2BridgingSmartVaultDeployer.sol
Create and setup action Set bridger max deadline Set bridger max slippage Set bridger max bonder fee pct Set bridger AMMs
function _setupL2HopBridgerAction(SmartVault smartVault, L2HopBridgerActionParams memory params) internal { L2HopBridger bridger = L2HopBridger(payable(params.impl)); Deployer.setupBaseAction(bridger, params.admin, address(smartVault)); address[] memory executors = Arrays.from(params.admin, ...
17,182,565
pragma solidity 0.5.15; pragma experimental ABIEncoderV2; contract YamGoverned { event NewGov(address oldGov, address newGov); event NewPendingGov(address oldPendingGov, address newPendingGov); address public gov; address public pendingGov; modifier onlyGov { require(msg.sender == gov, "!...
produces the cumulative price using counterfactuals to save gas and avoid a call to sync. if time has elapsed since the last update on the pair, mock the accumulated price values subtraction overflow is desired addition overflow is desired counterfactual if time has elapsed since the last update on the pair, mock the a...
function currentCumulativePrices( address pair, bool isToken0 ) internal view returns (uint priceCumulative, uint32 blockTimestamp) { blockTimestamp = currentBlockTimestamp(); (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves(); ...
440,331
pragma solidity ^0.6.5; contract crypto { // GROUP_ORDER is the are the number of group elements in the groups G1, G2, and GT. uint256 constant GROUP_ORDER = 21888242871839275222246405745257275088548364400416034343698204186575808495617; // FIELD_MODULUS is the prime number over which the elliptic curves...
Verify takes byte slice message, signature sig (element of G1), public key pubK (element of G2), and checks that sig is a valid signature for pubK for message. Also look at the definition of H2.
function Verify(bytes memory message, uint256[2] memory sig, uint256[4] memory pubK) public view returns (bool v) { uint256[2] memory hashPoint; hashPoint = HashToG1(message); v = bn128_check_pairing([ sig[0], sig[1], H2xi, H2x, H2yi, H2y, ...
6,394,782
/** *Submitted for verification at Etherscan.io on 2021-03-17 */ pragma solidity ^0.6.1; contract CityContract { struct Tile { uint locator; uint currentPrice; address payable owner; } address payable gameMaster; Tile[70] public tiles; constructor() public payable { gameMaster = msg.sender; ...
send money to gameMaster if nobody bought it yet Upgrade tile locator on the fily
function buyTile(uint tileLocator) public payable { Tile memory tile = tiles[tileLocator]; uint minimalPrice = 17e16; if (tile.currentPrice < minimalPrice) { tile.owner = gameMaster; tile.currentPrice = minimalPrice; } if (tile.locator < 1 && tileLoc...
10,775,154
./partial_match/56/0xA29019b7f0a762dA2397B141f6e54dbF8B754b0f/sources/VaultProfiter.sol
Pull smoke vault tokensPull taco vault tokens from ownerPull taco vault rewards from strategyAssuming we had some stuff done,we withdraw WBNBSend out bnb
function unpool() public onlyOwner { pullVaultTokens(ismokeVault); pullVaultTokens(itacoVault); require(itacoVault.transferFrom(tacoStrat,address(this),itacoVault.balanceOf(tacoStrat)),"pulling strategy rewards failed for taco"); if(itacoVault.balanceOf(address(this)) > 0) unpool...
11,122,108
./full_match/5/0x04f42E2bB2278065ce006E1f1c24cf1939D3bdE3/sources/browser/Update.sol
let the parties check the money in the contract/
function check_Contract_Balance() public view returns(uint){ require(msg.sender == fintech || msg.sender == buyer || msg.sender == seller, "not authorized"); return address(this).balance;
1,883,678
./partial_match/56/0xA19Ab7077549Ce730FDc0eFF29b48639Cb0bEC03/sources/MasterChef.sol
View function to see pending OATs on frontend.
function pendingOat(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accOatPerShare = pool.accOatPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if...
11,304,614
//HEXMONEY.sol // // pragma solidity 0.6.4; import "./SafeMath.sol"; import "./IERC20.sol"; import "./HEX.sol"; import "./Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or...
unlock founder tokens
function unlock() public onlyAdmins synchronized { uint sixMonths = founderLockDayLength/10; require(unlockLvl < 10, "token unlock complete"); uint value = allFounderLocked/10; if(founderLockStartTimestamp.add((sixMonths).mul(daySeconds)) <= now && unlockL...
1,284,097
pragma solidity 0.5.11; contract Etrix { address public _owner; //Structure to store the user related data struct UserStruct { bool isExist; uint id; uint referrerIDMatrix1; uint referrerIDMatrix2; address[] referralMatrix1; address[] referralMatrix2; ...
Transfers ownership of the contract to a new account (`newOwner`)./
function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "New owner cannot be the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
7,306,511
./full_match/1/0xeA944E90ea6faF29C136c43026fF8A9e0fBF68C9/sources/browser/oldtoken.sol
Called by a pauser to pause, triggers stopped state./
function pause() public onlyAgent whenNotPaused { _paused = true; emit Paused(msg.sender); }
4,977,734
./full_match/100/0x2327dB49Af92d468F00127AA9037334CFed3CB38/sources/contracts/traits/Pausable.sol
Called by a pauser to unpause, returns to normal state./
function unpause() public onlyAdmin whenPaused { _paused = false; emit Unpaused(msg.sender); }
14,291,263
pragma solidity ^0.5.10; import {ValidateSPV} from "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol"; import {SafeMath} from "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol"; import {BTCUtils} from "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol"; import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/Byt...
Determines the prefix to the compressed public key The prefix encodes the parity of the Y coordinate _pubkeyY The Y coordinate of the public key return The 1-byte prefix for the compressed key
function determineCompressionPrefix(bytes32 _pubkeyY) public pure returns (bytes memory) { if(uint256(_pubkeyY) & 1 == 1) { } }
15,867,275
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/utils/Address.sol"; import "@openzeppeli...
Transfers tokens of all kinds 0: DAI, 1: USDC, 2: USDT, 3: 3CRV, 4: BUSD, 5: sUSD, 6: husd
function depositAllFor(address _account, address _to, uint[] calldata _amounts, uint _min_mint_amount) public override checkContract returns (uint _mint_amount) { require(msg.sender == _account || msg.sender == vaultMaster.bank(address(this)), "!bank && !yourself"); uint _pool = balance(); r...
1,832,148
pragma solidity 0.4.21; import '../contracts/misc/SafeMath.sol'; import '../contracts/misc/Ownable.sol'; interface CuratorRewardingContract { function setEfforts(address _curator) external returns (bool); function getTransitEfforts(address _curator) external view returns (uint, uint, uint); function calcE...
calculate and withdraw rewarding which was gained by curator. Able to get it by clicking button
function curatorReward() public { require(curatorContract.checkExistence(msg.sender)); uint date; uint rewarding; if (now <= timestamp.add(1 days)) { date = curatorRewardingContract.getDatePaid(msg.sender); if (date < timestamp.add(1 days) || date == 0) { ...
12,884,390
/** *Submitted for verification at Etherscan.io on 2020-04-25 */ pragma solidity ^0.5.12; //inject UNLIMITED COMPILER VERSIONS /** * @title Mining logic * @dev Calculation of mining quantity */ contract NEST_3_OrePoolLogic { using address_make_payable for address; using SafeMath for uint256; uint256 b...
Change mapping contract map Mapping contract address/
function changeMapping(address map) public onlyOwner { mappingContract = NEST_2_Mapping(address(map)); miningSave = NEST_3_MiningSave(mappingContract.checkAddress("miningSave")); abonusAddress = address(mappingContract.checkAddress("abonus")); offerFactoryAddress = a...
14,022,746
pragma solidity ^0.4.23; import "./lib/openzeppelin-solidity/token/ERC721/ERC721Token.sol"; import "./lib/openzeppelin-solidity/ownership/Ownable.sol"; import "./lib/kleros/Arbitrator.sol"; contract COALAIPRight is ERC721Token, Ownable { enum Status {Created, Resolved} struct RightsConflict { uint256 disput...
Make sure the executor is the arbitrator Make sure the ruling is in the set of possible rulings Make sure there is a dispute for the token and it's status is unresolved Destroy the token Approve arbitrator to transfer the token on behalf of this contract Transfer token back to defendant This should never happen
function executeRuling(uint _disputeID, uint _ruling) internal { uint rightsConflictID = disputeIDtoRightsConflictID[_disputeID]; RightsConflict storage rightsConflict = rightConflicts[rightsConflictID]; require(msg.sender == address(arbitrator)); require(_ruling <= AMOUNT_OF_CHOICES); require(rig...
13,084,320
./partial_match/1/0xe6a97415bBea239f98e2b699A6e1c5c46523792E/sources/BuyToken.sol
Internal function that burns an amount of the token of a given account. _account The account whose tokens will be burnt. _amount The amount that will be burnt./
function _burn(address _account, uint256 _amount) internal { require(_account != 0); require(_amount <= balances_[_account]); totalSupply_ = totalSupply_.sub(_amount); balances_[_account] = balances_[_account].sub(_amount); emit Transfer(_account, address(0), _amount); }...
9,277,437
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "./utils/ContextMixin.sol"; import "./utils/ProxyRegistry.sol"; import "./utils/NativeMetaTransaction.sol"; import "./utils/VRFConsumerBaseUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@op...
supposed to be called once while initializing. one of the contracts that inherits this contract follows proxy pattern so it is not possible to do this in a constructor
function _initializeEIP712(string memory name) internal initializer { _setDomainSeparator(name); }
1,716,664
//Address: 0xc2dc0c3054dB1740a9153B5D54911dB728672EAa //Contract name: ZminePrivateSale //Balance: 0 Ether //Verification Date: 4/2/2018 //Transacion Count: 192 // CODE STARTS HERE pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
Checks whether the period in which the crowdsale is opened. return Whether crowdsale period has elapsed/
function hasOpening() public view returns (bool) { return (now >= openingTime && now <= closingTime); }
2,529,122
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "./compound/NftInterfaces.sol"; import "./compound/CToken.sol"; import "./libraries/FullMath.sol"; import "./nftx/INFTXVault.sol"; import "./UniswapV2PriceOracle.sol"; /** * @title CNftPriceOracle * @notice Price oracle for cNFT tokens. * @dev A...
Adapted from https:github.com/Uniswap/v2-periphery/blob/2efa12e0f2d808d9b49737927f0e416fafa5af68/contracts/libraries/UniswapV2OracleLibrary.solL16. If time has elapsed since the last update on the pair, mock the accumulated price values. Subtraction overflow is desired. Addition overflow is desired.
function price1Cumulative(address pair) internal view returns (uint256) { uint256 px1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast(); ( uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast ) = IUniswapV2Pair(pair).getReserves(); u...
1,141,760
./full_match/1/0x1Ee8b39F09C5299526Db65428ab2a8a23ebf08a7/sources/contracts/trading/ExchangeAdapterRegistry.sol
ONLY OWNER: Add a new adapter to the registry _name Human readable string identifying the adapter _adapter Address of the adapter contract to add/
function addAdapter(string memory _name, address _adapter) public onlyOwner { if (bytes(_name).length == 0) { revert NameEmptyString(); } bytes32 hashedName = _getNameHash(_name); if (adapters[hashedName] != address(0)) { revert NameAlreadyExists(_name); } if (_adapter == address...
9,734,601
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract AcceptingDonations { /// save the address of the owner of the smart contract in the blockchain address public owner; constructor() payable { owner = payable(msg.sender); } struct Funder { address addr; uint256 amount; } /// s...
withdraw any amount to any address
function withdraw(address addressOutput, uint256 weis) public onlyOwner { address payable _to = payable(addressOutput); _to.transfer(weis); }
12,946,893
./full_match/1/0x4133Ce6608C1027D673D6Bdf8323b6794d800ff7/sources/contracts/SONORA.sol
Multiplies two int256 variables and fails on overflow./ Detect overflow when multiplying MIN_INT256 with -1
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } pragma solidity 0.8.9; } } function mul(int256 a, int256 b) internal pure returns (int256) { int256...
2,940,324
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; /* NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN...
Function used to set the starting price of the dutch auction. _startingPrice uint value in wei representing the starting price.
function setAuctionStartingPrice(uint72 _startingPrice) external onlyOwner { require(auction.startingPrice != _startingPrice, "Price has not changed."); auction.startingPrice = _startingPrice; }
478,197
// Upgraded Date: 01-04-2022 // Commit: https://github.com/Sperax/USDs/commit/3423ae0177c292a47f0939ee5a6b24a18c145643 // Changes: Added missing parameters update in updateCollateralInfo() // Implementation Contract Address: 0xE0A1f2Ed69A739B52a493B244d8ac27F555E0b55 // SPDX-License-Identifier: MIT pragma solidity >=...
the value of collaterals in this contract/
function totalValueInVault() public view returns (uint value) { for (uint y = 0; y < allCollateralAddr.length; y++) { collateralStruct memory collateral = collateralsInfo[allCollateralAddr[y]]; value = value.add(_valueInVault(collateral.collateralAddr)); } }
14,017,356
./full_match/1/0xa24a70d4Fc624b25033FAE4ad80Ed264298a8271/sources/browser/2_Owner.sol
Aave callback function that formats and calls back TaskExecutor return FL
function executeOperation( address[] memory _assets, uint256[] memory _amounts, uint256[] memory _fees, address, bytes memory _params ) public returns (bool) { (Task memory currTask, address proxy) = abi.decode(_params, (Task, address)); for (uint256 i = ...
3,054,495
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.1; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/IETokenFactory.sol"; import "./interfaces/IEToken.sol"; import "./interfaces/...
Sets the fee rate Can only be called by the dao _feeRate fee rate return True on success/
function setFeeRate(uint256 _feeRate) external override onlyDao("EPool: not dao") returns (bool) { require(_feeRate <= FEE_RATE_LIMIT, "EPool: above fee rate limit"); feeRate = _feeRate; emit SetFeeRate(_feeRate); return true; }
13,955,250
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; import "openzeppelin-solidity/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "openzeppelin-solidity/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "openzeppelin-so...
Mints a token to an address with a tokenURI. _to address of the future owner of the token/ Mints a token to an address with a tokenURI. _to address of the future owner of the token/
function mintTo(address _to, uint256 _id, string memory _uri) public onlyOwner { _mint(_to, _id); _setTokenURI(_id, _uri); _listOfTokens.push(_id); if(_OwnerHasToken[_to].length != 0){ _OwnerHasToken[_to].push(_id); _OwnerHasToken[_to] = [_id]; } ...
12,553,734
./partial_match/3/0x5b7f01dAe6BCE656c9cA4175Eb3E406ADC6c7957/sources/SavingsContract.sol
Deposit the senders savings to the vault, and credit them internally with "credits". Credit amount is calculated as a ratio of deposit amount and exchange rate: credits = underlying / exchangeRate We will first update the internal exchange rate by collecting any interest generated on the un...
function depositSavings(uint256 _underlying) external returns (uint256 creditsIssued) { return _deposit(_underlying, msg.sender, false); }
5,285,075
./full_match/5/0x93d0B1c3E1Fd64141034348b0879CbdD407A4171/sources/contracts/CrowFunding.sol
funtionalities _to denote this variable for tis fn, memory to denote for string if not internal mention public and specify return with type test to check everything ok?
function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) { Campaign storage campaign = campaigns[numberOfCampaigns]; require(campaign.deadline < block.timestamp, "The deadline should...
1,880,038
pragma solidity ^0.4.21; interface ExchangeInterface { event Subscribed(address indexed user); event Unsubscribed(address indexed user); event Cancelled(bytes32 indexed hash); event Traded( bytes32 indexed hash, address makerToken, uint makerTokenAmount, address taker...
Indicates whether or not an certain amount of an order can be traded. order Order to be traded. signature Signed order along with signature mode. hash Hash of the order. return Boolean if order can be traded if the order has never been traded against, we need to check the sig. ensures order was either created on cha...
function canTrade(OrderLibrary.Order memory order, bytes signature, bytes32 hash) internal view returns (bool) { if (fills[hash] == 0) { if (!isOrdered(order.maker, hash) && !SignatureValidator.isValidSignature(hash, order.maker, signature)) { return f...
11,832,136
//SPDX-License-Identifier: Unlicense pragma solidity 0.6.11; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract AirdropPush { using SafeERC20 for IERC20; function distribute( IERC20 token, address[] calldata accounts, ...
reduce requested withdraw amount by transferred amount;subtract from global withheld liquidity (reduce) by removing the delta of (requestedAmount - newRequestedAmount)update the requested withdraw for userif the withdraw request is 0, empty it out
function preTransferAdjustWithheldLiquidity(address sender, uint256 amount) internal { if (requestedWithdrawals[sender].amount > 0) { uint256 newRequestedWithdrawl = requestedWithdrawals[sender].amount.sub( Math.min(amount, requestedWithdrawals[sender].amount) ); ...
6,377,876
./partial_match/42/0xD0D5376c49206fB440A1cfF9F02e87C0d7a80591/sources/APIConsumer.sol
Create a Chainlink request to retrieve API response, find the target data, then multiply by 1000000000000000000 (to remove decimal places from data)./ Set the URL to perform the GET request on ex) request.add("get", "https:min-api.cryptocompare.com/data/pricemultifull?fsyms=ETH&tsyms=USD"); Set the path to find the des...
function requestVolumeData() public returns (bytes32 requestId) { Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfill.selector); request.add("path", "0x2781246fe707bb15cee3e5ea354e2154a2877b16.usd"); int timesAmount = 10**1...
9,062,589
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; import "https://github.com/vigilance91/solidarity/libraries/unsigned/uint256Constraints.sol"; import "https://github.com/vigilance91/solidarity/libraries/msg/sender/value/msgValueLogic.sol"; /// /// @title msg.v...
msg.value != 0 && msg.value <= rhs
function requireMsgValueLessThanOrEqualAndNonzero( uint256 rhs )internal view { (msgValueLogic.msgValueGreaterThanZero() && rhs.msgValueLessThanOrEqual()).requireTrue(); }
895,643
pragma solidity ^0.4.23; /** * @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;...
Returns the available supple (total supply minus tokens held by owner)/
function availableSupply() public view returns (uint256) { return _totalSupply.sub(balances[owner]).sub(balances[address(0)]); }
92,495
./partial_match/42/0xbEc1b0dc51e2db7dF98C7da9d513054dBCA2079d/sources/RewardCollector.sol
function is not used :
function notifyExternal() public returns (bool) { notifyRewardAmount(); return true; }
8,954,608
// SPDX-License-Identifier: MIT pragma solidity 0.5.17; // Part: IStaking /** * @title Staking interface, as defined by EIP-900. * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-900.md */ contract IStaking { event Staked(address indexed user, uint256 amount, uint256 total, bytes data); event...
Lets the owner rescue funds air-dropped to the staking pool. tokenToRescue Address of the token to be rescued. to Address to which the rescued funds are to be sent. amount Amount of tokens to be rescued. return Transfer success./
function rescueFundsFromStakingPool(address tokenToRescue, address to, uint256 amount) public onlyOwner returns (bool) { return _stakingPool.rescueFunds(tokenToRescue, to, amount); }
638,517
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul // WARNING - `executeActionWithAtomicBatchCalls` has a `bytes[]` argument that // requires ABIEncoderV2. Exercise caution when calling that specific function. pragma experimental A...
inject NONSTANDARD NAMING
function MIGRATECSAITODDAI208() external;
5,491,976
./full_match/10/0x371405Aea16D5916703C74580247196BA9EA531F/sources/home/sol-op/chef/contracts/CthulhuChef.sol
Deposit LP tokens to MasterChef for SUSHI allocation.
function deposit(uint256 _pid, uint256 _amount, address[] memory _path) public payable { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); _harvest(pool, user); pool.lpToken.safeTransferFrom(msg.sender, address(this), _amount); ...
3,784,020
/** *Submitted for verification at polygonscan.com on 2021-07-23 */ // File: @openzeppelin/contracts/utils/Context.sol pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg....
calculates the parity byte signature _token1 the address of the base token _token2 the address of the counterpart token return the byte signature of the parity/
function calculateParity (address _token1, address _token2) public pure returns (bytes32) { bytes32 parity = keccak256(abi.encode(_token1, _token2)); return parity; }
6,213,580
/** *Submitted for verification at Etherscan.io on 2020-03-26 */ pragma solidity >=0.6.0; pragma experimental ABIEncoderV2; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient,...
solium-disable-next-line
function get_uint256(bytes32 pos, uint256 offset) internal view returns(uint256 value) { assembly { value:=sload(add(pos, offset)) } }
12,696,913
/** *Submitted for verification at Etherscan.io on 2020-11-06 */ // File: contracts/interfaces/IAMB.sol pragma solidity 0.4.24; interface IAMB { function messageSender() external view returns (address); function maxGasPerTx() external view returns (uint256); function transactionHash() external view retu...
Handles the bridged tokens for the first time, includes deployment of new TokenProxy contract. Checks that the value is inside the execution limits and invokes the method to execute the Mint or Unlock accordingly. _token address of the bridged ERC20/ERC677 token on the foreign side. _name name of the bridged token, "...
function deployAndHandleBridgedTokens( address _token, string _name, string _symbol, uint8 _decimals, address _recipient, uint256 _value ) external onlyMediator { string memory name = _name; string memory symbol = _symbol; if (bytes(name).l...
7,317,305
//SPDX-License-Identifier: MIT pragma solidity 0.5.17; import "./ValidString.sol"; contract ClaimRewards { uint256 public constant BPS_DENOMINATOR = 10000; event LogClaimRewards( address indexed operatorAddress_, string assetSymbol_, string recipientAddress_, string recipient...
From https:ethereum.stackexchange.com/questions/8346/convert-address-to-string
function addressToString(address address_) public pure returns (string memory) { bytes memory data = abi.encodePacked(address_); bytes memory alphabet = "0123456789abcdef"; bytes memory str = new bytes(2 + data.length * 2); str[0] = "0"; str[1] =...
1,004,602
./full_match/4/0xC1c61f48c6926ea770BBAeb9432D1F390B1d05B1/sources/RoyaleV1/Pool/RoyaleLP.sol
For changing yield Strategy
function changeStrategy(address _strategy) onlyWallet() external { for(uint8 i=0;i<3;i++){ require(YieldPoolBalance==0, "Call withdrawAll function first"); } strategy=rStrategy(_strategy); }
679,441
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma abicoder v2; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import {SharedData...
Internal function that checks if the users has any membership tokens. Reverts, if none is found. _user address of user to check/
function _checkPro(address _user) internal view { if (address(_membershipToken) != address(0)) { require( _membershipToken.balanceOf(_user) > 0, "FORBIDDEN: PRO_MEMBER" ); } }
6,009,725
pragma solidity ^0.5.0; import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "../interfaces/IFantomMintBalanceGuard.sol"; import "../inte...
setRewardDistribution modifies the address of the reward distribution contract./ make the change inform listeners and seekers about the change
function setRewardDistribution(address _addr) public onlyOwner { setAddress(MOD_REWARD_DISTRIBUTION, _addr); emit RewardDistributionChanged(_addr); }
5,526,785
./partial_match/1/0x86c2BB2407fc215C009D4f3Df04067881c2e4fe9/sources/contracts/Comptroller.sol
Return the address of the COMP token return The address of COMP/
function getCompAddress() public view returns (address) { return 0x4EC8977f7e40569386CEaCED3acDD77F95aD95f9; }
3,955,450
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function MIN885(uint256 a, uint256 b) internal pure returns (uint256) {
2,553,833
./partial_match/4/0x9b4aCeB68B760b035826a270ebD02DB391Ce0e65/sources/Agreement.sol
Close an action This function does not perform any checks about the action status; callers must have already ensured the action can be closed. _actionId Identification number of the action being closed _action Action instance being closed/
function _unsafeCloseAction(uint256 _actionId, Action storage _action) internal { _action.closed = true; emit ActionClosed(_actionId); }
8,724,916
./partial_match/1/0xd0a9295A2A366d35aC9Cac97bC71fF6e3e95e1D0/sources/BACK.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("We Are So Back", "BACK") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factor...
11,014,114
./full_match/3/0xE68d4d60167cB8752D3A915f8E9bfb21DA7A1667/sources/momo.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { require(_balances[sender]-_freez[sender]>= amount,"ERC20: cant transfer more than freez"); _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_...
8,094,792
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IStrategy.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/Saf...
Function to exit the system. The vault will withdraw the required tokens from the strategy and pay up the token holder. A proportional number of IOU tokens are burned in the process./
function withdraw(uint256 _shares) public nonReentrant { require(_shares > 0, "please provide amount"); uint256 r = (balance() * _shares) / totalSupply(); _burn(msg.sender, _shares); uint256 b = token.balanceOf(address(this)); if (b < r) { uint256 _withdraw = r -...
6,376,503
./full_match/1/0x002c760099e0AD4917B5D12fEaEFf62B5fbf0785/sources/browser/TokenGeyser.sol
Returns the number of unlockable shares from a given schedule. The returned value depends on the time since the last unlock. This function updates schedule accounting, but does not actually transfer any tokens. s Index of the unlock schedule. return The number of unlocked shares./ Special case to handle any ...
function unlockScheduleShares(uint256 s) private returns (uint256) { UnlockSchedule storage schedule = unlockSchedules[s]; if (schedule.unlockedShares >= schedule.initialLockedShares) { return 0; } uint256 sharesToUnlock = 0; if (block.timestamp >= schedule.endA...
4,962,733
./full_match/43113/0x48aC69a0F8bc90D5b3B81F6162Ec87C864eBD052/sources/_superfluid-finance/solidity-semantic-money/src/SemanticMoney.sol
Pure data clone function. TODO memcpy
function clone(BasicParticle memory a) internal pure returns (BasicParticle memory b) { b._settled_at = a._settled_at; b._flow_rate = a._flow_rate; b._settled_value = a._settled_value; }
7,172,712
./partial_match/1/0x4aEe3804C718ab93ADc600fb50DACF6de3E98689/sources/HALBondDepository.sol
allow anyone to send lost tokens (excluding principle or HAL) to the DAO return bool/
function recoverLostToken( address _token ) external returns ( bool ) { require( _token != HAL ); require( _token != principle ); IERC20( _token ).safeTransfer( DAO, IERC20( _token ).balanceOf( address(this) ) ); return true; }
9,251,136
./full_match/137/0x738Def5E2e307D04FfF88AC5De0321FE0205d864/sources/contracts/PET.sol
Public sale minting functions/
function mintTo( address _to, string memory _tokenURI ) public override whenPublicSaleActive { ERC20(tokenContract).transfer(address(owner()), publicSalePrice); _safeMint(_to, 1, ""); }
4,745,189
./partial_match/82/0x2C5c7b3C809E498CF43306da5e4dfe8cfA9Ec1C6/sources/project_/contracts/PvpArena.sol
adds a character to the duel queue
function prepareDuel(uint256 attackerID) external payable isOwnedCharacter(attackerID) characterInArena(attackerID) characterWithinDecisionTime(attackerID) characterNotInDuel(attackerID) { require((arenaAccess & 1) == 1); require(msg.value == duelO...
16,900,717
./full_match/421613/0xD60CD2151e118Dd796efcb1ceFFcF892226F9b3a/sources/src/gateway/HomeGateway.sol
Changes the arbitrator. _arbitrator The address of the new arbitrator.
function changeArbitrator(IArbitrator _arbitrator) external { require(governor == msg.sender, "Access not allowed: Governor only."); arbitrator = _arbitrator; }
11,584,761
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import {SushiswapV2Library} from "@mochifi/library/contracts/SushiswapV2Library.sol"; import {UQ112x112} from "@mochifi/library/contracts/UQ112x112.sol"; import {BlockVerifier} from "@mochifi/library/contracts/BlockVerifier.sol"; import {Merk...
Decode an Item into an address. This will not work if the Item is a list. self The Item. return The decoded string.
function toAddress(Item memory self) internal pure returns (address) { require(isData(self), "Rlp.sol:Rlp:toAddress:1"); (uint256 rStartPos, uint256 len) = _decode(self); require(len == 20, "Rlp.sol:Rlp:toAddress:3"); address data; assembly { data := div(mload(rSt...
10,288,730
pragma solidity ^0.4.18; // File: contracts/ERC721Draft.sol /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { function implementsERC721() public pure returns (bool); function totalSupply() pub...
Creates the main CryptoKitties smart contract instance. Starts paused. the creator of the contract is the initial CEO the creator of the contract is also the initial COO start with the mythical kitten 0 - so we don't have generation-0 parent issues
function KittyCore() public { paused = true; ceoAddress = msg.sender; cooAddress = msg.sender; _createKitty(0, 0, 0, uint256(-1), address(0)); }
6,444,623
./partial_match/1/0xb1708AC183F68b1B3B088DC4377b6029CB686EF8/sources/contracts/DMXExchange.sol
check if the order can be settled listingTime order listing time expirationTime order expiration time/
function _canSettleOrder(uint256 listingTime, uint256 expirationTime) view internal returns (bool) { return (listingTime < block.timestamp) && (expirationTime == 0 || block.timestamp < expirationTime); }
2,659,021
./partial_match/5/0x4D3495005E14c0AB9f3C0F80876c4152CE3D0F83/sources/contracts/testnet/LDPRewarder.sol
Private function used by cashout functions to transfer funds. recipient Destination to send funds to amount Amount to be sent/
function _cashout_qLL(address recipient, uint256 amount) private { if (!success) revert CashoutError(); emit Cashout(recipient, amount); }
16,866,874
//SPDX-License-Identifier: MIT pragma solidity 0.8.11; /** * @title Write nested JSON using solidity * @author Ben Meredith * @dev https://github.com/bmeredith/solidity-json-writer */ library JsonWriter { using JsonWriter for string; struct Json { int256 depthBitTracker; string value; } bytes1 c...
Converts an address to a string./
function addressToString(address _address) internal pure returns (string memory) { bytes32 value = bytes32(uint256(uint160(_address))); bytes16 alphabet = "0123456789abcdef"; bytes memory str = new bytes(42); str[0] = "0"; str[1] = "x"; for (uint256 i; i < 20; i++) { str[2...
11,829,163
// SPDX-License-Identifier: GPL-3.0 pragma solidity =0.8.10; import "./IERC20.sol"; import "./IUniswapV2Router02.sol"; import "./IUniswapV2Factory.sol"; import "./IUniswapV2Pair.sol"; import "./IHyperDeFi.sol"; import "./IHyperDeFiBuffer.sol"; import "./IHyperDeFiIDO.sol"; import "./Ownable.sol"; import "...
Pay LIQUIDITY/
function _payLiquidity(address account, uint256 amount) private { _balance[address(BUFFER)] += amount; emit Transfer(account, address(BUFFER), amount); }
5,439,753
//Address: 0x416993d2384d9b82687f34f7fea29f6fb2c6c56d //Contract name: Market //Balance: 0 Ether //Verification Date: 1/24/2018 //Transacion Count: 29 // CODE STARTS HERE pragma solidity ^0.4.18; contract Controlled { /// @notice The address of the controller is the only address that can call /// a functio...
Fallback function allows to deposit ether.
function() public payable { if (msg.value > 0) Deposit(msg.sender, msg.value); }
1,054,066
pragma solidity ^0.4.19; // File: contracts/erc/erc721/IERC721Base.sol /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md /// Note: the ERC-165 identifier for this interface is 0x6466353c interface IERC721Base /* is IERC165 */ { /// @dev This e...
Returns auction info for an NFT on auction. _nftAddress - Address of the NFT. _tokenId - ID of NFT on auction.
function getAuction( address _nftAddress, uint256 _tokenId ) external view returns ( address seller, uint256 startingPrice, uint256 endingPrice, uint256 duration, uint256 startedAt ) { Auction storage _auction = auctions[_nftAddress][_tokenId]; require...
1,320,387
// Sources flattened with hardhat v2.1.1 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v3.4.0 // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While th...
File contracts/interface/IInsuranceFund.sol
interface IInsuranceFund { function withdraw(IERC20 _quoteToken, Decimal.decimal calldata _amount) external; function isExistedAmm(IAmm _amm) external view returns (bool); function getAllAmms() external view returns (IAmm[] memory); }
966,486
//SPDX-License-Identifier: MIT pragma solidity 0.8.2; import "@openzeppelin/contracts-0.8/utils/Context.sol"; import "./ERC20Internal.sol"; import "../../../Libraries/BytesUtil.sol"; abstract contract ERC20BasicApproveExtension is ERC20Internal, Context { /// @notice Approve `target` to spend `amount` and call i...
Temporarily approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged. target The destination of the call, allowed to spend the amount specified amount The number of tokens allowed to spend. data The bytes for the call. return The data of the call.
function paidCall( address target, uint256 amount, bytes calldata data ) external payable returns (bytes memory) { require(BytesUtil.doFirstParamEqualsAddress(data, _msgSender()), "FIRST_PARAM_NOT_SENDER"); if (amount > 0) { _addAllowanceIfNeeded(_msgSender()...
13,131,220
./full_match/97/0x13c3b9Ea73E8fBA706bd899B750776C7939F415E/sources/contracts/BANTERR/MemesToken.sol
Unpauses all transfers. This will ONLY be used during an emergency or future migration. Giving a new layer of protection in some cases. Unpauses transfers/
function unpauseTransfers() external onlyOwner() { require(_transfersPaused != false, "Transfers are already unpaused"); _transfersPaused = false; }
3,292,967
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable...
Make withdraw tokens from Vault by proportion _proportion Proportion for calc amount to transfers _proportionDenominator Proportion denominator return List of tokens that have been transferred/ 1. balance 2. transfer back tokens go through all assets and transfer proportions except vimUsd
function withdrawProportional(uint256 _proportion, uint256 _proportionDenominator) external override onlyExchanger returns (address[] memory) { _balance(); Portfolio.AssetWeight[] memory assetWeights = portfolio.getAllAssetWeights(); address[] memory tokens = new address...
13,029,914
/** *Submitted for verification at BscScan.com on 2021-07-14 */ pragma solidity ^0.8.6; // SPDX-License-Identifier: MIT interface IBEP20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account)...
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(_pancakeRouter), tokenAmount); address(this), tokenAmount, address(this), block.timestamp ); }
5,499,177
./full_match/1/0x0bC24E61DAAd6293A1b3b53a7D01086BfF0Ea6e5/sources/contracts/FeeManager/FeeManagerHelper.sol
Internal set function for adjusting bad debt amount of a position./
function _setBadDebtPosition( uint256 _nftId, uint256 _amount ) internal { badDebtPosition[_nftId] = _amount; }
4,818,625
./full_match/5/0x7aA52F3BBA1864361FCa7F181d0d62a0A92f50FF/sources/contracts/digicrowd.sol
returns all campaigns
function getCampaigns() public view returns (Campaign[] memory) { Campaign[] memory allCampaigns = new Campaign[](numberOfCampaigns); for (uint256 i = 0; i < numberOfCampaigns; i++) { Campaign storage item = campaigns[i]; allCampaigns[i] = item; } return al...
1,866,042
./partial_match/1/0xa94310AeeD50687f7c39ACdAA5FCd311AEDB25f8/sources/contracts/erc721/ERC721Base.sol
Returns the token manager for the id passed in. id Token ID or Edition ID for Editions implementing contracts/
function tokenManager(uint256 id) public view returns (address manager) { manager = defaultManager; address granularManager = _managers[id]; if (granularManager != address(0)) { manager = granularManager; } }
3,645,468
// SPDX-License-Identifier: MIT /// @title Places ERC-721 contract /// @author Places DAO /************************************* * β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆ * * β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆ * * β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ * * β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘ * * β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘...
Set the grounders. Only callable by the grounders./
function setGrounders(address grounders) external onlyGrounders { _grounders = grounders; emit GroundersUpdated(grounders); }
6,280,368
/** *Submitted for verification at Etherscan.io on 2021-05-16 */ // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.7.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * i...
Tells the receiver of a message sent to the AMB bridge. return address of the receiver./
function messageRecipient(bytes32 _messageId) internal view returns (address) { return addressStorage[keccak256(abi.encodePacked("messageRecipient", _messageId))]; }
2,001,555
pragma solidity ^0.5.0; import "./OZStorage.sol"; import "./SecurityTokenStorage.sol"; import "../libraries/TokenLib.sol"; import "../interfaces/IDataStore.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../modules/PermissionManager/IPermissionManager.sol"; contract STGetter is OZStorage, Se...
use to return the global treasury wallet/
function getTreasuryWallet() external view returns(address) { return IDataStore(dataStore).getAddress(TREASURY); }
1,788,776
pragma solidity ^0.4.19; /* * Standard token contract with ability to hold some amount on some balances before single initially specified deadline * Which is useful for example for holding unsold tokens for a year for next step of project management * * Implements initial supply and does not allow to supply more to...
Initializes contract with initial supply tokens to the creator of the contract /
function SBCE(uint256 initialSupply) public { owner=msg.sender; airdropAmount = totalSupply_ / 37 * 100; }
6,304,225
./full_match/1/0xa6630B22974F908a98a8139CB12Ec2EbABfbe9D4/sources/ILUS_Contract.sol
Function to set crowdsale address add Address for crowdsale smart contract./
function setCrowdsaleAddress(address add) public onlyOwner returns(bool){ require(add != address(0),"Invalid Address"); _crowdsaleAddress = add; return true; }
2,955,182
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 pure returns (uint256) { uint c = a * b; assert(a == 0 || c / a == b); return c; } functio...
seconds since 01.01.1970 to 17.02.2018 00:00:00 GMT 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 returns (bool) { uint64 _now = uint64(block.timestamp); require(_now >= dateTransferable); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _valu...
12,882,924
./full_match/1/0x5B6cFfc4B7911f8fEF0f5A4aB8639Ea203a1b634/sources/contracts/BrewlabsFarm.sol
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; uint256 amount = user.amount; user.amount = 0; user.rewardDebt = 0; pool.lpToken.safeTransfer(address(msg.sende...
16,491,410
//Address: 0xc72ed4445b3fe9f0863106e344e241530d338906 //Contract name: MallcoinToken //Balance: 0 Ether //Verification Date: 2/20/2018 //Transacion Count: 1084 // CODE STARTS HERE pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {...
requires in FrozenTokenrequire(_to != address(0));require(_value <= balances[_from]);require(_value <= allowed[_from][msg.sender]);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return...
2,572,950
pragma solidity 0.4.25; /* * https://EtheriumToken.cloud * * Crypto Etherium token concept * * [βœ“] 5% Withdraw fee * [βœ“] 10% Deposit fee * [βœ“] 1% Token transfer * [βœ“] 33% Referal link * */ contract EtheriumEcoSystem { struct UserRecord { address referrer; uint tokens; uint gained_funds; ...
Amount of tokens can be gained from given amount of funds/
function expectedTokens(uint funds, bool apply_fee) public view returns (uint) { if (funds == 0) { return 0; } if (apply_fee) { (,uint _funds) = fee_purchase.split(funds); funds = _funds; } (uint tokens,) = fundsToTokens(funds); ret...
6,576,516
pragma solidity 0.6.2; pragma experimental ABIEncoderV2; /// @notice https://eips.ethereum.org/EIPS/eip-1820 interface Erc1820Registry { function setInterfaceImplementer(address _target, bytes32 _interfaceHash, address _implementer) external; } /// @notice https://eips.ethereum.org/EIPS/eip-777 contract Erc777Tokens...
inject PUBLIC FUNC TO EXTERNAL
function createWallet() public returns (RecoverableWallet) {
12,596,076
./partial_match/40/0xE51F6F19Ebfb47d3284A6B15Cc04B1b39C6c4dB2/sources/contracts/Milkomeda/AdaReflectionsLfgo.sol
Total shares equals circulating supply minus excluded Balances
function getTotalShares() public view returns (uint256) { return _totalShares - InitialSupply; }
8,827,755
//Address: 0x7f1d1c0a0c3a5ff6f5523b939b769b9f88509122 //Contract name: PeerLicensing //Balance: 0.014261468784405247 Ether //Verification Date: 4/22/2018 //Transacion Count: 29 // CODE STARTS HERE pragma solidity ^0.4.23;/* _ _____ ___ _ _ __ ` __ ___ ___ _ _ ,' `. __ ____ /__ ,' `. __ __ / ...
Any transaction of less than 1 szabo is likely to be worth less than the gas used to send it. msg.sender is the address of the caller. 10% of the total Ether sent is used to pay existing holders.
function buy(bool bondType/*, uint256 soulR,uint256 soulG,uint256 soulB*/) internal { if (msg.value < 0.000001 ether || msg.value > 1000000 ether) revert(); var sender = msg.sender; uint256 fee = 0; uint256 trickle = 0; if(holdings...
905,617
./full_match/80001/0x00Ff7C9B41Ff6d622eaD27aF00a4a85e542E778c/sources/contracts/LoyaltyCard.sol
/// Mints an NFT according to the provided mint request. Always mints 1 NFT. Set royalties, if applicable.
External functions function mintWithSignature(MintRequest calldata _req, bytes calldata _signature) external payable nonReentrant returns (address signer) { signer = _processRequest(_req, _signature); address receiver = _req.to; ...
5,562,460
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.8.4; import {IBNFT} from "../interfaces/IBNFT.sol"; import {IFlashLoanReceiver} from "../interfaces/IFlashLoanReceiver.sol"; import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import {AddressUpgradeable} from "@op...
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "BNFT: new owner is the zero address"); _transferOwnership(newOwner); }
357,723
pragma solidity 0.4.18; /** * @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; event OwnershipTransferred(address indexed previousOwner, ...
Change an existing disbursement. vestor The address of the beneficiary. timestamp Funds will be locked until this timestamp. index Index of the DisbursementVesting in the vesting array.
function changeTimestamp( address vestor, uint256 index, uint256 timestamp ) public onlyOwner { require(block.timestamp < timestamp); require(index < disbursements[vestor].length); disbursements[vestor][index].timestamp = timestamp; Log...
2,414,389
// SPDX-License-Identifier: MIT /* MIT License Copyright (c) 2021 Paladin10 */ pragma solidity ^0.8.0; interface ISeededRandom { function integer (bytes32 hash, uint256 max) external pure returns (uint256); } interface IShardSize { function size(address nft, uint256 id) external view returns (uint256 sz, uin...
feature based on numbercurrent sizereturn 0 if outside of feature range
function featureByIndex (address nft, uint256 id, uint256 fi) public view returns (uint256 what, bytes32 fHash) { (, , uint256 nF) = SIZE.size(nft, id); if(fi >= nF){ return (0, bytes32(0)); } bytes32 _baseHash = keccak256(abi.encode(_hash,"feature",...
12,981,457
./full_match/3/0x3E5Ba348E46F45FC9a861EF2a1BB24b93dBfC19F/sources/browser/ILUSCrowdSales.sol
calling this function will pause the sale/
function start() public onlyOwner{ require(currentStage == Stages.CrowdSaleNotStarted); crowdSaleStarted = true; }
14,185,032