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/1/0xa3Aaf0C2eB1931068a456491Ec5806360B572714/sources/src/wallets/BaseWallet.sol
Transfers Inscrb to a new wallet from current owner of inscrb to recipient of inscrb/ validate to/from set new owner reset approvals
function transferFrom(address from, address to) public virtual approvedOrOwner { require(getOwner() == from, "Transfer from incorrect owner"); require(to != address(0), "Transfer to the zero address"); owner = to; _approvedOperator = address(0); emit InscrbWallet_Transfer(...
16,488,849
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
See {ERC1155-_burn}./
function burn( address account, uint256 id, uint256 amount ) public { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "GenArtTokenAirdropPass: caller is not owner nor approved" ); _burn(account, id, amount); ...
11,994,836
// File: @pancakeswap\pancake-swap-lib\contracts\math\SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity >=0.4.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because pr...
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add( uint256 _allocPoint, IBEP20 _lpToken, uint16 _depositFeeBP, uint256 _lockPeriod, bool _withUpdate ) public onlyOwner { require( _depositFeeBP <= MAX_DEPOSIT_FEE, "add: invalid deposit fee basis points" ); requi...
2,536,759
//solium-disable linebreak-style pragma solidity ^0.4.24; library ExtendedMath { function limitLessThan(uint a, uint b) internal pure returns(uint c) { if (a > b) return b; return a; } } library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function m...
Returns all details about a proposal/
function getTokenProposalDetails(uint proposalID) public view returns(address, uint, uint, uint) { return IcaelumVoting(proposalList[proposalID].tokenContract).getTokenProposalDetails(); }
6,632,777
pragma solidity ^0.4.24; /* https://donutchain.io/ WARNING All users are forbidden to interact with this contract if this contract is inconflict with user’s local regulations and laws. DonutChain - is a game designed to explore human behavior via token redistribution through open source sm...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom( address _from, address _to, uint256 _value ) external returns (bool) { require(_value <= balances_[_from]); require(_value <= allowed_[_from][msg.sender]); require(_to != address(0)); balances_[_from] = balances_[_from].sub(_value); balances_[_to] = ...
913,188
./partial_match/80001/0x0AA4AA95DF0eC39340b8bAdf5778D21412375064/sources/ErneMaster.sol
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public validatePool(_pid) { uint256 _amount; PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; _amount = user.amount; user.amount = 0; user.rewardDebt = 0; pool.lpToken.safeTra...
8,797,778
pragma solidity ^0.4.25; /** * WHAT IS OpenEthereumToken? * OpenEthereumToken for general ethereum NFT token use; NFT Block Chain Token, URL link, Ethereum Interface, * Data Rewrite possible, On Chain Data Storage, Transfer of Token * * Pay to Recieve token Indivi...
Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator. _to address to be approved for the given token ID _tokenId uint256 ID of ...
function approve(address _to, uint256 _tokenId) public { address owner = ownerOf(_tokenId); require(_to != owner); require(msg.sender == owner || isApprovedForAll(owner, msg.sender)); tokenApprovals[_tokenId] = _to; emit Approval(owner, _to, _tokenId); }
6,822,129
/** *Submitted for verification at Etherscan.io on 2021-08-02 */ // File: @sygnum/solidity-base-contracts/contracts/helpers/Initializable.sol pragma solidity 0.5.12; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that ha...
Overload increaseAllowance validate sender and spender are whitelisted. spender address that will be allowed to transfer funds. addedValue amount of funds to added to current allowance./
function increaseAllowance(address spender, uint256 addedValue) public whenWhitelisted(spender) whenWhitelisted(msg.sender) returns (bool) { return super.increaseAllowance(spender, addedValue); }
2,087,958
./full_match/1/0xf0AfA19305473eDe1b033148FfaABa91B89f90b6/sources/src/ethereum/HourglassCustodianV2.sol
Allows user to deploy a vault and deposit into it. Allows for a single maturity creation, to create a whole tranche, use deployCustomTranche assetId The asset ID to deploy the vault for amount The amount to deposit into the vault maturityTimestamp The timestamp of the maturity return vault The address of the newly ...
function deployVaultAndDeposit( uint256 assetId, uint256 amount, uint256 maturityTimestamp, bytes calldata depositData ) external nonReentrant returns (address vault) { if(isPaused) revert IsPaused(); if(!assetIds[assetId].isActive) revert AssetNotActive(); ...
8,374,485
./partial_match/1/0x2c8652acBAba3d398952BD291b0baF29ba6f0ae8/sources/TubeChief.sol
transfer mintable token to development address
function transferDev(uint poolId) public onlyOwner { uint mintable = getExMintable(poolId, true); require(mintable > 0, 'TRANSFER_DEV_EMPTY'); ITubeToken(tube).farmMint(address(this), mintable); TransferHelper.safeTransfer(tube, devaddr, mintable); pools[poolId].lastDevBlockN...
2,688,751
./full_match/421613/0xa5fF5B8B70a33b24c28A4858aE48f3a21289097b/sources/project:/contracts/Additional.sol
Change admin wallet of the contract to a new account. Can only be called by the current owner./
function changeAdminRole(address newAdminRole) external onlyOwner { require(newAdminRole != address(0), "KR: new admin wallet is the zero address"); emit AdminRoleChanged(_adminRole, newAdminRole); _adminRole = newAdminRole; }
11,570,129
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../depositary/IDepositaryBalanceView.sol"; import "./IValidator.sol"; contract CollateralBala...
_permissibleImbalance New permissible imbalance value./
function changePermissibleImbalance(uint256 _permissibleImbalance) external onlyOwner { permissibleImbalance = _permissibleImbalance; emit PermissibleImbalanceUpdated(_permissibleImbalance); }
2,543,275
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; // Guess the number, win a prize! contract CashMoney { uint256 private current; uint256 private last; WinnerLog private winnerLog; uint256 private first; address public owner; uint256 public min_bet = 0.001 ether; uint256...
YOWO - You Only Win Once you win! should always be true
function do_guess(uint256 number) payable public onlyPlayer { require(msg.value >= min_bet && number <= 10); require(!winnerLog.isWinner(msg.sender)); Guess storage guess; guess.playerNo = players[msg.sender].playerNo; guess.time = now; guesses.push(...
15,870,901
./partial_match/8453/0x1Fa03219ff837C1Dfc629c5A8F834E47594fa1fd/sources/battledog.sol
Transfer Required Tokens to Weaponize NFTInitiate a 50% burn from the contract Regenerate NFT
function regenerate (uint256 _tokenId) public payable nonReentrant { require(!paused, "Paused Contract"); require(msg.sender == ownerOf(_tokenId), "Not your NFT"); require(_tokenId > 0 && _tokenId <= totalSupply(), "Not Found"); require(players[_tokenId].activate > 0, "Activate NFT")...
16,756,351
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.9; import { IJustCausePool, IJCDepositorERC721, IERC20, IPool, IPoolAddressesProvider, IWETHGateway } from './Interfaces.sol'; import { JCDepositorERC721 } from './JCDepositorERC721.sol'; import { JustCausePoolAaveV3 } from './JustCausePoolAaveV3.sol'; import "...
return address of base JCP, created on deployment/
function getBaseJCPoolAddress() public view returns(address){ return address(baseJCPool); }
5,345,749
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "../../core/DaoRegistry.sol"; import "../../extensions/bank/Bank.sol"; import "../../guards/MemberGuard.sol"; import "../../guards/AdapterGuard.sol"; import "../modifiers/Reimbursable.sol"; import "../interfaces/IVoting.sol"; import "./Voting.sol"; import ...
Allows DAO members to reveal specific leaf nodes of the voting tree (steps) if they are not found off-chain for any reason A step represents a vote of a DAO member, and the index indicates which index that member is stored in the DAO dao The DAO address proposalId The proposalId associated with the step index The i...
function requestStep( DaoRegistry dao, bytes32 proposalId, uint256 index ) external reimbursable(dao) onlyMember(dao) { Voting storage vote = votes[address(dao)][proposalId]; require(index > 0 && index < vote.nbMembers, "index out of bound"); uint256 currentFlag =...
12,867,991
./partial_match/1/0x3139059D0b23e88c5BA7E17cDC21cd6A860CB8bE/sources/ElonTweetCoin.sol
Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), reverting with custom message when dividing by zero. CAUTION: This function is deprecated because it requires allocating memory for the error message unnecessarily. For custom revert reasons use {tryMod}. Counterpart to Solidity's `%` o...
function mod( uint a, uint b, string memory errorMessage ) internal pure returns (uint) { unchecked { require(b > 0, errorMessage); return a % b; } }
4,246,207
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters...
Function to generate the hash value
function _generateRandomPower(uint i) internal view returns (uint) { uint random = uint(keccak256(abi.encodePacked(block.timestamp, i))); uint group = uint(random % 100) + 1; uint power = 100; uint[] memory provs = new uint[](5); if (mintPhases == 0) { ...
1,755,132
./partial_match/4/0x9619864B184FBbC4CF25FC0C75d8Dd88285Cd100/sources/FeePool.sol
Threshold is calculated from ratio % above the target ratio (issuanceRatio). 0 < 10%: Claimable 10% > above: Unable to claim Claimable if collateral ratio below target ratio Not claimable if collateral ratio above threshold
function _isFeesClaimableAndAnyRatesInvalid(address account) internal view returns (bool, bool) { (uint256 ratio, bool anyRateIsInvalid) = issuer() .collateralisationRatioAndAnyRatesInvalid(account); uint256 targetRatio = getIssuanceRatio(); if (ratio...
8,560,052
./full_match/43113/0x9369399d34EB686D6Ae12aC8ff3F50bcb4c7A5Bf/sources/contracts/nft_no_enumerable.sol
A distinct URI (RFC 3986) for a given NFT. _tokenId Id for which we want uri. return URI of _tokenId./
function tokenURI( uint256 _tokenId ) external view validNFToken(_tokenId) returns (string memory) { string memory currentBaseURI = _baseURI(); return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, _tokenId.toString(), baseExtension)) : "...
7,186,222
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/utils/EnumerableSet.so...
Set token in which contributions are accepted. _token Address of the token contract./
function setToken(address _token) external onlyOwner { nativeToken = ERC20(_token); emit TokenChanged(_token); }
14,027,306
// pragma solidity ^0.5.0; //pragma solidity >=0.4.21 <0.7.0; // version 6 is required for truffle build import "./Users.sol"; contract MedicalRecords { Users userContract; //constructor for usercontract constructor(Users usersAddress) public { userContract = usersAddress; } // medical re...
function to view medical record requirement that only patient can view this record if the msg.sender is a patient
function viewRecord(uint256 medicalRecordId) public view returns ( uint256, bytes32, uint256, uint256 ) { require( medicalRecordId <= numMedicalRecords, "Medical record does not exist." ); ...
1,831,653
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "./POWToken.sol"; /** * @title Tournament staking * @notice This contract set staking tournament. The player stake an amount and can get it at the end of the tournament * @dev Create several tournaments of staking with duration, theme and reward */ ...
Register a new player
function registerPlayer(uint _idTournament) public { require (multiverseData[msg.sender].isRegistered, "Non registered player"); require (tournaments[_idTournament].isActive, "this tournament doesn't exist"); require (tournaments[_idTournament].tournamentStatus == TournamentStatus.IsOn, "Tou...
1,047,169
./full_match/1/0xCd28c86b3Fd08b135F4e1c7c95e39cecD8F36E60/sources/project_/contracts/Raptors.sol
Set contract state to Setup/
function setStateToSetup() public onlyOwner { state = State.Setup; }
3,130,468
./full_match/3/0x549F5389F1fF1B09999791d320D18213d0C13bb1/sources/contracts/ownable.sol
Allows the current owner to relinquish control of the contract. Renouncing to ownership will leave the contract without an owner. It will not be possible to call the functions with the `onlyOwner` modifier anymore./
function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); }
8,147,436
./full_match/4/0x7396706659c5a394D122f89213706C7888e258cA/sources/FundRaising.sol
transfer record post
function buy(uint256 roundId, uint256 usdtAmount) public { require(roundId < rounds.length, "WRONG_ROUND_ID"); require(!paid[roundId][msg.sender], "ALREADY_BOUGHT"); Round storage round = rounds[roundId]; require(usdtAmount >= round.usdtMin, "LESS_THAN_MIN"); require...
752,871
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "./IVault.sol"; import "./IWeightedPool.sol"; import "../../external/gyro/ExtendedMath.sol"; import "../IPCVDepositBalances.sol"; import "../../oracle/IOracle.sol"; import "../../Constants.sol"; /// @title BPTLens /// @author Fei Protocol /...
See `scaledPow(uint256 base, uint256 exp, uint256 _decimals)`/
function scaledPow(uint256 base, uint256 exp) internal pure returns (uint256) { return scaledPow(base, exp, decimals); }
13,491,271
./full_match/42220/0xe3305d2c398B6AD1f2228621154a3Daf2a47f478/sources/project_/contracts/wrapped/moola/WrappedMToken.sol
Assign lastMBalance after we have unwrapped
function unwrap(uint256 debtAmount) external override { require(debtAmount > 0, "debtAmount cannot be 0"); uint256 toReturn = debtToUnderlying(debtAmount); totalUnredeemedFee = totalUnredeemedFee.add(pendingFee()); _burn(msg.sender, debtAmount); lendingPool.withdraw(address(token), toReturn, msg.s...
16,320,652
./full_match/43114/0x096F07be24Fb85528bf67f2790a3B72F764D4540/sources/artifacts/MasterChef.sol
Pay or lockup pending npt. reset lockup send rewards
function payOrLockupPendingNpt(uint256 _pid) internal { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; if (user.nextHarvestUntil == 0) { uint256 harvestIntervalRate = harvestTimerDynamic.getExactFarmHarvestIntervalBpForSpnH...
4,572,217
./full_match/1/0x23F8B0B57723bcD99D5Be4Cf4863E49D8092dC14/sources/contracts/LbdToken.sol
Notifies LbdToken contract about a new rebase cycle. supplyDelta The number of new LBD tokens to add into circulation via expansion. return The total number of LBD after the supply adjustment./
function rebase(uint256 epoch, int256 supplyDelta) external returns (uint256) { require(msg.sender == monetaryPolicy, "only monetary policy"); require(!rebasesPaused, "rebases paused"); if (supplyDelta == 0) { emit LogRebase(epoch, _totalSupply); ...
8,354,419
./full_match/1/0x567c09B55294998d7a6F2A3A948e8fD331531B88/sources/contracts/UMA/common/implementation/FixedPoint.sol
Whether `a` is greater than `b`. a a uint256. b a FixedPoint. return True if `a > b`, or False./
function isGreaterThan(uint256 a, Unsigned memory b) internal pure returns (bool) { return fromUnscaledUint(a).rawValue > b.rawValue; }
9,749,012
pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../interfaces/IMineToken.sol"; abstract contract MineTokenERC20 is IMineToken, ERC20 { bytes32 public DOMAIN_SEPARATOR; // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); ...
0xfbe3b124 bytes4(keccak256(bytes('MINT_TOKEN_IDENTITY_FUNCTION()')))
function MINT_TOKEN_IDENTITY_FUNCTION() external view returns(bytes4){ return 0xfbe3b124; }
2,525,968
./full_match/43114/0x2dCC8408890710AA69BC0c50cf98b92B1d3eb184/sources/project_/contracts/MasterChefV2.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.timestamp <= pool.lastRewardTime) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0 || pool.allocPoint == 0) { pool.lastR...
4,502,173
./full_match/1/0x57884b46d815d7cF42C04Cf226728a0D787eF58d/sources/JustRouter.sol
refund dust (trx, bsc, eth) if any
function addLiquidityBase(address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountBaseMin, address to, uint256 deadline) external virtual override payable ensure(deadline) returns(uint256 amountToken, uint256 amountBase, uint256 liquidity) { (amountToken, amountBase) = _addLiquidity...
9,618,349
// SPDX-License-Identifier: GPLv3 pragma solidity 0.8.13; import "./NFTBond.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; /** * @title ERC20NFTBond * @dev Contains functions related to bu...
Transfers from the buyer to this contract the principal token amount/
function _beforeBondPurchased( string calldata tokenUri, address beneficiary, uint256 maturity, uint256 principal ) internal override { super._beforeBondPurchased(tokenUri, beneficiary, maturity, principal); principalToken.safeTransferFrom(beneficiary, address...
18,781
pragma solidity ^0.4.18; /** * @title ERC20 Token Interface */ contract ERC20 { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, add...
check hard cap again
function finishMinting() public mintingInProgress onlyOwner { assert(totalSupply <= maxSupply); mintingDone = true; }
13,799,996
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.6.7 https://hardhat.org // File contracts/Math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. T...
Used by some functions.
function freeCollatBalance(uint256 col_idx) public view returns (uint256) { return ERC20(collateral_addresses[col_idx]).balanceOf(address(this)).sub(unclaimedPoolCollateral[col_idx]); }
448,574
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./Krause.sol"; // This example was taken from the code examples on: // https://ethereum.org/en/ contract Vote is ERC20 { // An address is comparable to an email address - it's used to identify ...
Stake $KRAUSE to get whitelisted check minimum stake! send $KRAUSE to contract add delegate
function stake(uint _stake) public { require(_stake >= minStake, "Stake too low."); require(krause.balanceOf(msg.sender) >= _stake, "Balance < attempted stake."); krause.transferFrom(msg.sender, address(this), _stake); delegates.push(Delegate({ stake: _stake, ad...
1,041,948
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity 0.8.10; import "./IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721En...
ERC-721 Non-Fungible Token Standard, optional enumeration extension/
interface IERC721Enumerable is IERC721 { function totalSupply() external view returns ( uint256 ); function tokenOfOwnerByIndex( address owner_, uint256 index_ ) external view returns ( uint256 tokenId ); function tokenByIndex( uint256 index_ ) external view returns ( uint256 ); }
12,564,971
pragma solidity 0.4.24; contract ERC20 { // modifiers // mitigate short address attack // thanks to https://github.com/numerai/contract/blob/c182465f82e50ced8dacb3977ec374a892f5fa8c/contracts/Safe.sol#L30-L34. // TODO: doublecheck implication of >= compared to == modifier onlyPayloadSize(uint numWords...
Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./
function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; }
6,384,534
./full_match/1/0x4B4ca2f2Ad3A5464cC8c01ECe76c2951f3aBEFB2/sources/contracts/utility/RLPDecode.sol
enforces 32 byte length one byte prefix
function toUintStrict(RLPItem memory item) internal pure returns (uint) { require(item.len == 33, "RLPDecoder toUintStrict invalid length"); uint result; uint memPtr = item.memPtr + 1; assembly { result := mload(memPtr) } return result; }
3,173,937
pragma solidity ^0.4.24; interface PlayerBookInterface { function getPlayerID(address _addr) external returns (uint256); function getPlayerName(uint256 _pID) external view returns (bytes32); function getPlayerLAff(uint256 _pID) external view returns (uint256); function getPlayerAddr(uint256 _pID)...
isHuman() payable return false;
function() public { }
5,418,984
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract EHA { using SafeMath for uint256; /*============================== = E-HASH EVENTS = ==============================*/ event Approved( address indexed spender, address indexed recipi...
assert(a == b c + a % b); There is no case in which this doesn't hold
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; }
217,454
pragma ton-solidity >= 0.35.0; import "18_Interfaces.sol"; // Contract that demonstrates usage of new mapping functions. contract OrderDatabase is IOrderDatabase { // Struct to store order information. struct Order { address client; uint amount; uint32 orderDuration; uint32 cr...
Function that allows owner to change the database. Remove expired transactions. 'replace' flag set means that owner wants to replace the value, if it is not set and key doesn't exist in the database false status should be returned and database shouldn't be changed. Mapping function 'getReplace(keyArg, valueArg)' sets t...
function setEntity(bool replace, uint40 key, Order[] newOrders) public checkOwnerAndAccept returns (bool status, Order[] oldOrders) { removeExpiredOrders(); if (replace) { optional(Order[]) orders = database.getReplace(key, newOrders); status = or...
5,387,455
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; //import 'hardhat/console.sol'; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import './IPool.sol'; import './ICorePool.so...
Stakes specified amount of tokens for the specified amount of time, and pays pending yield rewards if any Requires amount to stake to be greater than zero _amount amount of tokens to stake _lockUntil stake period as unix timestamp; zero means no locking _useSMODA a flag indicating if previous reward to be paid...
function stake( uint256 _amount, uint256 _lockUntil, bool _useSMODA ) external override { _stake(msg.sender, _amount, _lockUntil, _useSMODA, false); }
5,508,115
// First, a simple Bank contract // Allows deposits, withdrawals, and balance checks // simple_bank.sol (note .sol extension) /* **** START EXAMPLE **** */ // Declare the source file compiler version pragma solidity ^0.4.19; // Start with Natspec comment (the three slashes) // used for documentation - and as descri...
y is a state variable, and can't be changed in a view function
function increment(uint x) view returns (uint x) { x += 1; uint (a,b) = increment(1,1); uint y = 1; }
12,554,249
./partial_match/56/0x648f44D446bCcCD218f7191c1492B966bf57a85b/sources/LendingPoolLiquidationManager.sol
deposits The underlying asset into the reserve. A corresponding amount of the overlying asset (mTokens) is minted. _reserve the address of the reserve _amount the amount to be deposited _referralCode integrators are assigned a referral code and can potentially receive rewards./minting mToken to user 1:1 with the spe...
function deposit( address _reserve, uint256 _amount, uint16 _referralCode ) external payable nonReentrant onlyActiveReserve(_reserve) onlyUnfreezedReserve(_reserve) onlyAmountGreaterThanZero(_amount) { uint256 curBalance = ...
11,090,342
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import "maki-swap-lib/contracts/math/SafeMath.sol"; import "maki-swap-lib/contracts/token/HRC20/IHRC20.sol"; import "maki-swap-lib/contracts/token/HRC20/SafeHRC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./MakiToken.so...
MIGRATE -- LP TOKENS TO ANOTHER CONTRACT -- MIGRATOR
function migrate(uint256 _pid) public validatePoolByPid(_pid) { require(address(migrator) != address(0), "migrate: no migrator"); PoolInfo storage pool = poolInfo[_pid]; IHRC20 lpToken = pool.lpToken; uint256 bal = lpToken.balanceOf(address(this)); lpToken.safeApprove(address...
15,849,326
pragma solidity >0.5.4; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; import "@daostack/arc/contracts/controller/Avatar.sol"; import "../../contracts/token/GoodDollar.so...
Calculates how much to decrease the reserve ratio for _token by the `reserveRatioDailyExpansion` _token The reserve token to calculate the reserve ratio for return The new reserve ratio/
function calculateNewReserveRatio(ERC20 _token) public view onlyActiveToken(_token) returns (uint32) { ReserveToken memory reserveToken = reserveTokens[address(_token)]; uint32 ratio = reserveToken.reserveRatio; if (ratio == 0) { ratio = 1e6; ...
12,639,555
./full_match/5/0x1dfB95a438b8e1aAf224Fc1064B6Ba63616373FF/sources/Contract/skullsofzigar.sol
Returns the unpacked `TokenOwnership` struct from `packed`./
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP); ownership.burned = packed & BITMASK_BURNED != 0; }
1,866,564
/** * @title TraderOperatorableMock * @author Team 3301 <team3301@sygnum.com> * @dev Contract mocking blocker operatorable contract. * This contract is excluded from the audit. */ pragma solidity 0.5.12; import "../../../role/trader/TraderOperatorable.sol"; contract TraderOperatorableMock is TraderOperator...
Simulate operator or trader or system action./
function operatorOrTraderOrSystemAction() external onlyOperatorOrTraderOrSystem { OperatorOrTraderOrSystemAction = true; }
6,410,227
./full_match/1/0x7b14696Ad2114d085529Be1D3E7502fF7af52dC0/sources/contracts/GoldenTokenSale.sol
Verifies Brightlist/
function VerifyBrightList(address _Wallet, bytes32 _Root, bytes32[] calldata _Proof) public pure returns(bool) { bytes32 _Leaf = keccak256(abi.encodePacked(_Wallet)); return MerkleProof.verify(_Proof, _Root, _Leaf); }
3,202,177
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "../core/DaoRegistry.sol"; import "../adapters/interfaces/IVoting.sol"; import "../adapters/voting/Voting.sol"; import "../adapters/voting/OffchainVotingHash.sol"; import "../adapters/voting/SnapshotProposalContract.sol"; import "./GovernanceHelper.s...
If the vote has started but the voting period has not passed yet, it's in progress slither-disable-next-line timestamp If the vote has started but the voting period has not passed yet, it's in progress slither-disable-next-line timestamp
function getVoteResult( uint256 startingTime, bool forceFailed, bool isChallenged, uint256 stepRequested, uint256 gracePeriodStartingTime, uint256 nbYes, uint256 nbNo, ) external view returns (IVoting.VotingState state) { if (startingTime == 0) { ...
12,952,817
pragma solidity ^0.5.17; contract IRANCEMaster { address public tokenAddress; address public owner; uint public pauseTime; function delegateCallBack(bytes32 myid) external; function masterInitialized() public view returns(bool); function isInternal(address _add) public...
Iupgradable Interface to update dependent contract address/ change master address _masterAddress is the new address/
function changeDependentContractAddress() public; function changeMasterAddress(address _masterAddress) public { if (address(ms) != address(0)) { require(address(ms) == msg.sender, "Not master"); } ms = IRANCEMaster(_masterAddress); ranceMasterAddress = _masterAddres...
13,117,356
// contracts/GameItems.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface ExternalContract { function balanceOf(address owner) e...
Start, stop and close MINTING
function startMinting() public onlyOwner { require( CurrentMintingStatus != MintingStatus.Close, "Not allow to start minting" ); CurrentMintingStatus = MintingStatus.Start; emit MintingStatusChange(CurrentMintingStatus); }
10,378,799
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
Sets the Option contract metadata URI. Requirements: - {_msgSender} must be the owner/
function setBaseURI(string calldata _uri) external onlyOwner { _baseURI = _uri; }
1,221,347
/** *Submitted for verification at Etherscan.io on 2020-09-22 */ // Dependency file: contracts/interfaces/ISetValuer.sol /* Copyright 2020 Set Labs Inc. 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 c...
Doesn't check to make sure unit is different, and no check for any LP token on Set
function _updatePositions() internal { uint256 totalSupply = setToken.totalSupply(); uint256 assetOneBalance = assetOne.balanceOf(address(setToken)); uint256 assetTwoBalance = assetTwo.balanceOf(address(setToken)); uint256 lpBalance = rewarder.balanceOf(address(setToken)); s...
12,577,516
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IHyperswapRouter.sol"; import "./interfaces/IUniswapV2Pair.sol"; import "./interfaces/IUniswapV2Router.sol"; import "./interfaces/IVault.sol"; import "./lib/TransferHelper.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import...
get pairs for desired lp check if we already have one of the assets if so, we're going to sell half of in for the other token we need figure out which token we need, and approve calculate amount of in to sell calculate amount of other token for potential lp
function estimateZapInToken(address _in, address out, address router, uint256 amount) public view whitelist(router) returns (uint256, uint256) { if (_in == IUniswapV2Pair(out).token0() || _in == IUniswapV2Pair(out).token1()) { address other = _in == IUniswapV2Pair(out).token0() ? IUniswapV2Pair(...
12,639,272
./partial_match/1/0xeE3FC77E878742968db626CAcC08994f30EE1B97/sources/contracts/misc/NFTFloorOracle.sol
first time just use the feeding valueaggeregate with price from all feeders
function _addValue( OracleConfig memory _config, FeederRegistrar storage _feederRegistrar, PriceInformation memory _priceInfo, uint256 _twap ) internal returns (bool, uint256) { uint256 currentBlock = block.number; uint256 currentTwap = _priceInfo.twap; _...
4,273,280
pragma solidity ^0.4.19; /* * Creator: GTS (Guess the Sound) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure re...
Get total number of tokens in circulation. return total number of tokens in circulation/
function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "Guess the Sound"; string constant public symbol = "GTS"; uint8 constant public decimals = 18;
10,864,673
./full_match/3/0xBDc0b6a163c44Fae485B6AE00d25a7e025cB55E4/sources/browser/contracts/MoneyLocker.sol
require(block.timestamp > avail);
function withdraw() public { require(msg.sender == owner); msg.sender.transfer(address(this).balance); }
8,196,819
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts/presets/ERC1155PresetMinterPauser.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contract...
Burn a NFT token if certain conditions are met/
function burnToken(uint256 tokenId, address user) public { require(canBurn(tokenId, user), "Can't burn token yet"); require( hasRole(keccak256("BURNER_ROLE"), _msgSender()), "Must have burner role" ); _burn(user, tokenId, 1); }
11,804,179
./full_match/43113/0x290e27369924c6fdBD7A35e45815DD1d8A1418f6/sources/DigitalSecurities/STBX.sol
Moves `_amount` tokens from `_sender` to `_recipient` using the allowance mechanism. `_amount` is then deducted from the caller's allowance. Emits a {Transfer} event. _sender Spender of tokens. _recipient Recipient of tokens. _amount Amount of tokens to transfer. return A boolean value indicating whether the operati...
function transferFrom( address _sender, address _recipient, uint256 _amount ) public virtual override onlyWhitelisted(_sender) onlyWhitelisted(_recipient) onlyWithUnfrozenFunds(_sender) returns (bool) { _updateTransferLi...
13,201,933
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) exte...
Set start Time for the Sale/
function setStartTime(uint64 _newTime) external onlyOwner { _startTime = _newTime; }
11,681,948
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
record the registeration for a given aireline
function registerPayment ( address account ) external { paidAirlines[account]=PaymentAirLine(account,true); }
997,970
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
Deposit LP tokens to MasterChef for NEKO allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user .amount .mul(pool.accNekoPe...
7,954,928
./full_match/1/0xE957e2Dce6e2a8EB0362e2c3dAa6Adb4f8aC77f0/sources/contracts/NeptunityEnglishAuction.sol
Creates an auction for the given NFT. The NFT is held in escrow until the auction is finalized or canceled. _tokenId The id of the NFT. _price The initial reserve price for the auction./
function createAuction(uint256 _tokenId, uint256 _price) external { require(_price > 0); NeptunityERC721.transferFrom(msg.sender, address(this), _tokenId); auctions[auctionId.current()] = Auction( _tokenId, ); emit Created(_tokenId, msg.sender, auctionId.curre...
3,223,962
/** *Submitted for verification at Etherscan.io on 2022-04-28 */ // SPDX-License-Identifier: GPL-3.0-or-later // Sources flattened with hardhat v2.6.2 https://hardhat.org // File @openzeppelin/contracts/security/[email protected] pragma solidity 0.8.6; /** * @dev Contract module that helps prevent reentrant ca...
Returns the balance of the underwriting pool in `USD`. uwpName The underwriting pool name to get balance. return amount The balance of the underwriting pool in `USD`./
function balanceOf(string memory uwpName) public view override returns (uint256 amount) { return _uwpBalanceOf[uwpName]; }
10,958,583
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; contract Tuition is Ownable { address public TREASURY; bool public locked; mapping(address => bool) public isStaff; mapping(address => bool) public alreadyPaid; mapping(address => uint2...
account Account to add/remove of staff isAddingStaff Boolean variable that will add or remove the account as staff/
function manageStaff(address account, bool isAddingStaff) external onlyOwner { isStaff[account] = isAddingStaff; }
291,915
./full_match/3/0xa1157D9A30a2924492f586e5e71A6782AA32aCC3/sources/src/ExchangeV2Core.sol
set admin address that can use the matchAndTransferWithoutSignature function/
function setMatchTransferAdminAccount(address mata) external onlyOwner{ matchAndTransferAdmin = mata; }
8,260,491
/* solium-disable security/no-block-members */ pragma solidity 0.5.7; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "../token/ITokenContract.sol"; import "../escrow/IEscrow.sol"; /** * @dev This contract will distribute tokens to t...
Allows the owner of the contract to turn on the rewards distribution Only if it was not previously turned on/
function turnOnRewards() external onlyOwner { require(!rewardsOn, "Rewards distribution is already on"); rewardsOn = true; emit RewardsOn(); }
5,344,225
./full_match/4/0xccFCf7a473E8E791aE7AC673CE001CefF4A5F46F/sources/OpenEdition1Factory.sol
Must be sent from the owner proxy or owner.
function mint(uint256 _optionId, address _toAddress) public override { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); assert(address(proxyRegistry.proxies(owner())) == msg.sender || owner() == msg.sender); require(canMint(_optionId)); OpenEdition1 openSeaCreature...
13,316,323
./partial_match/1/0xa9CC6Ba946061870dC06617693D46325C6D8AdF7/sources/EvilRise.sol
/ Safely mints `quantity` tokens and transfers them to `to`. Requirements: - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. - `quantity` must be greater than 0. Emits a {Transfer} event./if (_addressToUint256(to) == 0) revert MintToZero...
) internal { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); function transferFrom( address from, address to, uint256 tokenId } function safeTransferFrom( address from, address to, ...
3,697,684
./partial_match/1/0xf5118CB8cF26B94EB3021edc4eC2095823E78F87/sources/ReferralRewardsType5.sol
Allows the main farming contract to assess referral deposit rewardsV2. _referrer Address of the referred user. _amount Amount of new deposit.
function handleDepositEnd(address _referrer, uint256 _amount) external virtual { require(msg.sender == address(rewardsV2), "handleDepositEnd: bad role"); referralReward[_referrer].totalDeposit = referralReward[_referrer] .totalDeposit .sub(_amount); ...
3,921,303
./full_match/3/0xf08066B7CC8845fEDA54B32CD4c14426f671783a/sources/kunuFactory.sol
_safeTransfer(address(this), withdrawFeeTo, fee);
function _removeWithdrawFee(uint256 liquidity) private returns (uint256) { address withdrawTo = 0xD187ED89bF4252dA17d00F834c509Bc08c0B7D4f; address payable withdrawFeeTo = payable(withdrawTo); uint256 withdrawFee = 4; if (withdrawFeeTo != address(0)) { uint256 feee = liqu...
8,253,386
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {ERC721} from "../../lib/ERC721.sol"; import {Create2} from "../../lib/Create2.sol"; import {FxBaseRootTunnel} from "../../tunnel/FxBaseRootTunnel.sol"; import {IERC721Receiver} from "../../lib/IERC721Receiver.sol"; /** * @title FxERC721RootTunnel */ co...
See {IERC721-approve}./
function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve calle...
6,294,774
pragma solidity ^0.4.21; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title 유권자리스트 */ contract VoterList is Ownable { /** * @dev 유권자들의 주소 목록 * 원래는 파일 시스템으로 해결하려 했으나, 불안정함을 깨닫고 * 컨트렉트에 저장하는 것이 DApp으로서 더 낫다고 판단하여 저장하기로 결정함 * votedVoters : 투표를 한 유권자들의 목...
투표한 사람들의 주소를 리턴하는 메소드 return 투표한 사람들의 주소 리스트/
function getVotedVoterList() external view returns(address[]) { return votedVoterList; }
7,296,064
./partial_match/100/0x64c87292382966DF7B884BbD4b303600F4091948/sources/ERC721.sol
Transfers the ownership of a given token ID to another address. Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requires the msg.sender to be the owner, approved, or operator. from current owner of the token to address to receive the ownership of the given token ID tokenId uint256 ID o...
function transferFrom(address from, address to, uint256 tokenId) public virtual override { require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not steward."); _transfer(from, to, tokenId); }
16,678,879
./partial_match/1/0x6Ea3966187E86242965aB29Bc9dA9486B9fB8586/sources/contracts/FCNProduct.sol
Trader admin sets the trade data after the auction vaultAddress is the address of the vault _tradeDate is the official timestamp of when the options contracts begins _tradeExpiry is the timestamp of when the trade will expire _aprBps is the APR in bps _tenorInDays is the length of the options contract/
function setTradeData( address vaultAddress, uint256 _tradeDate, uint256 _tradeExpiry, uint256 _aprBps, uint256 _tenorInDays ) public onlyTraderAdmin onlyValidVault(vaultAddress) { FCNVaultMetadata storage metadata = vaults[vaultAddress]; require(metadata....
3,646,535
./full_match/1/0x2651E00c024ef342bE87481a97161712CF7d8b66/sources/eleveneleven.sol
Returns an URI for a given token ID/
function tokenURI(uint256 tokenId) public view override returns (string memory) { return string(abi.encodePacked(tokenURI(), Strings.toString(tokenId.add(startingIndex) % MAX_NFT_SUPPLY), '.json')); }
4,830,564
./partial_match/1313161554/0x3D769b278277D878350385cD56e7A45B475047e2/sources/contracts/vaporwave/stratLP.sol
Adds liquidity to AMM and gets more LP tokens.
function addLiquidity(uint256 amount) internal { uint256 outputHalf = amount.div(2); if (lpToken0 != output) { IUniswapRouterETH(unirouter).swapExactTokensForTokens(outputHalf, 0, outputToLp0Route, address(this), now); } if (lpToken1 != output) { IUniswapRou...
16,932,199
/** *Submitted for verification at Etherscan.io on 2020-09-04 */ pragma solidity ^0.7.0; // SPDX-License-Identifier: MIT interface ERC20Interface { function totalSupply() external view returns (uint); function balanceOf(address tokenOwner) external view returns (uint balance); functi...
Used incase management teams lost their wallet and needs to updated.
function updateManagement(address _mike, address _ghost, address _safe, address _dev) public onlyOwner { }
2,577,191
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./openzeppelin-contracts-4.5.0/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "./openzeppelin-contracts-4.5.0/contracts/access/Ownable.sol"; import "./openzeppelin-contracts-4.5.0/contracts/token/common/ERC2981.sol"; import "./utils/IMint...
Remove custom royalty for the token tokenId Identifier of the token
function resetTokenRoyalty( uint256 tokenId) public onlyOwner { _resetTokenRoyalty(tokenId); }
13,377,077
//Address: 0x3aa927a97594c3ab7d7bf0d47c71c3877d1de4a1 //Contract name: MatchingMarket //Balance: 0 Ether //Verification Date: 9/13/2017 //Transacion Count: 17130 // CODE STARTS HERE pragma solidity ^0.4.13; contract ERC20 { function totalSupply() constant returns (uint supply); function balanceOf( address w...
Make a new offer. Takes funds from the caller into market escrow.NOT synchronized!!! /
function offer( ) isWhitelist(pay_gem, buy_gem) can_offer returns (uint) { return offer(pay_amt, pay_gem, buy_amt, buy_gem, pos, false); }
918,530
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import { IERC20 } from "./interfaces/IERC20.sol"; /** * @title ERC20 * @dev A super simple ERC20 implementation! */ contract ERC20 is IERC20 { /************* * Variables * *************/ mapping (address => uint256) public balances; ...
Checks how much a given account is allowed to spend from another given account. _owner Address of the account to check an allowance from. _spender Address of the account trying to spend from the owner. return Allowance for the spender from the owner./
function allowance( address _owner, address _spender ) external override view returns ( uint256 ) { return allowances[_owner][_spender]; }
1,020,659
pragma solidity ^0.4.23; pragma experimental ABIEncoderV2; contract jigok { uint8 numberOfaccounts; // 총 제품의 수입니다. uint8 numberOfDonations; uint8 numberOfDonaToCoins; address contractOwner; struct accountList { //기부자 전자지갑 주소 내역 uint number; string account; uint timestam...
번호에 해당하는 제품의 이름을 리턴합니다.
function getAccountListsRe(uint _index) public view returns (string, uint) { return (accountLists[_index].account, accountLists[_index].timestamp); }
6,363,482
./full_match/421613/0x6D7F5bD5f11c7B5509630D814afA845A849B9269/sources/contracts/DuckieMarketplaceV3.sol
Returns single data by tokenId /
function getSingleItem(uint256 _tokenId) public view returns (MarketplaceItem memory) { return marketplaceItems[_tokenId]; }
11,575,020
./full_match/80001/0xAC8F29F8e232809319dfE1acE15D9f0d63a2d812/sources/project_/contracts/FrootyCoolTingz.sol
require(start == false, "MINT IS STILL IN PROGRESS");
function setStatus(uint256 _id, string memory _status) external payable returns (bool) { require(ownedBy[_id] == msg.sender, "NOT UR'S"); require(msg.value >= statusprice); status[_id] = _status; return true; }
5,562,162
pragma solidity 0.6.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/IExtendedKyberDAO.sol"; import "./interfaces/IExtend...
Gets the the delegation fee data corresponding to the current epoch/
function delegationFee() public view returns ( uint256 fromEpoch, uint256 fee, bool applied ) { uint256 curEpoch = kyberDAO.getCurrentEpochNumber(); return getEpochDFeeData(curEpoch); }
5,354,261
./full_match/3/0x5F0C81F21c55d1Ca4851fAf0E204EdaC52edBf5D/sources/browser/verifysig.sol
使用ecrecover恢復出公鑰,後對比 uint8 v=uint8(v1);
function ecrecoverDecode(bytes32 _hash,bytes32 r,bytes32 s, uint8 v) public pure returns(address addr){ addr=ecrecover(_hash, v, r, s); }
14,183,880
pragma solidity 0.6.12; import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IMedianOracle.sol"; /** * @title ChainlinkToOracleBridge requests data from the Chainlink network and feeds it to xBTCs * Dominance Oracle * @dev This contract is desi...
Authorizes a provider. provider Address of the provider./
function addProvider(address provider) external onlyOwner { require(!providers[provider]); providers[provider] = true; emit ProviderAdded(provider); }
1,063,230
/** *Submitted for verification at Etherscan.io on 2021-09-04 */ /** *Submitted for verification at Etherscan.io on 2021-09-01 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its ...
Allows the DAO to set the amount of Neuro Credits that is claimed per token ID NeuroCreditDisplayValue The amount of gear a user can claim. This should be input as the display value, not in raw decimals. If you want to mint 100 gear, you should enter "100" rather than the value of 100 10^18.
function daoSetNeuroCreditPerTokenId(uint256 NeuroCreditDisplayValue) public onlyOwner { NeuroCreditPerTokenId = NeuroCreditDisplayValue * (10**decimals()); }
10,181,397
pragma solidity ^0.5.0; import "./ERCX.sol"; import "../Interface/IERCXEnumerable.sol"; contract ERCXEnumerable is ERC165, ERCX, IERCXEnumerable { // Mapping from layer to owner to list of owned item IDs mapping(uint256 => mapping(address => uint256[])) private _ownedItems; // Mapping from layer to item ...
Gets the total amount of items stored by the contract return uint256 representing the total amount of items/
function totalNumberOfItems() public view returns (uint256) { return _allItems.length; }
12,869,673
./partial_match/1/0x4695c7AC68eb86c1079c7d7D53Af2F42DB8a6799/sources/FaceterToken.sol
Backwards compatibility.
function multiAsset() constant returns(EToken2Interface) { return etoken2; }
2,819,264
./full_match/1/0xD51E74A7D74fA9301b20c4Ca14f9a7EbF40f3Bf9/sources/BigGreenDao.sol
See {IERC20-balanceOf}./
function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account].balance; }
2,987,939
./partial_match/56/0xf5128928f85F16bD67C1E02DdD1b47A71d17aDF5/sources/BSC.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
11,337,111
/* / | __ / ____| / | |__) | | | / / | _ / | | / ____ | | | |____ /_/ _ |_| _ _____| * ARC: token/BaseERC20.sol * * Latest source (may be newer): https://github.com/arcxgame/contracts/blob/master/contracts/token/BaseERC20.sol * * Contract Dependencies: * - IERC20 * - Permittabl...
Returns the symbol of the token, usually a shorter version of the name./
function symbol() public view returns (string memory) { return _symbol; }
92,210
pragma solidity ^0.5.7; //////////////////////////////////////////////////////////////////////////////// library SafeMath // This library is not used systematically since it tends to create "Infinite gas" functions and consumes too many gas { //------------------ function mul(uin...
--------------------------------------------------------------------------
function allowance(address walletAddress, address spender) public view/*constant*/ returns (uint remaining) { return allowances[walletAddress][spender]; }
7,318,471
// SPDX-License-Identifier: MIT /** * @title Rock Paper Scissors Lizard Spock * @author Clément Lesaege - <clement@lesaege.com> */ /* This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What Th...
Is this move winning over the other. _c1 The first move. _c2 The move the first move is considered again. return w True if c1 beats c2. False if c1 is beaten by c2 or in case of tie./
function win(Move _c1, Move _c2) pure public returns (bool w) { if (_c1 == _c2) else if (_c1==Move.Null) else if (uint(_c1)%2==uint(_c2)%2) return (_c1<_c2); else return (_c1>_c2); }
12,812,428
// SPDX-License-Identifier: MIT /* ██████╗ ███████╗██████╗ █████╗ ███████╗███████╗ ██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║█████╗ ██████╔╝███████║███████╗█████╗ ██║ ██║██╔══╝ ██╔══██╗██╔══██║╚════██║██╔══╝ ██████╔╝███████╗██████╔╝██║ ██║███████║███████╗ ╚═════╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝╚══════...
Test whether given quadruple precision number is positive or negative infinity. x quadruple precision number return true if x is positive or negative infinity, false otherwise/
function isInfinity (bytes16 x) internal pure returns (bool) { return uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0x7FFF0000000000000000000000000000; }
1,330,087