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: MIT pragma solidity ^0.8.4; 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(...
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) checkLockAccount(sender, amount) internal virtual { require(sender != address(0), "transfer from the zero address"); require(recipient != address(0), "transfer to the zero address"); _beforeTokenTransfer(sender, recipient...
5,461,302
./partial_match/1/0x5657f6D8fc59af3a8aff62bd2CdF3eF16cd710F1/sources/BananaCoin.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); }
3,565,235
pragma solidity 0.4.24; contract AccessControl { /// @dev Emited when contract is upgraded - See README.md for updgrade plan event ContractUpgrade(address newContract); // The addresses of the accounts (or contracts) that can execute actions within each roles. address public ceoAddress; ...
Developer can withdraw tip.
function withdrawTipForDeveloper() external onlyCEO { require(totalTipForDeveloper > 0, "Need more tip to withdraw!"); msg.sender.transfer(totalTipForDeveloper); totalTipForDeveloper = 0; }
1,056,524
pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../lib/TransferHelper.sol"; import "../interfaces/IBEP20.sol"; import "../BEP20.sol"; /// @notice Aggregators Proxy contr...
Excute swap. fromToken token's address. toToken token's address. approveTarget contract's address which will excute calldata minReturnAmount Include fee, not sub fee amnount yet. callDataConcat calldata thirdPartyAddress third party fee holder. deadLine Deadline
function swap( address fromToken, address toToken, address approveTarget, uint256 fromTokenAmount, uint256 minReturnAmount, bytes calldata callDataConcat, address thirdPartyAddress, uint256 deadLine ) external payable noExpired(deadLine) nonReentra...
12,844,362
pragma solidity ^0.6.0; import "../utils/GasBurner.sol"; import "../interfaces/IAToken.sol"; import "../interfaces/ILendingPool.sol"; import "../interfaces/ILendingPoolAddressesProvider.sol"; import "../utils/SafeERC20.sol"; /// @title Basic compound interactions through the DSProxy contract AaveBasicProxy is GasBur...
Return a rate for which we can buy an amount of tokens _srcAddr From token _destAddr To token _destAmount To amount return uint Rate
function getBuyRate(address _srcAddr, address _destAddr, uint _destAmount, bytes memory _additionalData) public override view returns (uint) { address srcAddr = ethToWethAddr(_srcAddr); address destAddr = ethToWethAddr(_destAddr); return wdiv(1 ether, wdiv(OasisInterface(OTC_ADDRESS).getPay...
380,829
./full_match/1/0xaa282C8aB681fbD501A2B8fA0Ea558cbF5785F73/sources/contracts/AvocadoMultisig/AvocadoMultisig.sol
Marks a bytes32 `message_` (signature digest) as signed, making it verifiable by EIP-1271 `isValidSignature()`. - Can only be self-called (authorization same as for `cast` methods). message_ data hash to be allow-listed as signed
function signMessage(bytes32 message_) external onlySelf { _signedMessages[message_] = 1; emit SignedMessage(message_); }
3,129,168
pragma solidity ^0.4.24; library NameFilter { /** * @dev filters name strings * -converts uppercase to lower case. * -makes sure it does not start/end with a space * -makes sure it does not contain multiple spaces in a row * -cannot be only numbers * -cannot start with 0x * -res...
============================================================================== _ |_ |. _ |` _ __|_. _ _ _ . |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . (use these to interact with contract)====|========================================================================= emergency buy uses last stored af...
function() isActivated() isHuman() isWithinLimits(msg.value) public payable { F3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_); uint256 _pID = pIDxAddr_[msg.sender]; buyCore(_pID, plyr_[_pID].laff, 2, _e...
516,421
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "openzeppelin-solidity/contracts/utils/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/access/Ownable.sol"; /** * @title CrystalEth Token (CRY) * @author Giancarlo Sanchez...
Check if address is stakeholder/
function isStakeholder(address _address) public view returns(bool, uint256) { for (uint256 s = 0; s < stakeholders.length; s += 1){ if (_address == stakeholders[s]) return (true, s); } return (false, 0); }
1,833,747
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.7.0; pragma experimental ABIEncoderV2; import "./PrizePoolBuilder.sol"; import "../registry/RegistryInterface.sol"; import "../prize-pool/compound/CompoundPrizePoolProxyFactory.sol"; import "../external/compound/CTokenInterface.sol"; /// @title Creates...
pairs The (source, measure) pairs to update. For each pair all of the balance drips, volume drips, and referral volume drips will be updated. user The user whose drips and balances will be updated. dripTokens The drip tokens to retrieve claim balances for.
function captureClaimsForBalanceDripsForPairs( UpdatePair[] memory pairs, address user, address[] memory dripTokens ) public { uint256 i; for (i = 0; i < pairs.length; i++) { UpdatePair memory pair = pairs[i]; uint256 measureBalance = IERC20Upgradeable(pair.measure).balanceOf(u...
12,863,615
./full_match/5/0x692f0Ac3eDDF405C8a864643DC104b3B01F594C2/sources/contracts/MoleculeAddress.sol
Owner only functions
function setStatus(Status newStatus) external onlyOwner { _status = newStatus; emit StatusChanged(newStatus); }
1,951,514
//SPDX-License-Identifier: Apache pragma solidity ^0.8.0; import "./Galaxy.sol"; // ================================================================================================= struct CelestialData { address owner; uint lastUpdate; } // ==================================================================...
Lets the frontend compute a celestial object ID from its coordinates. To query this off-chain, use `GalaxygetCelestialID`
function getCelestialID(uint x, uint y) pure internal returns (uint) { return x << 128 + y; }
5,470,522
pragma solidity ^0.4.21; interface itoken { function freezeAccount(address _target, bool _freeze) external; function freezeAccountPartialy(address _target, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool); function balanceOf(address _ow...
transfer an amount of tokens to an account, and then freeze the tokens _target the account address that will hold an amount of the tokens _value the amount of the tokens which has been transferred _frozenEndTime the end time of the lock period, unit is second _releasePeriod the locking period, unit is second/requir...
function transferAndFreeze(address _target, uint256 _value, uint256 _frozenEndTime, uint256 _releasePeriod) onlyOwner public returns (bool) { require(_target != address(0)); require(_value > 0); require(_frozenEndTime > 0); require(owned.allowance(msg.sender, this) > 0); re...
9,944,245
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../../interfaces/IWETH.sol"; import "../base/AbstractStrategy.sol"; import "./i...
Withdraw from homora v2 Deposit to WETH and transfer to Controller
function sell(uint256 _sellAmount) internal override returns (uint256) { uint256 balanceBeforeSell = address(this).balance; uint256 yrate = IYearnToken(ISafeBoxEth(ibToken).cToken()).exchangeRateCurrent(); ISafeBoxEth(ibToken).withdraw((_sellAmount * 1e18) / yrate); uint256 balance...
15,813,746
pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; import "./MixinResolver.sol"; import "./MixinSystemSettings.sol"; import "./interfaces/IExchanger.sol"; // Libraries import "./SafeDecimalMath.sol"; // Internal references import "./interfaces/ISystemStatus.sol"; import "./interfaces/IERC20.sol"; import "...
========== Exchange Related Fees ========== / public function to get the total fee rate for a given exchange sourceCurrencyKey The source currency key destinationCurrencyKey The destination currency key return The exchange fee rate, and whether the rates are too volatile
function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint) { (uint feeRate, bool tooVolatile) = _feeRateForExchange(sourceCurrencyKey, destinationCurrencyKey); require(!tooVolatile, "too volatile"); return feeRate; }
1,793,024
pragma solidity ^0.4.17; /** * Library with string conversion functions */ library Strings { /** * Converts bytes4 to string */ function fromCode(bytes4 code) internal pure returns (string) { bytes memory result =...
Converts concatenated string and two uint to string/
function substring(string str, uint startIndex, uint endIndex) internal pure returns (string) { bytes memory strBytes = bytes(str); bytes memory result = new bytes(endIndex-startIndex); for(uint i = startIndex; i < endIndex; i++) { result[i-startIndex] = strBytes[i]; } ...
5,391,614
// Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md pragma solidity ^0.4.21; contract MarianaKeyInterface { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: ...
账号之间代币交易转移 _from 发送者地址 _to 接收者地址 _value 转移数额/避免溢出的异常 不是零地址,因为0x0地址代表销毁默认totalSupply 不会超过最大值 (2^256 - 1).消息发送者可以从账户_from中转出的数量减少_value
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { uint256 allowance = allowed[_from][msg.sender]; require(balances[_from] >= _value && allowance >= _value && balances[_to] + _value >= balances[_to]); require(_to != 0x0); balances[_to] +...
10,720,304
./partial_match/1/0x919B5e2714FEaE5C366ADa120EA566F79106cB67/sources/StandardPoolConverter.sol
increases the pool's liquidity and mints new shares in the pool to the caller this version receives the two reserve amounts as separate args _reserve1Amount amount of the first reserve token _reserve2Amount amount of the second reserve token _minReturn token minimum return-amount return amount of pool tokens...
function addLiquidity(uint256 _reserve1Amount, uint256 _reserve2Amount, uint256 _minReturn) public payable returns (uint256) { uint256[] memory reserveAmounts = new uint256[](2); reserveAmounts[0] = _reserve1Amount; reserveAmounts[1] = _reserve2Amount; return addLiquidity(__reserveTo...
9,357,603
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppel...
set request index/
function setRequestIndex(uint256 ReuestId, uint256 indexValue) public onlyOperator { requests[ReuestId].index = indexValue; }
911,520
pragma solidity ^0.4.24; import "./PeriodUtil.sol"; /** * @title PeriodUtilWeek * * Used to calculate Weeks and Years * * (c) Philip Louw / Zero Carbon Project 2018. The MIT Licence. */ contract PeriodUtilWeek is PeriodUtil { uint256 public constant HOURS_IN_WEEK = 168; uint256 constant YEAR_IN_SECO...
Returns the Cycle count of the given Periods. A set of time creates a cycle, eg. If period is weeks the cycle can be years. return The Cycle Index timestamp The time in seconds since EPOCH (blocktime)/ Year
function getPeriodCycle(uint256 timestamp) public pure returns (uint256) { uint256 secondsAccountedFor = 0; uint16 year; uint256 numLeapYears; year = uint16(ORIGIN_YEAR + timestamp / YEAR_IN_SECONDS); numLeapYears = leapYearsBefore(year) - leapYearsBefore(ORIGIN_YEAR...
7,299,660
./full_match/1/0xD62A80368AdF5919f70193D15dCbD5C77EAf55ac/sources/src/Vault.sol
Set the nominal units of a token args The SetNominalArgs only rebalancer
function invokeSetNominal( SetNominalArgs calldata args ) external whenNotEmergency only(rebalancer) { _setNominal(args); }
3,028,576
pragma solidity ^0.4.23; import "./Verifier.sol"; contract WorglCoin { /***********************************/ /******* CONTRACT ATTRIBUTES *******/ /***********************************/ struct Consumer { bool isSet; address consumerAddress; uint tokenBalance; uint[] allOrders; } struct B...
allows you to return all item details _itemID the ID of the item/
function getItemDetails(uint _itemID) public view returns(string, string, uint, uint, address) { return ( allItems[_itemID].name, allItems[_itemID].picture, allItems[_itemID].quantity, allItems[_itemID].price, allItems[_itemID].supplier); }
2,538,352
./full_match/5/0x8Fe4d94ef5fC4c61DDb2c050653b4664Fcfa3C07/sources/project_/contracts/TellorFlex.sol
Returns all information about a staker _stakerAddress address of staker inquiring about return uint startDate of staking return uint current amount staked return uint current amount locked for withdrawal return uint reward debt used to calculate staking rewards return uint reporter's last reported timestamp return uin...
function getStakerInfo(address _stakerAddress) external view returns ( uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool ) { StakeInfo st...
7,079,460
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import {Operator} from '../access/Oper...
Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), reverting when dividing by zero. Counterpart to Solidity's `%` operator. This function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remaining gas). Requirem...
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; }
367
pragma solidity ^0.8.11; import "./Owned.sol"; import "./ERC20Interface.sol"; //SPDX-License-Identifier: LGPL // ---------------------------------------------------------------------------- // Symbol : AQG // Name : Sovereign Nature Momentum Hackathon // Total supply: 1,000,000.000000000000000000...
------------------------------------------------------------------------ Total supply ------------------------------------------------------------------------
function totalSupply() public view override returns (uint256) { return _totalSupply.sub(balances[address(0)]); }
12,920,104
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/helpers/PointerLibraries.sol
Reads the int208 at `mPtr` in memory.
function readInt208( MemoryPointer mPtr ) internal pure returns (int208 value) { assembly { value := mload(mPtr) } }
4,300,722
/** *Submitted for verification at Etherscan.io on 2021-08-17 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.6; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint256 ...
Pull in income without rebalancing
function accrue( address _vault, address _pair ) external onlyOwner { _pairWithdrawWithIncome(_vault, _pair, 0); }
7,974,713
./full_match/4/0x465D7F2770737A56234EdC0B58Eb77B55a366484/sources/some.sol
Initialize the contract _stakedToken: staked token address _rewardToken: reward token address _rewardPerBlock: reward per block (in rewardToken) _startBlock: start block _bonusEndBlock: end block _poolLimitPerUser: pool limit per user in stakedToken (if any, else 0) _admin: admin address with ownership/ Make thi...
function initialize( address _stakedToken, address _rewardToken, address _compound, uint256 _rewardPerBlock, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _poolLimitPerUser, address _treasury, address _admin ) external { requ...
12,437,511
//Address: 0x27cc5d6525dd3834e79dbe482d18d157a06f998f //Contract name: YDToken //Balance: 0 Ether //Verification Date: 5/4/2018 //Transacion Count: 5 // CODE STARTS HERE pragma solidity 0.4.19; // File: ../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable cont...
Returns list of transaction IDs in defined range. from Index start position of transaction array. to Index end position of transaction array. pending Include pending transactions. executed Include executed transactions. return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i = 0; i < transactionCount; i++) ...
12,543,687
./full_match/1/0xC383372e5B69fc487374b91298D124820132c567/sources/src/token/erc721/LazyMintAdventureERC721.sol
Enters the specified quest for a token id. Throws if the token is already participating in the specified quest. Throws if the number of active quests exceeds the max allowable for the given adventure. Emits a QuestUpdated event for off-chain processing.
function _enterQuest(address ownerOfToken, uint256 tokenId, address adventure, uint256 questId) internal { (bool participatingInQuest,,) = isParticipatingInQuest(tokenId, adventure, questId); if(participatingInQuest) { revert LazyMintAdventureBase__AlreadyOnQuest(); } ui...
8,311,116
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.6; pragma abicoder v2; import {OwnableUpgradeable} from '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import {ERC20} from '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20....
IGarden Interface for operating with a Garden./
interface ICoreGarden { function privateGarden() external view returns (bool); function publicStrategists() external view returns (bool); function publicStewards() external view returns (bool); function controller() external view returns (IBabController); function creator() external view retur...
217,763
./full_match/1/0x22880956813F054d59100CC3180EE5c63eef0121/sources/QRFID_gold.sol
See {IERC1400-balanceOfByPartition}/
function balanceOfByPartition(bytes32 _partition, address _tokenHolder) external view override returns (uint256) { return (_balancesByPartition[_partition][_tokenHolder]); }
4,919,093
/*** * _____ _ __ __ _ _ _ _ * / ____| | | | \/ | | | | (_) | | * | | _ __ _ _ _ __ | |_ ___ | \ / |_ _| | |_ _ ___ ___ _ __ __| | ___ _ __ * | | | '__| | | | '_ \| __/ _ \ |...
Allows for the distribution of an ERC20 token to be transferred to multiple recipients at a time. This function only facilitates batch transfers of constant values (i.e., all recipients will receive the same amount of tokens). _addressOfToken The contract address of an ERC20 token. _recipients The list of addresses w...
function singleValueTokenAirdrop(address _addressOfToken, address[] memory _recipients, uint256 _value, string memory _afCode) public payable returns(bool) { ERCInterface token = ERCInterface(_addressOfToken); uint256 price = _recipients.length.mul(dropUnitPrice); require( msg...
1,339,125
./full_match/1/0xec00f94B02aB3f6Df818a2aA93dE995936f7e169/sources/Manager.sol
it('name, symbol, decimals, totalSupply, balanceOf, DOMAIN_SEPARATOR, PERMIT_TYPEHASH', async () => { const name = await token.name() expect(name).to.eq('Uniswap V2') expect(await token.symbol()).to.eq('UNI-V2') expect(await token.decimals()).to.eq(18) expect(await token.totalSupply()).to.eq(TOTAL_S...
function uniswapDepositAddress() public pure returns (address) { return 0x345c86a7E1318f66E7E64Ff485c87B6d4d556a37; }
3,042,644
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "./RoyalNFT.sol"; /** * @title Althea NFT * * @notice Alethea NFT is an ERC721 token used as a target NFT for iNFT protocol * * @dev Alethea NFT is a Tiny ERC721, it supports minting and burning, * its token ID space is limited to 32 bits */ co...
Add token to both local and global collections (enumerations), used internally to mint new tokens Unsafe: doesn't check for data structures consistency (token existence, token ownership, etc.) Must be kept private at all times. Inheriting smart contracts may be interested in overriding this function. ...
function __addToken(uint256 _tokenId, address _to) internal virtual { uint32[] storage destination = collections[_to]; tokens[_tokenId] = uint224(allTokens.length) << 192 | uint192(destination.length) << 160 | uint160(_to); destination.push(uint32(_tokenId)); allTokens.push(uint32(_tokenId)); }
6,018,531
./partial_match/42/0x5f8Fac4cc082871004Ad2C2141675A04057B8c27/sources/LiquidityMineProxy.sol
Returns the current implementation. return impl of the current implementation/
function _implementation() override internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } }
3,394,270
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is ch...
Locks down all actions FOREVER! This should only be used in manual contract migration due to critical bug. This will halt alloperations and allow a new contract to be built by transfering all balances./
function lockForever() public onlyFailsafe returns (bool) { pause(); setOwner(address(this)); setFailsafe(address(this)); return true; }
1,756,300
./full_match/80001/0xB769200Eb2109732eA9da606259A4d34986f5315/sources/contracts/player-id/ParagonsDAOPlayerID.sol
Updates the AddressRegistry contract address. addressRegistry AddressRegistry contract address./
function setAddressRegistry(IAddressRegistry addressRegistry) external onlyOwner { _addressRegistry = addressRegistry; }
9,505,821
// File: contracts/GodMode.sol /**************************************************** * * Copyright 2018 BurzNest LLC. All rights reserved. * * The contents of this file are provided for review * and educational purposes ONLY. You MAY NOT use, * copy, distribute, or modify this software without * explic...
God can set a new blind auctions contract _blindAuctionsContract the address of the blind auctions contract
function godSetBlindAuctionsContract(address _blindAuctionsContract) public onlyGod { blindAuctionsContract = _blindAuctionsContract; }
5,490,397
./full_match/1/0x1bDfE04bB0Ef85047BA3e1Ce35f2649d8246F809/sources/contracts/PoxiMarketplaceV1.sol
set the referral fee for the given referrer. Must be in basis points (100% is 100 000)/
function setReferralFee(address _referrer, uint24 _fee) external onlyOwner { require (_fee <= 100_000, "Fee must be <= 100% (100 000 mpb)"); referrerFees[_referrer] = _fee; emit ReferralFeeSet(_referrer, _fee); }
16,470,486
./full_match/1/0x1E4558Fe59149Bb3FD8bA08E3fB6ed9B023e09aC/sources/contracts/pools/MSPoolBasic.sol
Returns the info to buy NFTs and updates the params _numNFTs NFT number to buy at pool _maxExpectedIn The maximum expected cost to buy the NFTs return inputValue Amount of tokens to pay the NFTs return protocolFee Fee charged in a trade return newStartPrice New pool startPrice return newMultiplier New pool multiplier
function _getBuyNFTInfo( uint _numNFTs, uint _maxExpectedIn ) private view returns ( uint256 inputValue, uint256 protocolFee, uint128 newStartPrice, uint128 newMultiplier ) { bool isValid; ( isValid, newStartPr...
16,404,064
pragma solidity ^0.4.0; import '../../../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol'; import "../DAOLib.sol"; import "../../Token/TokenInterface.sol"; import "../CrowdsaleDAOFields.sol"; contract VotingDecisions is CrowdsaleDAOFields { /* * @dev Transfers withdrawal sum in ether or DXC tokens...
Change DAO's mode to `refundable`. Calls from Refund proposal/
function makeRefundableByVotingDecision() external onlyVoting { makeRefundable(); }
14,043,326
./full_match/3/0xc3C944750A79e3c7A3dD8bb74b3D293AbE86D916/sources/browser/MyWill.sol
Adds two unsigned integers, reverts on overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath#add: OVERFLOW"); return c; }
8,101,904
pragma solidity ^0.4.13; /** * 10X contract * Copyright 2017, TheWolf * * An infinite crowdfunding lottery token * Using a permanent delivery of tokens as a reward to the lost bids. * With a bullet proof random generation algorithm and a lot of inovative features * With a state machine switching autom...
Sends eth back to the player
function sendEthBack(uint256 _value) internal { require (msg.sender>0); require (_value>0); LogMsg(msg.sender, "sendEthBack: not enough ETH to perform this operation."); isPaused=true; InPauseMode(now,isPaused); } }
12,609,318
./partial_match/1/0x4eAa1Fb174C85A3ef6820E45c5e065AAfE1BAC71/sources/src/UnstakeRequestsManager.sol
@inheritdoc IUnstakeRequestsManagerWrite Verifies the requester's identity, finality of the request, and availability of funds before transferring the requested ETH. The unstake request is then removed from the array.
function claim(uint256 requestID, address requester) external onlyStakingContract { UnstakeRequest memory request = _unstakeRequests[requestID]; if (request.requester == address(0)) { revert AlreadyClaimed(); } if (requester != request.requester) { revert No...
4,397,926
./full_match/97/0xA0FA3d6133657669CF03890c12c3aE1C48e641db/sources/contracts/sd/sd2.sol
Converts the SD tokens into more liquidity or sells them to increase the backing in the contract liquidityShare: the amount of SD that has been collected via taxes backingThreshold: the treshold in SD tokens required to perform the sell and convert into backing liquidityTreshold: the treshold in SD tokens required t...
function convertAll(uint liquidityShare, uint backingThreshold, uint liquidityTreshold) external returns (uint){ require(parent == msg.sender, "O: parent"); convertBacking(liquidityShare, backingThreshold); return convertLiquidity(liquidityShare, liquidityTreshold); }
5,039,483
// File: openzeppelin-solidity/contracts/GSN/Context.sol pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direc...
Validate a nane that only a-z is allowed _name - string for the name/
function _requireNameValid(string memory _name) internal pure { bytes memory tempName = bytes(_name); require( tempName.length >= 2 && tempName.length <= 15, "Name should be greather than or equal to 2 and less than or equal to 15" ); for(uint256 i = 0; i < te...
6,401,554
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import {MultiRateLimited} from "./MultiRateLimited.sol"; import {IGlobalRateLimitedMinter} from "./IGlobalRateLimitedMinter.sol"; import {CoreRef} from "./../refs/CoreRef.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; /// @n...
remove an authorized rateLimitedAddress contract rateLimitedAddress the address to remove from the whitelist of addresses
function removeAddress(address rateLimitedAddress) external override addressIsRegistered(rateLimitedAddress) onlyGuardianOrGovernor { uint256 oldRateLimitPerSecond = rateLimitPerAddress[rateLimitedAddress] .rateLimitPerSecond; delete rateLimitPerAddre...
13,409,600
./partial_match/1/0xf7d35CA1c865871e8cF8ba58515343ECBff6A46D/sources/project:/contracts/MEtherAdmin.sol
Sender redeems mTokens in exchange for a specified amount of underlying asset (ETH) Accrues interest whether or not the operation succeeds, unless reverted redeemAmount The amount of underlying to redeem return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/
function redeemUnderlying(uint redeemAmount) external nonReentrant returns (uint) { return redeemInternal(thisFungibleMToken, 0, redeemAmount); }
3,927,856
./full_match/5/0x5F717293FD992079f3e651c7DE3C57Ce3eb47e1c/sources/_thirdweb-dev/contracts/extension/Drop1155.sol
Returns the claim condition at the given uid.
function getClaimConditionById(uint256 _tokenId, uint256 _conditionId) external view returns (ClaimCondition memory condition) { condition = claimCondition[_tokenId].conditions[_conditionId]; }
1,961,659
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URISto...
Returns the Uniform Resource Identifier (URI) for the token tokenId ID of the token to return URI of return URI for the token/
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); }
60,949
./partial_match/3/0x50fef2Bb63b907Fa3897B8F35bd0F318E65478FB/sources/NexaBook.sol
messageHash can be used only onceVerifes signature
function registrationExt(address referrerAddress, uint _noOfTokens, bytes calldata _signature, uint _currentTime) external isLock payable { require(_currentTime >= now && _currentTime <= now.add(1 hours), "Time Expired Signature"); bytes32 messageHash = message(msg.sender, _noOfTokens, _...
5,092,674
./full_match/42/0x19f5a49BcE278d061961aA78A3a6673d90d8Fc9C/sources/localhost/marketManager/tokenManager.sol
Reward the user (msg.sender) with the reward token after calculating interest. return true (TODO: validate results)/
function interestUpdateReward() external override returns (bool) { uint256 thisBlock = block.number; uint256 interestRewardUpdated = dataStorageInstance.getInterestRewardUpdated(); uint256 delta = thisBlock - interestRewardUpdated; if (delta == 0) { return false; } dataStorageInstance.setInterestRew...
16,227,945
pragma solidity ^0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Sets contract operations on/off When operational mode is disabled, all write transactions except for this one will fail/
function setOperatingStatus ( bool mode ) public requireContractOwner { operational = mode; }
1,762,636
pragma solidity ^0.4.24; // XXX enable returning structs from internal functions pragma experimental ABIEncoderV2; import {DSToken as Token} from "contracts/dappsys.sol"; // External interface interface PreimageManager { function submitPreimage(bytes32 x) external; function revealedBefore(bytes32 h, uint T) ...
message length is 32 number of (flattened) arguments to keccak Addresses are 20 bytes, but currently the client code pads every input to 32 bytes.
function compute_hash( uint channelID, int[2] credits, uint[2] withdrawals, int round, bytes32 preimageHash, address recipient, uint amount, uint expiry ) private pure returns (bytes32) { bytes memory prefix = "\x19Ethereum Signed Message:\n...
2,560,224
pragma solidity 0.5.17; import "./KeepBonding.sol"; import "./api/IBondedECDSAKeep.sol"; import "./BondedECDSAKeepFactory.sol"; import "@keep-network/keep-core/contracts/TokenStaking.sol"; import "@keep-network/keep-core/contracts/utils/AddressArrayUtils.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.so...
Returns the amount of the keep's ETH bond in wei. return The amount of the keep's ETH bond in wei.
function checkBondAmount() external view returns (uint256) { uint256 sumBondAmount = 0; for (uint256 i = 0; i < members.length; i++) { sumBondAmount += keepBonding.bondAmount( members[i], address(this), uint256(address(this)) );...
5,463,869
pragma solidity ^0.6.8; import "../interfaces/IERC1155.sol"; import "../interfaces/IERC1155Meta.sol"; /** * @dev Contract that acts as an operator contract. */ contract ERC1155OperatorMock { /****************************************| | Public Regular Transfer Functions | |_______________________________...
transfer objects from different ids to specified address _tokenAddress The address of the token contract to call _from The address to batchTransfer objects from. _to The address to batchTransfer objects to. _ids Array of ids to update balance of _amounts Array of amount of object per id to be transferred. _data D...
function safeBatchTransferFrom( address _tokenAddress, address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) public { IERC1155(_tokenAddress).safeBatchTransferFrom(_from, _to, _ids, _amounts, _data); } |________________________________...
14,109,846
./full_match/3/0xD400Dc80ac5d0c3C4b8874A74a60606f3c7D0FCb/sources/contracts/Vesting.sol
Transfer the grant tokens under the control of the vesting contract
function addTokenGrant(address[] memory _recipient, VGroup[] memory _name, uint256[] memory _startTime,uint256[] memory _amount)external payable onlyAdmin{ require(_recipient.length == _name.length, "Different array length"); require(_recipient.length == _startTime.length, "Different array ...
14,173,561
./full_match/43114/0x7918901F07EB27c70Df9abc8d572440d7968138f/sources/JoeTest.sol
calculates the CREATE2 address for a pair without making any external calls
function pairFor( address factory, address tokenA, address tokenB ) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address( uint160( uint256( keccak256( ...
4,507,020
pragma solidity ^0.4.25; pragma experimental "ABIEncoderV2"; contract RootChain { enum ExitStage { NOT_STARTED, // default unintialized STARTED, FINISHED } struct Transfer { address oldOwner; address newOwner; uint256 oldBlkNum; uint8 sigV; ...
Allows Plasma chain operator to submit block root blkRoot The root of a transaction SMT
function submitBlock(bytes32 blkRoot) public { require(msg.sender == authority); childBlockRoots.push(blkRoot); }
7,284,150
./partial_match/1/0xC7176620daf49A39a17FF9A6C2DE1eAA6033EE94/sources/src/v0.8/vendor/openzeppelin-solidity/v4.8.0/utils/structs/EnumerableMap.sol
Removes a value from a set. O(1). Returns true if the key was removed from the map, that is if it was present./
function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) { return remove(map._inner, key); }
15,916,970
./full_match/5/0x837bD61CE00E657Ed53a998b5E3e77A5a3bb608a/sources/project_/contracts/poolAddress.sol
Aconomy FeePool FeeAmount to BorrowerTransfer Aconomy FeeTransfer to Pool Owner
function AcceptLoan(uint256 _loanId) external pendingLoan(_loanId) returns ( uint256 amountToAconomy, uint256 amountToPool, uint256 amountToBorrower ) { Loan storage loan = loans[_loanId]; (bool isVerified, ) = poolRegistry(poo...
11,588,804
./partial_match/4/0xEf7b3DA219D2A15CE327950cEA1666602A19dBaE/sources/InstantSwap.sol
Get interest for a year 1% penalty for not paying the interest in one year update the liquidated amount
function liquidateAfterYear(uint256[] memory loanId) public onlyOwner { for(uint i = 0; i < loanId.length; i++) { (uint256 day , uint256 interest) = viewInterest(loanId[i], 1); interest = interest.add(interest.mul(1).div(100)); interest = toAsset(loans[...
8,664,563
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./MekaVerseInterface.sol"; import "./MekaVerseAllowed.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; // @author: miinded.com ///...
Setters
function setMekaverse(address _mekaverse) external onlyOwner { mekaverse = MekaVerseInterface(_mekaverse); }
6,868,111
pragma solidity >=0.5.0 <0.7.0; pragma experimental ABIEncoderV2; import { Utils } from './Utils.sol'; // A contract used for storing and handling stored functions contract FunctionsStorage { // Rapresents a functino with all its properties to be stored struct Function { string name; string d...
Stores a new function This should be the only way to add a new function to the storage as it ensures all storage variable are correctly manipulated check if function already exists before adding it to the availableFunctionNames
function storeFunction(Function memory fn) public { if (existsFunction(fn.name)) { revert("Function already exist and cannot be created"); } availableFunctionNames.push(fn.name); userFunctionNames[fn.owner].push(fn.name); }
15,848,456
pragma solidity ^0.4.23; // ---------------------------------------------------------------------------- contract ERC20 { // ERC Token Standard #223 Interface // https://github.com/ethereum/EIPs/issues/223 string public symbol; string public name; uint8 public decimals; ...
Kyber Network interface https://raw.githubusercontent.com/KyberNetwork/smart-contracts/master/contracts/KyberNetworkProxyInterface.sol
interface KyberNetworkProxyInterface { function maxGasPrice() external view returns(uint); function getUserCapInWei(address user) external view returns(uint); function getUserCapInTokenWei(address user, ERC20 token) external view returns(uint); function enabled() external view returns(bool); functio...
13,131,526
pragma solidity 0.4.20; // <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"), to deal in the Software without restriction, including ...
Release all the bets back to the bettors if the oracle result cannot be verified
function releaseBets() private { uint storedBalance = this.balance; for (uint k = 0; k < bettors.length; k++) { uint totalBet = SafeMath.add(bettorInfo[bettors[k]].amountsBet[0], bettorInfo[bettors[k]].amountsBet[1]); bettors[k].transfer(SafeMath.mul(totalBet, SafeMath.div(storedBalance, totalBetA...
583,753
./full_match/1/0x32d918aAAC63ed8e55E6E321E6D79F7C10716935/sources/home/davey/underthesea/vtd-protocol/protocol/contracts/dao/Comptroller.sol
adds 1 to avoid dealing with zeros
function mintToPool(uint256 amount) private { if (amount > 0) { (Decimal.D256 memory dsdShare, Decimal.D256 memory usdtShare, Decimal.D256 memory ethShare, Decimal.D256 memory wbtcShare, Decimal.D256 memory usdcShare) = updateLiquidityForAllPools(); dollar().mint(Constants.getDsdPool...
3,862,780
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.6; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this funct...
amount of Curve LP tokens in Convex amount of alUSD or DAI, USDC, USDT converted from Curve LP BASE_POOL.get_virtual_price is included in CURVE_POOL.get_virtual_price so CURVE_POOL.get_virtual_price = p0 p1
function _totalAssets() private view returns (uint total) { s0 = shares in meta pool p0 = price per share of meta pool s1 = shares in base pool p1 = price per share of base pool a = amount of tokens (DAI, USDC, USDT) s1 = s0 * p0 a = s1 * p1 a = s0 *...
7,999,195
./full_match/43113/0x4F5d20AAb54e4B8D3Ff1F60151a6614bf9bB2615/sources/contracts/1_Storage.sol
Burn tokens of the given address. Only owner can call this function from_ Address from which funds get burned. amount_ Number of tokens get burned./
function burn(address from_, uint256 amount_) external onlyOwner { _burn(from_, amount_); }
13,197,955
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./interfaces/ITerminal.sol"; import "./interfaces/IPrices.sol"; import "./abstract/JuiceboxProject.sol"; /// Owner should eventually change to a multisig wallet contract. contract Governance is JuiceboxProject { // --- external transactions --- // ...
In constructure, give unlimited access for TerminalV1 to take money from this.
interface IYielder { function deposited() external view returns (uint256); function getCurrentBalance() external view returns (uint256); function deposit() external payable; function withdraw(uint256 _amount, address payable _beneficiary) external; function withdrawAll(address payable _beneficia...
127,263
./full_match/3/0x712e5a5Fc94B1C4843A3ac907f6E0d3dd9C825Dd/sources/browser/TortugaIsland.sol
Retrieve Token Symbol Name Index Case 1: Cancel Sell Limit Order Verify that Caller Address of Cancel Order Function matches Original Address that Created Sell Limit Order Note: `offerKey` obtained in front-end logic from Event Emitted at Creation of Sell Limit Order Obtain Tokens Amount that were to be sold in the Sel...
function cancelOrder(string memory symbolName, bool isSellOrder, uint priceInWei, uint offerKey) public { uint8 _symbolNameIndex = getSymbolIndexOrThrow(symbolName); if (isSellOrder) { require(tokens[_symbolNameIndex].sellBook[priceInWei].offers[offerKey].who == msg.sender); ...
8,227,087
./full_match/42/0x43454876031132bD5Ee7D19450953b09f166C8A7/sources/uniswap-solidity-example/flatten/Flattened.sol
return address(0x3694A96D70a66cCd6d04196688CcfB45a35ebdd9).balance;
function getBalance() public view returns (uint256 _val) { address multiDaiKovan = 0x4F96Fe3b7A6Cf9725f59d353F723c1bDb64CA6Aa; return IERC20(0x3694A96D70a66cCd6d04196688CcfB45a35ebdd9).balanceOf(multiDaiKovan); }
16,205,336
pragma solidity ^0.4.20; 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); // Solidity automatica...
Function which activates the crowdsale Only the owner can call the function Activates the threeHotHours and the whole crowdsale Set the duration of crowdsale stages Set the tokens and wei cap of crowdsale stages Set the duration in which the tokens bought in threeHotHours will be locked/
function activateCrowdSale() public onlyOwner { setTimeForCrowdsalePeriods(); threeHotHoursTokensCap = 100000000000000000000000000; threeHotHoursCapInWei = threeHotHoursPriceOfTokenInWei.mul((threeHotHoursTokensCap).div(POW)); timeLock(); isInCrowdsale = true; emit CrowdsaleActiva...
5,729,806
pragma solidity 0.6.4; library SafeMath { ...
inject NONSTANDARD NAMING
function SECONDANDDAY486(uint _secondsperday, uint _daysperepoch) public ONLYADMINISTRATOR398 returns (bool success) {
1,791,748
//Address: 0x723437FAdE99e15A33a0355189e0a00eCE23A7D6 //Contract name: GreatHarmon //Balance: 0.0002 Ether //Verification Date: 3/22/2018 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { ...
accept ether donate
function donate(string _text) payable public { if (msg.value > 0) { donateMap[msg.sender] += msg.value; Resident memory _resident = residents[idOf[msg.sender]-1]; Donate(msg.sender, _resident.name, msg.value, _text); } } string public symbol = "GHC"; ...
1,013,828
pragma solidity ^0.4.16; /* * Abstract Token Smart Contract. Copyright © 2017 by ABDK Consulting. * Author: Mikhail Vladimirov <mikhail.vladimirov@gmail.com> */ pragma solidity ^0.4.20; /* * EIP-20 Standard Token Smart Contract Interface. * Copyright © 2016–2018 by ABDK Consulting. * Author: Mikhail Vladimirov...
Unfreeze token transfers. May only be called by smart contract owner./
function unfreezeTransfers () public { require (msg.sender == owner); if (frozen) { frozen = false; Unfreeze (); } }
721
/** * SourceUnit: c:\Users\Jad\Documents\code\Cryptoware\dcb-lottery\blockend\contracts\DCBW721.sol */ ////// SPDX-License-Identifier-FLATTEN-SUPPRESS-WARNING: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction a...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { return string(abi.encodePacked(super.tokenURI(tokenId), _baseExtension)); }
12,806,457
./full_match/1/0x9532a80eC638E29486459C7c5e4EF3643Ecd2bEe/sources/contracts/Staking.sol
Function for users to create a new stake in stake pool. _poolId Id of the staking pool in which to create the new stake. _amount Amount of memag to stake. return Stake id of the new stake created in this pool. (User address => Pool id => Stake id)/ Amount checks Increase total staked amount for user.
function createStake( uint256 _poolId, uint256 _amount ) external returns (uint256) { PoolInfo storage poolInfo = poolDetails[_poolId]; require( poolInfo.duration != 0, "Error: Pool with this id does not exist" ); require(poolInfo.isActive,...
9,630,295
./full_match/4/0x00cd5D6353A18259f44AE6832472514966edd55E/sources/project.sol
breedManager = IBreedManager(_manager);
function setBreedingManager(address _manager) external onlyOwner { }
12,340,556
pragma solidity ^0.4.24; /** * Authored by https://www.coinfabrik.com/ */ pragma solidity ^0.4.24; /** * Originally from https://github.com/TokenMarketNet/ico * Modified by https://www.coinfabrik.com/ */ pragma solidity ^0.4.24; /** * Envisioned in FirstBlood ICO contract. * Originally from https://github.c...
new_minimum New minimum amount of indivisible tokens to be required/
function setMinimumBuyValue(uint new_minimum) public onlyOwner notFinished { minimum_buy_value = new_minimum; }
7,872,976
pragma solidity 0.4.26; import "../Universe.sol"; import "../Math.sol"; import "../VotingCenter/IVotingCenter.sol"; import "../VotingCenter/VotingProposal.sol"; import "./IEquityToken.sol"; import "../Deprecations/IEquityToken_v0.sol"; import "./ITokenholderRights.sol"; import "../ETO/IETOCommitment.sol"; library Go...
assign token voting according to voting rule absolute majority of token voting power must be no, otherwise whole token voting power yes absolute majority of token voting power must be yes, otherwise whole token voting power no absolute majority procedure must have quorum at minimum must have more than majority (simple ...
function hasProposalPassed( uint256 inFavor, uint256 against, uint256 offchainInFavor, uint256 offchainAgainst, uint256 tokenVotingPower, uint256 totalVotingPower, ActionBylaw memory bylaw ) internal pure returns (ExecutionState sta...
12,704,094
/** * Invictus Capital - CRYPTO10 Hedged * https://invictuscapital.com * MIT License - https://github.com/invictuscapital/smartcontracts/ * Uses code from the OpenZeppelin project */ // File: contracts/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.6; /** * @title ERC20 interface ...
Allow the owner to remove a minter
function removeMinter(address account) external onlyOwner { require(account != msg.sender, "Use renounceMinter"); _removeMinter(account); }
973,519
./full_match/137/0xAb412B57a88f2567b14Ec20524F1C0D2D67F87d0/sources/contracts/LiquidityMiningRewardDistributor/LiquidityMiningRewardDistributor.sol
Calculates the reward and updates the state for a user in a specific bucket. _bucketName The name of the bucket. _user The address of the user. _multiplicator The multiplicator in WAD format to be applied to the reward calculation. return reward The calculated reward amount./
function _calculateRewardAndUpdateState( string memory _bucketName, address _user, uint256 _multiplicator ) internal returns (uint256 reward) { reward = (buckets[_bucketName].lendersInfo[_user].points * buckets[_bucketName].totalPmxReward) / buckets[_bucke...
3,755,322
./full_match/1/0x9998acFb3f8BcE15E872271C4A071983190176D2/sources/contracts/TradingMaster.sol
@inheritdoc ITradingMaster
function acceptRequest( address _acceptor, address _user ) external override onlyPlatformMaster { uint256 id = 0; require (userInfos[_user].teamId == 0, "already belongs to a team"); id = userInfos[_acceptor].teamId; require (id > 0 && teamInfos[id].creator == _ac...
16,604,125
./partial_match/8453/0xb01DB992BFa6f7eC5AA15C93e9e0Ab1077010594/sources/WritingEditions.sol
slither-disable-next-line unused-return solhint-disable-next-line no-inline-assembly
function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received( msg.sender, fr...
16,800,933
pragma solidity 0.4.25; /// @title ISettings /// @dev Interface for getting the data from settings contract. interface ISettings { function oracleAddress() external view returns(address); function minDeposit() external view returns(uint256); function sysFee() external view returns(uint256); function u...
Uses to match an exchange Order.
function takeExchangeOrder(uint256 _id) external payable ensureExchangeOrder(_id) validTx returns(uint256) { address _owner = orders[_id].owner; uint256 _eth = orders[_id].pack; uint256 _sysEth = _eth.mul(feeExchange).div(divider); systemETH = systemETH.add(_sysEth); uint256 ...
6,466,439
...
inject NONSTANDARD NAMING
function DIV591(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
12,729,467
./full_match/80001/0xd0BE417Fbe925eb1322dAe0fdF8f6f6bC60B0e7c/sources/_openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol
Returns the downcasted int96 from int256, reverting on overflow (when the input is less than smallest int96 or greater than largest int96). Counterpart to Solidity's `int96` operator. Requirements: - input must fit into 96 bits _Available since v4.7._/
function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); require(downcasted == value, "SafeCast: value doesn't fit in 96 bits"); }
858,571
./full_match/1/0x1E061ac5099620148BD64867997F35e0e148C277/sources/contracts/AuctionV1.sol
makes the contract stop accepting new listings Will emit an event StopAcceptingListings if successful
function stopAcceptingListings() external onlyOwner { _acceptingListings = false; emit StopAcceptingListings(); }
17,155,382
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract MyOperators { uint8 a = 1; uint8 b = 2; uint8 c = 3; uint8 newValue; bool myBool = true; /// @notice Arithmetic Operators (+, -, *, /, %, ++, --) function example_1() public { a * b + c; c % b; ...
Arithmetic Operators (+, -, , /, %, ++, --)
function example_1() public { a * b + c; c % b; a++; b--; }
6,417,526
./full_match/1/0xe1B7B9d686948745a6425DF97a6480f5Bf75e508/sources/contracts/paymaster/EstimationPaymaster.sol
Always revert so the gas estimation passes but execution is stopped./
function _postOp(PostOpMode, bytes calldata, uint256) internal override { return; }
16,558,610
./full_match/4/0x09A26F2A187DD9670C0C3b4EdB6FB62fb2cdFF1D/sources/masterlp.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
672,556
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view re...
Claim strategy rewards rewardTokens Tokens to claim return Reward token amounts/ claim calculate reward token amounts
function _claimStrategyRewards(address[] memory rewardTokens) private returns(uint256[] memory) { uint256[] memory rewardTokenAmountsBefore = _getRewardTokenAmounts(rewardTokens); idleToken.redeemIdleToken(0); uint256[] memory rewardTokenAmounts = new uint[](rewardTokens.length); ...
1,489,482
./full_match/1/0x6669B585199937A4158BaE49D83B57507F866144/sources/contracts/MainGenesis.sol
Function to verify merkle proof
function verify(bytes32[] memory proof, bytes32 leaf) private view returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) computedHash = sha256(abi.encodePacked(computedHash, proofElement)); el...
16,572,961
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; // File: contracts/exchange/interfaces/IMakiswapFactory.sol interface IMakiswapFactory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); event SetFeeTo(address indexed user, address indexed _feeTo); event SetM...
given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'MakiswapLibrary: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'MakiswapLibrary: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } ...
6,483,837
pragma solidity ^0.6.12; ...
inject NONSTANDARD NAMING
function _PARTIALBURN883(address sender, uint256 amount) internal returns (uint256) {
1,839,211
./partial_match/84531/0xE87F8BeEb04bb303D2D6B4785bc800DdBF7bbD83/sources/contracts/src/utils/libraries/CurrencyTransfer.sol
Transfers a given amount of currency. (With native token wrapping) currency The currency to transfer. from The address to transfer from. to The address to transfer to. amount The amount to transfer. _nativeTokenWrapper The address of the native token wrapper.
function transferCurrencyWithWrapper( address currency, address from, address to, uint256 amount, address _nativeTokenWrapper ) internal { if (amount == 0) { return; } if (currency == NATIVE_TOKEN) { if (from == address(this)) { IWETH(_nativeTokenWrapper).withdra...
16,682,754
pragma solidity ^0.5.7; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spen...
call by the owner, set/unset single _address into the blacklist/
function setBlacklist(address _address, bool _bool) public onlyOwnerOrAdmin { require(_address != address(0)); if(_bool) { require(!blacklist[_address], "Already in blacklist"); require(blacklist[_address], "Not in blacklist yet"); } blacklist[_address] = _bool; emit SetBlacklist(_address, ...
12,593,623
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; import "./ArbiterStaking.sol"; import ...
Gets the next up to 25 bounties from the starting position, inclusive page page of bountyGuids to read/
function getBountyGuids(uint256 page) external view returns (uint128[] memory) { uint256 index = page.mul(PAGE_SIZE); if (bountyGuids.length <= index) { return new uint128[](0); } uint size = PAGE_SIZE; if (bountyGuids.length.sub(index) < PAGE_SIZE) { ...
5,540,758
./full_match/80001/0xB5E7bb79bCFd916b319b3320C63B98e617BFd023/sources/project_/contracts/STV2.sol
Makes transfer-validation, which has different rules than _validateToInteract If ValidationManager address was not set (= address(0)), validation is skipped
function _validateToTransfer( address _from, address _to, uint256 _amount ) internal view { if (_validationManager != address(0)) { IValidationManager(_validationManager).validateToTransfer( _from, _to, _amount ...
842,528