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/4/0xd5fB49a8f0156CE350A10403c453926a886746A6/sources/BActions.sol
Absorb any tokens that have been sent to this contract into the pool
function gulp(address token) external _logs_ _lock_ { require(_records[token].bound, "ERR_NOT_BOUND"); _records[token].balance = IERC20(token).balanceOf(address(this)); }
8,612,241
/** * ________ __ __ __ __ _______ __ __ __ __ * | \| \ | \ | \ | \ | \ | \ | \ | \ | \ * | $$$$$$$$ \$$ _______ ____| $$ ...
If during the time specified in revealTimer one of the players does not send the secret and salt to the opponent, the player can open a dispute. _gameId 32 byte game identifier _secret Secret of the player, who opens the dispute. _salt Salt of the player, who opens the dispute. _isHost True if the sending account i...
function openDispute( bytes32 _gameId, uint8 _secret, bytes32 _salt, bool _isHost, bytes32 _hashOfOpponentSecret ) public onlyParticipant(_gameId) { require(timeUntilOpenDispute(_gameId) == 0, "the waiting time for revealing is not over yet"); ...
13,000,745
./full_match/4/0x56AcaA025dBDEc3F776A75001724f2712200ef64/sources/browser/LiquidityTransformer.sol
checks for investors count on each day return _allInvestors array with investors count for each day/
function investorsOnAllDays() external view returns (uint256[31] memory _allInvestors) { for (uint256 i = 1; i <= INVESTMENT_DAYS; i++) { _allInvestors[i] = investorsOnDay(i); } }
747,148
pragma solidity 0.8.6; import "ERC721.sol"; import "Ownable.sol"; import "ReentrancyGuard.sol"; import "Strings.sol"; import "Base64.sol"; /** ////////////////// \\\ /// ///////////\\\ /// \\\ ////////////// ////////////\\\ ///////////////// \\\ /// //////...
/ MINT LOGIC //
function mint(string memory user_bars) payable external nonReentrant { require(totalSupply < maxSupply, 'Cypher: all blocks minted'); require(msg.value == 0.01 ether, "Cypher: 0.01 ETH to mint"); require(balanceOf(msg.sender) <= 2, "Cypher: max 3 per wallet"); require(block.timestamp...
6,069,355
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; } uint...
Constructor that gives msg.sender all of existing tokens./
function TestTokenA() public{ totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); }
1,610,239
pragma solidity 0.4.25; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the c...
Burns specified number of TMV tokens.
function _burnTMV(address _from, uint256 _amount) internal { if (_amount > 0) { require(IToken(settings.tmvAddress()).balanceOf(_from) >= _amount, "You don't have enough tokens"); IToken(settings.tmvAddress()).burnLogic(_from, _amount); } }
911,866
./full_match/43113/0x9849832a1d8274aaeDb1112ad9686413461e7101/sources/contracts/WeightedPoolFactory.sol
Reverts with a revert reason containing `errorCode`. Only codes up to 999 are supported./ We're going to dynamically create a revert string based on the error code, with the following format: 'BAL{errorCode}' where the code is left-padded with zeroes to three digits (so they range from 000 to 999). We don't have revert...
function _revert(uint256 errorCode) pure { function getProtocolFeesCollector() external view returns (IProtocolFeesCollector); function setPaused(bool paused) external; function WETH() external view returns (IWETH); } pragma solidity ^0.7.0; } assembly { let units := add(mod(errorCode...
7,161,796
// Sources flattened with hardhat v2.8.2 https://hardhat.org // File contracts/solidity/proxy/IBeacon.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be...
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20Upgradeable { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); }
1,435,864
pragma solidity ^0.4.18; import "./PetBase.sol"; /** *@title PetCore * Front contract for CryptoPets. Holds create pet funtionality and token name and symbol */ contract PetCore is PetBase{ // @notice Name and symbol of the non fungible token, as defined in ERC721. string public name = "CryptoPets"; strin...
this is the function to create a pet and update the mappings with a new pet _kind a string variable repreenting the kind of cryptopet _genes a string variable representing the unique genes of the cryptopet _owner an address to which the pet will be given, defaults to the owner/
function createPet(string _kind, uint _genes, address _owner) public onlyOwner() { if(_owner == address(0)) { _owner = owner; } uint256 newPetId = totalTokens; pets[newPetId] = Pet({ kind: _kind, genes: _genes, birthTime: uint64(now) ...
1,079,330
// pragma solidity >=0.5.16 <0.9.0; pragma experimental ABIEncoderV2; /* TODO: CHANGE DELETED DOCTOR/PATIENT TO POINTER TO FIRST ELEMENT/EMPTY ADDRESS */ // Service contract, combines patient, doctor, file contracts // and handles higher-level functionality contract Service { // Doctor Mappings mapping (addre...
getter function for doctor's information
function getDoctorInfo() public view checkDoctor(msg.sender) returns(string memory, address[] memory, address, string memory, string memory) { doctor memory d = doctors[msg.sender]; require((d.addr > address(0x0)), "doctor does not exist"); return (d.name, d.patient_list, d.addr, d.clinic, d...
7,290,052
./partial_match/1/0x6601d3f885D1A91FfE63B4b4A834Cf9E2490C2D8/sources/src/settled-physical/AccountPhysicalEngine.sol
Transfers long tokens to another account. _subAccount subaccount that will be update in place/ decode parameters update the account in state
function _transferLong(address _subAccount, bytes calldata _data) internal virtual { (uint256 tokenId, address to, uint64 amount) = abi.decode(_data, (uint256, address, uint64)); _decreaseLongInAccount(_subAccount, tokenId, amount); _increaseLongInAccount(to, tokenId, amount); emit...
4,198,891
pragma solidity ^0.4.21; /** * @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...
_owner The address from which the balance will be retrieved return The balance
function balanceOf(address _owner) external view returns (uint256 balance) { return balances[_owner]; }
2,339,797
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC721Proxy} from "./IERC721Proxy.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; import {TokenRoles} from "../../roles/TokenRoles.sol"; import {Domai...
Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator./
function burn(uint256 tokenId) public override virtual burningEnabled isProxyReady returns (bool) { bool result = _forwardCurrentCall(); if (result) { emit Transfer(_msgSender(), address(0), tokenId); } return result; }
1,790,636
./partial_match/1/0x56146633c6C9D3536eEBbf0bcB1D5F20A788B82a/sources/ETHRegistrarController.sol
Sets the `name()` record for the reverse ENS record associated with the calling account. First updates the resolver to the default reverse resolver if necessary. name The name to set for this address. return The ENS node hash of the reverse record./
function setName(string memory name) public override returns (bytes32) { return setNameForAddr( msg.sender, msg.sender, address(defaultResolver), name ); }
4,198,037
// SPDX-License-Identifier: MIT /* First satirical on-chain generative text NFT about NFT firsts. Don't sleep on this historic collection. 0xdeafbeef 2021-09-06 */ /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the foll...
Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. `_data` is additional data, it has no specified format and it is sent in call to `to`. This internal function is equivalent to {safeTransferFrom}, a...
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual { _transfer(from, to, tokenId); }
6,280,745
./full_match/43114/0xA36D4b75AB5c4D655ec7ed099701De094b137A66/sources/MintFactory.sol
Recover ERC20 from contract tokenAddress token address tokenAmount amount to recover/
function recoverERC20( address tokenAddress, uint256 tokenAmount ) external onlyOwner { require(tokenAmount > 0, "recoverERC20: amount is 0"); IERC20(tokenAddress).safeTransfer(_owner, tokenAmount); emit Recovered(tokenAddress, tokenAmount); }
4,511,173
/** *Submitted for verification at Etherscan.io on 2021-02-02 */ // File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overf...
returns the rate of 1 pool token in reserve token units _poolToken pool token _reserveToken reserve token/ get the pool token supply get the reserve balance for standard pools, 50% of the pool supply value equals the value of each reserve
function poolTokenRate(IDSToken _poolToken, IERC20Token _reserveToken) internal view virtual returns (Fraction memory) { uint256 poolTokenSupply = _poolToken.totalSupply(); IConverter converter = IConverter(payable(ownedBy(_poolToken))); uint256 reserveBa...
2,294,296
// SPDX-License-Identifier: MIT License pragma solidity ^0.6.0; import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import...
easy function transfer ETH (not WETH)
function safeTransferETH(address to, uint value) public linkLPGov { require(success, 'ETH_TRANSFER_FAILED'); }
12,765,769
/** *Submitted for verification at Etherscan.io on 2018-07-03 */ pragma solidity 0.4.18; // File: contracts/ERC20Interface.sol // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uin...
makes a trade between src and dest token and send dest tokens to msg sender src Src token srcAmount amount of src tokens dest Destination token minConversionRate The minimal conversion rate. If actual rate is lower, trade is canceled. return amount of actual dest tokens
function swapTokenToToken( ERC20 src, uint srcAmount, ERC20 dest, uint minConversionRate ) public returns(uint) { bytes memory hint; return tradeWithHint( src, srcAmount, dest, msg.sender, ...
950,346
pragma solidity ^0.4.26; contract TomoGame { function payoutBet(uint256 betData, uint256 entropy) public view returns (uint256, uint16, uint256); } contract TomoCasinoGames { uint8 constant MAXIMUM_RUNNING_GAMES = 100; // EVM BLOCKHASH opcode can query no further than 256 blocks into the // past. Giv...
This is the method used to settle 99% of the time. To process a bet with "commit" (sent to player), settleBet should supply a "reveal" number that would Keccak256-hash to "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it is additionally asserted to prevent changing the bet outcomes on To...
function settleBets(uint8 gameId, uint32 round, uint16 numBets, address[] players, uint256[] bets) external onlyCroupier { uint32 settledBlockNumber = gameStartBlocks[gameId] + round * gameRoutines[gameId] + gameSettledBlocks[gameId]; require(block.number > settledBlockNumber + 2, "settleBet too ear...
922,464
./full_match/80001/0x5828C287320288e130740ed538f3852fAD13995D/sources/contracts/oracles/template/OracleManagerFixedEpoch.sol
TODO: make name of this function more descriptive and aligned! TODO: should we not be passing around epoch indexes rather than timestamps? TODO: make naming more clear by specifying renaming 'currentEpochTimestamp' to 'currentEpochStartTimestamp'
function updateCurrentEpochTimestamp(uint32 lastEpochTimestamp) public view virtual returns (uint32 currentEpochTimestamp, uint32 numberOfEpochsSinceLastEpoch) { currentEpochTimestamp = uint32(getEpochStartTimestamp()); numberOfEpochsSinceLastEpoch = uint32( (currentEpochTimestamp - la...
846,061
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns ...
pick first winner (the vNFT) pick second winner (50% cudl) pick third winner (25% cudl) pick fourth winner (25% cudl)burn the leftover (25%)
function endLottery() public { require(now > end && end != 0); uint256 cudlBalance = cudl.balanceOf(address(this)); end = 0; start = 0; winner1 = players[currentRound][ randomNumber(block.number, players[currentRound].length) ]; IERC721(0xc3f733...
13,831,845
./partial_match/4/0x3346Db7F33DF0196D073A79e60c2c0E975152164/sources/Dotc.sol
ๅช่ƒฝ็”ฑ็ฌฌไธ€่ฝฎๆˆ–็ฌฌไบŒ่ฝฎไปฒ่ฃๅˆๅŒ่ฐƒๆ•ดไฟ่ฏ้‡‘ @_who == 1 ๆ‰ฃ้™คๅ•†ๅฎถ็š„ไฟ่ฏ้‡‘,@_who == 2 ๆ‰ฃ้™ค็”จๆˆท็š„ไฟ่ฏ้‡‘,
function setComp( uint256 i, uint256 _who, uint256 _comp) external { require(Tima <= sub(block.timestamp, users[i].tima) && (users[i].timc == 0 || users[i].pau == 1 || users[i].pau == 2) , "Dotc/not-arbtime"); require(users[i].mma >0, "Dotc/mar-not"); require(_who == 1 || _who == 2, "Dotc/w...
8,508,942
./full_match/97/0xb0b2dD90491Bc9091604793321b98aC863dE8C0C/sources/project_/contracts/CollectionMethods.sol
Repays the withdrawn validator funds and transfers back token on full repayment. _tokenId The Id of the token. _erc20Contract The address of the funds to be repaid. _amount The amount to be repaid./ Send payment to the Pool
function Repay( uint256 _tokenId, address _erc20Contract, uint256 _amount ) external nonReentrant { require(NFTowner[_tokenId] == msg.sender); require(erc20Balances[_tokenId][_erc20Contract] != 0); require(_amount <= withdrawnAmount[_tokenId]); require( ...
3,282,901
/** *Submitted for verification at Etherscan.io on 2022-02-20 */ // File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants...
1645365600: start time at 20 Feb 2022 09:00:00 EST in seconds 1645408799: end time at 20 Feb 2022 20:59:59 EST in seconds
function setPreSalesTime(uint256 _startTime, uint256 _endTime) external onlyOwner { require( _endTime >= _startTime, "PreSalesActivation: End time should be later than start time" ); preSalesStartTime = _startTime; preSalesEndTime = _endTime; }...
6,319,354
./partial_match/8453/0xCD9C9b40D757b56359e19563203D3bc64089638d/sources/contracts/past-versions/PublicLockV13.sol
Allows a lock manager to add or remove an event hook/
function setEventHooks( address _onKeyPurchaseHook, address _onKeyCancelHook, address _onValidKeyHook, address _onTokenURIHook, address _onKeyTransferHook, address _onKeyExtendHook, address _onKeyGrantHook ) external { _onlyLockManager(); if (_onKeyPurchaseHook != address(0) && ...
16,778,746
pragma solidity ^0.5.0; import "./SampleToken.sol"; import "./MultiOwnable.sol"; contract BYODex is MultiOwnable { using SafeMath for uint256; //TODO: //events SampleToken public token; //how many tokens for one ether, e.g. 900 uint256 public buyRate; //how many tokens for one ether, e.g...
to prevent unexpected changes of rate
function buyTokens(uint256 _expectedBuyRate) public payable { require(!isTradingPaused, "trading is paused"); require(_expectedBuyRate == buyRate, "the buyRate is different from expected"); require(msg.value > 0, "must be sending non zero eth value"); uint256 totalTokens = msg.value....
12,684,277
./full_match/1/0x0Eb638648207D00b9025684d13B1cB53806deBe4/sources/contracts/NIL.sol
this method is responsible for taking all fee, if takeFee is true only whitelisted accounts buy or sender can trade
function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!canTrade) { if (!(whitelist[sender] || whitelist[recipient])) { require(sender == owner()); } } if (!takeFee)...
2,980,760
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./AMM.sol"; import "../lib/CappedPool.sol"; import "../lib/CombinedActionsGuard.sol";...
If a option is ITM, either PUTs or CALLs, the minimum price that it would cost is the difference between the spot price and strike price. If the target price after applying slippage is above this minimum, the function returns true. newTargetPrice the new ABPrice after slippage (how many units of tokenB, to buy 1 optio...
function _isValidTargetPrice(uint256 newTargetPrice, uint256 spotPrice) internal view returns (bool) { if (priceProperties.optionType == IPodOption.OptionType.PUT) { if (spotPrice < priceProperties.strikePrice) { return newTargetPrice > pri...
88,937
./full_match/4/0x7D50dF98B38765Da17b812fE879A4b4b23081d46/sources/browser/Untitled.sol
this saves gas while using this multiple timeschecking all conditionstransferring PAX tokens from smart user to smart contract for level 1update variables
function regUser(uint _referrerID, uint cid) public returns(bool) { address msgSender = msg.sender; require(!userInfos[msgSender].joined, 'User exist'); if(!(_referrerID > 0 && _referrerID <= lastIDCount)) _referrerID = defaultRefID; if(userInfos[userAddressByID[_referrerID]]....
800,490
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "./node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "./node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; impor...
_beforeTokenTransfer should be overriden from ERC721Pausable
function _beforeTokenTransfer(address from, address to, uint256 tokenId)internal virtual override(ERC721, ERC721Pausable) { super._beforeTokenTransfer(from, to, tokenId); require(!paused(), "ERC721Pausable: token transfer while paused"); }
15,864,675
pragma solidity ^0.5.10; import "tabookey-gasless/contracts/GsnUtils.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol"; import "./ProxyFactory.sol"; import "gsn-sponsor/contracts/GsnRecipient.sol"; import "./SmartAccount.sol"; contrac...
require(knownSmartAccounts[smartAccountId] == address(0), "SmartAccount already created for this id"); (bytes4 timestamp, bytes memory sig) = abi.decode(approvalData,(bytes4, bytes)); require(uint32(timestamp) + APPROVAL_VALIDITY > now, "Outdated request"); bytes32 hash = keccak256(abi.encodePacked...
function acceptRelayedCall( address relay, address from, bytes calldata encodedFunction, uint256 transactionFee, uint256 gasPrice, uint256 gasLimit, uint256 nonce, bytes calldata approvalData, uint256 maxPossibleCharge ) external view returns (uint256 res, bytes memory data) { (r...
12,873,979
pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./utils/ReentrancyGuard.sol"; import "./libs/LibUnitConverter.sol"; import "./libs/Li...
Batch query of asset liabilities for a user user user address to query/
function getLiabilities(address user) public view returns (MarginalFunctionality.Liability[] memory liabilitiesArray) { return liabilities[user]; }
13,685,849
pragma solidity ^0.8.0; import "./_validators_hub.sol"; import "./Hashurance_T.sol"; //Imports Hashurance token import "./policy_contract.sol"; //Imports policy contract to create and manage policies. contract _Insurengine{ //Hushurance token contract object. HashuranceToken public hashuranceToken...
Function to apply for an insurance. @inputData. prequel should be 0 if its a fresh insurance application. function applyForInsurance(inputApplyForm memory inputData, receiptTemplate memory receipt) public returns(bool){Confirm and process funds.Submit application after successful transfer ApplicationForm memory newAp...
function applyForInsurance(string memory insuring, uint cost, uint prequel, receiptTemplate memory receipt) public returns(bool){ receipt.paymentTime = block.timestamp; hashuranceToken.updateDepoPool(applications.length, reformReceipt(receipt)); ...
12,916,004
pragma solidity 0.4.25; /** * @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 returns (uint256); function allowance(address _owner, address _...
Function to mint tokens can run only from crowdsale contract to The address that will receive the minted tokens. _value The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address to, uint256 _value) public onlyOwner { _mint(to, _value); }
7,275,070
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeab...
Withdraw only reward tokens. Stake must have already been withdrawn./slither-disable-next-line calls-loop
function withdrawRewards() external stakingPeriodComplete rewardsAvailable whenNotPaused { StakingPoolLib.Config memory _config = _stakingPoolConfig; User memory user = _users[_msgSender()]; require(user.depositAmount == 0, "StakingPool: withdraw stake");...
5,534,217
pragma solidity ^0.8.4; contract Sha3 { function hashArray() pure public returns(bytes32) { bytes8[] memory tickers = new bytes8[](4); tickers[0] = bytes8('BTC'); tickers[1] = bytes8('ETH'); tickers[2] = bytes8('LTC'); tickers[3] = bytes8('DOGE'); return keccak256(abi...
0xe79a6745d2205095147fd735f329de58377b2f0b9f4b81ae23e010062127f2bc
function hashPackedArray() pure public returns(bytes32) { bytes8 btc = bytes8('BTC'); bytes8 eth = bytes8('ETH'); bytes8 ltc = bytes8('LTC'); bytes8 doge = bytes8('DOGE'); return keccak256(abi.encodePacked(btc, eth, ltc, doge)); }
14,053,363
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // 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 ...
Withdraws tokens from the Uniswap pool. tokenAmounts Array with one element - TokenAmount struct with UNI token address, UNI token amount to be redeemed, and amount type. return tokensToBeWithdrawn Array with two elements - underlying tokens. Implementation of InteractiveAdapter function./ solhint-disable-next-line n...
function withdraw(TokenAmount[] calldata tokenAmounts, bytes calldata) external payable override returns (address[] memory tokensToBeWithdrawn) { require(tokenAmounts.length == 1, "ULIA: should be 1 tokenAmount"); address token = tokenAmounts[0].token; ui...
12,957,111
./full_match/43114/0xD781b8126F857A2073D5d0DD3D2903253DAA46bD/sources/src/token/ERC721/extensions/mintable/ERC721AMintableExtension.sol
@inheritdoc IERC721MintableExtension/
function mintByFacet(address[] calldata tos, uint256[] calldata amounts) public virtual override { if (address(this) != msg.sender) { revert ErrSenderIsNotSelf(); } for (uint256 i = 0; i < tos.length; i++) { _mint(tos[i], amounts[i]); } }
4,637,374
./full_match/1/0x6cE532764F3c7700cdA0967a6aC5B4f636201491/sources/contracts/PreSaleDop.sol
Purchases dopToken with Usdt token investment The Investment amount code The code is used to verify signature of the user round The round in which user wants to purchase deadline The deadline is validity of the signature v The `v` signature parameter r The `r` signature parameter s The `s` signature parameter
function purchaseWithUsdt( uint256 investment, string memory code, uint8 round, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external notBlacklisted(msg.sender) canBuy { if (block.timestamp > deadline) { revert DeadlineExpired(); ...
2,941,004
// Copyright (C) 2018 MixBytes, LLC // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WIT...
calculates dividends for the account _for return (true if state has to be updated, dividend amount (could be 0!), lastProcessedEmissionNum) If no new ether was collected since last dividends claim if no tokens owned by account We start with last processed emission because some ether could be collected before next emiss...
function calculateDividendsFor(address _for) view internal returns ( bool hasNewDividends, uint256 dividends, uint256 lastProcessedEmissionNum ) { uint256 lastEmissionNum = getLastEmissionNum(); uint256 lastAccountEmissionNum = m_lastAccountEmission[_for]; assert(...
5,430,768
./full_match/42220/0x764bb9F7232EED556Ec36beCADf1F783833cF553/sources/contracts/treasury/TreasuryImplementation.sol
Returns the details of a token _tokenAddress address of the token return rate of the token return exchangePath of the token/
function tokens(address _tokenAddress) external view override returns (uint256 rate, address[] memory exchangePath) { return (_tokens[_tokenAddress].rate, _tokens[_tokenAddress].exchangePath); }
16,351,011
./partial_match/1/0xE4aB0bE415e277d82C38625B72BD7DeA232C2E7d/sources/XRP20Token.sol
change whitelist status of a particular address _address address of the user to change status _status bool value for the status/
function whitelistAddress(address _address, bool _status) external onlyOwner { isWhitelisted[_address] = _status; }
3,999,764
./partial_match/1/0x13bC172D8008629d71fd54369f796b4a51d57d9F/sources/PickleStrategy3PoolMainnet.sol
Withdraws all the yCRV tokens to the pool./
function withdrawAllToVault() external restricted { exitMasterChef(); liquidate(); IERC20(pickleJar).safeApprove(pickleJar, 0); IERC20(pickleJar).safeApprove(pickleJar, IERC20(pickleJar).balanceOf(address(this))); Pickle(pickleJar).withdrawAll(); IERC20(underlying).safeTransfer(vault, IERC20(u...
2,714,024
./full_match/1/0x06cB7C24990cBE6b9F99982f975f9147c000fec6/sources/browser/DSA/InstaPool.sol
Withdraw Liquidity. token token address.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) amt token amount./
function withdraw(address token, uint amt) external returns (uint _amt) { uint _userLiq = liquidityBalance[token][msg.sender]; require(_userLiq > 0, "nothing-to-withdraw"); uint _cAmt; address ctoken = tknToCTkn[token]; if (amt == uint(-1)) { uint initknBal = to...
3,206,817
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // 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 ...
TroveManager contract interface. Only the functions required for LiquityAssetAdapter contract are added. The TroveManager contract is available here/
interface TroveManager { function getTroveColl(address _borrower) external view returns (uint); } import { ProtocolAdapter } from "../ProtocolAdapter.sol"; }
630,040
./full_match/5/0xcE7DB249fA1b45C6D983bDc9d38b11c738414aD5/sources/contracts/unaudited/evolving-nfts/extension/RulesEngineExtension.sol
Returns whether the rules engine used by the contract can be overriden in the given execution context. DEFAULT_ADMIN_ROLE
function _canOverrieRulesEngine() internal view virtual override returns (bool) { return _hasRole(0x00, msg.sender); }
1,937,393
//SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "../../interfaces/GorillaBitsI.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/sec...
External/ claiming a token based on a signature/
function claim( uint256 _oldId, uint16 _newId, address _account, string calldata _network, bytes calldata _signature ) external nonReentrant { require(enabled, "Bridging is stopped"); require(_account == msg.sender, "Not the owner"); require(verify(_oldId, _newId, _account, _network,...
13,695,181
pragma solidity ^0.4.25; /******************************************************************************* * * Copyright (c) 2019 Decentralization Authority MDAO. * Released under the MIT License. * * Minado - Crypto Token Mining & Forging Community * * Minado has been optimized for mining ERC918-compa...
Get Minting FIXED amount/
function getMintFixed( address _token ) public view returns (uint amount) { bytes32 hash = keccak256(abi.encodePacked( _namespace, '.', _token, '.mint.fixed' )); amount = _zer0netDb.getUint(hash);
902,637
./full_match/1/0x75eE35F7D0aD5Aa6ED6Aa314Bf47d740d6D2d900/sources/browser/DomProtocol.sol
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if (_transNumber > 3) { if (amount>10*(10**18)){ require...
3,203,298
/** *Submitted for verification at Etherscan.io on 2022-03-02 */ /** *Submitted for verification at Etherscan.io on 2022-03-02 */ // hevm: flattened sources of src/HeyElontoken.sol // SPDX-License-Identifier: MIT pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0; pragma experimental ABIEncoderV2; ////// lib/openzepp...
exclude from paying fees or having max transaction amount
constructor() ERC20("Hey Elon", "$HeyElon") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = ...
2,224,534
./partial_match/3/0x7dfcAd83cd93E309338705dca079add3A4bD72DC/sources/Nexon.sol
Whitelist addresses and amount for claim-able check _amountToClaim Amount of tokens staked in the wallet/This code will perform stake of the number of token for next 1 year of 365 days
function performClaim(uint256 _amountToClaim) external checkBlocker(msg.sender,_amountToClaim) validatorForStaking(_amountToClaim, now + 31536000) returns(bool){ _stakingCount = _stakingCount +1; _stakerAddress[_stakingCount] = msg.sender; _stakingEndTime[_stakingCount] = now + 31536000; _stakingStart...
5,068,724
pragma solidity ^0.5.0; // Everyone who deposits funds is issued time tokens. // 1 CHAR token is equivalent to 1 DAI for 1 block and represents your voting power // There are three phases - voting, deposit and donate // In the voting phase CHAR holders vote on the address they would like to receive funds from the next...
Add a small amount to owner
function balanceOfUnderlying(address owner) external returns (uint) { return token.balanceOf(address(this)).mul(105).div(100); }
2,550,727
// Copyright New Alchemy Limited, 2017. All rights reserved. pragma solidity >=0.4.10; // Just the bits of ERC20 that we need. contract Token { function balanceOf(address addr) returns(uint); function transfer(address to, uint amount) returns(bool); } // Receiver is the contract that takes contributions contr...
set the target sale address
function setSale(address s) onlyOwner { sale = Sale(s); }
2,261,281
./partial_match/1/0x919B5e2714FEaE5C366ADa120EA566F79106cB67/sources/StandardPoolConverter.sol
decreases the pool's liquidity and burns the caller's shares in the pool _amount token amount _reserveTokens address of each reserve token _reserveMinReturnAmounts minimum return-amount of each reserve token return the amount of each reserve token granted for the given amount of pool token...
function removeLiquidity( uint256 _amount, IERC20Token[] memory _reserveTokens, uint256[] memory _reserveMinReturnAmounts ) public protected active returns (uint256[] memory) { bool inputRearranged = verifyLiquidityInput(_reserveTokens, _reserveMinReturnAmounts, _amount); ...
9,357,625
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\\ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\\ //@@@@@@@@@@@@@@@...
mint function you can choose to mint 1 or 2 mint is free, but payments are accepted
function mint(uint8 numTokens) external payable { require(!paused, "Sale hasn't not started yet"); require(balanceOf(msg.sender) < 2, "Each address may only own 2 NFTs"); require(numTokens < 3, "Billionaire Skull Club: Max 2 NFTs per transaction"); require( nextTokenId + ...
2,422,639
./full_match/43114/0xbbC2643FD3e4E8ae48A801a5f45d03a1bDdAD983/sources/AxMutation.sol
Creates `amount` tokens of token type `id`, and assigns them to `to`. Emits a {TransferSingle} event. Requirements: - `to` cannot be the zero address. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value./
function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArr...
4,560,086
./full_match/1/0x9a8A1D7Eac06871f60158f127704F3910613E3c3/sources/contracts/adapters/SanTokenERC4626Adapter.sol
@inheritdoc IERC4626Upgradeable
function mint(uint256 shares, address receiver) public returns (uint256) { uint256 assets = previewMint(shares); _deposit(msg.sender, receiver, assets, shares); return assets; }
3,219,214
pragma solidity ^0.4.13; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal returns (uint) { return a / b; } ...
Purchase on a behalf of the sender, but uses a nil identifier./
function() public payable { purchase(0); }
14,056,978
./full_match/1/0x2dCdCA085af2E258654e47204e483127E0D8b277/sources/contracts/DividendToken.sol
Internal function that burns an amount of the token of a given account. Update magnifiedDividendCorrections to keep dividends unchanged. account The account whose tokens will be burnt. value The amount that will be burnt.
function _burn(address account, uint256 value) internal override { super._burn(account, value); magnifiedDividendCorrections[account] = magnifiedDividendCorrections[account] .add( (magnifiedDividendPerShare.mul(value)).toInt256Safe() ); } address indexed from, uint256 weiAmount ); add...
8,413,612
/* โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘ โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘ โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆ...
-------------------------------------------------------------------------- / HELPERS / -------------------------------------------------------------------------- / Convert a bytes4 to a string.
function _toString(bytes4 b) private pure returns (string memory) { uint256 numChars = 0; for (uint256 i; i < 4; i++) { if (b[i] == bytes1(0)) break; numChars++; } bytes memory result = new bytes(numChars); for (uint256 i; i < numChars; i++) result[i] = b[i]; return string(abi.e...
595,519
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "../interfaces/IPair.sol"; import "../interfaces/IEnchant.sol"; import "../interfaces/IERC20.sol"; import "../interfaces/ISummoner.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract SoulAura is Ownable { ISummoner summoner = ISummone...
gets: member's enchanted power enchanted voting power is the members' enchanted SEANCE share.
function enchantedPower(address member) public view returns (uint raw, uint formatted) { uint enchant_total = enchant.totalSupply(); uint enchant_balance = enchant.balanceOf(member); uint enchant_totalSeance = seance.balanceOf(address(enchant)); uint enchanted_power = enchant_totalS...
14,094,046
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
Curve pool may have more than one reward token. Child contract should override _claimRewards/
function _claimRewardsAndConvertTo(address _toToken) internal virtual override { _claimRewards(); for (uint256 i = 0; i < rewardTokens.length; i++) { uint256 _amt = IERC20(rewardTokens[i]).balanceOf(address(this)); if (_amt != 0) { uint256 _minAmtOut; ...
5,825,350
pragma solidity ^0.4.23; import "raiden/Utils.sol"; import "raiden/Token.sol"; import "raiden/TokenNetwork.sol"; contract TokenNetworkRegistry is Utils { /* * Data structures */ string constant public contract_version = "0.3._"; address public secret_registry_address; uint256 public chain...
Token contract checks are in the corresponding TokenNetwork contract
function createERC20TokenNetwork(address _token_address) external returns (address token_network_address) { require(token_to_token_networks[_token_address] == 0x0); token_network_address = new TokenNetwork( _token_address, secret_registry_address, ...
12,727,965
//Address: 0xd275b50f71badf4fa2f911e80e1e420730ab403e //Contract name: DragonCrowdsaleCore //Balance: 0 Ether //Verification Date: 12/25/2017 //Transacion Count: 7 // CODE STARTS HERE pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {...
uint crowdsaleCounter = dragoncrowdsalecore.crowdsaleCounter();
function DragonAward ( uint amount, uint crowdsaleCounter ) internal returns ( uint ){ if ( crowdsaleCounter > 1000000000000000 && crowdsaleCounter < 2500000000000000 ) price = secondroundprice; if ( crowdsaleCounter >= 2500000000000000 ) price = thirdroundprice; ...
12,799,359
./full_match/1/0x6BAa28FE15A0ec75a92Dc8a9E356B39Fbe0bbbe3/sources/contracts/Meditations.sol
_transfer override adds logic to track transfer counts as well as the prior owner. This override updates mappings and then calls the overridden function. _from is the address the token is being sent from. _to is the address the token is being sent to. _tokenId is the token being transferred./
function _transfer( address _from, address _to, uint256 _tokenId ) internal virtual override { transferCountOf[_tokenId]++; lastTransferOf[_tokenId] = block.timestamp; super._transfer(_from, _to, _tokenId); }
8,294,860
./full_match/42/0x225ea51550882702DD6F2C247B912daA54D9b3c7/sources/browser/IlkRegistry.sol
Authed edit function
function file(bytes32 ilk, bytes32 what, string calldata data) external auth { if (what == "name") ilkData[ilk].name = data; else if (what == "symbol") ilkData[ilk].symbol = data; else revert("IlkRegistry/file-unrecognized-param-string"); }
9,597,338
// Sources flattened with hardhat v2.6.0 https://hardhat.org // File contracts/interfaces/IArmorMaster.sol pragma solidity ^0.6.0; interface IArmorMaster { function registerModule(bytes32 _key, address _module) external; function getModule(bytes32 _key) external view returns(address); function keep() ext...
Transfers control of the contract to a newOwner. newOwner The address to transfer ownership to./
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } uint256[50] private __gap;
24,220
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./IPool.sol"; import "./ModaAware.sol"; import "./ModaCorePool.sol"; import "./EscrowedModaERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "abdk-libraries-solidity/ABDKMath64x64.sol"; /** * @title Moda Pool Factory * * @notice M...
Calculates the effective moda per second at a future timestamp./ If we're before the start, just return initial. If we're at the end, we don't continue to decrease. How many times do we need to decrease the rewards between the last time we've calculated and now? Calculate the resulting amount after applying that many d...
function modaPerSecondAt(uint time) public view returns (uint256) { if (time < startTimestamp) return initialModaPerSecond; if (time > endTimestamp) time = endTimestamp; uint periods = (time - startTimestamp) / secondsPerUpdate; return compound(initialModaPerSecond, period...
15,806,351
//Address: 0x9df10486168cb25278c7ec72a3090e34f7aac29a //Contract name: GPowerToken //Balance: 0 Ether //Verification Date: 1/11/2018 //Transacion Count: 5 // CODE STARTS HERE pragma solidity ^0.4.18; //*** Owner ***// contract owned { address public owner; //*** OwnershipTransferred ***// event Owners...
Set Params For Sale
function setParamsStopSale(bool _value) public onlyOwner{ stopSale=_value; }
12,662,264
pragma solidity ^0.4.24; contract RSEvents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
withdraws all of your earnings. -functionhash- 0x3ccfd60b/ setup local rID grab time fetch player ID setup temp var for player eth check to see if round has ended and no one has run round end yet set up our tx event data end the round (distributes pot) get their earnings gib moni build event data fire withdraw and dist...
function withdraw() isActivated() isHuman() public { uint256 _rID = rID_; uint256 _now = now; uint256 _pID = pIDxAddr_[msg.sender]; uint256 _eth; if (_now > round_[_rID].end && round_[_rID].ended == false...
12,171,687
pragma solidity ^0.5.0; // Copyright 2019 OpenST Ltd. // // 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 applica...
Facilitator calls the method to initiate the stake process. Staked amount from composer and bounty amount from facilitator is then transferred to the StakerProxy contract of the staker. _amount Amount that is to be staked. _beneficiary The address in the auxiliary chain where the utility ...
function acceptStakeRequest( uint256 _amount, address _beneficiary, uint256 _gasPrice, uint256 _gasLimit, uint256 _nonce, address _staker, EIP20GatewayInterface _gateway, bytes32 _hashLock ) external onlyWorker returns(bytes...
12,962,256
pragma solidity ^0.4.25; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // -----------...
Get the max null nonce of the given wallet and currency wallet The address of the concerned wallet currency The concerned currency return The max nonce
function maxNonceByWalletAndCurrency(address wallet, MonetaryTypesLib.Currency currency) public view returns (uint256) { return walletCurrencyMaxNonce[wallet][currency.ct][currency.id]; }
948,958
./partial_match/42/0xC31518D4fbA20E3618F6e7B24D1Bada43837Ed45/sources/GebProxyDebtAuctionActions.sol
Mints protocol tokens for your proxy and then the proxy sends all of its balance to msg.sender coinJoin CoinJoin auctionHouse Auction house address auctionId Auction ID
function settleAuction(address coinJoin, address auctionHouse, uint auctionId) public { DebtAuctionHouseLike debtAuctionHouse = DebtAuctionHouseLike(auctionHouse); debtAuctionHouse.settleAuction(auctionId); claimProxyFunds(address(CoinJoinLike(coinJoin).systemCoin())); claimProxyFund...
3,338,865
pragma solidity ^0.5.16; import "../CToken.sol"; import "../ErrorReporter.sol"; import "../PriceOracle.sol"; import "../ComptrollerInterface.sol"; import "../Unitroller.sol"; import "./CWComptrollerStorage.sol"; /** * @title CloudWalk's Comptroller Contract * @author Compound (CloudWalk) */ contract CWComptroller ...
Checks if the account should be allowed to borrow the underlying asset of the given market cToken The market to verify the borrow against borrower The account which would borrow the asset borrowAmount The amount of underlying the account would borrow return 0 if the borrow is allowed, otherwise a semi-opaque error c...
function borrowAllowed(address cToken, address borrower, uint borrowAmount) external returns (uint) { require(!borrowGuardianPaused[cToken], "borrow is paused"); if (!markets[cToken].isListed) { return uint(Error.MARKET_NOT_LISTED); } if (!markets[cToken].accountMembers...
14,523,832
pragma solidity 0.4.25; import "./SafeMath.sol"; import "./IToken.sol"; import "./ISettings.sol"; import "./ITBoxManager.sol"; import "./IOracle.sol"; /// @title BondService contract BondService { using SafeMath for uint256; /// @notice The address of the admin account. address public admin; // The...
Uses to match the holder request. _id A Bond ID.
function takeBuyRequest(uint256 _id) external payable buyRequest(_id) validTx { address _holder = bonds[_id].holder; uint256 _sysEth = bonds[_id].deposit.mul(issuerFee).div(divider); systemETH = systemETH.add(_sysEth); uint256 _tmv = bonds[_id].deposit.mul(rate()).div(precision())...
1,820,735
pragma solidity ^0.4.24; interface IDRCWalletMgrParams { function singleWithdrawMin() external returns (uint256); // min value of single withdraw function singleWithdrawMax() external returns (uint256); // Max value of single withdraw function dayWithdraw() external returns (uint256); // Max value of ...
get the withdraw wallet addresses list binding to the deposit contract address _deposit the deposit contract address _indices the array of indices of the withdraw wallets/ WithdrawWallet storage wallet = depositRepos[_deposit].withdrawWallets[_indices[i]]; names[i] = wallet.name; wallets[i] = wallet.walletAddr;
function getDepositWithdrawList(address _deposit, uint[] _indices) onlyOwner public view returns (bytes32[], address[]) { require(_indices.length != 0); bytes32[] memory names = new bytes32[](_indices.length); address[] memory wallets = new address[](_indices.length); for (uint i =...
12,845,646
./partial_match/1/0xcAB2f2a8ab011ED7cD74fB77C49f057d9F90C2A7/sources/LoanToken.sol
Emitted when the loan is funded lender Address which funded the loan/ Emitted when transfer whitelist is updated account Account to whitelist for transfers status New whitelist status/ Emitted when borrower withdraws funds beneficiary Account which will receive funds/ Emitted when term is over status Final loan...
function _beforeTokenTransfer( address from, address to, uint256 amount } } ) public ERC20("Loan Token", "LOAN") { require(_lender != address(0), "LoanToken: Lender is not set"); currencyToken = _currencyToken; borrower = _borrower; liquidator = _liquid...
3,633,949
./partial_match/5/0xA109b34B1974C1f6BA554607F46E202926728E14/sources/src/InterestRateModel.sol
Returns the interest rate state of a position position Address of position (owner) return _ Interest rate state of the position
function getPositionIRS(address position) public view returns (PositionIRS memory) { return _checkPositionIRS(_positionIRS[position]); }
16,850,779
contract IERC20Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// @no...
Funds must be transfered by calling contract before calling this contract. msg.sender is address of calling contract that must be approved./Create gameLockTransfer game credits to winner
function createLock(address _winner, uint _totalParticipationAmount, uint _tokenLockDuration) public { require(approvedGames[msg.sender] == true); require(isGameLocked[msg.sender] == false); GameLock memory gameLock = GameLock(_totalParticipationAmount, block.number + _tokenLockDura...
4,807,301
./partial_match/42/0xB45F2e74d0fEc8E2aaa49bEc38F5178Bd880EcF7/sources/IdleStrategyUSDTTestnet.sol
Returns the current balance. Ignores COMP that was not liquidated and invested./ NOTE: The use of virtual price is okay for appreciating assets inside IDLE, but would be wrong and exploitable if funds were lost by IDLE, indicated by the virtualPrice being greater than the token price.
function investedUnderlyingBalance() public view returns (uint256) { if (protected) { require(virtualPrice <= idleTokenHelper.getRedeemPrice(idleUnderlying), "virtual price is higher than needed"); } uint256 invested = IERC20(idleUnderlying).balanceOf(address(this)).mul(virtualPr...
8,839,513
pragma solidity ^0.8.10; pragma abicoder v2; import "../DjinnBottleUSDC.sol"; import "../interfaces/CTokenInterfaces.sol"; import "../interfaces/ComptrollerInterface.sol"; import "../interfaces/IStdReference.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; import "../interface...
execute the swap herenext step
function swapForTokens() internal { uint half = (getTokenBalance(WETH) * 50) / 100; IERC20(WETH).approve(spookyAddress, getTokenBalance(WETH)); swap(WETH, WFTM, half); uint rest = getTokenBalance(WETH); swap(WETH, TOMB, rest); getLPTokens(); }
12,639,489
// Dependency file: as/interfaces/ISetToken.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 copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ...
Dependency file: as/interfaces/IIntegrationRegistry.sol/ pragma solidity 0.6.10;
interface IIntegrationRegistry { function addIntegration(address _module, string memory _id, address _wrapper) external; function getIntegrationAdapter(address _module, string memory _id) external view returns(address); function getIntegrationAdapterWithHash(address _module, bytes32 _id) external view retur...
1,794,542
./full_match/5/0x64A0ED7f89d9F6de790F7d77022017be9Dcb405A/sources/browser/veth2-5.sol
Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens rawAmount The number of tokens that are approved (2^256-1 means infinite) return Whether or not the approval succeeded/
function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); amount = safe96(rawAmount, "vETH2::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; ...
11,628,909
// Sources flattened with hardhat v2.4.1 https://hardhat.org // File contracts/interfaces/IERC721.sol pragma solidity 0.5.7; /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// Note: the ERC-165 identifier for this interface is 0x80ac58cd interface IERC721 { /...
Called by owner to withdraw all funds from the lock. TODO: consider allowing anybody to trigger this as long as it goes to owner anyway?/ Security: re-entrancy not a risk as this is the last line of an external function
function withdraw() external onlyOwner { uint balance = _getBalance(address(this)); require(balance > 0, 'NOT_ENOUGH_FUNDS'); _withdraw(balance); }
949,471
./full_match/7700/0x6F16b6661F91e666946F8621896C4060Cd7fb196/sources/contracts/cedar/drop/CedarERC721Drop.sol
Expose the current active claim condition including claim limits
function getActiveClaimConditions() external view override returns ( ClaimCondition memory condition, uint256 conditionId, uint256 walletMaxClaimCount, uint256 maxTotalSupply, uint256 tokenSupply, bool isClaimPau...
4,655,233
./full_match/4/0x95774833307E2F54583644F52be0c238c62D5122/sources/GunPool.sol
ๅพ—ๅˆฐ ่ฟ™ไธช BridgePair ็š„ๅฎžๆ—ถ่ต„ไบง
function getTokenAmount() public view returns (address _token0, uint _amount0, address _token1, uint _amount1) { _token0 = Token0; _token1 = Token1; address UniPair = UniswapV2Library.pairFor(factory, Token0, Token1); _amount0 = IERC20(_token0).balanceOf(address(this)) + IERC20(_tok...
764,391
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // 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 ret...
Withdraw LP tokens from MasterChef.
function withdraw(uint256 _amount) public { UserInfo storage user = userInfo[msg.sender]; require(user.amount >= _amount && _amount > 0, "withdraw: not good"); rewardPool.updatePool(poolId); (IERC20 lpToken, , , uint256 acconePoolPerShare,) = rewardPool.poolInfo(poolId); uin...
12,135,166
pragma solidity ^0.8.4; import "remix_tests.sol"; // injected by remix-tests import "./Company.sol"; contract MyTest { // Deploy our ERC721 contract to the ethereum blockchain allowing โ€˜Companyโ€™ tokens to be minted. Company company; function beforeAll() public { // deploy share contract Share share...
deploy share contract mint erc721 token point erc20 token to erc721 token
function beforeAll() public { Share share; company = new Company(0x72656d6978000000000000000000000000000000000000000000000000000000, 'testcompany', 'testURI', 1000, 2); share.setCompanyContractLocation(0x72656d6978000000000000000000000000000000000000000000000000000000); }
12,725,307
./partial_match/1/0x14cC8DfaF2258E1B8B2869300dBa1B734dc0fE43/sources/KtuneTokenBlocks.sol
return the address of the owner./
function owner() public view returns (address) { return _owner; }
2,737,018
./full_match/1/0x0bC24E61DAAd6293A1b3b53a7D01086BfF0Ea6e5/sources/contracts/FeeManager/FeeManagerHelper.sol
Internal function updating bad debt amount of a position and global one (in USD). Compares totalBorrow and totalCollateral of the postion in USD anadjustes bad debt variables. Pseudo pool amounts needed to be updated before this function is called./
function _updateUserBadDebt( uint256 _nftId ) internal { uint256 currentBorrowUSD = WISE_SECURITY.overallUSDBorrowHeartbeat( _nftId ); uint256 currentCollateralBareUSD = WISE_SECURITY.overallUSDCollateralsBare( _nftId ); uint2...
4,818,629
/** *Submitted for verification at Etherscan.io on 2021-05-30 */ /* * Fire Inu (FINU) * * Anon fork with adjusted tokenomics. * * Locking Liquidity. * * Total Supply: 100,000,000,000,000 * Max Buy: 690,000,000,000 (0.69% of Total Supply) * Max Hold: 2,100,000,000,000 (2.1% of Total Supply) * * READ THIS CA...
Wen tier end in seconds from epoc/
function wenTierEnd(uint256 count) public view returns (uint256) { require(count < _taxTiers.length); return _start_timestamp + (_taxTiers[count] * HOUR); }
2,213,222
pragma solidity ^0.5.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by */ function supportsInterface(bytes4 interfaceId) external view ...
Internal function to transfer ownership of a given token ID to another address. As opposed to transferoriginAddress, this imposes no restrictions on msg.sender. originAddress current owner of the token destinationAddress address to receive the ownership of the given token ID nftIndex uint256 ID of the token to be tr...
function _transferFrom(address originAddress, address destinationAddress, uint256 nftIndex) internal { super._transferFrom(originAddress, destinationAddress, nftIndex); _removeTokenFromOwnerEnumeration(originAddress, nftIndex); _addTokenToOwnerEnumeration(destinationAddress, nftIndex); ...
6,416,881
// Sources flattened with hardhat v2.0.5 https://hardhat.org // File @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol@v3.4.1 // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** *...
return Returns current withdrawal lock duration./
function withdrawalLockDuration() public view whenNotPaused returns (uint256) { return _getUintParamValue(withdrawalLockDurationParam); }
433,297
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/...
calculate current bond premium return price_ uint/
function bondPrice() public view returns (uint price_) { price_ = (terms.controlVariable * debtRatio() + 1000000000) / 1e7; if (price_ < terms.minimumPrice) { price_ = terms.minimumPrice; } }
1,040,923
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./interfaces/IPoolTokensContainer.sol"; import "../../../utility/Owned.sol"; import "../../../utility/TokenHolder.sol"; import "../../../token/SmartToken.sol"; /** * @dev The PoolTokensContainer contract serves as a container ...
concatenates a string and a digit (single only) and returns the result string _str string _digit digit return concatenated string/
function concatStrDigit(string memory _str, uint8 _digit) private pure returns (string memory) { return string(abi.encodePacked(_str, uint8(bytes1('0')) + _digit)); }
12,855,218
./full_match/1/0xF1C7b9A188C071d397ef55440A028321D6D780A0/sources/contracts/BountyV2.sol
Sets a new minimum bounty newMinBounty The new minimum bounty
function setMinBounty(uint256 newMinBounty) external onlyOwner { _minBounty = newMinBounty; }
3,024,021
/** *Submitted for verification at Etherscan.io on 2021-03-09 */ /** *Submitted for verification at Etherscan.io on 2021-02-22 */ // File @animoca/ethereum-contracts-erc20_base/contracts/token/ERC20/[emailย protected] /* https://github.com/OpenZeppelin/openzeppelin-contracts The MIT License (MIT) Copyright (c) 20...
Lifecycle step which delivers the purchased SKUs to the recipient. Responsibilities: - Ensure the product is delivered to the recipient, if that is the contract's responsibility. - Handle any internal logic related to the delivery, including the remaining supply update. - Add any relevant extra data related to deli...
function _delivery(PurchaseData memory purchase) internal virtual override { super._delivery(purchase); address[] memory to = new address[](purchase.quantity); uint256[] memory ids = new uint256[](purchase.quantity); bytes32[] memory uris = new bytes32[](purchase.quantity); ...
7,883,523
/** *Submitted for verification at Etherscan.io on 2022-04-02 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
First checks if a sale is valid by checking that the hash has not been cancelled or already completed and that the correct address has given the signature. If both checks pass we mark the hash as complete and emit an event./
function _markHashSold( address seller, uint256 version, uint256 nonce, uint256 tokenId, uint256[4] memory pricesAndTimestamps, uint256 salePrice, bytes memory signature ) internal { bytes32 hash = _hashToCheckForSale( seller, ...
15,379,566
./full_match/42/0x1973FC2bAeE05598f79ac14c77C45C99166F07f7/sources/contracts/das_get_balance.sol
/ uint256 _gas = 35000; (bool sent, bytes memory data) = _receiver.call{value:_amount, gas: _gas}(""); require(sent, "Failed to send Ether");
function sendEth(address payable _receiver, uint256 _amount) public payable { _receiver.transfer(_amount); }
9,589,287