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: 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...
Withdraws staking tokens and claims for a list of distributions to a callback contract stakingTokens The staking tokens to withdraw tokens from distributionIds The distributions to claim for callbackContract The contract where tokens will be transferred callbackData The data that is used to call the callback contra...
function exitWithCallback( IERC20[] calldata stakingTokens, bytes32[] calldata distributionIds, IDistributorCallback callbackContract, bytes calldata callbackData ) external override nonReentrant { for (uint256 i; i < stakingTokens.length; i++) { IERC20 stakin...
14,039,103
// SPDX-License-Identifier: MIT /** * @title A LIT Invitation To Kindness * @author Transient Labs, Copyright (C) 2022 * @notice ERC 1155 contract, single owner, merkle claim * @dev includes the public parameter `name` so it works with OS */ /* ( ( ( ...
overrides supportsInterface function _interfaceId is supplied from anyone/contract calling this function, as defined in ERC 165 return a boolean saying if this contract supports the interface or not/
function supportsInterface(bytes4 _interfaceId) public view virtual override(ERC1155, EIP2981) returns (bool) { return super.supportsInterface(_interfaceId); }
1,204,633
pragma solidity ^0.5.10; /** @title OnDemandSPV */ /** @author Summa (https://summa.one) */ import {Relay} from "./Relay.sol"; import {ISPVRequestManager, ISPVConsumer} from "./Interfaces.sol"; import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol"; import {BTCUtils} from "@summa-tx/bitcoin-spv-so...
Subscribe to a feed of Bitcoin txns matching a request The request can be a spent utxo and/or a created utxo _spends An outpoint that must be spent in acceptable txns (optional) _pays An output script that must be paid in acceptable txns (optional) _paysValue A minimum v...
function _request( bytes memory _spends, bytes memory _pays, uint64 _paysValue, address _consumer, uint8 _numConfs, uint256 _notBefore ) internal returns (uint256) { uint256 _requestID = nextID; nextID = nextID + 1; bytes memory pays = _pay...
12,594,018
pragma solidity ^0.4.23; // Copyright 2017 OpenST Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applic...
External function commitStateRoot. commitStateRoot Called from game process. Commit new state root for a block height. _blockHeight Block height for which stateRoots mapping needs to update. _stateRoot State root of input block height. return bytes32 stateRoot/ State root should be valid Input block height...
function commitStateRoot( uint256 _blockHeight, bytes32 _stateRoot) external onlyWorker returns(bytes32 /* stateRoot */) { require(_stateRoot != bytes32(0), "State root is 0"); require(_blockHeight > latestStateRootBlockHeight, "Given block height is lower or equal to highest committed state root block ...
15,810,764
./partial_match/1/0x2845f0f85c1AfC937Dc214b5dF34f03b71F062E8/sources/Kilroy.sol
sell half the tokens for ETH and add liquidity sell tokens for ETH and send to project fund
function swapAndLiquify(uint256 tAmount) private lockTheSwap { uint256 totalFee = _liquidityFee.add( _projectFee ); uint256 forLiquidity = tAmount.mul(_liquidityFee).div(totalFee); uint256 forFund = tAmount.sub(forLiquidity); if(forLiquidity > 0 && _liquidityFee > 0) ...
2,763,590
/** *Submitted for verification at Etherscan.io on 2022-04-12 */ /** *Submitted for verification at BscScan.com on 2022-04-06 */ // File: contracts/interfaces/IAggregationExecutor.sol pragma solidity >=0.6.12; interface IAggregationExecutor { function callBytes(bytes calldata data) external payable; // 0xd9c...
Only use this mode if the first pool of each sequence can receive tokenIn directly into the pool collect amount to the first pool solhint-disable-next-line avoid-low-level-calls may take some native tokens for commission fee solhint-disable-next-line avoid-low-level-calls may take some native tokens for commission fee
function _swapMultiSequencesWithSimpleMode( IAggregationExecutor caller, address tokenIn, uint256 totalSwapAmount, address tokenOut, address dstReceiver, bytes calldata executorData ) internal { SimpleSwapData memory swapData = abi.decode(executorData, (Si...
7,619,886
// 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...
Mutates `amounts` by applying `mutation` with each entry in `arguments`. Equivalent to `amounts = amounts.map(mutation)`./
function _mutateAmounts( uint256[] memory toMutate, uint256[] memory arguments, function(uint256, uint256) pure returns (uint256) mutation ) internal view { for (uint256 i = 0; i < _getTotalTokens(); ++i) { toMutate[i] = mutation(toMutate[i], arguments[i]); } ...
12,850,304
pragma solidity 0.4.25; // File: contracts/sogur/interfaces/IPaymentHandler.sol /** * @title Payment Handler Interface. */ interface IPaymentHandler { /** * @dev Get the amount of available ETH. * @return The amount of available ETH. */ function getEthBalance() external view returns (uint256)...
Exchange ETH for SGR. Can be executed from externally-owned accounts as well as from other contracts./
function exchange() external payable { ISGRTokenManager sgrTokenManager = getSGRTokenManager(); uint256 amount = sgrTokenManager.exchangeEthForSgr(msg.sender, msg.value); _mint(msg.sender, amount); sgrTokenManager.afterExchangeEthForSgr(msg.sender, msg.value, amount); }
208,329
./partial_match/1313161554/0xa200B567579a577F582d292f7A1b5C4ecce195F8/sources/Comptroller.sol
Claim all the PLY accrued by holder in the specified markets holder The address to claim PLY for auTokens The list of markets to claim PLY in/
function claimReward(uint8 rewardType, address holder, AuToken[] memory auTokens) external { _claimRewardForOne(rewardType, holder, auTokens, true, true); }
16,936,510
/* ███████╗ ██████╗ ██╗ ██╗ ██████╗ █████╗ ███╗ ███╗███████╗ ██╔════╝██╔═══██╗╚██╗██╔╝ ██╔════╝ ██╔══██╗████╗ ████║██╔════╝ █████╗ ██║ ██║ ╚███╔╝ ██║ ███╗███████║██╔████╔██║█████╗ ██╔══╝ ██║ ██║ ██╔██╗ ██║ ██║██╔══██║██║╚██╔╝██║██╔══╝ ██║ ╚██████╔╝██╔╝ ██╗ ╚██████╔╝██║ ██║██║ ╚═╝...
gets the alpha score for a Fox tokenId the ID of the Fox to get the alpha score for return the alpha score of the Fox (5-8)/
function _getAdvantagePoints(IFoxGameNFT nftContract, uint16 tokenId) internal view returns (uint8) { }
14,423,443
./partial_match/1/0xfFdf17652cca46eB98A214cb3E413C8661241E49/sources/CryptoBeastiesToken.sol
Internal function to add a token ID to the list owned by a given address _to address representing the new owner of the token ID _tokenId uint256 ID of the token to be added/ index is +1 to avoid Solidity's zero default mapping value
function addTokenTo(address _to, uint256 _tokenId) internal { super.addTokenTo(_to, _tokenId); ownedTokens[_to].push(_tokenId); ownedTokenIndexes[_tokenId] = ownedTokens[_to].length; }
3,926,482
pragma solidity ^0.5.0; import "./SafeMath.sol"; import "./Valset.sol"; import "./CosmosBridge.sol"; contract Oracle { using SafeMath for uint256; /* * @dev: Public variable declarations */ CosmosBridge public cosmosBridge; Valset public valset; address public operator; uint256 pub...
: checkBridgeProphecy Operator accessor method which checks if a prophecy has passed the validity threshold, without actually completing the prophecy./
function checkBridgeProphecy(uint256 _prophecyID) public view onlyOperator isPending(_prophecyID) returns (bool, uint256, uint256) { require( cosmosBridge.isProphecyClaimActive(_prophecyID) == true, "Can only check active prophecies" ...
5,498,029
./partial_match/1/0xdac4585B741E5b6625CEc460D2A255fB3FBE0D47/sources/contracts/lib/pools/FusePoolController.sol
Approves tokens to Fuse without spending gas on every deposit. cErc20Contract The CErc20 contract address of the token. erc20Contract The ERC20 contract address of the token. amount Amount of the specified token to approve to Fuse./
function approve(address cErc20Contract, address erc20Contract, uint256 amount) external { IERC20 token = IERC20(erc20Contract); uint256 allowance = token.allowance(address(this), cErc20Contract); if (allowance == amount) return; if (amount > 0 && allowance > 0) token.safeApprove(cEr...
3,925,309
./full_match/1/0xD4515f0A85DcA839C8D639cf55d553Ce0FA4bBe8/sources/contracts/CoverMarketMakers.sol
Mint CLAIM / NOCLAIM , deposit CLAIM and NOCLAIM in balancer and return BPTs
function marketMakerDeposit( IProtocol _protocol, IBPool _claimPool, IBPool _noclaimPool, uint48 _expiration, uint256 _mintAmount, uint256 _collateraLpAmount, address _collateral ) external { IERC20(_collateral).safeTransferFrom(msg.sender, address(this), (_collat...
5,015,756
./partial_match/56/0xe8d312E41F8f5aBCd68911De96EDcA697E70FDB6/sources/Vault.sol
Reduce BaseToken reserve, effectively giving them to the depositors. value The number of BaseToken reserve to reduce.
function reduceReserve(uint256 value) external onlyOwner { reservePool = reservePool.sub(value); }
11,316,430
./full_match/43113/0xd1F3A2e663E1895F9Ef301E4f08093cb0f56d9ed/sources/LendingPool_flat.sol
mint it 1:1 to the amount put in get fee set first deposit to false
function deposit(uint256 _amount) external { require(_amount > 0, "Can't deposit 0"); uint256 totalAmount = _amount * 10 ** 18; _mint(msg.sender, totalAmount); uint256 isFirstDeposit = balances[msg.sender].isFirstDeposit; if (isFirstDeposit == 0) { ...
13,158,659
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; import {IKODAV3Minter} from "../core/IKODAV3Minter.sol"; import {IKODAV3PrimarySaleMarketplace} from "../marketplace/KODAV3PrimaryMarketplace.sol"; import {ICollabRoyaltiesRegistry} from "../coll...
Make tokens & edition
function mintBatchEditionAsProxy( address _creator, SaleType _saleType, uint16 _editionSize, uint128 _startDate, uint128 _basePrice, uint128 _stepPrice, string calldata _uri, address _deployedRoyaltiesHandler ) canMintAgain external { requi...
6,354,164
pragma solidity 0.4.24; import "../common/ReservedAddrPublic.sol"; import "../../interaction/interface/IPermission.sol"; /// @title Permission contract /// @author ["Rivtower Technologies <contact@rivtower.com>"] /// @notice The address: Created by permissionCreator /// The interface can be called: Only query...
Add the resources _conts The contracts of resource _funcs The function signature of resource return true if successed, otherwise false
function addResources(address[] _conts, bytes4[] _funcs) external onlyPermissionManagement returns (bool) { require(_addResources(_conts, _funcs), "addResources failed."); return true; }
12,783,999
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // Lib: Safe Math // ---------------------------------------------------------------------------- contract SafeMath { function safeAdd(uint256 a, uint256 b) public pure returns (uint256 c) { c = a + b; ...
------------------------------------------------------------------------ Token owner can approve for spender to transferFrom(...) tokens from the token owner's account. The spender contract function receiveApproval(...) is then executed ------------------------------------------------------------------------
function approveAndCall( address spender, uint256 tokens, bytes data ) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval( msg.sender, ...
62,168
./full_match/137/0xD6e87CE87382854e4817c9a8331C8F2341bc7264/sources/hh.sol
Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), reverting with custom message when dividing by zero. CAUTION: This function is deprecated because it requires allocating memory for the error message unnecessarily. For custom revert reasons use {tryMod}. Counterpart to Solidity's `%` o...
...
3,755,721
pragma solidity 0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @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...
recordDealRefundReason creates an event of not paid deal that was cancelled _orderId Identifier of deal's order _clientAddress Address of client's account _clientReputation Updated reputation of the client _merchantReputation Updated reputation of the merchant _dealHash Hashcode of the deal, describing the or...
function recordDealRefundReason( uint _orderId, address _clientAddress, uint32 _clientReputation, uint32 _merchantReputation, uint _dealHash, string _refundReason) external onlyMonetha { DealRefundReason( _orderId, _clientAd...
882,026
/// SPDX-License-Identifier: MIT /* ▄▄█ ▄ ██ █▄▄▄▄ ▄█ ██ █ █ █ █ ▄▀ ██ ██ ██ █ █▄▄█ █▀▀▌ ██ ▐█ █ █ █ █ █ █ █ ▐█ ▐ █ █ █ █ █ ▐ █ ██ █ ▀ ▀ */ /// Special thanks to Keno, Boring and Gonpachi for review and continued inspiration. pragma solidity 0.6.12; pr...
Stake SUSHI local balance into xSushi for benefit of `to` by call to `sushiBar`.
function stakeSushiBalance(address to) external { }
44,077
./full_match/1/0x0000000304aAD016bA7a745da3cE64f6198B76B3/sources/lib/solady/src/utils/FixedPointMathLib.sol
Returns `x y`, without checking for overflow.
function rawMul(uint256 x, uint256 y) internal pure returns (uint256 z) { unchecked { z = x * y; } }
3,200,585
pragma solidity >=0.5.0 <0.6.0; /// @title ERC165Interface /// @dev https://eips.ethereum.org/EIPS/eip-165 interface ERC165Interface { /// @notice Query if a contract implements an interface /// @param interfaceId The interface identifier, as specified in ERC-165 /// @dev Interface identification is speci...
An internal convenience function that checks to see if we are currently in the Window defined by the WindowParameters struct passed as an argument. We are never "in a window" if the contract is paused If we are before the first window of this type, we are obviously NOT in this window!
function _isInWindow(WindowParameters memory localParams) internal view returns (bool) { if (block.number <= localParams.pauseEndingBlock) { return false; } if (block.number <= localParams.firstWindowStartBlock) { return false; } }
12,784,503
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.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...
claim TAD based on current state
function claimTad() public whenNotPaused { updateMiningState(); uint claimableTad = claimableTad(msg.sender); stakerIndexes[msg.sender] = miningStateIndex; if(claimableTad > 0){ stakerClaimed[msg.sender] = stakerClaimed[msg.sender].add(claimable...
325,199
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for ...
Leave the Sanctuary. Claim back your SDTs.
function leave(uint256 _share) public { uint256 totalShares = totalSupply(); uint256 what = _share.mul(sdt.balanceOf(address(this))).div(totalShares); _burn(_msgSender(), _share); sdt.transfer(_msgSender(), what); emit Unstake(_msgSender(), what); }
120,036
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "./TokenHolder.sol"; import "./lib/Sig.sol"; import "./lib/Bytes.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract Erdstall is Ownable { // The epoch-balance statements signed by the TEE. struct Balance { uint64 e...
Transfers all tokens to msg.sender, using each token's token holder. successful withdrawal of this token
function _withdraw(uint64 _epoch, TokenValue[] memory tokens) internal { require(!withdrawn[_epoch][msg.sender], "already withdrawn"); withdrawn[_epoch][msg.sender] = true; for (uint i=0; i < tokens.length; i++) { TokenValue memory tv = tokens[i]; TokenHolder holder ...
5,402,928
./partial_match/7700/0x2Bf57af42Cc1daB534DAe42169DdeD97f139A316/sources/dice_flat.sol
Play the game!Won!Loser!
function lottery(uint8 guess) public payable returns(bool){ require(guess == 0 || guess == 1, "Guess should be either 0 ('heads') or 1 ('tails')"); require(msg.value >= 5, "Bet at least 5"); require(msg.value < maxBet || (msg.value <= address(this).balance - msg.value), "Max bet is 50 and cannot be more t...
3,506,116
// SPDX-License-Identifier: GPL-3.0-or-later // Deployed with donations via Gitcoin GR9 pragma solidity 0.7.5; interface IERC20 { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function name() externa...
bytes4(keccak256(bytes('transfer(address,uint256)')));
function safeTransfer( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TH_TRANSFER_FAILED'); }
283,806
./full_match/84531/0xd7149865d07cCfdfB10f858AFAb297A8251882Cc/sources/contracts/api/Processor.sol
Submitted Pyth price is bound by the Chainlink price
) internal pure returns (bool) { if (chainlinkPrice == 0 || maxDeviation == 0) return true; if ( price >= (chainlinkPrice * (BPS_DIVIDER - maxDeviation)) / BPS_DIVIDER && price <= (chainlinkPrice * (BPS_DIVIDER + maxDeviation)) / BPS_DIVIDER function _boundPriceWithChainl...
11,525,736
pragma solidity 0.4.18; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed...
Allows to add a new owner. Transaction has to be sent by wallet. owner Address of new owner.
function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); }
39,642
./partial_match/1/0xE6B3C373380896e671c5a94E3f74cd2527324466/sources/contracts/feeding/Feeding.sol
Calculates the minimum amount of tokens to receive from a swap, accounting for slippage. _tokenIn Token to be swapped _amountIn Amount of tokens to be swapped _slippage Maximum allowable slippage for the swap return Minimum amount of tokens to receive/
function _calculateAmountOutMin( address _tokenIn, uint256 _amountIn, uint256 _slippage ) internal view returns (uint256) { uint256[] memory amountsOut = IUniswapV2Router02(routerAddress).getAmountsOut(_amountIn, tokenPath[_tokenIn]); uint256 amount = amountsOut[amounts...
4,083,742
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: IAlphaV2 interface IAlphaV2 { // ERC20 part function balanceOf(address) external view returns (uint256); // AlphaV2 view interface function cToken() external view returns (address); // VaultV2 user interface function deposit...
Returns the underlying invested balance. This is the underlying amount based on yield bearing token balance, plus the current balance of the underlying asset./
function investedUnderlyingBalance() external view override returns (uint256) { uint256 shares = IERC20(aBox).balanceOf(address(this)); address cToken = IAlphaV2(aBox).cToken(); uint256 exchangeRate = ICErc20(cToken).exchangeRateStored(); uint256 p...
12,087,541
// SPDX-License-Identifier: MIT /** * @title obscurityDAO * @email [email protected] * @dev Nov 3, 2020 * ERC-20 * obscurityDAO Copyright and Disclaimer Notice: */ pragma solidity ^0.8.7 <0.9.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgra...
SPDX-License-Identifier: MIT OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) Interface of the ERC20 standard as defined in the EIP./
interface IERC20Upgradeable { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view ret...
14,546,423
./full_match/7700/0x6eA48824253f64662945Ae77A790331D7183f8c0/sources/project_/contracts/digidaemons.sol
this is a public getter for ETH blance on contract
function getBalance() external view returns (uint) { return address(this).balance; }
4,661,605
pragma solidity =0.5.16; pragma experimental ABIEncoderV2; /** * ______ ____ __ ______ * / ____/____ _ ____ ___ ___ / __ \ ___ ____ _ ____/ /___ _____ / ____/____ _____ * / / __ / __ `// __ `__ \ / _ \ / /_/ // _ \ / __ `// __ // _ \...
Returns next of `account`./
function playerNextA(address account) public view returns ( uint256[SM_PAGE] memory serials, address[SM_PAGE] memory accounts, uint256[SM_PAGE] memory playerSerials, bytes[SM_PAGE] memory names, bytes[SM_PAGE] memory adviserNames, ...
12,693,134
pragma solidity 0.4.25; // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/ERC20.sol // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/...
Release the tokens once the holding period expires, transferring them back to the ERC20 contract to the holder. NOTE: This function preserves the isAffiliate flag of the holder. who The owner of the tokens. return True on successful release, false on error./
function release(address who) public onlyTransferAgent returns (bool) { Holding memory holding = heldTokens[who]; require(!holding.isAffiliate, "To release tokens for an affiliate use partialRelease()."); if(block.timestamp > holding.releaseDate) { bool res = ERC20Interface(tok...
2,545,288
./full_match/1/0xFE0D22E6516643e2cB3C9Cc3b8D6A1fAb9B8aAF3/sources/contracts/blindBackrun.sol
Executes an arbitrage transaction between Uniswap V3-V2 pairs. Approve the firstPair to spend the contract's WETH. swap WETH for token1 swap WETH for token0
function executeArbitrage( bool isWETHZero, address secondPairAddress, uint amountIn, uint finalAmountOut, address token0, address token1, uint24 actualUniV3Fee, uint percentageToPayToCoinbase ) external onlyOwner { uint256 balanceBefore = ...
3,154,593
/* * Origin Protocol * https://originprotocol.com * * Released under the MIT license * https://github.com/OriginProtocol/origin-dollar * * Copyright 2020 Origin Protocol, Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files ...
Get the credits per token for an account. Returns a fixed amount if the account is non-rebasing. _account Address of the account./
function _creditsPerToken(address _account) internal view returns (uint256) { if (nonRebasingCreditsPerToken[_account] != 0) { return nonRebasingCreditsPerToken[_account]; return rebasingCreditsPerToken; } }
210,759
/** *Submitted for verification at Etherscan.io on 2022-02-05 */ // SPDX-License-Identifier: MIT // # Runes.sol // This is a ERC-20 token that is ONLY meant to be used as a extension for the Mysterious World NFT Project // The only use case for this token is to be used to interact with The Mysterious World. // This t...
burn removes the withdrawn $RUNES from the wallet provided for the amount provided/
function burn(address inhabitant, uint256 cost) external payable onlyContractWallets { _burn(inhabitant, cost); }
7,739,793
./full_match/3/0x4B2b0E0F74Bb9166Dbc162D7E8956f0413D54FD6/sources/SmartBank.sol
define the functions of compound we'll be using
interface cETH{ function exchangeRateStored() external view returns (uint); function balanceOf(address owner) external view returns (uint256 balance); pragma solidity >=0.7.0 <0.9.0; }
8,226,942
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.4.21 <=0.7.4; //import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title Voting * @dev Organise Voters registration, proposals registration, vo...
Add a voter _addressVoter address of new voter _isAbleToPropose is voter abble to propose proposals/
function addVoter(address _addressVoter, bool _isAbleToPropose) external onlyOwner{ require(currentStatus == WorkflowStatus.RegisteringVoters, "Not RegisteringVoters Status"); require(!voters[_addressVoter].isRegistered, "Voter already registered"); voters[_addressVoter] = Voter(tru...
12,717,749
./full_match/43113/0x44bFBAD3105f1884c0feD9f3d25671feb006469B/sources/contracts/1_Storage.sol
Store value in variable num value to store/
function store(uint256 num) public { number = 100000000000; }
13,195,841
/** *Submitted for verification at Etherscan.io on 2022-04-12 */ /** *Submitted for verification at Etherscan.io on 2022-04-13 */ // SPDX-License-Identifier: MIT // File: contracts/interfaces/ILayerZeroUserApplicationConfig.sol pragma solidity >=0.5.0; interface ILayerZeroUserApplicationConfig { // @notice s...
set the configuration of the LayerZero messaging library of the specified version _version - messaging library version _chainId - the chainId for the pending config change _configType - type of configuration. every messaging library has its own convention. _config - configuration in the bytes. can encode arbitrary ...
interface ILayerZeroUserApplicationConfig { function setConfig( uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config ) external; function setSendVersion(uint16 _version) external; function setReceiveVersion(uint16 _version) external; functi...
15,295,773
pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint2...
require(receiverCount > 0 && receiverCount <= 20); /
function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { uint receiverCount = _receivers.length; uint256 amount = _value.mul(uint256(receiverCount)); require(receiverCount > 0); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] =...
7,607
pragma solidity 0.5 .11; // 'ButtCoin' contract, version 2.0 // Website: http://www.0xbutt.com/ // // Symbol : 0xBUTT // Name : ButtCoin v2.0 // Total supply: 33,554,431.99999981 // Decimals : 8 // // ---------------------------------------------------------------------------- // =====================...
---------------------------------------------------------------------------- Removes account from the whitelist ----------------------------------------------------------------------------
function removeFromWhitelist(address removeFromWhitelist) public { whitelist[removeFromWhitelist] = false; }
14,015,813
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @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, which i...
verifySignature checks the the provided signature matches the provided parameters.
function verifySignature(bytes32 _signedMessageHash, bytes memory _sig) public view returns (bool) { bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(_signedMessageHash); address signer = ECDSA.recover(ethSignedMessageHash, _sig); return admin == signer; }
1,641,532
./partial_match/5/0xdE4c870F36a614E44bd00f987B22F4c4D48718F3/sources/contracts/base/MetawinERC721.sol
[Tx][External][Restricted] Set final provenance record _hash Provenance hash/
function setProvenance(string calldata _hash) external onlyMetadataProvider { require(bytes(PROVENANCE).length == 0, "Override not allowed"); require(bytes(_hash).length > 0, "Empty provenance not allowed"); PROVENANCE = _hash; }
16,866,948
//Address: 0x5301f1ec2f48f86bbd5291dfd7998a3d733a3245 //Contract name: RentAuction //Balance: 0 Ether //Verification Date: 1/28/2018 //Transacion Count: 4 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { func...
The creator of the contract is the initial CFO.
function DWorldAccessControl() public { cfoAddress = msg.sender; }
12,995,679
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../utils/timelock/QuadraticTokenTimelock.sol"; interface IVotingToken is IERC20 { function delegate(address delegatee) external; } /// @title a timelock for tokens allowing for bu...
amount of held tokens unlocked and available for release
function availableForRelease() public view override returns (uint256) { uint256 elapsed = timeSinceStart(); uint256 totalAvailable = _proportionAvailable(initialBalance, elapsed, duration); uint256 netAvailable = totalAvailable - alreadyReleasedAmount(); return netAvailable; }
1,245,655
pragma solidity ^0.4.21; import "zeppelin-solidity/contracts/access/rbac/RBAC.sol"; interface ITeamNFT { function _createTeam( uint256 _id, string memory _TeamUrl, string memory _name, address _teamOwner ) public returns (uint256); function mintTeamToken( address t...
price to prev ownerchange offer statuscall transferWeekNFTOnBid
function acceptAnOffer(uint256 offerID) public payable { var ( weekId, teamId, weekOwner, exists, WeekUrl, price,WeekNo,Year)=getWeekById(offerList[offerID].WeekId); offerList[offerID].ownerAddress.transfer(price); offerList[offerID].accepted = true; transferWeekNFTOnBid(...
6,460,584
/* Copyright 2019 RigoBlock, Rigo Investment Sagl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
INTERNAL FUNCTIONS/ Allows owner to set an infinite allowance to an approved exchange. tokenTransferProxy Address of the proxy to be approved. token Address of the token to receive allowance for. amount Amount to be approved.
function setAllowances( address tokenTransferProxy, address token, uint256 amount) internal returns (bool success) { success = false; require( ERC20(token) .approve( tokenTransferProxy, amount ...
943,270
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol"; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol"; import "https://github.com/OpenZeppelin/openzeppeli...
Returns whether an account is excluded from reward./
function isExcludedFromReward(address account) external view returns (bool) { return _isExcludedFromReward[account]; }
916,781
pragma solidity 0.5.17; import "./MToken.sol"; import "./ErrorReporter.sol"; import "./PriceOracle.sol"; import "./MomaMasterInterface.sol"; import "./MomaMasterStorage.sol"; import "./MomaPool.sol"; /** * @title Moma's MomaMaster Contract * @author Moma */ contract MomaMaster is MomaMasterInterface, MomaMasterV1S...
Calculate token accrued by a borrower Borrowers will not begin to accrue until after the first interaction with the protocol. mToken The market in which the borrower is interacting borrower The address of the borrower to distribute token to marketBorrowIndex The market borrow index/
function distributeBorrowerToken(address token, address mToken, address borrower, uint marketBorrowIndex) internal { delegateToFarming(abi.encodeWithSignature("distributeBorrowerToken(address,address,address,uint256)", token, mToken, borrower, marketBorrowIndex)); }
12,663,229
./partial_match/42/0xe74EFb19BBC46DbE28b7BaB1F14af6eB7158B4BE/sources/L1_Bridge.sol
Bond covers _amount plus a bounty to pay a potential challenger
function getChallengeAmountForTransferAmount(uint256 _amount) public view returns (uint256) { return _amount.mul(challengeAmountMultiplier).div(challengeAmountDivisor); }
3,427,465
./partial_match/1/0xF2170fC7C95f2745FfE12366b29a003Ce2Da8820/sources/RefundEscrow.sol
Withdraws the beneficiary's funds./
function beneficiaryWithdraw() public virtual { require(_state == State.Closed, "RefundEscrow: beneficiary can only withdraw while closed"); _beneficiary.transfer(address(this).balance); }
15,935,661
./full_match/43114/0xfA6289aE61588DC08a9E0CD31B6f64135a24412A/sources/DoubleMint.sol
Unstake and send to active
function sendToActive(address payable _active) public { _unstake(); uint256 amount = IERC20(time).balanceOf(address(this)); _active.transfer(amount); }
4,521,688
pragma solidity 0.5.10; // This is a staking token ERC677 contract // (a copy of the token contract from https://github.com/poanetwork/tokenbridge-contracts repo). // Since the source `ERC677BridgeTokenRewardable` requires solc v0.4.24 but truffle // doesn't allow using different versions of compiler at the same time...
Returns all recorded bridge contract addresses return address[] bridge contract addresses/
function bridgeList() external view returns (address[] memory) { address[] memory list = new address[](bridgeCount); uint256 counter = 0; address nextBridge = bridgePointers[F_ADDR]; require(nextBridge != address(0)); while (nextBridge != F_ADDR) { list[counter] ...
6,346,681
./partial_match/1/0xD2dF60073C0A9c0b607ca6AC809ACecc0D9250bD/sources/contracts/core/SmardexPair.sol
@inheritdoc ISmardexPair
function swap( address _to, bool _zeroForOne, int256 _amountSpecified, bytes calldata _data ) external override lock returns (int256 amount0_, int256 amount1_) { require(_amountSpecified != 0, "SmarDex: ZERO_AMOUNT"); SwapParams memory _params = SwapParams({ ...
3,646,215
pragma solidity ^0.4.0; import "6_safe.sol"; // I need no ether to attack, contract GiveMeEverything { TokensGate public tg; uint64 public theif_counter; constructor() payable { } function startAttack(address _addr) public { tg = TokensGate(_addr); thei...
tries to steal a limited times to that the attack is successful (does not drain the resources)tg.transferEth(address(this), 500000000000000000 wei);
function() public payable { if (theif_counter < 8) { theif_counter++; tg.transferEth(address(this), 800000000000000000 wei); } }
15,816,527
./partial_match/1/0x7D70447241Be7442Ae08e96d7EF1d0c13d727f29/sources/InvestmentPool.sol
apply funds from investor. _beneficiary investor./
function invest(address _beneficiary) public payable { uint amount = msg.value; _preValidateInvest(_beneficiary, amount); weiRaised = weiRaised.add(amount); investments[_beneficiary] = investments[_beneficiary].add(amount); emit Invest(_beneficiary, amount); }
2,804,649
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; impor...
This function should allow governance rescue tokens from the staking rewards contract /
function withdrawTorn(uint256 amount) external onlyGovernance { if (amount == type(uint256).max) amount = torn.balanceOf(address(this)); torn.safeTransfer(address(Governance), amount); }
12,600,006
./full_match/11155111/0x1e7eE10b72628db353DeDDfd3A6EC8a2543BDF78/sources/src/SimpleStorage.sol
memory , calldata, storage -- with memory the information only exists for a short period of time same with calldata calldata once defined in a function cant be modified again after its being defined string are a special data type so they work with memory,calldata or storage creating a variable outside of a function aut...
function addPeople( string memory _name, uint256 _number, bool _isAdded ) public { listOfPeopleAdded.push(Person(_number, _name, _isAdded)); nameToNumber[_name] = _number; }
3,792,698
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; interface ISqwidMigrator { function positionClosed( uint256 positionId, address receiver, bool saleCreated ) external; } interface ISqwidERC1155 { function mint( ad...
Returns active loans funded by an address paginated in reverse order (starting from last element)./ Get start and end index
function _fetchAddressLoansReverse( address targetAddress, uint256 pageSize, uint256 pageNumber ) private view returns (PositionResponse[] memory loans, uint256 totalPages) { uint256 totalPositionCount = marketplace.currentPositionId(); uint256 addressLoanCount; f...
979,053
pragma solidity ^0.4.24; contract RSEvents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
distributes eth based on fees to com, aff, and p3d/ pay 5% out to community rewards distribute share to affiliate decide what to do with affiliate share of fees affiliate must not be self, and must have a name registered no affiliates, add to community This ensures Team Just cannot influence the outcome of FoMo3D with ...
function distributeExternal(uint256 _pID, uint256 _eth, uint256 _affID, RSdatasets.EventReturns memory _eventData_) private returns(RSdatasets.EventReturns) { uint256 _com = _eth * 5 / 100; uint256 _aff = _eth / 10; if (_affID != _pID && plyr_[_a...
338,459
pragma solidity ^0.4.18; import "./BaseAPI.sol"; import "../interfaces/EpochRegistry.sol"; import "../interfaces/ContractDirectory.sol"; import "../interfaces/NodeRegistry.sol"; contract EpochRegistryAPI is EpochRegistry, BaseAPI { // Events event EpochStarted(uint256 _nonce, uint256 _blockStart, uint256 _blo...
Sets the blocksPerEpoch state variable/
function setBlocksPerEpoch(uint256 _blocksPerEpoch) public onlyOwner { blocksPerEpoch = _blocksPerEpoch; }
5,535,358
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; // solhint-disable-line /** * @dev Constant values shared across mixins. */ abstract contract Constants { uint256 internal constant BASIS_POINTS = 10000; } interface ICHIARTNFT721 { function tokenCreator(u...
Returns how much funds are available for manual withdraw due to failed transfers./
function getPendingWithdrawal(address user) public view returns (uint256) { return pendingWithdrawals[user]; }
41,777
./full_match/5/0x4D0a9d8ed1052B1F09de21D87eFd30a35Dc25c7d/sources/contracts/staking/StakingVolTiers.sol
Returns true if NFTs are locked (cannot be withdrawn), false otherwise
function getWithdrawalStatus() public view returns (bool) { return (emergencyUnlock || block.timestamp > periodFinish) ? false : true; }
11,613,098
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.6; import "./libraries/Margin.sol"; import "./libraries/ReplicationMath.sol"; import "./libraries/Reserve.sol"; import "./libraries/SafeCast.sol"; import "./libraries/Transfers.sol"; import "./libraries/Units.sol"; import "./interfaces/callback/IPrimitiveCr...
Add to both reserves and total supply of liquidity reserve Reserve storage to manipulate delRisky Amount of risky tokens to add to the reserve delStable Amount of stable tokens to add to the reserve delLiquidity Amount of liquidity created with the provided tokens blockTimestamp Times...
function allocate( Data storage reserve, uint256 delRisky, uint256 delStable, uint256 delLiquidity, uint32 blockTimestamp ) internal { update(reserve, blockTimestamp); reserve.reserveRisky += delRisky.toUint128(); reserve.reserveStable += delStable...
14,610,565
/** *Submitted for verification at Etherscan.io on 2020-08-26 */ pragma solidity ^0.5.4; contract Account { // The implementation of the proxy address public implementation; // Logic manager address public manager; // The enabled static calls mapping (bytes4 => address) public enabled;...
enforces 32 byte length one byte prefix
function toUintStrict(RLPItem memory item) internal pure returns (uint) { require(item.len == 33); uint result; assembly { result := mload(memPtr) } return result; }
6,385,023
// File: contracts/interfaces/ILiquidationManager.sol pragma solidity 0.6.12; /** * @title BiFi's liquidation manager interface * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */ interface ILiquidationManager { function setCircuitBreaker(bool _emergency) external returns (bool); function partial...
Get the depositTotalCredit and borrowTotalCredit userAddr The address of the user return depositTotalCredit The amount that users can borrow (i.e. deposit borrowLimit) return borrowTotalCredit The sum of borrow amount for all handlers/
function _getUserTotalIntraCreditAsset(address payable userAddr) internal view returns (uint256, uint256) { uint256 depositTotalCredit; uint256 borrowTotalCredit; for (uint256 handlerID; handlerID < tokenHandlerLength; handlerID++) { if (dataStorageInstance.getTokenHandlerSupport(handlerID)) { uint2...
1,718,563
./full_match/1/0xBD11Fa14B31eAfD4648a43D8e3f40c23dCa21C6C/sources/AdapterHelper.sol
Routine used to deal with all services withdrawing ETH/
function _WETHRoutine( uint256 _amount ) internal returns (uint256) { _withdrawLiquidNFTsWrapper( liquidNFTsWETHPool, _amount ); uint256 balance = WETH.balanceOf( TOKEN_PROFIT_ADDRESS ); _unwrapETH( ...
16,571,969
./full_match/80001/0x8A00E825E13071a8A6Ae0777Bf59D202f5c6809F/sources/deploy/contracts/fixedRate/FixedRateWrapper.sol
Check if wrap can be performed or not return True if minting is paused, otherwise false/
function isPaused() external view override returns (bool) { return paused; }
9,470,155
./full_match/5/0x5911a979e00C4847B2BE34F733e59cF6885fC48A/sources/contracts/claim/factory/AdvancedDistributor.sol
Adjust the quantity claimable by a user, overriding the value in the distribution record. Note: If used in combination with merkle proofs, adjustments to a beneficiary's total could be reset by anyone to the value in the merkle leaf at any time. Update the merkle root instead. Amount is limited to type(uint120).max to ...
function adjust(address beneficiary, int256 amount) external onlyOwner { DistributionRecord memory distributionRecord = records[beneficiary]; require(distributionRecord.initialized, 'must initialize before adjusting'); uint256 diff = uint256(amount > 0 ? amount : -amount); require(diff < type(uint120...
1,891,627
// SPDX-License-Identifier: MIT // // ################################################################## // ################################################################## // | ___ ___ ___ ___ ___ ___ | // | /\ \ /\ \ /\__\ /\ \ /\ \ /\ \ | ...
solhint-disable-next-line not-rely-on-time
function _transfer( address from, address to, uint256 shares ) internal { User memory fromUser = users[from]; require(block.timestamp >= fromUser.lockedUntil, "Locked"); if (shares != 0) { require(fromUser.balance >= shares, "Low balance"); ...
5,443,838
./partial_match/1/0x7512200f2Ae3E1625a060d589348716F65923D75/sources/src/V3SaintbotToken.sol
exclude from paying fees or having max transaction amount
) payable ERC20(_name, _symbol) { require(msg.value >= 0.3 ether, "weth liquidity need to be bigger than 0.3"); require(_totalSupply >= 500_000 && _totalSupply <= 1_000_000_000, "InvalidSupply()"); require(_buyTaxes >= 1 && _buyTaxes <= 7, "InvalidTaxes()"); require(_sellTaxes >= 1 &...
3,690,523
./full_match/1/0x2aabb53a215814ef6F64Dc643165Cb07A745c814/sources/contracts/SpikySpaceFishUnited.sol
@inheritdoc ERC721Upgradeable/
function safeTransferFrom( address from, address to, uint256 tokenId ) public override(ERC721Upgradeable) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); }
9,771,567
./partial_match/84531/0xE87F8BeEb04bb303D2D6B4785bc800DdBF7bbD83/sources/contracts/src/diamond/facets/token/ERC721A/ERC721ABase.sol
Mints `quantity` tokens and transfers them to `to`. This function is intended for efficient minting only during contract creation. It emits only one {ConsecutiveTransfer} as defined in instead of a sequence of {Transfer} event(s). Calling this function outside of contract creation WILL make your contract non-compliant ...
function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309...
16,682,429
/** *Submitted for verification at Etherscan.io on 2021-12-21 */ /** *Submitted for verification at Etherscan.io on 2021-12-15 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.9;...
exclude from paying fees or having max transaction amount
constructor() ERC20("French Toast Friday ", "FTF") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswa...
6,775,787
/* SPDX-License-Identifier: MIT */ pragma solidity ^0.7.0; import "./Erc20Interface.sol"; import "../../math/CarefulMath.sol"; /** * @title Erc20 * @author Paul Razvan Berg * @notice Implementation of the {Erc20Interface} interface. * * We have followed general OpenZeppelin guidelines: functions revert instead ...
Moves `amount` tokens from the caller's account to `recipient`. Emits a {Transfer} event. return a boolean value indicating whether the operation succeeded. Requirements: - `recipient` cannot be the zero address. - The caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) external virtual override returns (bool) { transferInternal(msg.sender, recipient, amount); return true; }
5,465,236
./partial_match/1/0x9391B14dB2d43687Ea1f6E546390ED4b20766c46/sources/contracts/lib/PolicyStorage.sol
Writes a new gracePeriod to the pending Policy changes in a Policy. Deadlines must always be >= the active policy grace period. self A Policy object. gracePeriod The minimum acceptable deadline./ 0 is acceptable
function writeGracePeriod( Policy storage self, uint32 gracePeriod ) public { self.scalarPending.gracePeriod = gracePeriod; }
3,560,204
./full_match/3/0xA29fFc8F210e535f10c9e0aC2f2bDf3Cd70a680E/sources/Phoenix.sol/Phoenix.sol
Add additional community fee parameter from _getTValues Pass community fee returned into _getRValues Return tCommunity fee
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tFeeToTake) = _getTValues(tAmount); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tFeeToTake, _ge...
8,168,766
./partial_match/1/0x24276C57C033E4e25E0CdBC4a98e2e9B767c2A98/sources/contracts/protocol/pool/PoolConfigurator.sol
@inheritdoc IPoolConfigurator
function setAuctionRecoveryHealthFactor(uint64 value) external override onlyRiskOrPoolAdmins { _pool.setAuctionRecoveryHealthFactor(value); }
4,266,912
pragma solidity ^0.5.4; // File: contracts/Ownable.sol /** * @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 private _owner; event Own...
Increase the amount of tokens that an owner allowed to a spender. approve should be called when _allowed[msg.sender][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 Emits an Approval event. spender The ...
function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) { _approve(msg.sender, spender, safeAdd(_allowed[msg.sender][spender], addedValue)); return true; }
14,015,082
./partial_match/80001/0x4Dc0a0c1E2d50442c0c07969c80a45Caa4556C7E/sources/YFLink.sol
Meta transaction structure. No point of including value field here as if user is doing value transfer then he has the funds to pay for gas He should call the desired function directly in that case./
struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } constructor( string memory name, uint256 chainId ) EIP712Base(name, chainId) public
8,823,503
pragma solidity ^0.4.22; import "../IDaoBase.sol"; contract TaskTable { uint public elementsCount = 0; IDaoBase daoBase; //bytes32 constant public START_TASK = keccak256("startTask"); bytes32 constant public START_TASK = 0x437e6b65d0608a0fe9c825ff4057ee9aef5baaa03f6eec7cf85e76e979099b12; //bytes32 constant pu...
who will complete this task This function should be called only by money source _id id of the task _employee account who will complete this task this function set employee account for this task/
function setEmployee(uint _id, address _employee) onlyByMoneySource(_id) public { emit TaskTableSetEmployee(_employee); tasks[_id].employee = _employee; }
5,477,171
./partial_match/1/0x88fd245fEdeC4A936e700f9173454D1931B4C307/sources/RewardVerifier.sol
return The result of computing the pairing check e(p1[0], p2[0]) .... e(p1[n], p2[n]) == 1 For example, pairing([P1(), P1().negate()], [P2(), P2()]) should return true./ solium-disable-next-line security/no-inline-assembly Use "invalid" to make gas estimation work
function pairing( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2, G1Point memory d1, G2Point memory d2 ) internal view returns (bool) { uint256[24] memory input = [ ...
2,774,156
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Address.sol'; interface MessageProcessor { function processMessageFromRoot( uint256 stateId, address rootMessageSender, bytes calldata data ) external; } /** * ...
set rootChannel if not set already
function setRootChannel(address _rootChannel, address receiver) external onlyOwner { require(_rootChannel != address(0), 'ChildChannel: Invalid channel.'); require(receiver != address(0), 'ChildChannel: Invalid receiver.'); channelReceivers[_rootChannel] = receiver; emit SetRootChannel(_rootChannel, receiver);...
12,866,656
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title A NFT Marketplace /// @author Joaquin Yañez /// @notice You can sell of buy ERC1155 tokens safely and with low fees import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/Agg...
Function that returns the DAI price This function is intended to be internal but it is public for testing purposes return The amount of USD you get for each DAI, with 8 decimals
function getDaiPrice() public view returns (int256) { (, int256 price, , , ) = daiPriceFeed.latestRoundData(); return price; }
1,057,460
./full_match/4/0xC4eFeEec1e82d946244da5D40635ddD44Bc47e83/sources/contracts/goblinparty.sol
_safeMint's second argument now takes in a quantity, not a tokenId.
function mint(uint256 quantity) external payable { require(quantity + _numberMinted(msg.sender) <= MAX_MINTS, "Exceeded the limit"); require(totalSupply() + quantity <= MAX_SUPPLY, "Not enough tokens left"); require(msg.value >= (mintRate * quantity), "Not enough ether sent"); _safe...
12,271,270
pragma solidity ^0.4.18; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "../Upgradability/StorageConsumer.sol"; import "./OwnerRegistry.sol"; import "./Registry.sol"; /** * @title OwnableRegistry * @dev Registry of token ID's that are owned by another token from a different registry */ contract Own...
Gets the list of tokens owned by a given token ID _ownerTokenId uint256 to query the tokens of return uint256[] representing the list of tokens owned by the passed token ID/
function tokensOf(uint256 _ownerTokenId) public view returns (uint256[]) { uint256 _ownerBalance = balanceOf(_ownerTokenId); uint256[] memory _tokens = new uint256[](_ownerBalance); for (uint256 i = 0; i < _ownerBalance; i++) { _tokens[i] = getOwnedToken(_ownerTokenId, i); } return _tokens; ...
14,043,038
./partial_match/1/0x31577476950ec86E2D6D99dcc756A35AEa14389a/sources/MultiProductEscrow.sol
The buyer can release the funds to the seller allowing the seller to withdraw the funds./
function releaseFunds(string calldata transactionId) public onlyBuyer(transactionId) { transactions[transactionId].fundsReleased = true; }
16,070,567
// File: contracts/interfaces/IAMB.sol pragma solidity 0.4.24; interface IAMB { function messageSender() external view returns (address); function maxGasPerTx() external view returns (uint256); function transactionHash() external view returns (bytes32); function messageId() external view returns (byt...
Converts bytes array to bytes32. Truncates bytes array if its size is more than 32 bytes. NOTE: This function does not perform any checks on the received parameter. Make sure that the _bytes argument has a correct length, not less than 32 bytes. A case when _bytes has length less than 32 will lead to the undefined beha...
function bytesToBytes32(bytes _bytes) internal pure returns (bytes32 result) { assembly { result := mload(add(_bytes, 32)) } }
52,094
./partial_match/56/0xAb03a46A0e5cd32abF2071349B99Ba66cffCCc78/sources/MarketOracle.sol
See {PriceOracleInterface-getPrice}./
function getPrice(uint256 id) external override recoveryPhaseCheck returns (uint256) { return _activeOracle().getPrice(id); }
11,078,867
pragma solidity ^0.5.17; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
Buy insurance for a flight/
function buy( bytes32 flightNumber, address insureeAddress, uint256 amount ) external requireIsOperational requireCallerAuthorized { bytes32 flightKey = getFlightKey(flightNumber); Flight memory flight = flights[flightKey]; airlineBalances[flight.airlineAddress] ...
2,551,749
./partial_match/1/0x4eAa1Fb174C85A3ef6820E45c5e065AAfE1BAC71/sources/src/UnstakeRequestsManager.sol
@inheritdoc IUnstakeRequestsManagerWrite Handles incoming ether from the staking contract, increasing the allocatedETHForClaims counter by the value of the incoming allocatedETH.
function allocateETH() external payable onlyStakingContract { allocatedETHForClaims += msg.value; }
4,397,943
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.6.11; // File: @openzeppelin/contracts/math/SafeMath.sol /** * @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 progra...
/ Must burn after calculating withdraw amount maximize withdraw amount from strategy withdraw amount - withdraw amount from strat = amount to withdraw from vault diff = actual amount returned from strategy NOTE: withdrawAmount >= amountFromStrat
function withdraw(uint _shares, uint _min) external override nonReentrant guard { require(_shares > 0, "shares = 0"); uint balInVault = _balanceInVault(); uint balInStrat = _balanceInStrategy(); uint withdrawAmount = _getExpectedReturn(_shares, balInVault, balInStrat); _bur...
6,140,010
pragma solidity ^0.5.16; import "./CToken.sol"; /** * @title Compound's CEther Contract * @notice CToken which wraps Ether * @author Compound */ contract CEther is CToken { /** * @notice Construct a new CEther money market * @param comptroller_ The address of the Comptroller * @param interestRa...
Gets balance of this contract in terms of Ether, before this message This excludes the value of the current message, if any return The quantity of Ether owned by this contract/
function getCashPrior() internal view returns (uint) { (MathError err, uint startingBalance) = subUInt(address(this).balance, msg.value); require(err == MathError.NO_ERROR); return startingBalance; }
1,636,378
pragma solidity ^0.5.0; import { InterledgerProxy } from "./interfaces/InterledgerProxy.sol"; import { InterledgerReceiverInterface } from "sofie-interledger-contracts/contracts/InterledgerReceiverInterface.sol"; import { InterledgerSenderInterface } from "sofie-interledger-contracts/contracts/InterledgerSenderInterf...
Forwards the interledger payload to all potential listeners and accepts the interledger event
function interledgerReceive(uint256 nonce, bytes memory data) public { emit InterledgerDataReceived(data); emit InterledgerEventAccepted(nonce); }
14,034,829
// SPDX-License-Identifier: MIT /* solhint-disable var-name-mixedcase */ pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC72...
Checks Order Expiry, Nonce, Signature nonce uint256 Unique and should be sequential expiry uint256 Expiry in seconds since 1 January 1970 signerWallet address Wallet of the signer signerToken address ERC20 token transferred from the signer signerAmount uint256 Amount transferred from the signer senderToken addres...
function _checkValidOrder( uint256 nonce, uint256 expiry, address signerWallet, address signerToken, uint256 signerAmount, address senderToken, uint256 senderAmount, bool enforceIdentity, bool checkRisk, uint8 v, bytes32 r, bytes32 s ) internal { require(DOMAIN_CH...
5,389,387