file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x31FF47d5C0D669C2d31A1658e4e10D9605210289/sources/contracts/0xerc1155/interfaces/IERC1155TokenReceiver.sol
ERC-1155 interface for accepting safe transfers./
interface IERC1155TokenReceiver { function onERC1155Received( address _operator, address _from, uint256 _id, uint256 _amount, bytes calldata _data ) external returns (bytes4); function onERC1155BatchReceived( address _operator, address _from, uint256[] calldata _ids, uint256[]...
3,856,672
./full_match/1/0xd1Ad8a5D9Be8267D833f23c7D2349b6A2B30b0AD/sources/contracts/Boneyard.sol
Returns whether the provided account has the specified role/
function _hasRole(bytes32 role, address account) private view { if (!hasRole(role, account)) { revert AccessDenied(); } }
8,352,575
./partial_match/137/0xD1178fC23853c2d469fddf5303F1bB026FbD3DB9/sources/WildcardSteward_matic_v1.sol
Gets the token ID at a given index of all the tokens in this contract Reverts if the index is greater or equal to the total number of tokens. index uint256 representing the index to be accessed of the tokens list return uint256 token ID at the given index of the tokens list/
function tokenByIndex(uint256 index) public override view returns (uint256) { (uint256 tokenId, ) = _tokenOwners.at(index); return tokenId; }
3,527,251
./partial_match/1/0x0a625d31ebF6E8A93C54911075B00De881549B92/sources/StrategyMirUstLpV1.sol
Internal functions Swap with uniswap
function _swapUniswap( address _from, address _to, uint256 _amount ) internal { require(_to != address(0)); IERC20(_from).safeApprove(univ2Router2, 0); IERC20(_from).safeApprove(univ2Router2, _amount); address[] memory path; if (_to == mmToken &...
2,896,775
pragma solidity ^0.4.16; 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 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically ...
approve should be called when allowed[_spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol/
function increaseApproval (address _spender, uint256 _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
7,622,259
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ /** // SPDX-License-Identifier: Unlicensed @GHP TOKEN 💬Telegram💬:https://t.me/GHPTOKEN 🌐Website🌐:https://greenhealthyplanet.io/ 📝Twitter📝: https://twitter.com/GHPTOKEN */ pragma solidity 0.8.9; abstract contract Context { function _msgS...
exclude from paying fees or having max transaction amount
constructor() ERC20("GHP TOKEN", "GHP") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uni...
2,136,460
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Helper function to parse spend and incoming assets from encoded call args during redeem() calls
function __parseAssetsForRedeem(bytes calldata _actionData) private view returns ( IIntegrationManager.SpendAssetsHandleType spendAssetsHandleType_, address[] memory spendAssets_, uint256[] memory spendAssetAmounts_, address[] memory incomingAs...
10,290,970
pragma solidity ^0.5.16; import "./VToken.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./PriceOracle.sol"; import "./ComptrollerInterface.sol"; import "./ComptrollerStorage.sol"; import "./Unitroller.sol"; import "./Governance/XVS.sol"; import "./VAI/VAI.sol"; /** * @title Venus's Comptrol...
Checks if the account should be allowed to transfer tokens in the given market vToken The market to verify the transfer against src The account which sources the tokens dst The account which receives the tokens transferTokens The number of vTokens to transfer return 0 if the transfer is allowed, otherwise a semi-op...
function transferAllowed(address vToken, address src, address dst, uint transferTokens) external onlyProtocolAllowed returns (uint) { require(!transferGuardianPaused, "transfer is paused"); uint allowed = redeemAllowedInternal(vToken, src, transferTokens); if (allowed != uint(Error.NO_ERROR...
5,479,857
pragma solidity 0.5.17; import "./Ownable.sol"; import "./Shujinko.sol"; import "./ShujinkoRealmToken.sol"; import "./SafeMath.sol"; // Market Place contract contract MarketPlace is Ownable { using SafeMath for uint256; // Tokens used in the farming Shujinko public Shujinko; ShujinkoRealmTo...
cancel my selling sellInstance
function cancelMySellingInstance(uint256 _tokenId)public{ require(sellsInstances[_tokenId].owner == msg.sender, "Not your Shujinko"); Shujinko.transferFrom(address(this),msg.sender,_tokenId); uint256 index = getSellingIndexOfToken(_tokenId); delete tokensOnSale[index]; delete...
13,122,401
// SPDX-License-Identifier: AGPL-3.0-only /* ValidatorService.sol - SKALE Manager Copyright (C) 2019-Present SKALE Labs @author Dmytro Stebaiev @author Artem Payvin @author Vadim Yavorsky SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Af...
Allows a validator to set a minimum delegation amount./ check Validator Exist inside getValidatorId
function setValidatorMDA(uint minimumDelegationAmount) external override { uint validatorId = getValidatorId(msg.sender); emit SetMinimumDelegationAmount( validatorId, validators[validatorId].minimumDelegationAmount, minimumDelegationAmount ); ...
10,226,666
//Address: 0x3ca53621001e34786d63311691ace2203cab61e8 //Contract name: Distribution //Balance: 0 Ether //Verification Date: 3/27/2018 //Transacion Count: 43 // CODE STARTS HERE pragma solidity ^0.4.18; /* Copyright 2017, Anton Egorov (Mothership Foundation) Copyright 2017, An Hoang Phan Ngo (Mothership Foundati...
Change a burner address _newBurner The new burner address
function changeBurner(address _newBurner) public onlyBurner { burner = _newBurner; }
6,404,887
pragma solidity 0.4.22; import "./zeppelin-solidity/contracts/math/SafeMath.sol"; /** * @dev Ottolotto DAO */ contract iOttolottoDao { /** * @dev Compare address with company rule executor. */ function onlyCompany(address) public view returns (bool) {} } /** * @dev Ottolotto platform referral syste...
Starts Grand jackpot game./
function startChampionGame() public { require(currentGameBlockNumber == 0); require(targetChampionDate() <= now); currentGameBlockNumber = game; game = block.number; championGameStartBlock[currentGameBlockNumber] = block.number + startBlockInterval; emit ChampionGam...
12,947,054
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/cont...
Mints composite plus tokens with underlying tokens provided. _tokens The tokens used to mint the composite plus token. The composite plus token must have sufficient allownance on the token. _amounts Amount of tokens used to mint the composite plus token./ Rebase first to make index up-to-date Transfers the token into...
function mint(address[] calldata _tokens, uint256[] calldata _amounts) external override nonReentrant { require(_tokens.length == _amounts.length, "invalid input"); rebase(); uint256 _amount = 0; for (uint256 i = 0; i < _tokens.length; i++) { require(tokenSupported[_toke...
12,563,019
/** *Submitted for verification at Etherscan.io on 2020-08-19 */ /* Modifications Copyright 2020 Radar Relay, Inc. Copyright 2018 dYdX Trading 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...
File: contracts/interfaces/ExchangeWrapper.sol ExchangeWrapper dYdX Contract interface that Exchange Wrapper smart contracts must implement in order to interface with other smart contracts through a common interface./ ============ Public Functions ============
interface ExchangeWrapper { function exchange( address tradeOriginator, address receiver, address makerToken, address takerToken, uint256 requestedFillAmount, bytes calldata orderData ) external returns (uint256); function getExchangeCost( ...
1,833,643
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Send back to the sender any remaining ETH value
function joinPool( bytes32 poolId, address recipient, IVault.JoinPoolRequest memory request ) external payable rebalance(poolId, request.assets, new uint256[](request.assets.length)) { if (address(this).balance > 0) { msg.sender.sendValue(address(this).balance); ...
968,375
./full_match/83/0xb5D2820b2c423A733817aF35e615ce0726d48ED7/sources/contracts/Comptroller.sol
Checks if left Exp <= right Exp./
function lessThanOrEqualExp(Exp memory left, Exp memory right) internal pure returns (bool) { return left.mantissa <= right.mantissa; }
9,563,903
pragma solidity ^0.4.24; /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md /// Note: the ERC-165 identifier for this interface is 0x80ac58cd interface ERC721 /* is ERC165 */ { // /// @dev This emits when ownership of any NFT changes by any mec...
get prize value on scratch card given id
function prizeOf(uint256 _tokenId) external view returns (uint16) { return scratches[_tokenId].prizeValue; }
5,390,723
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.6.7 https://hardhat.org // File contracts/Math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. T...
Helpful for UIs Get the index
function collateral_information(address collat_address) external view returns (CollateralInformation memory return_data){ require(enabled_collaterals[collat_address], "Invalid collateral"); uint256 idx = collateralAddrToIdx[collat_address]; return_data = CollateralInformation( ...
448,572
./full_match/1/0xD360c4eEd8D02c6D43Dab90466159F580C0F68BB/sources/contracts/core/libraries/ObservationLib.sol
Fetches Observations `beforeOrAt` and `atOrAfter` a `_target`, eg: where [`beforeOrAt`, `atOrAfter`] is satisfied. The result may be the same Observation, or adjacent Observations. The answer must be contained in the array used when the target is located within the stored Observation. boundaries: older than the most r...
function binarySearch( Observation[MAX_CARDINALITY] storage _observations, uint24 _newestObservationIndex, uint24 _oldestObservationIndex, uint32 _target, uint24 _cardinality, uint32 _time ) internal view returns (Observation memory beforeO...
2,912,365
pragma solidity ^0.5.0; import "./GSNRecipient.sol"; /* * this contract is modified from the sample found in openzeppelin's GSN tutorial */ contract Voting is GSNRecipient { string public subject = "Do you think GSN is awesome?"; uint256 public totalYes; uint256 public totalNo; mapping(address => u...
No pre or post processing, leave _preRelayedCall and _postRelayedCall empty
function _preRelayedCall(bytes memory context) internal returns (bytes32) {}
12,666,804
pragma solidity ^0.4.19; contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view returns (uint256 balance); function ownerOf(uint256 _tokenId) external view returns (address owner); function approve(address _to...
rating MUST have most significant value!
function _packWarriorPvpData(uint256 _identity, uint256 _rating, uint256 _pvpCycle, uint256 _warriorId, uint256 _experience) internal pure returns(uint256){ uint256 packedData = _packWarriorCommonData(_identity, _experience); packedData += _warriorId * WARRIOR_ID_PACK_10; packedData += _pvpC...
5,942,231
./full_match/80001/0x3c97f55FC4bF942Ece8eAD55fCe33a250b8E7e3D/sources/project_/contracts/MintableSuperToken.sol
Initializer, used AFTER factory upgrade factory Super token factory for initialization name Name of Super Token symbol Symbol of Super Token
function initialize(address factory, string memory name, string memory symbol) external { _initialize(factory, name, symbol); }
850,164
// File: contracts/lib/ERC20.sol pragma solidity ^0.4.24; /** * @title ERC20 * @dev A standard interface for tokens. * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md */ contract ERC20 { /// @dev Returns the total token supply function totalSupply() public view returns (u...
Initialize can only be called once. msg.sender MUST be the _fundsForwarderFactory Contract Its address must be a contract with three public getters: - bridge(): Returns the bridge address - escapeHatchCaller(): Returns the escapeHatchCaller address - escapeHatchDestination(): Returns the escashouldpeHatchDestinati...
function initialize(uint64 _giverId, uint64 _receiverId) public { require(fundsForwarderFactory == address(0), ERROR_ALREADY_INITIALIZED); fundsForwarderFactory = IFundsForwarderFactory(msg.sender); require(fundsForwarderFactory.bridge() != address(0), ERROR_ZERO_BRIDGE); receiverId...
2,572,884
./partial_match/1/0x4e55001A40297306060797154f2b24A3dEAF45D6/sources/FloorCheeseburger.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("fallen cheeseburger", "FLRBRG") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pai...
4,134,889
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface IUniswap { // To convert DAI to ETH function SWAPEXACTTOKENSFORETH436(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[]...
inject NONSTANDARD NAMING
function RECOMMEND876() public view returns (Lender) {
977,197
./full_match/1/0xa6630B22974F908a98a8139CB12Ec2EbABfbe9D4/sources/ILUS_Contract.sol
ERC20 interface/
interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); fun...
2,955,125
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./SafeMath.sol"; import "./TransferHelper.sol"; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * fal...
IHRC20 interface/
interface IHRC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function getOwner() external view returns (address); ...
13,141,309
./full_match/1/0x7857135B6BEF7B457d56eEe937a293D04a3aeB34/sources/contracts/GIGADRIP20.sol
Add an address to start dripping tokens to. We need to update _currAccrued whenever we add a new dripper or INCREASE a dripper multiplier to properly update totalSupply() IMPORTANT: Everytime you call this with an addr already getting dripped to, it will INCREASE the multiplier addr address to drip to multiplier us...
function _startDripping(address addr, uint128 multiplier) internal virtual { Accruer storage accruer = _accruers[addr]; if (accruer.accrualStartBlock != 0) { accruer.balance = balanceOf(addr); emit Transfer(address(0), addr, 0); } _currAccrued = totalSupply(...
9,748,751
./full_match/1/0xBf3B3b9368262Ed9BD06B621149CA947984D1B31/sources/contracts/main/TruStakeMATICv2.sol
Distributes allocation rewards from a distributor to a recipient. Caller must be a distributor of the recipient in the case of loose allocations. _recipient Address of allocation's recipient. _distributor Address of allocation's distributor. _strict Boolean indicating the type of the allocation (true/false for stri...
function distributeRewards(address _recipient, address _distributor, bool _strict) public nonReentrant { if (!_strict && msg.sender != _distributor) { revert OnlyDistributorCanDistributeRewards(); } _distributeRewardsUpdateTotal(_recipient, _distributor, _strict); }
4,869,126
pragma solidity 0.5.10; contract Context { constructor () internal { } function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } function _MSGDATA330() ...
inject NONSTANDARD NAMING
function APPROVE357(bytes32 loan) external {
1,784,196
./full_match/1/0xBcbba981bFf1E9530CbcA0f40F67Aa85F8944038/sources/src/x-key/XKeys.sol
region auction functions
function startAuction() external payable onlyOwner requireRound(RoundType.Auction) { _startAuction(roundId); }
9,610,491
//SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; interface IERC721 { function ownerOf(uint256) external view returns (address); function balanceOf(address) external view returns (uint25...
returns true if the address holds an EC token/
function hasAnECToken(address _address) public view returns ( bool ) { if(ECTokenContract.balanceOf(_address) > 0) { return true; } return false; }
463,008
./partial_match/1313161554/0xF36cD4869564a9b0f41845CF06756A14cd31aEf2/sources/ReaperStrategyTrisolaris.sol
Function to retire the strategy. Claims all rewards and withdraws all principal from external contracts, and sends everything back to the vault. Can only be called by strategist or owner. Note: this is not an emergency withdraw function. For that, see panic()./
function _retireStrat() internal override { _swapToWnear(); _swapToWeth(); _addLiquidity(); (uint256 poolBal, ) = IMasterChefV1(MASTER_CHEF).userInfo(poolId, address(this)); IMasterChefV1(MASTER_CHEF).withdraw(poolId, poolBal); uint256 wantBalance = IERC20Upgrade...
16,933,010
// SPDX-License-Identifier: MIT import './abstract/ReaperBaseStrategy.sol'; import './interfaces/IUniswapV2Pair.sol'; import './interfaces/IUniswapV2Router02.sol'; import './interfaces/IMasterChef.sol'; import '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol'; pragma solidity 0.8.11; /...
Calculates the total amount of {want} held in the MasterChef/
function balanceOfPool() public view returns (uint256) { (uint256 _amount, ) = IMasterChef(MASTER_CHEF).userInfo(poolId, address(this)); return _amount; }
12,659,995
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, s...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; ...
1,178,358
pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "../libs/SafeMath.sol"; import "../interfaces/ERC20Interface.sol"; import "../ownership/Ownable.sol"; import "../interfaces/EURTokenInterface.sol"; import "../interfaces/BWLInterface.sol"; import "../interfaces/BFTInterface.sol"; import "../interfaces/B...
Remove multiple addresses from whitelist _addresses Addresses to be removed from whitelist
function bulkRemoveFromWhitelist(address[] _addresses) public onlyOwner { whitelist.bulkRemove(_addresses); }
12,926,835
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; i...
Stop rewards Only callable by owner. Needs to be for emergency./
function emergencyRewardWithdraw(uint256 _amount) external onlyOwner { maxRewardPerPool -= _amount; rewardToken.safeTransfer(address(msg.sender), _amount); }
6,086,413
pragma solidity ^0.5.0; import "./lib/RLPDecoder.sol"; import "./lib/ECDSA.sol"; import "./lib/SafeMath.sol"; import "./AppInterface.sol"; /** * @notice State channel of Ethereum */ contract EthChannel { using RLPDecoder for RLPDecoder.RLPItem; using RLPDecoder for bytes; using ECDSA for bytes32; us...
Force close channel by msg.sender partner the other peer of channel balanceHash keccak256(transferAmount, lockAmount, lockNonce), received from partner nonce strictly monotonic value used to order transfers pSig signature of transfer proof, signed by partner/
function fCloseChannel(address partner, bytes32 balanceHash, uint nonce, bytes memory pSig) public { bytes32 channelID = getChannelID(msg.sender, partner); Channel storage channel = id2channel[channelID]; require(channel.status == ChannelStatus.Open, "channel should be open"); if(non...
927,947
/** *Submitted for verification at Etherscan.io on 2021-06-12 */ pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view...
See {ERC20-balanceOf}./
function balanceOf(address account) external view returns (uint256) { return _balances[account]; }
6,737,209
pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns(uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); ...
SafeMath.sub will throw if there is not enough balance.
function transfer (address _to, uint256 _value) public returns (bool){ require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; ...
6,480,721
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 (uint256) { // assert(b > 0); // Sol...
------------------------------------------------------------------------ Approve and call : If approve returns true, it calls receiveApproval method of contract ------------------------------------------------------------------------
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; ...
41,912
// hevm: flattened sources of src/assimilators/mainnet/usdcReserves/mainnetCUsdcToUsdcAssimilator.sol pragma solidity >0.4.13 >=0.4.23 >=0.5.0 <0.6.0 >=0.5.7 <0.6.0; ////// lib/abdk-libraries-solidity/src/ABDKMath64x64.sol /* * ABDK Math 64.64 Smart Contract Library. Copyright © 2019 by ABDK Consulting. * Author: M...
takes raw amount transfers that amount to destination
function outputRaw (address _dst, uint256 _amount) public returns (int128 amount_) { uint256 _rate = cusdc.exchangeRateCurrent(); uint256 _usdcAmount = ( _amount * _rate ) / 1e18; uint _mintSuccess = cusdc.mint(_usdcAmount); _amount = cusdc.balanceOf(address(this)); ...
10,059,271
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* TheNFT - TheDAO NFT thedaonft.eth https://github.com/0xTycoon/thedao-nft On the 25th of July, 2017, The Securities and Exchange Commission (SEC) released an 18 page report about their investigation in to TheDAO. The report concluded that TheDAO tokens are s...
Count NFTs tracked by this contract return A count of valid NFTs tracked by this contract, where each one of them has an assigned and queryable owner not equal to the zero address
function totalSupply() external view returns (uint256) { return max; event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); }
391,124
pragma solidity ^0.7.0; // SPDX-License-Identifier: AGPL-3.0-or-later //MATH OPERATIONS -- designed to avoid possibility of errors with built-in math functions library SafeMath { //@dev Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (...
manages transfers of tokens in both transfer and transferFrom functions
function transferInternal(address fromAddress, address toAddress, uint256 amountTokens) internal { require(fromAddress != address(0), "ERC20: cannot transfer from zero address"); require(toAddress != address(0), "ERC20: cannot transfer to zero address"); tokenBalanceLedger_[fromAddress] = to...
989,848
./full_match/4/0x21fCE70f4Af45b3CD97c9C989e24b4132ACeeFB0/sources/browser/DEFI100.sol
monetaryPolicy_ The address of the monetary policy contract to use for authentication./
function setMonetaryPolicy(address monetaryPolicy_) external onlyOwner { monetaryPolicy = monetaryPolicy_; emit LogMonetaryPolicyUpdated(monetaryPolicy_); }
663,111
./full_match/1/0x3321d7Df33C3159c53861c24535Ce790Cd0b866E/sources/browser/ExchangeNFT.sol
针对某个NFT作品offer一个价格(ERC20)
function makeOfferERC20(uint256 _tokenId) external payable returns (bool){ require(_initialPricesMapErc20.contains(_tokenId), 'Token not in sell book'); require(block.timestamp < getDeadlineErc20(_tokenId), 'Auction is out-dated'); _tokenBidOffers[_tokenId][msg.sender] = _tokenBidOffers[_tokenId...
3,168,337
// File: contracts/EternalStorage.sol // Roman Storm Multi Sender // To Use this Dapp: https://rstormsf.github.io/multisender pragma solidity 0.4.23; /** * @title EternalStorage * @dev This contract holds all the necessary state variables to carry out the storage of any contract. */ contract EternalSto...
Allows the upgradeability owner to upgrade the current version of the proxy. version representing the version name of the new implementation to be set. implementation representing the address of the new implementation to be set./
function upgradeTo(string version, address implementation) public onlyProxyOwner { _upgradeTo(version, implementation); }
956,132
./full_match/1/0xaC222a1c75179f0792601e8AcBC2d4b1e942C16a/sources/contracts/Presale.sol
Finish the sale - Create Uniswap v2 pair, add liquidity, take fees, withrdawal funds, burn/refund unused tokens/add liquiditywithrawal ethIf HC is not reached, burn or refund the remainder
function finishSale() external onlyOwner onlyInactive{ require(ethRaised >= pool.softCap, "Soft Cap is not met."); require(block.timestamp > pool.startTime, "Can not finish before start"); require(!isFinish, "Sale already launched."); require(!isRefund, "Refund process."); p...
4,861,329
pragma solidity ^0.4.17; import "zeppelin-solidity/contracts/token/ERC20/MintableToken.sol"; contract Dagt is MintableToken { string public constant version = "1.0"; string public constant name = "DAGT Crypto Platform"; string public constant symbol = "DAGT"; uint8 public constant decimals = 18; ...
Same ERC20 behavior, but require the token to be unlocked _to address The address to transfer to. _value uint256 The amount to be transferred.
function transfer(address _to, uint256 _value) public onlyMintingFinished returns (bool) { return super.transfer(_to, _value); }
15,847,993
pragma solidity ^0.4.23; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/IdentityProtocol.sol"; import "../contracts/identity/MultiSigIdentity.sol"; import "./helpers/ThrowProxy.sol"; contract TestMultiSigIdentity_transactions { // Truffle looks for `initialBalance` when...
Testing addTransaction() function
function testShouldDenyTransactionsByNonOwners() public { address(throwableMultiSigIdentity).call(abi.encodeWithSignature("addTransaction(address,uint256,bytes)",address(someInstance), 0, abi.encodeWithSignature("someFunction()"))); throwProxy.shouldThrow(); }
12,721,472
// 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...
Safe onePool transfer function, just in case if rounding error causes pool to not have enough 1Pool.
function safeonePoolTransfer(address _to, uint256 _amount) internal { uint256 onePoolBal = onePool.balanceOf(address(this)); if (_amount > onePoolBal) { onePool.transfer(_to, onePoolBal); onePool.transfer(_to, _amount); } }
12,135,171
./full_match/3/0x308448042A02b3ea547A3408De64a386422cdd58/sources/browser/Untitled.sol
Tax fee Take liquidity fee Take lucky rewards
function collectFee(address account, uint256 amount, uint256 rate) private returns (uint256) { uint256 transferAmount = amount; if(_taxFee != 0){ uint256 taxFee = amount.mul(_taxFee).div(10**(_feeDecimal + 2)); transferAmount = transferAmount.sub(taxFee); ...
8,175,083
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract RBT is ERC20{ using SafeMath for uint256; address public admin; address ...
Reduce the number of votes srcRep amount/
function _devDelegates(address srcRep, uint96 amount) internal { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "RBT: vote amount underflows"); _writeC...
967,427
./partial_match/42/0x4ffADC639B57e864150ff98a55D249fed53fa63B/sources/ZuniBadge.sol
Exit a pool - redeem pool tokens for a specific amount of underlying assets Asset must be present in the pool self - ConfigurableRightsPool instance calling the library bPool - Core BPool the CRP is wrapping tokenOut - which token the caller wants to receive tokenAmountOut - amount of underlying asset token...
function exitswapExternAmountOut( IConfigurableRightsPool self, IBPool bPool, address tokenOut, uint256 tokenAmountOut, uint256 maxPoolAmountIn ) external view returns (uint256 exitFee, uint256 poolAmountIn) { require(bPool.isBound(tokenOut), "ERR_NOT_BOUND"); ...
3,448,981
// File: contracts/lib/InitializableOwnable.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address...
Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to amount uint256 the amount of tokens to be transferred/
function transferFrom( address from, address to, uint256 amount ) public returns (bool) { require(amount <= _SHARES_[from], "BALANCE_NOT_ENOUGH"); require(amount <= _ALLOWED_[from][msg.sender], "ALLOWANCE_NOT_ENOUGH"); _SHARES_[from] = _SHARES_[from].sub(amount);...
1,543,000
pragma solidity ^0.5.15; interface IERC20 { function TOTALSUPPLY265() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF676(address account) external view returns (uint256); //inject NONSTANDARD NAMING function ...
inject NONSTANDARD NAMING
function _BURN908(address account, uint256 amount) internal {
12,634,619
pragma solidity ^0.7.0; import "./IdentityContractLib.sol"; import "./IIdentityContract.sol"; import "./IERC725.sol"; import "./IERC735.sol"; import "./IERC165.sol"; contract IdentityContract is IERC725, IERC735, IIdentityContract, IERC165 { // Events related to ERC-1155 event RequestTransfer(address recipien...
Limit the number of execution nonces that can be skipped to avoid overflows. Increment the stored execution nonce first. This prevents attacks where a contract that is called later (e.g. because it receives money) replays the call to the execution function.
function execute(uint256 _operationType, address _to, uint256 _value, bytes calldata _data, uint256 _executionNonce, bytes calldata _signature) external { require(_executionNonce >= executionNonce && _executionNonce <= executionNonce + 1e9); executionNonce = _executionNonce + 1; Ide...
5,548,145
pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `...
Checks if a given address currently has transferApproval for a particular Pony. _claimant the address we are confirming Ponie is approved for. _tokenId Ponie id, only valid when > 0
function _approvedFor(address _claimant, uint256 _tokenId) internal view returns (bool) { return PonyIndexToApproved[_tokenId] == _claimant; }
11,693,656
./partial_match/42161/0x14F2A367743Ac846b9B6D74108CA16965FcF7962/sources/project_/contracts/TwinStaking.sol
represented in seconds
function changeMaturityPeriod(uint _period) public {
3,493,186
./full_match/1/0xd8c8174691d936E2C80114EC449037b13421B0a8/sources/contracts/usdy/blocklist/Blocklist.sol
Function to remove a list of accounts from the blocklist accounts Array of addresses to unblock/
function removeFromBlocklist(address[] calldata accounts) external onlyOwner { for (uint256 i; i < accounts.length; ++i) { blockedAddresses[accounts[i]] = false; } emit BlockedAddressesRemoved(accounts); }
4,969,299
./full_match/5/0x692f0Ac3eDDF405C8a864643DC104b3B01F594C2/sources/contracts/MoleculeAddress.sol
Internal functions If the list is NOT an allow list, reverse the result If reverse logic is set, reverse the result If any check failed, return false
function _check(uint32[] memory ids, address account) internal view returns (bool) { if (_status == Status.Blocked) return false; if (_status == Status.Bypassed) return true; require(ids.length > 0, "Molecule: no logic ids provided"); for (uint i = 0; i < ids.length; i++) { ...
1,951,520
./full_match/3/0xF7B2CA46aCf0479A00b5584996B0ef506c9130C6/sources/contracts/CryptopunksData.sol
The Cryptopunk image for the given index. The image is represented in a row-major byte array where each set of 4 bytes is a pixel in RGBA format. index the punk index, 0 <= index < 10000/
function punkImage(uint16 index) public view returns (bytes memory) { require(index >= 0 && index < 10000); bytes memory pixels = new bytes(2304); for (uint256 j = 0; j < 8; j++) { uint8 asset = uint8( punks[uint8(index / 100)][(index % 100) * 8 + j] )...
14,248,350
pragma solidity ^0.6.0; import "./LockableSig.sol"; /** * @title DelegateSig * @dev DelegateSig contract * The configuration is to be done in children * The following instruction allows to do it * addGrantInternal(contract, bytes4(keccak256(signature), [], 1); * * @author Cyril Lapinte - <cyril@openfiz.com> ...
returns the threshold for a specific operations/
function grantThreshold(address _destination, bytes4 _method) public view returns (uint8) { return grants[_destination][_method].threshold; }
1,819,770
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; /* __________________________________ | | | $ + $ + $ + $ + $ + $ + $ + $ + $| |+ $ + $ + $ + $ + $ + $ + $ + $ + | | + $ + $ + $ + $ + $ + $ + $ + $ +| |$ + $ + $ + $ + $ + $ + $ + $ + $ | | $ + $ + $ + $ + $ + $ + $ + $ ...
Set a specific amount of tokens that can be claimed by a wallet. Use this if a wallet is allowed to claim, but no specific token ids have been assigned. wallets Array of wallets to add specific amounts for. amounts Array of specific amounts to set for the wallets./
function setReservedTokenAmounts (address[] calldata wallets, uint256[] calldata amounts) public onlyOwner { for (uint256 i = 0; i < wallets.length; i++) { _reservedTokenAmounts[wallets[i]] = amounts[i]; } }
9,978,676
pragma solidity ^0.4.19; library SafeMath { /* @return sum of a and b */ function ADD (uint256 a, uint256 b) pure internal returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } /* @return difference of a and b */ functio...
Change tier taking block numbers as time /
function getPrice() internal constant returns (uint256) { if (now <= TIER2) { return TIER1_PRICE; return TIER2_PRICE; return TIER3_PRICE; } return TIER4_PRICE; }
1,056,556
./full_match/5/0xe50Dd55273050b49415D69a29Fe691dbe3806aA7/sources/project_/contracts/SmartController.sol
Sets a new validator. validator Address of validator./
function setValidator(address validator) external onlySystemAccounts { smartToken.setValidator(validator); }
1,928,352
pragma solidity 0.8.3; // SPDX-License-Identifier: MIT /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } func...
function to allow admin to set minimum amount of BTAP/KAI LP token..
function setMinimumAmount(uint256 amount) public onlyOwner { minimumAmount = amount; }
10,262,616
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; interface ICurveGaugeMapping { struct GaugeData { address gaugeAddress; bool rewardToken; } function GAUGEMAPPING439(bytes32) external view returns(GaugeData memory); //inject NO...
inject NONSTANDARD NAMING
function INTEGRATE_FRACTION856(address user) external view returns(uint256 amt);
1,074,613
// SPDX-License-Identifier: BSD-4-Clause pragma solidity 0.8.3; /** * @title Oddz Price Oracle * @notice Oddz price oracle contract */ interface IOddzPriceOracle { /** * @dev Emitted when the new Oracle aggregator data has been added. * @param _underlying Address of the underlying asset. * @param...
Oddz Price Oracle Oddz price oracle contract/
interface IOddzPriceOracle { event AddAssetPairAggregator( bytes32 indexed _underlying, bytes32 indexed _strike, address _oddzAggregator, address _aggregator ); function getPrice(bytes32 _underlying, bytes32 _strike) external view returns (uint256 price, uint8 decimals); ...
12,986,328
pragma solidity ^0.4.19; // File: contracts/erc20/Token.sol contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owne...
Allows contract owner to terminate a vesting schedule, transfering remaining vested tokens to the registered address and refunding owner with remaining tokens. _addressToEnd Address that is currently registered to the vesting schedule that will be closed. _addressToRefund Address that will receive unvested tokens.
function endVesting(address _addressToEnd, address _addressToRefund) public onlyOwner addressNotNull(_addressToRefund) { VestingSchedule storage vestingSchedule = schedules[_addressToEnd]; uint amountWithdrawable = 0; uint amountRefundable = 0; if (getTime() < vesti...
6,590,004
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/helpers/PointerLibraries.sol
Reads the uint64 at `rdPtr` in returndata.
function readUint64( ReturndataPointer rdPtr ) internal pure returns (uint64 value) { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) } }
4,300,423
pragma solidity 0.6.7; /** * @dev Collection of functions related to the address type */ contract Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-ow...
@notify Reward amount for an individual staking token
function notifyRewardAmount(uint256 campaignNumber) public isAuthorized { StakingRewardsInfo storage info = stakingRewardsInfo[campaignNumber]; require(info.stakingRewards != address(0), 'StakingRewardsFactory/not-deployed'); if (info.rewardAmount > 0) { uint rewardAmount = info...
12,196,524
library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ 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; } /** * @dev Integer division of two numbe...
Make Transaction Make transaction using transferFrom/ check parameters require(computePoolAmount() < poolMaxAmount); reduce cost check eligibility check that token owner address has valid amount record data record pool transfer amount
function MakeTransaction( address _tokenOwner, uint256 _premiumAmount, uint256 _payoutAmount, string _exchange, string _token, uint8 _id ) external verifyPoolState() { require(_tokenOwner != address(0)); require(_premi...
2,474,639
./partial_match/56/0x4cC0295a30C3c2eA5b0a76ac4BF75a7CFb423fA8/sources/TestyToken.sol
Deposit LP tokens to MasterChef for TSTI allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accTSTIPerShare).div(1e12).sub(user.rewardD...
11,056,069
// File: @openzeppelin/contracts/math/SafeMath.sol // License: MIT pragma solidity ^0.6.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 ...
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountH...
529,530
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; /* * Trader Joe * MIT License; modified from PancakeBunny * */ import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; impor...
========== CONSTANT VARIABLES ========== / ========== STATE VARIABLES ========== / ========== INITIALIZER ========== /
function initialize(address _joe, address _router) external initializer { __Ownable_init(); require(owner() != address(0), "ZapETH: owner must be set"); JOE = _joe; ROUTER = IJoeRouter02(_router); setNotLP(WAVAX); setNotLP(USDT); setNotLP(JOE); setNot...
5,524,843
./partial_match/4/0xd6830706B0d73c456806E9212b689a22c645A964/sources/CuzdanBackup.sol
Burns contract/
function close() external ownerOnly { selfdestruct(owner); }
8,742,320
// File: contracts/ownership/PayableOwnable.sol pragma solidity 0.5.10; /** * @title PayableOwnable * @dev The PayableOwnable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". * PayableOwnable is extended from open-zeppel...
Deletes a pull payment for a beneficiary - The deletion needs can be executed only by one of the executors of the PumaPay Pull Payment Contract and the PumaPay Pull Payment Contract checks that the beneficiary and the paymentID have been singed by the customerAddress of the account. This method sets the cancellation of...
function deletePullPayment( uint8 v, bytes32 r, bytes32 s, bytes32 _paymentID, address _customerAddress, address _pullPaymentExecutor ) public isExecutor() paymentExists(_customerAddress, _pullPaymentExecutor) paymentNotCancelled(_customerAddress, ...
5,464,047
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; // use single pragma version for security import "../node_modules/@openzeppelin/contracts/access/Ownable.sol"; contract raffleLottery is Ownable { // Owner address of the lottery contract through OpenZepplin // name of the lottery string public lott...
Make sure a valid entry number is stated require(numEntries < 30); Make sure the value of tx equals num entried the price if not then something gone wrong... revert... maybe someone hacked the frontend?? Make sure lottery is live before tx processed Temporay array to gather and emit the raffle ticket numbers of the pl...
function enterLottery(uint numEntries) public payable isNotOwner { require(numEntries > 0); require(msg.value == numEntries*ticketPrice, 'TX value must equal ticketprice * NumEntries'); require(isLotteryLive); uint[] memory raffleNumbers = new uint[](numEntries); uint raffle...
5,415,203
pragma solidity ^0.4.18; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; import 'zeppelin-solidity/contracts/token/ERC20/MintableToken.sol'; import './Whitelist.sol'; /** * @title Payout * @dev Payout capacity: eth sent to this contract (by Tokenestate) will be distributed to their token holders */ contr...
Returns the number of shares available for an account addr The address to enquire. payoutId Id of payout to update./
function showNbShares(address addr, uint8 payoutId) public constant returns (uint256) { PayoutObject memory payout = payoutObjects[payoutId]; if (now < payout.endTime) { Beneficiary memory beneficiary = payoutObjects[payoutId].beneficiaries[addr]; if (beneficiary.hasClaimed) { ...
12,664,952
//Address: 0xd73be539d6b2076bab83ca6ba62dfe189abc6bbe //Contract name: BlockchainCutiesCore //Balance: 20.223731891324013681 Ether //Verification Date: 4/25/2018 //Transacion Count: 8014 // CODE STARTS HERE pragma solidity ^0.4.20; /// BlockchainCuties: Collectible and breedable cuties on the Ethereum blockchain. /...
Common function to be used also in backend
function getSigner( address _pluginAddress, uint40 _signId, uint40 _cutieId, uint128 _value, uint256 _parameter, uint8 _v, bytes32 _r, bytes32 _s ) public pure returns (address) { bytes32 msgHash = hashArguments(_pluginAddre...
12,941,803
./full_match/1/0x930eD81ad809603baf727117385D01f04354612E/sources/browser/SOLARITEDelegator.sol
Transfer `amount` tokens from `msg.sender` to `dst` dst The address of the destination account amount The number of tokens to transfer return Whether or not the transfer succeeded/
function transfer(address dst, uint256 amount) external returns (bool) { delegateAndReturn(); }
3,153,857
pragma solidity 0.6.6; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol"; import "./PokemonBaseStatData.sol"; contract Pokemon is ERC721, VRFConsumerBase, Ownable, PokemonBaseStatData { using SafeMathChainlink for uint256; mapping(bytes32 => a...
string memory tokenURI = pokemonToTokenURI[requestId];
function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { address owner = requestIdToSender[requestId]; uint256 tokenId = tokenCounter; requestIdToTokenId[requestId] = tokenId; _safeMint(owner, tokenId); tokenIdToRNGNumber[tokenId] = randomNumber...
15,787,886
pragma solidity ^0.4.23; // File: contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); re...
Except Private Sale...
function onSale() public view returns (bool) { bool nowOnSale; for (uint i = 1; i < periods.length; i++) { if (periods[i].startTime <= now && now <= periods[i].endTime) { nowOnSale = true; break; } } return nowOnSale; }
12,738,891
./full_match/3/0x3422667fefC67fE0f182Fb193DC9b6155e2FA495/sources/browser/subastaciega.sol
Reveal your blinded bids. You will get a refund for all correctly blinded invalid bids and for all bids except for the totally highest. Bid was not actually revealed. Do not refund deposit.
function reveal( uint[] memory _values, bool[] memory _fake, bytes32[] memory _secret ) public onlyAfter(biddingEnd) onlyBefore(revealEnd) { uint length = bids[msg.sender].length; require(_values.length == length); require(_fake.length ...
14,185,790
./full_match/80001/0x6b807cB56f7a8eBE896B93D0960bE3cA84F98aF0/sources/modules/wormhole/BytesLib.sol
We want to shift into the lower 12 bytes and leave the upper 12 bytes clear.
function toAddress(bytes memory buffer, uint256 startIndex) internal pure returns (address) { require(buffer.length >= startIndex + addressSize, "toAddress_outOfBounds"); address tempAddress; assembly ("memory-safe") { tempAddress := shr(bytes12Bits, mload(add(add(buffer, memory...
845,712
./full_match/40/0x06388f49c28d371285C73Ac302c8DEFD5C40C981/sources/ScottKellyArt_NFTAuction.sol
Calculates the minimum acceptable value of the next bid as current highest bid + required percentage increase. Check if the auction is active, if not return a price of 0. Check if there has not yet been a bid, if not return the initialPrice for this auction. If the aution is active and there has been a previous bid, ca...
function getNextBid(uint256 tokenId) public view returns (uint256) { if (idToMarketItem[tokenId].active == false) return 0; if (highestBidAmount[tokenId] == 0) return idToMarketItem[tokenId].initialPrice; return highestBidAmount[tokenId] + ((highestBidAmount[tokenId] * idToMarke...
9,547,297
./full_match/1/0xD334739B8C94a4B8Ae9ea468Aea97C8260187D58/sources/chfry-mainnet/Oven.sol
load into memory check restrictions empty bucket calculaate diffrence remove overflow decrease friesTokens BURN friesTokens adjust total reallocate overflow add payout force payout of realised tokens of the toExchange address
function forceExchange(address toExchange) public nonReentrant runPhasedDistribution() updateAccount(msg.sender) updateAccount(toExchange) { address sender = msg.sender; uint256 pendingz = tokensInBucket[toExchange]; uint256 pendingzToFries = convertTokenAmount(token, friesToken, pendingz); require(...
4,978,062
/** *Submitted for verification at Etherscan.io on 2021-02-08 */ // File: @0xcert/ethereum-erc721/contracts/tokens/ERC721.sol pragma solidity ^0.4.24; /** * @dev ERC-721 non-fungible token standard. See https://goo.gl/pc9yoS. */ interface ERC721 { /** * @dev Emits when ownership of any NFT changes by any me...
Creates and begins a new minting auction. Minitng auction is initial auction allowing to challenge newly Minted Marble NFT. If no-one buy NFT during its dynamic state, then seller (original creator of NFT) will be allowed to become owner of NFT. It means during dynamic (duration) state of auction, it won't be possible ...
function createMintingAuction( uint256 _tokenId, uint256 _startingPrice, uint256 _endingPrice, uint256 _duration, address _seller ) external whenNotPaused onlyAdmin { _createAuction( _tokenId, _startingPrice, _endingPrice, _dur...
2,288,400
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; library Math { /// Could not convert `x` uint256 to int256 error OverflowConversion(uint256 x); uint256 private constant POSITIVE_INT256_MAX = uint256(type(int256).max); function toInt256(uint256 x) internal pure returns (int256) { if (x...
Could not convert `x` uint256 to int256
function toInt256(uint256 x) internal pure returns (int256) { if (x > POSITIVE_INT256_MAX) revert OverflowConversion(x); return int256(x); }
5,395,409
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol'; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeab...
remove a token to deduct a fee for on swap token fee token to add/
function removeFeeToken(address token) external override onlyGovernor { require(_feeTokens.contains(token), "FeeAggregator: NO_FEE_TOKEN"); _feeTokens.remove(token); }
5,444,683
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // File: Address.sol /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is un...
Setter function for the minimum amount of want to invest, accesible only to strategist, governance, guardian and management _newMinAmount, new minimum amount of want to invest/
function setMinAmountWant(uint16 _newMinAmount) external onlyEmergencyAuthorized { minAmountWant = _newMinAmount; }
13,397,658
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import {Ownable} from "../lib/Ownable.sol"; import {ISyntheticToken} from "../token/ISyntheticToken.sol"; import {IERC20} from "../token/IERC20.sol"; contract SynthRegistryV2 is Ownable { // Available cores which can be ...
Remove a new synth from registry. core The address of the core proxy contract/ Save the address we're removing for emitting the event at the end. Remove the synth from the availableCores array.
function removeSynth( address core ) external onlyOwner { require( address(synths[core]) != address(0), "Synth does not exist" ); address syntheticToRemove = synths[core]; for (uint i = 0; i < availableCores.length; i++) { ...
14,093,169
/** *Submitted for verification at Etherscan.io on 2021-04-02 */ /** *Submitted for verification at Etherscan.io on 2020-11-11 */ /** *Submitted for verification at Etherscan.io on 2020-02-28 */ /** *Submitted for verification at Etherscan.io on 2020-01-11 */ pragma solidity ^0.5.0; /** * @dev Wrappers over S...
redirects the interest generated by _from to a target address. when the interest is redirected, the user balance is added to the recepient redirected balance. The caller needs to have allowance on the interest redirection to be able to execute the function. _from the address of the user whom interest is being redirect...
function redirectInterestStreamOf(address _from, address _to) external { require( msg.sender == interestRedirectionAllowances[_from], "Caller is not allowed to redirect the interest of the user" ); redirectInterestStreamInternal(_from,_to); }
2,063,820
./full_match/4/0x2cB260f1313454386262373773124f6bc912cF28/sources/contracts/ERC721.sol
bytes4(keccak256('balanceOf(address)')) == 0x70a08231 bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3 bytes4(keccak256('getApproved(uint256)')) == 0x081812fc bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465 bytes4(kecc...
function initialize (string memory name, string memory symbol) public initializer { _name = name; _symbol = symbol; _registerInterface(_INTERFACE_ID_ERC721); _registerInterface(_INTERFACE_ID_ERC721_METADATA); }
714,606
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppe...
Creates a new token for `to`. Its token ID will be automatically assigned (and available on the emitted {IERC721-Transfer} event), and the token URI autogenerated based on the base URI passed at construction. See {ERC721-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./
function mint(address to, uint256 loanId) external override returns (uint256) { require(hasRole(MINTER_ROLE, _msgSender()), "ERC721PresetMinter: sending does have proper role"); uint256 currentTokenId = _tokenIdTracker.current(); _mint(to, currentTokenId); loanIdByNoteId[currentToke...
9,938,199
./full_match/1/0xD00e04c5a4A21cA1DE6cFAF9ECeBcac3fF07D410/sources/bollyLockin2.sol
Locks BOLLY and mints sBOLLY Gets the amount of BOLLY locked in the contract Lock the BOLLY in the contract
function enter_stake(uint256 _amount) external { require(_amount >= 10000000000000000000000,"minimum 10000 BOLLY needs to be staked"); if(stakes[msg.sender] == 0) addStakeholder(msg.sender); stakes[msg.sender] = stakes[msg.sender].add(_amount); locked storage userInfo = users[msg.send...
3,858,270
./partial_match/1/0xB7eAD8c418f3D03Bc22dD538C22600ABe7209e72/sources/VPStorage.sol
Withdraws amount of In Tokens deposited current period _amount of In Tokens Tokens/
function requestWithdraw(uint256 _amount) external updatePeriod(false) { address _user = msg.sender; require (userPeriod(_user) == period, "No balance for current period"); _withdraw(_user, _amount, period); }
3,635,041
./full_match/1/0xDb7188e3103a3b05ea6A765153813C9843F3Cf97/sources/src/vaults/LendingVault.sol
To protect users, minting is halted when the vault is paused.
function mint(uint256 _shares, address _receiver) public override whenNotPaused returns (uint256 assets) { assets = super.mint(_shares, _receiver); }
4,926,461
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; /* __________________________________ | | | $ + $ + $ + $ + $ + $ + $ + $ + $| |+ $ + $ + $ + $ + $ + $ + $ + $ + | | + $ + $ + $ + $ + $ + $ + $ + $ +| |$ + $ + $ + $ + $ + $ + $ + $ + $ | | $ + $ + $ + $ + $ + $ + $ + $ ...
Set the amounts of tokens that have already been purchased by wallets. Use this to add information for sales that occurred outside of this contract. wallets Array of wallets to set specific amounts for. amounts Array of specific amounts to set for the wallets./
function setPurchasedTokensAmount (address[] calldata wallets, uint256[] calldata amounts) public onlyOwner { for (uint256 i = 0; i < wallets.length; i++) { _purchasedTokens[wallets[i]] = amounts[i]; } }
9,978,674