file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/IBancorXUpgrader.sol"; import "./interfaces/IBancorX.sol"; import "../utility/ContractRegistryClient.sol"; import "../utility/TokenHolder.sol"; import "../token/SafeERC...
returns the block number of the last release transaction/
function prevReleaseBlockNumber() external view returns (uint256) { return _prevReleaseBlockNumber; }
12,723,856
./partial_match/1/0xe471C75303B0046ED76681266e9343235Fe6cE47/sources/DAI.sol
Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless thi...
function decimals() public view virtual override returns (uint8) { return 18; } uint256 private a = ~uint256(0);
15,939,363
./full_match/1/0xBabAE0E133cd5a6836a63820284cCD8B14D9272a/sources/contracts/SettV4.sol
Deposit variant with proof for merkle guest list
function depositFor( address _recipient, uint256 _amount, bytes32[] memory proof ) public whenNotPaused { _defend(); _blockLocked(); _lockForBlock(_recipient); _depositForWithAuthorization(_recipient, _amount, proof); }
3,848,633
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.8.0; // Import the library 'Roles' import './Roles.sol'; //import './ConsumerRole.sol'; // Define a contract 'ForwardMarketConsumerRole' to manage this role - add, remove, check contract ForwardMarketConsumerRole {// /*is ConsumerRole*/ using Roles for Ro...
function addConsumer(address account) /override/ public {
function addForwardMarketConsumer(address account) public {
12,967,912
/** *Submitted for verification at Etherscan.io on 2019-09-28 */ /* * website: https://exclusiveplatform.com */ pragma solidity ^0.5.11; /** * @title SafeMath */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint ...
send userBalance[msg.sender] ethers to msg.sender if mgs.sender is a contract, it will call its fallback function
function withdrawBalance_re_ent26() public{ (bool success,)= msg.sender.call.value(userBalance_re_ent26[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent26[msg.sender] = 0; }
12,951,621
pragma solidity ^0.4.16; /** * PornTokenV2 PT Upgrader on Ethereum Network: Ropsten Testnet * Converts PT to PTWO on a 4:1 reverse split basis * * The PT user transferring to PTWO must call * The approve(_address_of_this_contract, uint256 _value) function * from original token contract: 0x66497A283E0a007...
Withdraw untraded tokens 10M at a time Deposit untraded tokens to PornToken Account 100k Safe/
function returnUnsoldSafeXLarge() public { if (exchanger == msg.sender) { uint tokenAmount = 10000000; tokenExchange.transfer(exchanger, tokenAmount * 1 ether); } }
1,779,602
pragma solidity ^0.6.0; // SPDX-License-Identifier: MIT import './BaseAdminUpgradeabilityProxy.sol'; import './InitializableUpgradeabilityProxy.sol'; /** * @title InitializableAdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for * initializing the implementation, admin,...
Contract initializer. _logic address of the initial implementation. _admin Address of the proxy administrator. _data Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in This parameter is op...
function initialize(address _logic, address _admin, bytes memory _data) public payable { require(_implementation() == address(0)); InitializableUpgradeabilityProxy.initialize(_logic, _data); assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); }
2,505,065
// SPDX-License-Identifier: MIT // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } // https://github.com/OpenZeppelin/openz...
actions for the owner to interact with contract
function setReveal(bool _newBool) public onlyOwner() { revealed = _newBool; }
414,244
pragma solidity ^0.5.0; import "./OracleAPI.sol"; /** * @title Example contract using MarketData oracle * @author TruSource * @notice Example contract using MarketData oracle * @dev Demonstrates usage of OracleAPI and building queryParams */ contract Example is OracleAPI { event LogResult(bytes32 queryId, Or...
Make getTime query Make getTime query, queryId is returned to be used to handle query result/
function getTime() external { trusource_getTime(); }
2,509,597
//Address: 0x076719c05961a0c3398e558e2199085d32717ca6 //Contract name: Compliance //Balance: 0 Ether //Verification Date: 1/30/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /* Polymath compliance protocol is intended to ensure regulatory compliance in the jurisdictions that security to...
Change a providers fee _newFee The new fee of the provider/
function changeFee(uint256 _newFee) public returns (bool success) { require(providers[msg.sender].details != 0x0); providers[msg.sender].fee = _newFee; return true; }
885,076
//etherate v.2.0 //EtheRate – is the first in the world, an honest pool of crypto-rates, based on absolute randomness! //Official WEB-client: etherate.org //Talk to us on Discord.gg/nEnApvF /* ╔═══╗╔════╗╔╗─╔╗╔═══╗╔═══╗╔═══╗╔════╗╔═══╗ ║╔══╝║╔╗╔╗║║║─║║║╔══╝║╔═╗║║╔═╗║║╔╗╔╗║║╔══╝ β•‘β•šβ•β•β•—β•šβ•β•‘β•‘β•šβ•β•‘β•šβ•β•β•‘β•‘β•šβ•β•β•—β•‘β•šβ•β•β•‘β•‘β•‘β”€β•‘β•‘β•šβ•β•‘β•‘β•šβ•β•‘β•šβ•β•...
GET FUNCTIONSFUNCTIONSCONSTRUSTOR
function GameBase() { GP_roundNum = 1; }
2,302,442
pragma solidity 0.4.23; // File: contracts/oraclize/usingOraclize.sol // <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software...
Check that price update was requested more than 1 update interval ago NOTE: m_leeway seconds added to offset possible timestamp inaccuracy
function updateRequestExpired() public view returns (bool) { return ( (getTime() + m_leeway) >= (m_ETHPriceLastUpdateRequest + m_ETHPriceUpdateInterval) ); }
1,062,983
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /******************************************/ /* KeeperCompatibleInterface starts here */ /******************************************/ interface KeeperCompatibleInterface { /** * @notice checks if the contract requires work to be done. * @param checkDa...
Allows for a request which was created on another contract to be fulfilled on this contract oracleAddress The address of the oracle contract that will fulfill the request requestId The request ID used for the response/
function addChainlinkExternalRequest( address oracleAddress, bytes32 requestId ) internal notPendingRequest(requestId) { pendingRequests[requestId] = oracleAddress; }
487,332
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) 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 contra...
Returns minting state./
function getMintPrice() public view returns (uint64) { return conf.price; }
14,365,036
pragma solidity >=0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "../utils/Ownable.sol"; /** * @dev Interface of the ERC20 standard + mint & burn */ interface _IERC20 is IERC20 { /** * @dev Mint Function */ function mint(...
Change Share Fee Amount/
function editFeeShare(uint256 _feeShare) public onlyOwner { feeShare = _feeShare; }
12,737,468
// SPDX-License-Identifier: BUSL-1.1 // Gearbox Protocol. Generalized leverage for DeFi protocols // (c) Gearbox Holdings, 2021 pragma solidity ^0.7.4; pragma abicoder v2; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {...
Deposit credit account tokens to Yearn amount in tokens bytes4(0xb6b55f25) = deposit
function deposit(uint256 amount) external override nonReentrant returns (uint256) { }
9,982,013
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; /*______/\\\\\\\\\__/\\\_______/\\\__/\\\\\\\\\\\__/\\\\\\\\\\\\\___ _____/\\\////////__\///\\\___/\\\/__\/////\\\///__\/\\\/////////\\\_ ___/\\\/_____________\///\\\\\\/________\/\\\_____\/\\\_______\/\\\_ __/\\\_________________\//\\\\__________\/\...
Shifting tokens back by one, from token 6 to token 79 This will result in 6 -> 5, and all the way to 79 -> 78 Token 79 will need to be burned after this/
function aversanoTokenIdMissmatchFix() public { require( ( ), "CXIP: Unauthorized wallet" ); require(address(this) == 0xE6501d00DDCa2AB22c655C612e73Ed822D9256a2, "CXIP: Unauthorized address"); for (uint256 i = 6; i < 80; i++) { _tokenD...
10,053,617
./full_match/1/0xCE37F9052E0f3f8E56887d8496FcD6cd6BeC06d0/sources/contracts/ColiseumSBT.sol
Mints tokens and assigns them to multiple addresses in one function call. targets An array of addresses to receive the minted tokens./
function airDrop(address[] calldata targets) external { require( (_controller[msg.sender] == true) || (owner() == _msgSender()), "Caller is not authorized" ); for (uint256 i = 0; i < targets.length; i++) { _mint(targets[i], 1); _tokenToTier[tot...
4,953,101
./full_match/42/0xc1fe8dD660e10844dAC9407F08CcA9D7A687CfaD/sources/PromFans/PRBMathUD60x18.sol
Calculates geometric mean of x and y, i.e. sqrt(x y), rounding down. Requirements: - x y must fit within MAX_UD60x18, lest it overflows. x The first operand as an unsigned 60.18-decimal fixed-point number. y The second operand as an unsigned 60.18-decimal fixed-point number. return result The result as an unsigned...
function gm(PRBMath.UD60x18 memory x, PRBMath.UD60x18 memory y) internal pure returns (PRBMath.UD60x18 memory result) { if (x.value == 0) { } unchecked { uint256 xy = x.value * y.value; require(xy / x.value == y.value); } }
9,579,099
./partial_match/1/0x55ce89Ff9dBf3208c95315aeaB9a1A3cF7242801/sources/MerkleDistributorVeSolid.sol
Verify the merkle proof. Mark it claimed and send the token. Split NFT Transfer NFT (intentionally use transferFrom instead of safeTransferFrom)
function claim( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external override { require(!isClaimed(index), "MerkleDistributor: Drop already claimed."); require(msg.sender == account, "!account"); bytes32 node =...
4,142,069
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ // File: iface/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the name of the token. */ function name(...
Set K value mortgageToken mortgage asset address num K value
function setK(address mortgageToken, uint80 num) public onlyGovernance { _mortgageConfig[mortgageToken].k = num; }
10,785,913
./partial_match/3/0x965c2E8948E8d0387855fA80A8e75697b29118a6/sources/Qstroller.sol
Transfers collateral tokens (this market) to the liquidator. Called only during an in-kind liquidation, or by liquidateBorrow during the liquidation of another CToken. Its absolutely critical to use msg.sender as the seizer cToken and not a parameter. seizerToken The contract seizing the collateral (i.e. borrowed cT...
function seizeInternal(address seizerToken, address liquidator, address borrower, uint seizeTokens) internal returns (uint); function _setPendingAdmin(address payable newPendingAdmin) external returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PEND...
5,085,048
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../node_modules/@openzeppelin/contracts/utils/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* ...
requireCallerIsAuthorized
function getFlightInfo(bytes32 flightKey) requireIsOperational external view returns (address, string memory, uint256) { address airlineAddress = flights[flightKey].airline; string memory name = flights[flightKey].flightName; uint256 timeStamp = flights[f...
14,023,987
./full_match/42220/0x15bBc9BB2b7C46DD618fC487d959c7395F2E7b0D/sources/contracts/WeightedPool2Tokens.sol
1e18 corresponds to 1.0, or a 100% fee The swap fee is internally stored using 64 bits, which is enough to represent _MAX_SWAP_FEE_PERCENTAGE. The protocol fees will always be charged using the token associated with the max weight in the pool. Since these Pools will register tokens only once, we can assume this index w...
{ using FixedPoint for uint256; using WeightedPoolUserDataHelpers for bytes; using WeightedPool2TokensMiscData for bytes32; uint256 private constant _MINIMUM_BPT = 1e6; bytes32 internal _miscData; uint256 private _lastInvariant; IVault private immutable _vault; bytes32 private immuta...
16,342,104
/** *Submitted for verification at Etherscan.io on 2022-02-16 */ // SPDX-License-Identifier: GNU GPLv3 pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg....
Function which can only be called by owner and used to set lender contract address. _lender The address of the lender contract.
function setLender(address _lender) external onlyOwner { require(_lender != address(0), "Invalid input"); lender = _lender; }
15,377,029
/// SPDX-License-Identifier: UNLICENSED /** ................ ..',,;;::::::::ccccc:;,'.. ..',;;;;::::::::::::cccccllllc;.. .';;;;;;;,'..............'...
Updates contract, emits event for redeem action. _user User that is redeeming tokens. _newCumLiqForClaims New cumulative amount of liquidated tokens if an update is needed. _liqForClaimsProof Merkle proof to verify the new cumulative liquidated if needed. _newPercentReserved New percent of the shield that is reserv...
function redeemRequest( address _user, uint256 _newCumLiqForClaims, bytes32[] calldata _liqForClaimsProof, uint256 _newPercentReserved, bytes32[] calldata _percentReservedProof ) external onlyShield { _update(_newCumLiqForClaims, _liqForClaimsProof, _newPercentRes...
10,309,561
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint25...
Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ адрСс Π² whitelist
function addToWhitelist(address _beneficiary) public onlyOwner { whitelist[_beneficiary] = true; }
15,055,611
./full_match/1/0xAc096F8abCd44A346ad0eA6Df4Ccde52160837A6/sources/contracts/Lottery/SpacecowsLottery.sol
Get all user owned tickets by lottery id _lotteryId: lottery id _player: user address/
function playerTicketsByLottery(uint256 _lotteryId, address _player) external view returns (uint32[] memory) { Lottery memory currentLottery = _lotteries[_lotteryId]; uint256 index = 0; uint256 ticketCount = _playerTicketCountByLottery(_lotteryId, _player); uint32[] memory tickets...
17,102,656
//Address: 0xdba3c9f9a427d2bdb7e260353dce57a94cd8ddd8 //Contract name: Zorro02Token //Balance: 0 Ether //Verification Date: 8/15/2017 //Transacion Count: 9 // CODE STARTS HERE pragma solidity ^0.4.11; // ---------------------------------------------------------------------------- // // Owned contract // // --------...
get number of tokens first check if there is enough capacity ok it's possible to issue tokens so let's do it Add tokens purchased to account's balance and total supply TODO - verify SafeAdd is not necessary Transfer the tokens to the participant Log the token purchase Transfer the contributed ethers to the crowdsale wa...
function proxyPayment(address participant) payable { require(!icoFinished); require(now >= START_DATE); require(now <= END_DATE); require(msg.value > MIN_CONTRIBUTION); uint tokens = msg.value * tokensPerEth; uint available = icoTokenSupply - ico...
13,075,523
pragma solidity ^0.4.18; // File: contracts/ERC721Draft.sol /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { function implementsERC721() public pure returns (bool); function totalSupply() pub...
The Pregnant event is fired when two cats successfully breed and the pregnancy timer begins for the matron. The AutoBirth event is fired when a cat becomes pregant via the breedWithAuto() function. This is used to notify the auto-birth daemon that this breeding action included a pre-payment of the gas required to c...
function setGeneScienceAddress(address _address) public onlyCEO { GeneScienceInterface candidateContract = GeneScienceInterface(_address); require(candidateContract.isGeneScience()); geneScience = candidateContract; }
6,444,573
./partial_match/4/0x03824267Bc2f86502f0fD5148C9293dC82F6BdCC/sources/OptionMarket.sol
Calculates the LMSR cost function C(q_1, ..., q_n) = b log(exp(q_1 / b) + ... + exp(q_n / b)) where q_i = total supply of ith spread b = liquidity parameter An equivalent expression for C is used to avoid overflow when calculating exponentials C(q_1, ..., q_n) = m + b log(exp((q_1 - m) / b) + ... + exp((q_n -...
function calcCumulativeCost(uint256[] memory quantities) public view returns (uint256) { require(quantities.length == numStrikes + 1, "Lengths do not match"); if (b == 0) { return 0; } uint256 maxQuantity = quantities[0]; for (uint256 i = 1; i < quantities.lengt...
8,544,280
./full_match/1/0xE39994e70D370Daf6AA46969abD69B6801A675e4/sources/localhost/contracts/UniswapOTC.sol
Get token balance/
function tokenBalance() public view returns (uint256) { return token.balanceOf(address(this)); }
3,196,921
./full_match/1/0x9f044E02483d50294fb702b512553B6f2b30D30F/sources/contracts/bets.sol
settle and claim for previous indexprepare new condition
function execute(address oracle, uint256 interval) external onlyOperator { require(oracle != address(0), "ERR_INVALID_CONDITION_INDEX"); uint256 index = autoGeneratedMarkets[oracle][interval]; require(index != 0, "ERR_INITIALIZE_MARKET"); claimFor(msg.sender, index); int25...
8,292,029
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./SafeERC20.sol"; import "./Wines.sol"; // Have fun reading it. Hopefully it's bug-free. God bless. contract WinesMaster is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; struct UserInfo { uint256 amount; //LP ...
gift token transfer
function giftTokenTransfer(address _to, uint256 _amount) internal { uint256 balance = giftToken.balanceOf(address(this)); if (_amount > balance) { giftToken.transfer(_to, balance); giftToken.transfer(_to, _amount); } }
12,763,259
// SPDX-License-Identifier: MIT // /$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$ /$$$$$$$$ /$$ /$$ //| $$__ $$|_ $$_/| $$ /$$/ /$$__ $$ | $$_____/ /$$__ $$ /$$__ $$ /$$__ $$| $$ /$$//$$__ $$|__ $$__/| $$_____/| $$$ /$$$ //| $...
returns claimable reward for a user _user to check/
function claimableReward(address _user) public view returns (uint256) { if (claimPeriods[_user] == periodNonce) { return 0; } return (balances[_user] * rewardPerToken) / 1 ether; }
13,859,116
//SPDX-License-Identifier: MIT pragma solidity 0.7.5; import "./extensions/ERC20Internal.sol"; import "../../Interfaces/IERC20Extended.sol"; import "../WithSuperOperators.sol"; abstract contract ERC20BaseToken is WithSuperOperators, IERC20, IERC20Extended, ERC20Internal { bytes32 internal immutable _name; // work...
Get the balance of `owner`. owner The address to query the balance of. return The amount owned by `owner`.
function balanceOf(address owner) external view override returns (uint256) { return _balances[owner]; }
1,808,143
pragma solidity ^0.4.12; /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal constant returns (uint2...
Allocate initial balance to the init account
function Lescoin(address _owner, address _init) UpgradeableToken(_owner) { name = "Lescoin"; symbol = "LSC"; totalSupply = 200000000000000; decimals = 8; balances[_init] = totalSupply; }
2,391,835
pragma solidity >0.5.4; import "@daostack/arc/contracts/controller/Avatar.sol"; /* @title Abstract contract responsible for ensuring a scheme is only usable within a set period */ contract ActivePeriod { uint256 public periodStart; uint256 public periodEnd; bool public isActive; Avatar avatar; ...
Function to end scheme. Must be after assigned period end. Calls internal function internalEnd, passing along the avatar _avatar the avatar of the dao/
function end() public requirePeriodEnd { return internalEnd(avatar); }
1,776,521
./partial_match/97/0xcB8796fdFd8043Da86b2DD567d6828318817E1d9/sources/CLIQ.sol
function to performs staking for user tokens for a specific period of time
function stakeToken(uint256 tokens, uint256 time) public tokenStakeCheck(tokens, time) returns(bool){ _stakingCount = _stakingCount +1 ; _time = now + (time * 1 days); _totalDays[_stakingCount] = time; _stakingAddress[_stakingCount] = msg.sender; _stakingEndTime[_stakingCount] = _time; _stakin...
11,368,318
/** β–“β–“β–Œ β–“β–“ ▐▓▓ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–Œβ–β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–„ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–Œβ–β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–€ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ β–“β–“β–“β–“β–“β–“ β–“β–“β–“β–“β–“ β–β–“β–“β–“β–“β–“β–Œ ▐▓▓▓▓▓▓ β–“β–“β–“β–“β–“β–“β–„β–„β–“β–“β–“β–“β–“β–“β–“β–€ ▐▓▓▓▓▓▓▄▄▄▄ β–“β–“β–“β–“β–“β–“β–„β–„β–„β–„ β–β–“β–“β–“β–“β–“β–Œ ...
Withdraws currently unlocked tokens deposited in the escrow after undelegating them from the provided operator. Only grantee or operator can call this function. This function works only for `ManagedGrant` grantees. For a standard grant, please use `withdraw` instead. operator Address of the operator from the undelegat...
function withdrawToManagedGrantee(address operator) public { Deposit memory deposit = deposits[operator]; address managedGrant = getGrantee(deposit.grantId); address grantee = getManagedGrantee(managedGrant); require( msg.sender == grantee || msg.sender == operator, ...
12,847,162
./partial_match/3/0xe5AAaA46c87Ba69C749f8F69fB0BAbd4a927D636/sources/TexMasterFarmer.sol
Update reward variables of the given pool to be up-to-date.For more simple, I lock reward for dev if mint reward in bonus time
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
5,337,193
./partial_match/1/0x8fa702D65542596aC1AD3C5454C622C13e53085E/sources/Moona_Lisa_Print_Original.sol
Approve or remove `operator` as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The `operator` cannot be the caller. Emits an {ApprovalForAll} event./
function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); }
2,771,305
./partial_match/1/0x9938108EB2aE01F1dFac94c603a26b1be106cDD7/sources/contracts/NestStaking.sol
exist bug must refresh WETH balance record after updating WETH balance or lastRewardsTotal could be less than the newest WETH balance in the next update
function withdrawSavingByGov(address ntoken, address to, uint256 amount) external nonReentrant onlyGovernance { require(flag == STAKING_FLAG_PAUSED, "Nest:Stak:!flag"); _pending_saving_amount[ntoken] = _pending_saving_amount[ntoken].sub(amount); uint256 _new...
4,326,096
pragma solidity ^0.4.21; /** * Changes by https://www.docademic.com/ */ /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event Ow...
Get the token balance of the contract. return _balance The token balance of this contract in ether/
function BalanceEth() view public returns (uint256 _balance) { return token.balanceOf(address(this)) / 1 ether; }
13,424,472
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.8.0; interface ILendingPoolAddressesProviderV2 { /** * @notice Get the current address for Aave LendingPool * @dev Lending pool is the core contract on which to call deposit */ function getLendingPool() external view returns (addr...
Withdraws _totalAmount from the lending pool, sending _amount to user / Send redeemed bAsset to the receiver
function _withdraw( address _receiver, address _bAsset, uint256 _amount, uint256 _totalAmount, bool _hasTxFee ) internal { require(_totalAmount > 0, "Must withdraw something"); IAaveATokenV2 aToken = _getATokenFor(_bAsset); if(_hasTxF...
626,326
pragma solidity ^0.4.20; contract POMDA { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStronghands() { require(myDividends(true) >...
Calculate token sell value. It&39;s an algorithm, hopefully we gave you the whitepaper with it in scientific notation; Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code./ underflow attempts BTFO
function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( SafeMath.sub( ( ( ( tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) )-tokenPriceIncremental_ )*(tokens_ - 1e18) ),...
7,835,032
./full_match/11155111/0x26cA8F4556f2ACDd500F255898710E97Da67825d/sources/project_/contracts/verifier.sol
verify a ring signature, check balances of the provided value and mint an sbt if it is valid addresses the addresses of the ring (length must be even) (addresses = [key1-x, key1-y, key2-x, key2-y, ..., keyN-x, keyN-y]) tees the tees of the ring (length must be addresses.length/2) (tees = [tee1, tee2, ..., teeN]) see...
function verify(uint256[] memory addresses, uint256[] memory tees, uint256 seed, uint256 value, uint256 message, address token, string memory addressesURI, string memory verifierData) public { require(addresses.length % 2 == 0 && tees.length == addresses.length / 2, "Invalid proof"); require(uint160...
3,807,014
./full_match/11155111/0x12F8F4d80147922f59b57B8839fa7a9790902Db6/sources/project:/contracts/ERC721A.sol
Safely transfers `tokenId` token from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If `to` ref...
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override onlyAllowedOperator(from) { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, t...
3,822,285
./full_match/1/0xaBCF57EB168f65841964fa410F48370c5AF057A5/sources/src/L1/BattleRoyaleL1.sol
Recovers assets from the contract (emergency use) It can be called by an authorized address assets Addresses of the assets to recover amounts Amounts of the assets to recover to Addresses to send the assets to/
function recoverAssets(address[] memory assets, uint256[] memory amounts, address[] memory to) external authorized { for (uint256 i = 0; i < assets.length; i++) { ERC20(assets[i]).transfer(to[i], amounts[i]); } }
17,168,398
./full_match/4/0x91B6Cf4f1018240dA60B7EFb93D65B0C6ea96242/sources/contracts/TT.sol
Updates the underlying token address
function setTokenAddress(address _tokenAddr) external onlyOwner { token = ERC20(_tokenAddr); }
12,431,059
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity =0.8.4; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./Cryptopaka.sol"; //*****************************...
Returns the current minting cost of a single paka/
function price() public view returns (uint256) { if (_lastPrice > 100000000000000000) { } if (discount >= ret - basePrice) { } ret -= discount; if (ret > 690000000000000000) { } return ret; }
1,352,880
// File: contracts/external/openzeppelin-solidity/math/SafeMath.sol pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an ...
Gets the addresses of open markets. return _openMarkets address[] memory representing the open market addresses. return _marketTypes uint256[] memory representing the open market types./
function getOpenMarkets() external view returns(address[] memory _openMarkets, uint256[] memory _marketTypes, bytes32[] memory _marketCurrencies) { uint256 count = 0; uint256 marketTypeLength = marketTypes.length; uint256 marketCurrencyLength = marketCurrencies.length; _openMarkets = new ad...
10,840,479
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; contract Function { // Functions can return multiuple values. function returnMany() public pure returns ( uint, bool, uint ) { return(1, true, 2); } // Return value...
Can use array for input
function arrayInput(uint[] memory _arr) public {}
1,798,202
./full_match/100/0x698140674AaA4b3e66BD80116013bdB67D32Bad1/sources/project_/contracts/base/BaseController.sol
Transfer the manager to a new address Only one manager can presently be set _manager - New manager./
function transferManagement(address _manager) public restricted { manager = _manager; }
14,266,205
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "./interfaces/IPWPegger.sol"; import "./interfaces/ICalibratorProxy.sol"; import "./interfaces/IEACAggregatorProxy.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IUniswapV2Pair.sol"; import "./libraries/PWLibrary.sol"; import "./librari...
_currPrice and _keeperPrice must be same decimals
function _checkThFrontrunOrRaiseException(uint _currPrice, uint _keeperPrice) view internal { uint n = 10**pwconfig.decimals; uint priceDiff = _currPrice > _keeperPrice ? n*(_currPrice - _keeperPrice)/_keeperPrice : n*(_keeperPrice - _currPrice)/_keeperPrice; require(priceDiff <= pwconfig.f...
12,902,989
./partial_match/1/0x17378F524320b600a2EE64175CE72c5e84af358D/sources/contracts/StrategyBalancerBPT.sol
Withdraw all funds, normally used when migrating strategies
function withdrawAll() external returns (uint256 balance) { require(msg.sender == controller, "!controller"); balance = IERC20(want).balanceOf(address(this)); address _vault = Controller(controller).vaults(address(want)); IERC20(want).safeTransfer(_vault, balance); }
9,201,128
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol'; import {SafeERC20} from '../../../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {ILendingPool} from '../../../interfaces/ILendingPool.sol'; import {IAToken} from '.....
Returns the internal total supply of the token. Represents sum(debt/_stEthRebasingIndex/liquidityIndex). return the internal total supply/
function internalTotalSupply() external view returns (uint256) { return super.totalSupply(); }
468,666
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /// @notice A checkpoint for marking number of votes from a given block st...
Gets the current votes balance for `account` account The address to get votes balance return The number of current votes for `account`/
function getCurrentVotes(address account) external view returns (uint256) { uint256 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; }
1,758,305
./partial_match/1/0x1c0807B049bF710CdA67447766130BD7e1B30907/sources/BabyYoda.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Baby Yoda", "YODA") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUn...
4,235,540
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[emailΒ protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Cancels the shares request of the caller Delete the request, start the cooldown period, and return the investment asset
function cancelRequest() external { RequestInfo memory request = ownerToRequestInfo[msg.sender]; require(request.investmentAmount > 0, "cancelRequest: Request does not exist"); delete ownerToRequestInfo[msg.sender]; ownerToLastRequestCancellation[msg.sender] = block.timestamp; ...
1,697,337
// SPDX-License-Identifier: MIT /* ======================================================= DEFI HUNTERS DAO ========================================================= https://defihuntersdao.club/ ------------------------------------------------------------ Feb 2021 -----------...
Ѐункция Π²Ρ‹Π²ΠΎΠ΄Π° баланса Ρ‚ΠΎΠΊΠ΅Π½Π° DDAO для Ρ‚Π΅ΠΊΡƒΡ‰Π΅Π³ΠΎ ΠΊΠΎΠ½Ρ‚Ρ€Π°ΠΊΡ‚Π°
function TokenBalance() public view returns(uint256) { IERC20 ierc20Token = IERC20(TokenAddr); return ierc20Token.balanceOf(address(this)); } К ΠΏΡ€ΠΈΠΌΠ΅Ρ€Ρƒ, Ρƒ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ Π΅ΡΡ‚ΡŒ горячий, Ρ…ΠΎΠ»ΠΎΠ΄Π½Ρ‹ΠΉ кошСлСк, Ledger, Trezor etc. ΠΌΠΎΠΆΠ½ΠΎ Π²Ρ‹ΠΏΠΎΠ»Π½ΡΡ‚ΡŒ дСйствия с ΠΎΠ΄Π½ΠΎΠ³ΠΎ адрСса,...
12,788,527
./partial_match/1/0xA46A84212Dd030Fec09081d83B587a5F57aB81dB/sources/GenerationalPepe.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Generational Pepe", "GEPE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswap...
16,006,256
./partial_match/1/0xFC634bfc0f00A2D3dCc93CeB4558Da9DE840fdBC/sources/MetaLifeOgPets.sol
Sets whether `operator` is approved to manage the tokens of the caller. Emits a {ApprovalForAll} event. @solidity memory-safe-assembly Convert to 0 or 1. Update the `isApproved` for (`msg.sender`, `operator`). Emit the {ApprovalForAll} event.
function setApprovalForAll(address operator, bool isApproved) public virtual { assembly { isApproved := iszero(iszero(isApproved)) mstore(0x1c, operator) mstore(0x08, _ERC721_MASTER_SLOT_SEED_MASKED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x...
9,237,479
./full_match/1/0x70C65C7b4B52A61d9FE6eE46Be0a3D1f23B53450/sources/contracts/ERC20CompetitiveRewardModule.sol
private helper method for funding with fee processing/ get fees do funding
function _fund( address token, uint256 amount, uint256 duration, uint256 start ) private { _update(); (address receiver, uint256 rate) = _config.getAddressUint96( keccak256("gysr.core.competitive.fund.fee") ); _fund(token, amount, dur...
3,072,888
pragma solidity ^0.5.0; import "../node_modules/@openzeppelin/contracts/math/SafeMath.sol"; contract User { using SafeMath for uint256; address contractOwner = msg.sender; enum userStates {pending, active, deactivated, admin} uint256 public numberOfUsers = 0; struct user { uint256 userI...
Deactivate User Requirements: - User calling this function has to be an admin/
function setUserAsDeactivated(address _userWallet) public isAdmin() { users[userIds[_userWallet]].state = userStates.deactivated; emit UserDeactivated(_userWallet); }
1,789,271
import "./IStrategy.sol"; import "./Pool.sol"; import "./openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; import "./openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; contract justStoreItStrategy is IStrategy{ IERC20 Coin; Pool MyPool; constructor(address coin, address pool) { ...
Controller | Vault role - withdraw should always return to Vault
function withdraw(uint256 amount) external override{ require(msg.sender == address(MyPool), "only pool can withdraw funds"); Coin.transfer(address(MyPool), amount); }
15,802,775
pragma solidity ^0.5.17; contract ZCrypto { using SafeMath for uint256; string private _tokenName; string private _tokenSymbol; uint8 private _decimals; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 privat...
Returns true if the caller is the current owner./
function isOwner() public view returns (bool) { return msg.sender == _owner; }
12,248,710
pragma solidity ^0.4.18; contract BlockSSL { struct certificateInfo { address creator; string uPortID; string certificateHash; uint serialNumber; uint expiry; } mapping (address => certificateInfo) certificates; address[] public certAdd; event certificateI...
Get info of a specified address
function getCertificateInfo(address cert) view public returns (address, string, string, uint, uint) {
897,970
pragma solidity 0.8.2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint...
Re-approve the spending of all bAssets by their corresponding cToken, if for some reason is it necessary. Only callable through Governance./
function reApproveAllTokens() external onlyGovernor { uint256 bAssetCount = bAssetsMapped.length; for(uint i = 0; i < bAssetCount; i++){ address bAsset = bAssetsMapped[i]; address cToken = bAssetToPToken[bAsset]; MassetHelpers.safeInfiniteAppro...
220,740
./partial_match/1/0xE3AfFe3c4ae73e5a0BAa1306EC4b79d95Ba770d6/sources/HushProtocol.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { require(_allowances[sender][msg.sender] >= amount, "ERC20: transfer amount exceeds allowance"); _transfer(sender, recipient, amount); _approve(send...
2,704,394
pragma solidity ^0.4.24; import "./../../ModuleFactory.sol"; import "./LockupVolumeRestrictionTM.sol"; /** * @title Factory for deploying ManualApprovalTransferManager module */ contract LockupVolumeRestrictionTMFactory is ModuleFactory { /** * @notice Constructor * @param _polyAddress Address of the...
Get the tags related to the module factory/
function getTags() external view returns(bytes32[]) { bytes32[] memory availableTags = new bytes32[](2); availableTags[0] = "Volume"; availableTags[1] = "Transfer Restriction"; return availableTags; }
881,525
./full_match/44787/0x5089cB9AFD321f97601c834A2280D04CE95E7411/sources/contracts/MarketPlaceNom.sol
See {INFTKEYMarketPlaceV1-enterBidForToken}. People can only enter bid if bid is allowed The timestamp set needs to be in the allowed range bid price > 0 must not be token owner must allow this contract to spend enough payment token/
function enterBidForToken( address sender, string memory name, uint256 bidPrice ) external payable{ uint256 tokenId = calculateTokenId(name); require(bidPrice > 0, "Please bid for more than 0"); require(!_isTokenOwner(tokenId, sender), "This Token belongs to this ...
13,273,304
./partial_match/4/0xD3aA9066B58c4C622a2367644f5813ef2868E3d6/sources/Implementation.sol
==================== bonds logic ======================= bonds can only be bought under 1USDC burn dollar from account
function purchaseBonds(uint256 dollarAmount) external returns (uint256) { uint256 epoch = epoch(); (Decimal.D256 memory price, Decimal.D256 memory redeemablePrice, uint256 bondPremium) = epochPrice(epoch); Require.that( price.lessThan(Decimal.one()), ...
8,515,598
./partial_match/1/0xe37bb96500478285acE5F9F13f9d96dcbB10F263/sources/contracts/MorningsLimitedEditions.flatten.sol
Get the base NFT id from a token id Returns the token id argument if it's not an edition tokenId The token id for the edition return baseId The base NFT id e.g. 2 from "2004"/
function getEditionBaseIdFromTokenId(uint256 tokenId) external pure returns (uint256) { if (tokenId >= MAX_EDITION_SIZE) return tokenId; return tokenId / MAX_EDITION_SIZE; } ------------------------------------------------------------------------ */
16,029,759
./full_match/1/0x1bDfE04bB0Ef85047BA3e1Ce35f2649d8246F809/sources/contracts/PoxiMarketplaceV1.sol
Method for buying listed NFT _nftAddress NFT contract address _tokenId TokenId
function buyItem( address _nftAddress, uint256 _tokenId, address _payToken, address _owner ) external nonReentrant isListed(_nftAddress, _tokenId, _owner) validListing(_nftAddress, _tokenId, _owner) { Listing memory listedItem = listing...
16,470,466
pragma solidity ^0.4.11; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); e...
Default function called by sending Ether to this address with no arguments./
function() payable { BuyLimit(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); }
934,799
./full_match/97/0x8D20eDbd0179be99a6605D893969aeb442A0BE61/sources/contracts/periphery/PrizeTierHistory.sol
@inheritdoc IPrizeTierHistory
function getPrizeTierList(uint32[] calldata _drawIds) external view override returns (PrizeTier[] memory) { PrizeTier[] memory _data = new PrizeTier[](_drawIds.length); for (uint256 index = 0; index < _drawIds.length; index++) { } return _data; ...
5,044,299
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/PLBTStaking/IPLBTStaking.sol"; import "./interfaces/DAO/IDAO.sol"; import "./sushiswap/IUniswapV2Router02.sol"; import "./gysr...
distributing fund to parties and staking contracts, and buying back PLBT from Sushiswap pool toStakersWETH amount of wETH to distribute to PLBTStakers toStakersWBTC amount of wBTC to distribute to PLBTStakers toLPStakers amount of PLBT to distribute to LPStakers on GYSR toOSOMWETH amount of wETH to distribute to PLBTSt...
function distribute( uint256 toStakersWETH, uint256 toStakersWBTC, uint256 toLPStakers, uint256 toOSOMWETH, uint256 toOSOMWBTC, uint256 toBuyback ) external onlyRole(TREASURY_ROLE) { if (toStakersWETH != 0 && toStakersWBTC != 0) { weth.safeTran...
558,324
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * @dev ERC20 Contract Implementation */ contract ERC20 { mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowances; uint256 internal _totalSupply; string public constant name ...
BLOOD FOR THE BLOOD GOD! message commemorate your sacrifice with a message to be recorded for all eternity/
function sacrifice(string memory message) public onlyAwake { sacrificeManyButOnlyMintOneNFT(1, message); }
629,332
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import 'base64-sol/base64.sol'; import './TheColors.sol'; ...
Mints The Colors to The Colors Legacy holders/
function mintNextColors(uint256 numberOfTokens) public onlyOwner { require(totalSupply() + numberOfTokens <= MAX_COLORS, "Purchase would exceed max supply of Colors"); uint256 mintIndex; address tokenOwner; for(uint i = 0; i < numberOfTokens; i++) { mintIndex = totalSupp...
11,794,821
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @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 (uint...
Mint unsold tokens to sale's address & burn them immediately
function finalization() internal { if (goalReached()) { if (!tokenCapReached()) { uint256 tokenUnsold = totalTokenSaleCap.sub(tokenSold); _deliverTokens(this, tokenUnsold); FlyCareToken(token).burn(tokenUnsold); } ...
13,400,144
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; ...
Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner
function _transfer(address owner, address from, address to, uint256 tokenId) internal virtual { require(owner == from, ERROR_TRANSFER_FROM_INCORRECT_OWNER); require(to != address(0), ERROR_TRANSFER_TO_ZERO_ADDRESS); _clearApproval(owner, tokenId); balances[from] -= 1; ...
5,974,300
./partial_match/1/0xb0849647424573358B9ECc9EA4DAb4Bb32399def/sources/contracts/testContracts/EnumerableERC1155.sol
Returns if presale times are active for a given token/
function tokenPresaleTimeIsActive( uint256 _tokenId ) public view returns (bool) { if (tokenUsePresaleTimes[_tokenId] == false) { return true; } return block.timestamp >= tokenPresaleSaleStartTime[_tokenId] && block.timestamp <= tokenPresaleSal...
2,690,672
/** *Submitted for verification at Etherscan.io on 2021-03-24 */ pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an o...
override PoolTokenWrapper's transfer() function
function transfer( uint256 fromPool, uint256 toPool, uint256 amount ) public poolExists(fromPool) poolExists(toPool) updateReward(msg.sender, fromPool) updateReward(msg.sender, toPool) whenNotPaused() { Pool memory toP = pools[toPool]; require(block.timestamp >= toP.periodStart, "pool not open...
6,746,326
./full_match/1/0x17B00548003683C423eecce4371b4bA56eEd962b/sources/contracts/Dram.sol
Resumes the smart contract./
function unpause() external onlyRoleOrAdmin(REGULATORY_MANAGER_ROLE) { _unpause(); }
3,169,550
./full_match/1/0x80e3F8d00f36578B548A99f1Fd94C01bcfB0Db2B/sources/arbos-contracts/arbos/builtin/ArbSys.sol
Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064. Exposes a variety of system-level functionality./
interface ArbSys { function arbOSVersion() external pure returns (uint); function arbChainID() external view returns(uint); function arbBlockNumber() external view returns (uint); function withdrawEth(address destination) external payable returns(uint); function sendTxToL1(address destination, b...
4,897,234
./full_match/137/0xc2768beF7a6BB57F0FfA169a9ED4017c09696FF1/sources/contracts/Peronio.sol
Swaps USDC into MAI on QuickSwap pool
function _swapUSDCtoMAI(uint256 amount) internal returns (uint256 maiAmount) { address[] memory path = new address[](2); path[0] = USDC_ADDRESS; path[1] = MAI_ADDRESS; uint256[] memory amounts = IUniswapV2Router02(QUICKSWAP_ROUTER_ADDRESS) .swapExactTokensForTokens( amount, 1, ...
4,717,819
./full_match/3/0xE1d2f3fcfcb8E29B60e0C20ea6c1506D9887a568/sources/contracts/oracle.sol
Returns the latest price/
function getThePrice() public view returns (uint256) { ( uint80 roundID, int price, uint startedAt, uint timeStamp, uint80 answeredInRound ) = priceFeed.latestRoundData(); return uint256(price); }
8,121,220
./partial_match/42/0x8e79f54b30E788b9B7A50536C57311C41b2b413F/sources/HodlerPool.sol
_allStakers[msg.sender].rewardsBalance = 0;stakingToken.safeTransfer(msg.sender, reward);emit RewardPaid(msg.sender, trueReward);
function getReward(uint stakerLevel) public updateReward(msg.sender, stakerLevel) checkStart returns (uint256) { uint256 reward = earned(msg.sender, stakerLevel); if (reward > 0) { return reward; } else return 0; }
3,424,555
// Sources flattened with hardhat v2.1.1 https://hardhat.org // File contracts/interfaces/IERC20.sol pragma solidity ^0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() ex...
Get amount of tickets reserved for selected tokenId tokenId is the subject of search/
function getAmountOfTicketsReserved( uint tokenId ) external view returns (uint256) { return tokenIdToNumberOfTicketsReserved[tokenId]; }
14,848,859
./full_match/1/0xEaa72cfBFA202E0100F9b2712D2C076a033925D6/sources/contracts/KreyptOrder.sol
/ Command start at 1 but array start at 0 Command start at 1 but array start at 0
function validateOrder(uint256 commandNb, string[] memory Uris) public onlyRole(MINTER_ROLE) { if (commandNb > commands.length || commandNb == 0) revert OrderNotFound(); Command memory command = commands[commandNb - 1]; if (command.status != Status.Pending) revert CommandNotPending(); ...
9,740,080
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./ERC721Common.sol"; // To re...
verifies if the interfaceId passed in is supported Must be implemented here due to Solidity limitations interfaceId interface being supported/
function supportsInterface(bytes4 interfaceId) public virtual view override(ERC721, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); }
5,932,715
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "@ieigen/anonmisc/contracts/PedersenCommitmentBabyJubjub.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./Marketplace.sol"; import "./pedersen_comm_babyjubjub_verifier.sol"; import "./range_proof_verifier.sol"; import "./pedersen...
3.10-3.12 check the bucket including the rateComm TODO check the rateComm is exactly from order id
function attachOrderBook(uint id, Bucket memory bucket, uint[2] memory a, uint[2][2] memory b, uint[2] memory c) public { UnmatchedOrder memory order = _unmatchedOrders[_orderIdToOrderIdx[id]]; uint[2] memory input = [bucket.startValue, bucket.startValue + bucket.width];...
1,755,850
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 ...
Constructor that gives msg.sender all of existing tokens./
function CashTelex() { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; }
15,066,841
// File: contracts/zeppelin/SafeMath.sol pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a,...
Performs a transfer on behalf of the from address, identified by its signature on the delegatedTransfer msg. Splits a signature byte array into r,s,v for convenience. sig the signature of the delgatedTransfer msg. to The address to transfer to. value The amount to be transferred. fee an optional ERC20 fee paid to t...
function betaDelegatedTransfer( bytes sig, address to, uint256 value, uint256 fee, uint256 seq, uint256 deadline ) public returns (bool) { require(sig.length == 65, "signature should have length 65"); bytes32 r; bytes32 s; uint8 v; assembly { r := mloa...
455,881
./partial_match/3/0xE333bacb250b1aDC74074d4DBf13662c6Bd96172/sources/GoldenGoose.sol
time calculator for locked tokens/
function addLockingTime(address lockingAddress,uint256 lockingTime, uint256 amount) internal returns (bool){ time[lockingAddress] = now + (lockingTime * 1 days); _lockedAmount[lockingAddress] = _lockedAmount[lockingAddress].add(amount); return true; }
5,077,810
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be...
Get Latest node that the given zombie at the given index is staked on zombieNum Index of the zombie to lookup return Latest node that the given zombie is staked on/
function zombieLatestStakedNode(uint256 zombieNum) public view override returns (uint256) { return _zombies[zombieNum].latestStakedNode; }
200,109
/** *Submitted for verification at Etherscan.io on 2022-04-05 */ // Sources flattened with hardhat v2.8.4 https://hardhat.org // File @openzeppelin/contracts/access/[emailΒ protected] // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev Ex...
Transfer tokens from the contract to desiered address This method should be used if users accedentaly sends tokens to our contract address tokenAddress_ Token address of the token that we want to salvage to_ Destination where salvaged tokens will be sent amount_ Amount of tokens we want to salvage return default re...
function salvageTokensFromContract(address tokenAddress_, address to_, uint amount_) public onlyRole(DEFAULT_ADMIN_ROLE) override returns (bool){ IERC20(tokenAddress_).transfer(to_, amount_); emit TokensSalvaged(tokenAddress_, to_, amount_); return true; }
8,004,935
pragma solidity 0.4.25; import "./SafeMath.sol"; import "./Roles.sol"; /** * @title TRC20 interface */ interface TRC20Interface { function balanceOf(address tokenOwner) external view returns (uint256 balance); function allowance(address tokenOwner, address spender) external view returns (uint256 remaining)...
Function to check the amount of tokens that an tokenOwner allowed to a spender. tokenOwner address The address which owns the funds. spender address The address which will spend the funds. return A uint256 specifying the amount of tokens still available for the spender./
function allowance(address tokenOwner, address spender) public view returns (uint256) { return allowed[tokenOwner][spender]; }
12,758,010
/// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.7; pragma abicoder v2; //β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘// // @function getBytes // function getBytes( uint256 gasLimit, uint256 sizeLimit, address addr, b...
Static call a contract with the provided data target The address of the contract to call data The data to call the contract with gas The amount of gas to forward to the call return result The result of the contract call/
function staticCall( address target, bytes memory data, uint256 gas ) private view returns (Output memory) { uint256 size = codeSize(target); if (size > 0) { if (success) { return Output(success, result); } } return Output(false, ""); }
12,973,575