file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/3/0xD675a50E477c035BCAA8191a9715306640683732/sources/Lock.sol
returns the fee receiver wallet address/
function getWallet() external view returns(address) { return _wallet; }
5,119,522
pragma solidity ^0.4.14; /** * @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 sets the origin...
Transfers the balance of the sale auction contract to the ArtworkCore contract. We use two-step withdrawal to prevent two transfer calls in the auction bid function.
function withdrawAuctionBalances() external onlyCLevel { saleAuction.withdrawBalance(); }
418,746
./full_match/1/0x0E6641E62BAA87d77E01aB1C7e9d2F323f26942B/sources/contracts/ASETc.sol
Sets a marketing partner and the amount to be routed in Ether. _marketingPartner The address of the marketing partner. _amountInEther The amount in Ether to be routed./
function setMarketingPartner( address payable _marketingPartner, uint256 _amountInEther ) external nonReentrant onlyOwner { marketingPartner = _marketingPartner; marketingFeesToBeRouted = _amountInEther * 10**18; totalMarketingPaid = 0; routePaymentToMarketingPart...
8,421,228
./full_match/1/0x5DeeF70b4a335127fD06507af8AD9d9399865633/sources/contracts/AngryPitbullClubStaked.sol
Mints a batch of tokens to the specified address. to The address to mint the tokens to. tokenIds An array of unique tokenIds for the new tokens./
function batchMint( address to, uint256[] memory tokenIds ) external callerIsController { for (uint256 i = 0; i < tokenIds.length; i++) { mint(to, tokenIds[i]); } }
8,323,346
./full_match/80001/0x645711fd0ED87fC70968CA0FBe7F465DCD8b455A/sources/contracts/BiletsClub.sol
Owner can choose others contracts an admin. /
function OWNER_FlipAdmin(address _admin) public onlyOwner { admins[_admin] = !admins[_admin]; }
5,615,237
// SPDX-License-Identifier: MIT pragma solidity =0.8.11; import {BoringOwnable} from "BoringOwnable.sol"; import "UUPSUpgradeable.sol"; import "SafeERC20.sol"; import "ERC20.sol"; import "ReentrancyGuard.sol"; import "ERC20VotesUpgradeable.sol"; import {IVault, IAsset} from "IVault.sol"; import "IWeightedPool.sol"; im...
SPDX-License-Identifier: GPL-3.0-or-later 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. This program is distributed in the hop...
interface IPriceOracle { function getTimeWeightedAverage(OracleAverageQuery[] memory queries) external view returns (uint256[] memory results); function getLatest(Variable variable) external view returns (uint256); enum Variable { PAIR_PRICE, BPT_PRICE, INVARIANT } function sw...
1,382,379
./full_match/4/0xfBdD4577b7AeB49070b98d5F50147Ec5CA9766Bb/sources/FirmaPro/FirstTest.sol
See {ERC1155-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./
function mint( address to, uint256 id, uint256 amount, bytes memory data ) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), 'ERC1155: must have minter role to mint'); _mint(to, id, amount, data); tokenSupply[id] += amount; }
809,444
pragma solidity ^0.4.21; /* ----------------- */ // this is expected from another contracts // if it wants to spend tokens of behalf of the token owner in our contract // this can be used in many situations, for example to convert pre-ICO tokens to ICO tokens // see 'approveAndCall' function contract allowanceRec...
https:github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.mdapprove there is and attack, see: https:github.com/CORIONplatform/solidity/issues/6, https:drive.google.com/file/d/0ByMtMw2hul0EN3NCaVFHSFdxRzA/view but this function is required by ERC-20 event
function approve(address _spender, uint256 _value) public returns (bool success){ require(_value >= 0); allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } event TokensCreated(address indexed to, uint indexed value, uint ...
899,017
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "../libraries/Position.sol"; import "../accessors/NameAccessor.sol"; /// @title HologramPool - stores any data. /// @author Shumpei Koike - <shumpei.koike@bridges.inc> contract HologramPool is Nam...
Sets the bytes value. key bytes32 of the key
function setBytes(bytes32 key, bytes memory value) external onlyAllowedContract { _bytesStorage[key] = value; }
12,668,582
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721 // SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract SpikySpaceFish is...
Mints token/ If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after the end of pre-sale, set the starting index block
function mintToken(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active"); require(totalSupply().add(numberOfTokens) <= MAX_TOKEN, "Purchase would exceed max supply."); require(tokenPrice.mul(numberOfTokens) <= msg.value, "Ether value sent is not correct"); ...
1,666,187
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT OR Apache-2.0 import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; im...
See comment at the top of this file for explanation of how this function works. NOTE: theoretically possible overflow of (_start + 0x3)
function bytesToUInt24(bytes memory _bytes, uint256 _start) internal pure returns (uint24 r) { uint256 offset = _start + 0x3; require(_bytes.length >= offset, "U"); assembly { r := mload(add(_bytes, offset)) } }
72,242
pragma solidity ^0.4.11; import './PrismLibData.sol'; import './SafeMath.sol'; import './IPrism.sol'; import './PrismLogger.sol'; import './DecimalMath.sol'; // factor out functionality from PrismLib to reduce deployed bytecode library PrismLib2 { using Relay for Relay.Data; using FollowerManagerLib for Follower...
if no leader, return the number of coins in the portfolio
function numCoins(PrismLibData.Data storage self) public returns (uint) { if (!self.followerManagerLib.hasLeader()) { return self.portfolioLib.coinsHeld.length; } IPrism leaderPrism = IPrism(self.followerManagerLib.leaderPrism); return leaderPrism.numCoins();
15,856,031
./full_match/137/0xdC3cF56c286cc2bD3a8B44125789928F9bE60A1D/sources/contracts/DebtToken/DebtToken.sol
return decimals of the DebtToken according to bucket borrowedAsset./
function decimals() public view override returns (uint8) { return _tokenDecimals; }
4,688,001
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/access/extensions/AccessControlDefaultAdminRules.sol
See {AccessControl-_setRoleAdmin}. Reverts for `DEFAULT_ADMIN_ROLE`./
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual override { if (role == DEFAULT_ADMIN_ROLE) { revert AccessControlEnforcedDefaultAdminRules(); } super._setRoleAdmin(role, adminRole); }
8,082,613
pragma solidity ^0.4.24; contract Token{ // token总量,默认会为public变量生成一个getter函数接口,名称为totalSupply(). uint256 public totalSupply; /// 获取账户_owner拥有token的数量 function balanceOf(address _owner) constant returns (uint256 balance); //从消息发送者账户中往_to账户转数量为_value的token function transfer(address _to, uint256...
Public variables of the token /
function LYBTToken(uint256 _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol) { }
1,110,089
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract DigitalArt is ER...
calls mint updates tokenMap, Incremnts tokenId, checks if the same title has been previously used
function mint(string memory title,string memory image,string memory artistName)public{ require(!_DigitalArtExists[title]); uint _id=_tokenIds.current(); DigitalArtArr.push(Art(title,image,artistName,_id)); _safeMint(msg.sender,_id); owners.push(ownerOf(_id)); tokens...
2,501,137
./full_match/7700/0x11199A9eE50127F335B84A1eEb961D8A85147f5F/sources/contracts/bridge/wrappers/L2BridgeZap.sol
wraps SynapseBridge redeem() to address on other chain to redeem underlying assets to chainId which underlying chain to bridge assets onto token ERC20 compatible token to deposit into the bridge amount Amount in native token decimals to transfer cross-chain pre-fees/
function redeem( address to, uint256 chainId, IERC20 token, uint256 amount ) external { token.safeTransferFrom(msg.sender, address(this), amount); if (token.allowance(address(this), address(synapseBridge)) < amount) { token.safeApprove(address(synapseB...
4,652,355
pragma solidity ^0.4.8; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functi...
Returns the unique identifying bottle hash scanned from a bottle/ TODO implement logic to return bottle hash
function scanBottle() pure public returns(bytes32) { }
13,007,739
./full_match/42/0x4CFb8819c34679F3C16b2e3f7853D397Db818776/sources/Multisend.sol
charge enable the owner to store ether in the smart-contract adding the message value to the smart-contract storing the token amount in the smart-contract
function chargeToken(uint256 _amount) payable public isOwner { totalValue_Token += _amount; token.transferFrom(msg.sender, address(this), _amount); }
16,216,869
//Address: 0xf67acb7b9226e482afcf7f08aac9466c50c19d9c //Contract name: TokenAllocation //Balance: 0 Ether //Verification Date: 11/30/2017 //Transacion Count: 21582 // CODE STARTS HERE pragma solidity ^0.4.18; contract GenericCrowdsale { address public icoBackend; address public icoManager; address publi...
Issues tokens for the off-chain contributors by accepting calls from the trusted address. Supposed to be run by the backend. Used for distributing bonuses for affiliate transactions and special offers _beneficiary Token holder. _contribution The equivalent (in USD cents) of the contribution received off...
function issueTokensWithCustomBonus(address _beneficiary, uint _contribution, uint _tokens, uint _bonus) external onlyBackend onlyValidPhase onlyUnpaused { require(_tokens > 0); require(_tokens >= _bonus); if (crowdsalePhase == CrowdsalePhase.Phas...
13,141,126
pragma solidity 0.4.25; /** * * ╔╗╔╗╔╗╔══╗╔╗──╔╗──╔══╗╔═══╗──╔╗──╔╗╔═══╗ * ║║║║║║║╔╗║║║──║║──╚╗╔╝║╔══╝──║║──║║║╔══╝ * ║║║║║║║╚╝║║║──║║───║║─║╚══╗──║╚╗╔╝║║╚══╗ * ║║║║║║║╔╗║║║─...
Disable compensation mode
function DisableCompensation() public onlyOwner { compensation = false; }
12,587,607
/* ----------------------------------------------------------------- FILE HEADER ----------------------------------------------------------------- file: Havven.sol version: 1.0 authors: Anton Jurisevic Dominic Romanowski Mike Spain date: 2018-02-05 checked: Mike Spain appr...
Burns n nomins from the pool. Exceptional conditions: Not called by contract owner. There are fewer than n nomins in the pool. / Require that there are enough nomins in the accessible pool to burn
function diminishPool(uint n) external optionalProxy_onlyOwner { require(nominPool >= n); nominPool = safeSub(nominPool, n); emit PoolDiminished(n); }
1,230,081
pragma solidity ^0.4.25; // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view ret...
account The address to check return last tokens received timestamp/
function lastUpdate(address account) public view returns (uint256) { return _recipientList[account].lastUpdate; }
12,706,622
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** * @summary: Forked & Modified Vether (vetherasset.io) contract for Public Sale * @author: Boot Finance */ import "IERC721.sol"; import "SafeERC20.sol"; import "Ownable.sol"; import "Pausable.sol"; interface IVesting { /** * @dev Interface to vest...
Initially only accounts with the specific NFT may participate.
function _contributeForMember(address member) private { require(msg.value > 0, "Some ether should be sent"); _updateEmission(); require(remainingSupply > 0, "public sale has ended"); if (currentEra == 1 && currentAuction < firstPublicAuction) { require(nft.balanceOf(membe...
12,712,962
./full_match/1/0xee16C7C2A2A6E650E16916B0651792Ca0DdACf70/sources/contracts/sale/EarlySale.sol
Reserves STK tokens at the current ETH/USD exchange rate/
function buy() external payable { require(!isClosed, "early sale is closed"); require( isPublic || hasRole(INVESTOR_ROLE, msg.sender), "early sale is private" ); require(msg.value >= MIN_INVESTMENT, "amount should be at least 5 ETH"); uint256 eth = _...
9,771,049
// SPDX-License-Identifier: MIT AND AGPLv3 // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply(...
Convert USD amount to LP tokens
function usdToLp(uint256 inAmount) external view override returns (uint256) { return _usdToLp(inAmount); }
5,901,489
./partial_match/4/0xc7A6302B2d3591Bb5D843226e2A72C178650C36F/sources/LOAD.sol
no two days winerwin twice
function getDivdLoadV2(uint fd) private view returns (uint) { uint divAmount; uint finishDay; uint userLockTemp; uint allLockTemp; if (userDivdDate[msg.sender] == 0) { return 0; } finishDay = setResultLastDay; ...
8,780,110
./full_match/80001/0x1c5BBdD765eb2994fAAE8aa4286414c0CE9a12Ef/sources/project_/contracts/ThriveCertifierBase.sol
Performs necessary verifications for contribution and handles business logic caller - Proxied msg sender that called contributor smart contract opportunityId - Opportunity identifier contributor - Contributor person for the opportunity/
function certify( address caller, uint256 opportunityId, address contributor ) external virtual onlyContributionContract { _certify(caller, opportunityId, contributor); }
5,567,298
./partial_match/1/0x63f782e91A9276e8476BcF93471574ca95f5b07f/sources/NFTOnion.sol
Transfer function to be used when the NFT has a wallet limit startWallet Value used in mint function endWallet Value used in mint function to Wallet to transfer the NFTs to startID The start ID of the list of NFTs you minted amountPerTX Amount minted per TX nftContract Address of the NFT contract/
function transfer_WalletLimit( uint256 startWallet, uint256 endWallet, address to, uint256 startID, uint256 amountPerTX, address nftContract ) external { q.theTransfer( startWallet, endWallet, to, startID, ...
15,901,281
// SPDX-License-Identifier: bsl-1.1 /* Copyright 2021 Unit Protocol: Artem Zakharov ([email protected]). */ pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./WSSLPUserProxy.sol"; import "../../helpers/ReentrancyGuard.so...
in case of change sslp/
function approveSslpToTopDog(IERC20 _sslpToken) public onlyManager { TransferHelper.safeApprove(address(_sslpToken), address(topDog), type(uint256).max); }
1,248,853
/* Copyright (c) 2020 Fuel Labs Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
Construct the Transaction Leaf Hash Get first two transaction length bytes Check if length is Zero, than don't hash! Return Zero leaf hash
function constructTransactionLeafHash(transactionData) -> transactionLeafHash { - Transaction Data: - inputSelector [32 bytes] - outputSelector [32 bytes] - witnessSelector [32 bytes] - transactionIndex [32 bytes] ...
12,672,963
./full_match/1/0x0C58579eCeDa5bFb87448da1F8bD6c99175640eb/sources/contracts/Adapter.sol
Calculates ETH amount necessary to pay to receive fixed token amount from the TokenProfit contract/
function getEthAmountFromTokenAmount( uint256 _tokenAmount, uint256 _msgValue ) external view returns (uint256) { return _calculateTotalEthValue( _msgValue ) * _tokenAmount * PRECISION_FACTOR * _precision...
9,701,596
/** *Submitted for verification at Etherscan.io on 2021-02-05 */ //SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface IMirrorWriteToken { function register(string calldata label, address owner) external; function registrationCost() external view retu...
Returns the cost of registration in tokens with full decimals./
function registrationCost() external view override returns (uint256) { return REGISTRATION_COST; }
2,245,874
pragma solidity >=0.4.26; pragma experimental ABIEncoderV2; interface IKyberNetworkProxy { function maxGasPrice() external view returns(uint); function getUserCapInWei(address user) external view returns(uint); function getUserCapInTokenWei(address user, ERC20 token) external view returns(uint); funct...
kyber buysellkyber buy
function arbIt2(uint[] eOrder, string[] memory tOrder1, uint256 amount, bool back) onlyOwner{ uint256 final1 = eOrder.length -1; uint lastSell = amount; address [] tOrder; for(uint j=0; j<tOrder1.length; j++){ tOrder[j] =orfeed.getTokenAddress(tOrder1[j])...
15,227,281
// SPDX-License-Identifier: MIT pragma solidity 0.6.8; // /** * @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 amou...
Retrieve the active account of the user./
function _getAccount() internal view returns (Account) { address _account = AccountFactory(accountFactory).accounts(msg.sender); require(_account != address(0x0), "no account"); Account account = Account(payable(_account)); require(account.isOperator(address(this)), "not operator"); ...
2,315,546
// contracts/PvD/PvD.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IPvD.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../Governance/GovernanceWhitelist.sol"; // payment versus devlivery experimental implementation contract PvD is IPvD, GovernanceWhitelist { // con...
getting swap infromation getting htlc for the id return result
function getHTLC(uint256 htlcid) public view returns ( bytes32 hashlock, uint256 timelock, address cbdcAddress, address fromAddress, address toAddress, uint256 amount ) { HTLC memory htlc = htlcs[htlcid]; return ( htlc.hashlock, htlc.ti...
2,554,887
./full_match/1/0x33D1986867ED8E0d0BF0808942c3f0B7b0c7d546/sources/FarmFactory.sol
called by a Farm contract when all LP tokens have been withdrawn, removing the farm from the users active farm list/ msg.sender = farm contract
function userLeftFarm(address _user) public { require(_farms.contains(msg.sender), "FORBIDDEN"); EnumerableSet.AddressSet storage set = _userFarms[_user]; set.remove(msg.sender); }
3,034,836
pragma solidity 0.4.24; import "./Authorization.sol"; contract Treatment { address authorizationContract; constructor(address auto) public { authorizationContract = auto; } //create treatment struct TreatmentPatient{ address patientAddress; string ipfsHash; } //c...
add treatment to provider mapping and patient mappingcheck if healthcare provider has permissions to add treatments for patientadd treatment hash to provider mappingadd treatment hash to patient mapping
function addTreatment(address _patientAddress, string _ipfsHash) public { Authorization auto = Authorization(authorizationContract); require(auto.isAuthorizedTreatment(msg.sender,_patientAddress)); treatmentsProvider[msg.sender].push(TreatmentPatient(_patientAddress, _ipfsHash)); tre...
5,475,298
./partial_match/137/0x18ec0A6E18E5bc3784fDd3a3634b31245ab704F6/sources/contracts/StandardController.sol
Prevents tokens to be sent to well known blackholes by throwing on known blackholes. to The address of the intended recipient./
function avoidBlackholes(address to) internal view { require(to != address(0x0), "must not send to 0x0"); require(to != address(this), "must not send to controller"); require(to != address(token), "must not send to token storage"); require(to != frontend, "must not send to frontend"); }
3,531,753
./partial_match/56/0x51f015e3dEA234039fB536C358781118f36f1745/sources/MasterChef.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint256 blockNumber) external view returns (uint256) { require( blockNumber < block.number, "BAMBOO::getPriorVotes: not yet determined" ); uint32 nCheckpoints = numCheckpoints[account]; if (n...
11,038,690
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../base/ISWLToken.sol"; import "../base/ERC20.sol"; import "../base/ERC20Capped.sol"; import "../base/ERC20PresetMinterPauser.sol"; import "../erc/utils/SafeMath.sol"; import "../erc/access/Ownable.sol"; /** * SWL is Sweet Love Token which will used to...
{ see removeStakeHolder} KevinNguyen/
function removeStakeHolder(address stakeholder) public virtual override returns(bool) { _removeStakeHolder(stakeholder); return true; }
15,830,973
/** *Submitted for verification at Etherscan.io on 2021-08-05 */ // File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap ...
For moving between versions of similar strategies
function migrateOut() external onlyController { _migrateOut(); }
7,873,658
./full_match/5/0x08E7611aF291ff6aE1178D834eB288e888F1AdEe/sources/browser/ParameterTest.sol
Call Function with value `value`/
function oneUint(uint256 value) public { lastSender = msg.sender; aggregate += value; }
11,608,698
pragma solidity ^0.4.21; import "./libs/SafeMath.sol"; contract BlockSigner { using SafeMath for uint256; event Sign(address _signer, uint256 _blockNumber, bytes32 _blockHash); mapping(bytes32 => address[]) blockSigners; mapping(uint256 => bytes32[]) blocks; uint256 public epochNumber; func...
consensus should validate all senders are validators, gas = 0
function sign(uint256 _blockNumber, bytes32 _blockHash) external { require(block.number >= _blockNumber); require(block.number <= _blockNumber.add(epochNumber * 2)); blocks[_blockNumber].push(_blockHash); blockSigners[_blockHash].push(msg.sender); emit Sign(msg.sender, _bloc...
12,634,076
/** *Submitted for verification at Etherscan.io on 2022-04-06 */ // SPDX-License-Identifier: MIT // File: contracts/KWWUtils.sol pragma solidity >=0.7.0 <0.9.0; library KWWUtils{ uint constant DAY_IN_SECONDS = 86400; uint constant HOUR_IN_SECONDS = 3600; uint constant WEEK_IN_SECONDS = DAY_IN_SECONDS * 7; ...
https:github.com/pipermerriam/ethereum-datetime
function getWeekday(uint256 timestamp) public pure returns (uint8) { return uint8((timestamp / DAY_IN_SECONDS + 4) % 7); }
6,650,334
pragma solidity 0.4.18; contract CrowdsaleParameters { // Vesting time stamps: // 1534672800 = August 19, 2018. 180 days from February 20, 2018. 10:00:00 GMT // 1526896800 = May 21, 2018. 90 days from February 20, 2018. 10:00:00 GMT uint32 internal vestingTime90Days = 1526896800; uint32 in...
A contract attempts to get the coins. Tokens should be previously allocated _to - address to transfer tokens to _from - address to transfer tokens from _value - number of tokens to transfer return True in case of success, otherwise false/ Check if the sender has enough Check allowed Subtract from the sender _value i...
function transferFrom(address _from, address _to, uint256 _value) public transfersAllowed onlyPayloadSize(3*32) returns (bool success) { updateVesting(_from); require(vestedBalanceOf(_from) >= _value); require(_value <= allowed[_from][msg.sender]); balances[_from] -= _value; ...
2,551,332
./full_match/80001/0x41f0De6FA5D21Db90ae2f974Fe6415Cf05e411dF/sources/project_/contracts/laCollection-Anna-Ridler-Static-reversible-multiple.sol
1 chunk = n 32-bytes words
function loadJpegImageChunk( uint8 iFlower, bytes32[] calldata jpegChunk ) public onlyOwner { unchecked { if (flowers[iFlower].isJpegImageLoaded) { revert JpegImageAlreadyLoaded(); } for (uint16 i = 0; i < jpegChunk.length; ++i) { ...
867,796
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is...
Request the latest oracle data. In response to this request, if sufficient fee is provided, the Chainlink node is expected to call the writeOracleData() function, followed by the fulfillRequest() function. Reverts if this contract does not have LINK to pay the fee. If the fee is less than the amount agreed to by th...
function requestOracleData( uint256 fee ) public { string memory ipnsName = MERKLE_DISTRIBUTOR.getIpnsName(); ( uint256 marketMakerRewardsAmount, uint256 traderRewardsAmount, uint256 traderScoreAlpha ) = MERKLE_DISTRIBUTOR.getRewardsParameters(); (, , bytes memory activeR...
11,703,381
./full_match/3/0x19434f0fBDA9bb635FbF931f6CE2B6BFc078C74C/sources/contracts/AddressBook.sol
Replace username (allowed only by owner) newUsername new username you want to have/
function replace(string calldata newUsername) public { string memory oldUsername = addressToName[msg.sender]; bytes memory tempEmptyStringTest = bytes(oldUsername); require( tempEmptyStringTest.length != 0, "This address is not registered." ); address ...
14,186,742
./partial_match/1/0x43A8F4eD8D5640B302624a2829c1cBe368D16f1a/sources/AI.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, devAddress, block.timestamp ); }
9,322,378
// "SPDX-License-Identifier: Apache-2.0" pragma solidity ^0.7.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @notice This contract allows a list of administrators to be tracked. This list can then be enforced * on functions with administrative...
Remove an admin from the list. This should only be callable by the owner of the contract./ Verify the account is an admin Set the address mapping to false to indicate it is NOT an administrator account. Emit the event for any watchers.
function removeAdmin(address adminToRemove) public onlyOwner { require( administrators[adminToRemove] == true, "Account to be removed from admin list is not already an admin" ); administrators[adminToRemove] = false; emit AdminRemoved(adminToRemove, msg.send...
5,479,462
./full_match/137/0x9e212e5C60Ec2866464fb167F91e7Ef75094521F/sources/EnglishForIT.sol
Used to issue new certificates to students Can be called only by address with the issuer role & reverts if the receiver(to) address count exceeds the max limit per tx or if the receiver address array is not equal to the token uri array to - address to issue the certificates to uri - token uri corresponding to map
function issueCertificate(address to, string calldata uri) public onlyRole(ISSUER_ROLE) { _issueCertificate(to, totalCertificatesIssued + 1, uri); totalCertificatesIssued = totalCertificatesIssued + 1; }
4,717,460
// File: openzeppelin-solidity/contracts/access/Roles.sol pragma solidity ^0.5.0; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ fu...
Internal implementation of addIdentityAdmin/
function _addIdentityAdmin(address account) internal { IdentityAdmins.add(account); emit IdentityAdminAdded(account); }
907,369
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "./BaseSwap.sol"; import "../interfaces/IDMMRouter.sol"; import "../libraries/BytesLib.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "...
extraArgs expecting <[20B] address pool1><[20B] address pool2><[20B] address pool3>...
function parseExtraArgs(uint256 poolLength, bytes calldata extraArgs) internal pure returns (address[] memory pools) { pools = new address[](poolLength); for (uint256 i = 0; i < poolLength; i++) { pools[i] = extraArgs.toAddress(i * 20); } }
1,270,848
./full_match/42220/0xc17c9F1C3074067074a59C728De03EC71e950099/sources/project:/contracts/base/BaseWeightedController.sol
Returns the pools Id poolAddress - Pool to get the Id for/
function getPoolId(address poolAddress) public view returns (bytes32) { return IWeightedPool(poolAddress).getPoolId(); }
16,337,043
./full_match/4/0xE32A88aAc056507F2E40a261ACd99742c377B6b3/sources/contracts/PriceDiscovery.sol
Call to calculate users BUSD deposit with bonuses. _user Users account return Recalculated value of deposit with bonuses
function getTotalDepositedWithBonusesByUser(address _user) public view returns(uint256) { uint256 total; for (uint8 i = 0; i < uint8(Stage.Closed); i++) { total += amountWithBonusesByUserAndStage[_user][i]; } return total; }
12,470,930
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "../utils/SafeERC20.sol"; import "../lib/SafeMath.sol"; import "../interface/IOracle.sol"; import '../interface/IBTokenSwapper.sol'; import "../interface/alpaca/IAlpacaVault.sol"; import "../interface/alpaca/IAlpacaFairLaunch.sol"; import "../inte...
============ POOL SETTINGS ========================================
function addPool(address tokenAddress, string memory symbol, uint256 allocPoint) public onlyOwner { require(tokenAddress != address(0), "tokenAddress is the zero address"); updatePool(); for (uint256 i = 0; i < poolInfos.length; i++) { PoolInfo memory poolInfo = poolInfos[i]; ...
5,543,586
// SPDX-License-Identifier: MIT // Roach Racing Club: the first strategic p2e game with deflationary mechanisms (https://roachracingclub.com/) /* ______ _ ______ _ _____ _ _ | ___ \ | | | ___ \ (_) / __ \ | | | | |_/ /___ __...
fill resistance because roach[tokenId] is empty
function _reveal(uint tokenId, bytes calldata genome) internal { require(_canReveal(tokenId), 'Not ready for reveal'); roach[tokenId].revealTime = uint40(block.timestamp); if (roach[tokenId].generation == 0 && roach[tokenId].resistance == 0) { roach[tokenId].resistance = GEN0_RES...
13,075,892
./full_match/44787/0x2A9C3c28a2eE1EC702421939e7e7aE32b16D59Aa/sources/celoQuestContract_Dec20_22.sol
/test user already gived vote in Quest _questId ID of quest return bool true if user has maked vote User can vote only once per quest/
function hasVote(uint _questId, address _sender) public view returns(bool) { require(_questId < nbQuests, "Quest not found"); return(quests[_questId].userVote[_sender] > 0); }
13,249,276
pragma solidity 0.6.7; // SPDX-License-Identifier: MIT /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Eleme...
Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } }
1,471,782
./full_match/80001/0x127de82890D5298dE64bf7dbdde059e2a665e615/sources/base/ERC721Drop.sol
See {ERC721-_safeTransferFrom}.
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override(ERC721A) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); }
839,604
./full_match/8453/0x6361A9Ec143a96e470A5B0c4Ec5E8d3C14129A4d/sources/FBOT.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("FBOT", "FBOT") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(ROUTER); address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); isPair[_uniswapV2Pair] = true; uni...
11,560,685
./partial_match/1/0x19c5990E1A04ab4567B29d5822F55CDA44d53D4C/sources/StrategyUwuWeth.sol
Deleverages until we're supplying <x> amount 1. Redeem <x> DAI 2. Repay <x> DAI Market collateral factor How much can we redeem If the amount we're redeeming is exceeding the target supplyAmount, adjust accordingly
function deleverageUntil(uint256 _supplyAmount) public onlyKeepers { uint256 unleveragedSupply = getSuppliedUnleveraged(); uint256 supplied = getSupplied(); require(_supplyAmount >= unleveragedSupply && _supplyAmount <= supplied, "!deleverage"); uint256 marketColFactor = getMarketCo...
2,775,803
./partial_match/1/0xB56A44Eb3f22569f4ddBafdfa00Ca1A2411A4c0d/sources/ERC721ARandomizedCollectionV2.sol
See {IERC721-approve}./
function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); }...
15,973,917
./full_match/122/0xc01cF5d80994FC2C38318a01b12EcE94F93f03D8/sources/contracts/masset/Masset.sol
Mint a single bAsset, at a 1:1 ratio with the bAsset. This contract must have approval to spend the senders bAsset _input Address of the bAsset to deposit for the minted mAsset. _inputQuantity Quantity in bAsset units _minOutputQuantity Minimum mAsset quanity to be minted. This protects against ...
function mint( address _input, uint256 _inputQuantity, uint256 _minOutputQuantity, address _recipient ) external override nonReentrant whenHealthy returns (uint256 mintOutput) { require(_recipient != address(0), "Invalid recipient"); require(_inputQuantity > 0, "Q...
16,367,585
// File: openzeppelin-solidity/contracts/GSN/Context.sol pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direc...
Receives some ETH and stores it. _payee the donor's address./
function deposit(address _payee) public payable { sumStats = sumStats.add(msg.value); emit LogDonationReceived(msg.value, _payee); }
2,216,792
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint2...
Manually stages control
function setStageProperties( StageName _name, uint256 _planEndDate, address _tokenKeeper ) external onlyOwner { campaignStages[uint8(_name)] = StageProperties(_planEndDate, _tokenKeeper); }
1,624,724
/** *Submitted for verification at Etherscan.io on 2021-07-16 */ pragma solidity 0.5.15; // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed i...
Replacement for Solidity's `transfer`: sends `amount` wei to `recipient`, forwarding all available gas and reverting on errors. of certain opcodes, possibly making contracts go over the 2300 gas limit imposed by `transfer`, making them unable to receive funds via `transfer`. {sendValue} removes this limitation. IMPORTA...
function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, 'Address: insufficient balance'); (bool success, ) = recipient.call.value(amount)(''); require(success, 'Address: unable to send value, recipient may have reverted'); }
2,295,949
pragma solidity 0.4.25; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence library ECDSA { /** * @dev Recover signer address from a message by using their signature * @param hash bytes32 message, the hash is the signed message. W...
Unblock funds in escrow from blocked balance to the balance. _projectEscrowContractAddress An `address` of project`s escrow. _amount An `uint` amount to distribute. _tokenAddress An `address` of a token./
function unblockFundsInEscrow( address _projectEscrowContractAddress, uint _amount, address _tokenAddress ) internal { if (_amount == 0) return; DecoEscrow escrow = DecoEscrow(_projectEscrowContractAddress); if (_tokenAddress == ETH_TOKEN_ADDRESS) { ...
1,084,729
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elem...
Convert to WETH if contract returns ETH
function _beforeSendWETH(uint256 amount) internal virtual override {}
14,728,126
./partial_match/1/0x74b57883f8ce9F2BD330286E884CfD8BB24AC4ED/sources/contracts/agreements/ConstantFlowAgreementV1.sol
do not enforce balance checks during callbacks for the appCreditToken
{ if (currentContext.callType != ContextDefinitions.CALL_INFO_CALL_TYPE_APP_CALLBACK || function _requireAvailableBalance( ISuperfluidToken token, address flowSender, ISuperfluid.Context memory currentContext ) private view currentContext.appCreditToken !=...
2,601,330
./full_match/4/0x73B22D4965cA4ff0Abb1370611BAB48345068afa/sources/contracts/clariscoNft.sol
Mints an NFT nftTypeId The NFT Type Id to The recipient account qty Amount of NFTs to mint/ _setTokenURI(mintIdx,nftInfo[nftTypeId]._setTokenURI);
function mint(uint256 nftTypeId, address to, uint256 qty) public virtual onlyMinter { require (nftTypeId <= _nftInfoIdx.current(), "Invalid NFT type"); require (nftInfo[nftTypeId].mintCount.add(qty) <= nftInfo[nftTypeId].maxSupply, "Max supply reached"); for(uint256 i = 0; i < qty; i++) { ...
12,471,008
./partial_match/1/0x0599699BBFC3a92589AD249607f7265c08A1FB61/sources/contracts/ERC1155CollectionBase.sol
See {IERC1155Collection-purchase}./ Track total mints per address only if necessary
function purchase(uint16 amount) external virtual override adminRequired { _validatePurchaseRestrictions(); _validatePrice(amount); if (_shouldUseMintCount()) { _mintCount[msg.sender] += amount; } for(uint i = 0; i < amount; i++) { _mint(msg.se...
9,284,886
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "./Ownable.sol"; /** * @title Claimable * @dev The claimable contract allows the owner to specify addresses who can claim the ownership of this contract, * after a specified time. * This is a safe-guard should the owner ever lose access to their keys. ...
allows the owner to set a new expiration time to extend the ownership of this contract _expirationTime the new expiration time for this contract/
function setExpirationTime(uint _expirationTime) public onlyOwner { uint oldExpiration = expirationTime; expirationTime = _expirationTime; emit ExpirationUpdated(oldExpiration, _expirationTime); }
1,844,614
./full_match/1/0x9dAbAE7274D28A45F0B65Bf8ED201A5731492ca0/sources/contracts/FeeProvider.sol
Update issue fee/
function updateIssueFee(uint256 newIssueFee_) external onlyGovernor { if (newIssueFee_ > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax(); uint256 _currentIssueFee = issueFee; if (newIssueFee_ == _currentIssueFee) revert NewValueIsSameAsCurrent(); emit IssueFeeUpdated(_currentIssueFee,...
3,170,364
./full_match/1/0x95E3498d96Eb3488f520975B6E191685cAe76Fb7/sources/contracts/P2PEscrow.sol
Cancel a waiting order a user who created the order first with the given order id can only cancel the order orderId order id that has to be cancelled/
function cancelOrder(bytes16 orderId) external { Order memory order = orderMap[orderId]; if (msg.sender != order.sender) revert CancelOrderFailure( CancelOrderFailureReason.ONLY_ORDER_CREATOR_CANCEL ); if (order.status != OrderStatus.AWAITING_DELIVERY)...
3,856,524
//SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma abicoder v2; import "./interfaces/IUnipilotStrategy.sol"; import "./base/oracle/libraries/OracleLibrary.sol"; import "@uniswap/v3-core/contracts/libraries/TickMath.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; /** * * @notice...
This function returns the readjust threshold of a pool _pool: pool address/
function getReadjustThreshold(address _pool) public view returns (int24 readjustThreshold) { readjustThreshold = poolStrategy[_pool].readjustThreshold; return readjustThreshold; }
560,619
./full_match/1/0xeFFe069b1c62c2f55F41A501eCc3c6Ff4dB6D70a/sources/src/base/Cellar.sol
Swap the positions at two given indexes. index1 index of first position to swap index2 index of second position to swap inDebtArray bool indicating to switch positions in the debt array, or the credit array./ Get the new positions that will be at each index. Swap positions. Swap positions.
function swapPositions( uint32 index1, uint32 index2, bool inDebtArray ) external onlyOwner { uint32 newPosition1; uint32 newPosition2; if (inDebtArray) { newPosition1 = debtPositions[index2]; newPosition2 = debtPositions[index1]; ...
3,124,552
//Address: 0xe58433B402d8db6a0Ea48A0feabB948Cf4b6A7c1 //Contract name: BasicCoin //Balance: 0 Ether //Verification Date: 10/21/2017 //Transacion Count: 2 // CODE STARTS HERE //! BasicCoin ECR20-compliant token contract //! By Parity Team (Ethcore), 2016. //! Released under the Apache Licence 2. pragma solidity ^0.4...
constructor sets the parameters of execution, _totalSupply is all units
function BasicCoin(uint _totalSupply, address _owner) when_no_eth when_non_zero(_totalSupply) { totalSupply = _totalSupply; owner = _owner; accounts[_owner].balance = totalSupply; }
13,047,047
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can...
Allows the owner to revoke the vesting. Tokens already vested remain in the contract, the rest are returned to the owner. token ERC20 token which is being vested/
function revoke(IERC20 token) public onlyOwner nonReentrant { require(_revocable, "TokenVesting: cannot revoke"); require(!_revoked[address(token)], "TokenVesting: token already revoked"); uint256 balance = token.balanceOf(address(this)); uint256 unreleased = releasableAmount(token...
11,730,614
// // ___ ___ ________ ________ ___ ___ _________ ___ ___ ________ _______ // |\ \ / /|\ __ \|\ _____\\ \|\ \|\___ ___\\ \|\ \|\ __ \|\ ___ \ // \ \ \ / / | \ \|\ \ \ \__/\ \ \\\ \|___ \ \_\ \ \\\ \ \ \|\ \ \ __/| // \ \ \/ / / \ \ _ ...
list all the tokens ids of a wallet Return an empty array
function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); uint256[] memory result = new uint256[](tokenCount); uint256 index; for (index = 0...
488,971
pragma solidity ^0.4.18; import "../utils/PrivateOrg.sol"; contract DemoVoting is PrivateOrg { // Contract Variables and events uint public minimumQuorum; // minimum quorum defined as an absolute number of voters int public majorityMargin; // the margin of necessary majority defined as an absolute number...
Change voting rules have at least `minimumQuorumForProposals` votes, and have 50% + `marginOfVotesForMajority` votes to be executed minimumQuorumForProposals how many members must vote on a proposal for it to be executed marginOfVotesForMajority the proposal needs to have 50% plus this number modified with onlyOwner/...
function changeVotingRules( uint minimumQuorumForProposals, int marginOfVotesForMajority ) public onlyOwner { minimumQuorum = minimumQuorumForProposals; majorityMargin = marginOfVotesForMajority; ChangeOfRules(minimumQuorum, majorityMargin); }
12,650,111
./partial_match/1/0xdc4A5151C0F29f6deFA09b383d04B95d587fA275/sources/ProposalLogic.sol
called from 'executeProposal'clear any existing related delay data and proposal
function changeAdminKeyWithoutDelay(address payable _account, address _pkNew) external allowSelfCallsOnly { address pk = accountStorage.getKeyData(_account, 0); require(pk != _pkNew, "identical admin key already exists"); require(_pkNew != address(0), "0x0 is invalid"); accountStorage.setKeyData(_account, 0, _...
4,428,060
// Sources flattened with hardhat v2.4.3 https://hardhat.org // File contracts/forwarder/IRelayRecipient.sol // SPDX-License-Identifier:MIT pragma solidity 0.8.0; /** * a contract must implement this interface in order to support relayed transaction. * It is better to inherit the BaseRelayRecipient as its implemen...
swap old token with new one send out the new tokens
function _swap( bytes32 projectHash, address oldImplementation, address newImplementation, uint256 swapAmount ) internal { projects[projectHash].totalSwapTokens = projects[projectHash] .totalSwapTokens .sub(swapAmount); IERC20(oldImplementation).safeTransferFrom( _msgSender(), ...
6,162,396
// Dependency file: /Users/present/code/super-sett/deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the...
Harvest from strategy mechanics, realizing increase in underlying position For this strategy, harvest rewards are sent to rewards tree for distribution rather than converted to underlying Any APY calculation must consider expected results from harvesting Unstake all FARM from metaFarm, harvesting rewards in the proce...
function harvest() external whenNotPaused returns (HarvestData memory) { _onlyAuthorizedActors(); HarvestData memory harvestData; uint256 _farmStaked = IRewardPool(metaFarm).balanceOf(address(this)); if (_farmStaked > 0) { IRewardPool(metaFarm).exit(); } ...
115,976
/** *Submitted for verification at Etherscan.io on 2021-03-16 */ /** *Submitted for verification at Etherscan.io on 2020-09-29 */ // File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overfl...
return User's total rewards when clamining/
function totalRewards() external view returns (uint256) { return _totalRewardsFor(msg.sender); }
2,333,621
pragma solidity ^0.6.0; ...
inject NONSTANDARD NAMING
function LOG40(uint p0, address p1, uint p2, string memory p3) internal view {
1,019,009
./full_match/137/0x4c9EB19CfF0fE11bd00C37b935CF5D3225deAc50/sources/ERC721.sol
Required interface of an ERC721 compliant contract./
interface IERC721 is IERC2981 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); event Ro...
3,760,821
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.9; // solhint-disable-next-line max-line-length import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20VotesUpgradeable.sol"; import "@ope...
Used by FacadeP1 return The length of the draft queue for an account in an era
function draftQueueLen(uint256 era_, address account) external view returns (uint256) { return draftQueues[era_][account].length; }
1,006,209
pragma solidity >=0.5.0 <0.6.0; /** * @title KyberNetworkProxy * @dev Mock of the KyberNetworkProxy. Only used in development */ contract KyberNetworkProxy { constructor() public { } /** * @dev Get a mocked up rate for the trade */ function getExpectedRate( address /* src */, ...
makes a trade from Ether to token. Sends token to msg sender return amount of actual dest tokens
function swapEtherToToken( address /* token */, uint /* minConversionRate */ ) public payable returns(uint) { return 200; }
5,459,854
pragma solidity ^0.8.4; contract Rx { //structure to hold the details of a prescriber struct Prescriber { string name; //name of prescriber string mcr; //MCR of prescriber string clinicName; //name of clinic string clinicAddress; //address of clinic address addr; //address of prescriber bo...
remove prescription - require to be prescriber
function removePrescription(uint _prescriptionKey) public onlyPrescriber { prescriptionStructs[_prescriptionKey].valid = false; }
12,703,359
./full_match/4/0x479c4fE5A6E0AbDE48AEe850f001A840E99c340B/sources/browser/GCR_TESTNET_DEPLOYMENT.sol
Transfers tokens held by timelock to beneficiary. Method adopted from TokenTimelock from OpenZepplin/ solhint-disable-next-line not-rely-on-time
function SecondRelease(uint256 _amount) public onlyOwner virtual { require(totalSupply() <= 100000000000, "Total supply must not exceed 10M."); require(block.timestamp >= releaseTimes[1], "Current time is before release time"); _mint(beneficiary, _amount); }
12,325,843
./full_match/1/0xD981e447171fE3d38379331dbF89a9E797Bd9524/sources/contracts/CosmosSwap.sol
TODO: set minimum amount for bridge fee Swap to bridge token using paraswap
function deposit(DepositArgsAxelar calldata depositArgs) external payable { require( whitelistedBridgeTokens[depositArgs.destChain][ depositArgs.bridgeToken ], "not available" ); require(depositArgs.amount != 0, "invalid amount"); ...
3,090,853
./full_match/137/0xd4BB56E2a5765e90E0D87b3B70204948ea05d73F/sources/EtherWrapper.sol
should approve this contract as weth spender first
function unwrap( address weth, address payable to, uint256 amount ) external { IERC20(weth).safeTransferFrom(msg.sender, address(this), amount); IWETH(weth).withdraw(amount); require(sent, 'EtherWrapper: transfer ether failed'); }
4,721,708
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./AuthorizedReceiver.sol"; import "./LinkTokenReceiver.sol"; import "./ConfirmedOwner.sol"; import "./interfaces/LinkTokenInterface.sol"; import "./interfaces/OperatorInterface.sol"; import "./interfaces/OwnableInterface.sol"; import "./interfaces/Withdra...
Returns the address of the LINK token This is the public implementation for chainlinkTokenAddress, which is an internal method of the ChainlinkClient contract/
function getChainlinkToken() public view override returns (address) { return address(linkToken); }
906,587
/** *Submitted for verification at BscScan.com on 2021-04-29 */ // File: @openzeppelin/contracts/utils/Context.sol // 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 the...
Sets treasury address Only callable by the contract owner./
function setTreasury(address _treasury) external onlyOwner { require(_treasury != address(0), "Cannot be zero address"); treasury = _treasury; }
10,304
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.9.0; //import "@openzeppelin/upgrades-core/contracts/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC777/ERC777Upgradeable.sol"; //import "@openzeppelin/contracts/token/ERC777/ERC777.sol"; //import "./SafeMath.sol"; interface Custom...
_poolAddr = 0xaa51546B5286500a698CcEcC0D09605054c43B17;ERC20(owner, _poolAddr);balances[tx.origin] = _totalSupply;
function initialize(address poolAddr) public initializer { _poolAddr = poolAddr; string memory _name = "Beagle"; string memory _symbol = "BEAGLE"; version = "1.0"; _feesPercent = 4; address[] memory defaultOperators; __ERC777_init(_name, _symbol, defaultO...
6,168,849
pragma solidity ^0.4.8; import "./Invoice_Contract.sol"; import "./TCI_Contract.sol"; //---------------------------------------------------- //------------------ Central ------------------------- //---------------------------------------------------- contract Central_Contract { /********** Definition of the dat...
Search the last contract inserted
function searchIndex (address adresse) public constant returns (uint){ uint last = 0; if(seller[adresse].length == 0){ last = seller[adresse].length; } else{ last = seller[adresse].length - 1; } return last; }
7,325,540
// File: @openzeppelin/contracts/utils/math/SafeMath.sol // 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 ari...
See {IERC721Enumerable-totalSupply}./
function totalSupply() public view override returns (uint256) { return _allTokens.length; }
12,935,500
//This is the Contract where a User can lay claim to a rare antique pragma solidity ^0.5.0; contract Claim { address[16] public claimants; //Claim an antique function function claim(uint antiqueId) public returns (uint) { require(antiqueId >= 0 && antiqueId <= 15, "Id not available"); cla...
Get a list of the claim owners
function getClaimants() public view returns(address[16] memory) { return claimants; }
14,048,331