file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// Sources flattened with hardhat v2.6.5 https://hardhat.org // File contracts/EIP20Interface.sol pragma solidity 0.5.17; /** * @title ERC 20 Token Standard Interface * https://eips.ethereum.org/EIPS/eip-20 */ interface EIP20Interface { function name() external view returns (string memory); function sym...
Set the early redeem penalty. newEarlyRedeemPenaltyMantissa New early redeem penalty/
function setEarlyRedeemPenalty(uint256 newEarlyRedeemPenaltyMantissa) external adminOnly { earlyRedeemPenaltyMantissa = newEarlyRedeemPenaltyMantissa; }
2,487,516
pragma solidity ^0.5.13; import './interfaces/SyscoinClaimManagerI.sol'; import './interfaces/SyscoinSuperblocksI.sol'; import './SyscoinErrorCodes.sol'; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "./SyscoinParser/SyscoinMessageLibrary.sol"; // @dev - Manages a battle session between superblo...
- looks for {0xfa, 0xbe, 'm', 'm'} byte sequence returns the following 32 bytes if it appears once and only once, 0 otherwise also returns the position where the bytes first appear
function findCoinbaseMerkleRoot(bytes memory rawBytes) private pure returns (uint, uint, uint) { uint position; uint found = 0; uint target = 0xfabe6d6d00000000000000000000000000000000000000000000000000000000; uint mask = 0xffffffff000000000000000000000000...
14,105,758
./partial_match/3/0xa6D94C6C57bE9D525fBA4d1006D1Ff4d0B28B699/sources/CVPTokenTest.sol
Error messages for require statements/
function lock(bytes32 _reason, uint256 _amount, uint256 _time, address _of) public returns (bool); function tokensLocked(address _of, bytes32 _reason) public view returns (uint256 amount); function tokensLockedAtTime(address _of, bytes32 _reason, uint256 _time) public view retur...
5,232,958
pragma solidity ^0.4.18; // File: contracts-origin/AetherAccessControl.sol /// @title A facet of AetherCore that manages special access privileges. /// @dev See the AetherCore contract documentation to understand how the various contract facets are arranged. contract AetherAccessControl { // This facet controls a...
Updates the minimum payment required for calling createUnit(). Can only be called by the COO address.
function setUnitCreationFee(uint256 _value) public onlyCOO { unitCreationFee = _value; }
1,090,919
/** * Copyright 2017-2020, bZeroX, LLC <https://bzx.network/>. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "SafeMath.sol"; import "GovernorBravoDelegate.sol"; import "IStaking.sol"; import "StakingVoteDelegatorState.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) pausable external { if(delegatee == msg.sender){ delegatee = ZERO_ADDRESS; } bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, ...
1,496,436
./partial_match/1/0x9781C4E9B9cc6Ac18405891DF20Ad3566FB6B301/sources/SavingsManager.sol
Freezes streaming of mAssets/
function freezeStreams() external onlyGovernor whenStreamsNotFrozen { streamsFrozen = true; emit StreamsFrozen(); }
16,112,380
./full_match/1/0x11D1463D2D93CB26cAF34C40Cb21539e61Ef47Fa/sources/contracts/vaults/DolletVault.sol
Function to send funds into the strategy and put them to work. It's primarily called by the vault's deposit() function. _token The token used in the deposit/
function earn(IERC20Upgradeable _token, uint256 _minWant) internal { uint256 _tokenBal = _token.balanceOf(address(this)); _token.safeTransfer(address(strategy), _tokenBal); strategy.deposit(address(_token), msg.sender, _minWant); }
16,429,873
pragma solidity 0.5.7; /* required for transpiler */ #define TRANSPILE /* data constants */ #define WORD_0 0 /* 32*0 = 0 */ #define WORD_1 32 /* 32*1 = 32 */ #define WORD_2 64 /* 32*2 = 64 */ #define WORD_3 96 /* 32*3 = 96 */ #define WORD_4 128 /* 32*4 = 128 */ #define WORD_5 160 /* 32*5 = 160 */ #define WO...
[ name_offset, owner, withdraw_address, recovery_address, recovery_address_proposed, name_len, name_data(12) ] /
function get_exchange(uint32 exchange_id) public view returns ( string memory name, bool locked, address owner, address withdraw_address, address recovery_address, address recovery_address_proposed ) { uint256[8] memory return_value_mem; assembly { let exchange_count := sload(exchange_count...
14,122,818
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; /** @author Open Zeppelin / Tellor @title ERC20 @dev Taken from OZ, but no context **/ contract ERC20 is IERC20 { mapping(address => uint256) private _balances; mapping(address => mappin...
Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account] - amount; _totalSupply = _totalSupply - amount; emit Transfer(account, address(0), amount); }
12,984,346
// SPDX-License-Identifier: Unlicense pragma solidity 0.7.6; // Part: IStrategy interface IStrategy { function rebalance() external; function shouldRebalance() external view returns (bool); } // Part: IVault interface IVault { function deposit( uint256, uint256, uint256, ...
check called by keeper check enough time has passed
function shouldRebalance() public view override returns (bool) { if (msg.sender != keeper) { return false; } if (block.timestamp < lastTimestamp.add(period)) { return false; } int24 tickMove = tick > lastTick ? tick - lastTick : lastTick - tick; ...
352,578
//Address: 0x5c743a35E903F6c584514ec617ACEe0611Cf44f3 //Contract name: ExyToken //Balance: 0 Ether //Verification Date: 2/24/2018 //Transacion Count: 12523 // CODE STARTS HERE pragma solidity ^0.4.19; contract ERC223ReceivingContract { function tokenFallback(address _from, uint256 _value, bytes _data) public; } ...
Second signatory consent for contract pause state change, triggers the change./
function approvePauseChange(bool status) onlySignatory whenPaused(!status) public { pauseProposer = 0x0; paused = status; LogPause(paused); }
15,833,596
./full_match/97/0x670B9706b9f798e65Ed1608945055E5ca3966A47/sources/contracts/Rebuy.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, block.timestamp ); uniswapV2Router.addLiquidityETH{value: ethAmount}( ...
3,267,978
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; // ---------------------- Built with 💘 for everyone -------------------------- /// @author Kinois Le Roi /// @title SmACV1 [Smart Ads Contract V1] - This contract enables addresses to deploy smart ads. /// Token : Paid Per Click - The winning crypto of the int...
Claim rewards. Before anyone can claim a reward, we must perform some checks: 1. The promoter and the founded cannot claim rewards. 2. A claimer can claim only once. 3. A claimer must have a minimum amount of tokens. 4. The coffer must have enough funds for the claim. 5. The Ad have to be running, not expired. Claimer ...
function claim() public notOwners { uint256 claimerBalance = PPeC(PPeCAddress).balanceOf(msg.sender); bool claimedStatus = claimed[address(this)][msg.sender]; if (claimedStatus == true) revert Claimed(); if (minClaimerBalance > claimerBalance) revert NotEn...
12,804,922
./full_match/5/0xA5EA05358F4D65548cb04aeCC2C4a2381F573E9B/sources/contracts/MinerIssuance.sol
Issue exactly `exactMinerOut` Miner for no more than `maxAmountIn` of the selected token. @ dev Emits a SwappedTokenToMiner event if successful. path address[] The optimal path to take when swapping a token for ETH. Must be a valid ERC20-compatible token and the final token must be WETH. maxAmountIn uint256 The maxim...
function issueExactMinerForTokens( address[] calldata path, uint256 maxAmountIn, uint256 exactMinerOut, uint256 deadline ) external returns (uint256) { IUniswapV2Router02 router = IUniswapV2Router02(uniswapRouter); uint256 requiredETHIn = _calculateMinerToETH(exa...
7,034,076
pragma solidity >=0.4.21 <0.6.0; contract ArtWarehouse { // define a Pictureobject. Each picture will be stored as this on the blockchain struct Picture { int id; string link; int worth; address owner; } // define an associated array for listing all pictures in depende...
function for adding a picture to the blockchain. Will be called from the app.js boolean used to determine if a picture has already been uploaded iterate through all stored pictures compare the names of a picture if picture is already existing set boolean to true
function addPicture (string memory link) public { bool used = false; for (int i = 0; i <= picturesCount; i++) { if(compareLinks(link, pictureList[i].link) == true){ used = true; } } }
12,708,953
./full_match/5/0x507092d20022999DC3179EF6E959B7A5da784f09/sources/project_/contracts/ProxyFactory.sol
This deploys an extremely minimalist proxy contract with the mainAddress embedded within. Note: The bytecode is explained in comments below this contract. return dst The new contract address./ copy init code into memory and immutable ExchangeDeposit address onto stack Get the position of the start of init code grab the...
function deployNewInstance(bytes32 salt) external returns (address dst) { bytes memory initCodeMem = INIT_CODE; address payable addrStack = mainAddress; assembly { let pos := add(initCodeMem, 0x20) let first32 := mload(pos) let addrBytesShifted := shl(8, a...
1,876,296
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uin...
sBTC pool bUSD pool stETH pool sBTC pool bUSD pool stETH pool
interface ICurveFi { function get_virtual_price() external view returns (uint256); function add_liquidity( uint256[3] calldata amounts, uint256 min_mint_amount ) external; function add_liquidity( uint256[4] calldata amounts, uint256 min_mint_amount ) external; ...
575,082
pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint...
@abstract This address has the ability to distribute the rewards
{ function notifyRewardAmount(uint256 reward) external; function getRewardToken() external view returns (IERC20); address public rewardsDistributor; function _initialize(address _rewardsDistributor) internal { rewardsDistributor = _rewardsDistributor; } modifier onlyRewardsDistributo...
5,881,809
pragma solidity ^0.4.24; contract ERC20Interface { function name() public view returns(bytes32); function symbol() public view returns(bytes32); function balanceOf (address _owner) public view returns(uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); ...
Internal transfer, only can be called by this contract/ Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future Subtract from the sender Add the same to the recipient Asserts are used to use static analysis to find bugs in your code...
function _transfer(address _from, address _to, uint _value) internal returns (bool) { require(_to != 0x0); require(balances[_from] >= _value); require(balances[_to] + _value > balances[_to]); uint previousBalances = balances[_from] + balances[_to]; balances[_from] -= _value; ...
6,451,604
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../maker/Manager.sol"; import "./ISubscriptions.sol"; import "../saver_proxy/MCDSaverProxy.sol"; import "../../constants/ConstantAddresses.sol"; import "../maker/Vat.sol"; import "../maker/Spotter.sol"; /// @title Handles subscriptions for automatic mo...
Returns an address that owns the CDP _cdpId Id of the CDP
function getOwner(uint _cdpId) public override view returns(address) { return manager.owns(_cdpId); }
12,718,196
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/LiveMintTokyo.sol
Deauthorizes A Contract From Minting/
function ___DeauthorizeContract(address NewAddress) external onlyOwner { Role[NewAddress] = 0x0; emit DeauthorizedContract(NewAddress); }
8,470,954
pragma solidity ^0.5.0; import "./interface/RegistryInterface.sol"; import "./registry/RegistryContract.sol"; import "./UserFactory.sol"; import "./SigningLogicInitializable.sol"; /** @title Contract for Audius user replica set management */ contract UserReplicaSetManager is SigningLogicInitializable, RegistryContr...
Get userReplicaSetBootstrapAddress
function getUserReplicaSetBootstrapAddress() external view returns (address) { return userReplicaSetBootstrapAddress; }
7,304,023
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@ope...
Refund token and return the mint price to the token owner. _tokenId The id of the token to refund./ Transfer token to CATC wallet Refund the token owner 100% of the mint price.
function refund(uint256 _tokenId) external nonReentrant { require(refundGuaranteeActive(), "REFUND_GUARANTEE_EXPIRED"); require(ownerOf(_tokenId) == msg.sender, "MUST_OWN_TOKEN"); _transfer(msg.sender, refundAddress, _tokenId); payable(msg.sender).transfer(price); }
6,874,058
./full_match/1/0x60Fa954e22c42F52E8C815a9476f339BD38AEEf7/sources/contracts/core/defi/three-x/ThreeXBatchProcessing.sol
This function allows the owner to change the composition of underlying token of the 3X _components An array of addresses for the yToken needed to mint 3X _componentDependencies An array structs describing underlying yToken, curveMetapool (which is also the lpToken), swapPool and AngleRouter/
function setComponents(address[] memory _components, ComponentDependencies[] calldata _componentDependencies) external onlyRole(DAO_ROLE) { _setComponents(_components, _componentDependencies); }
4,889,303
pragma solidity ^0.4.23; library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if '...
Gets the token ID at a given index of the tokens list of the requested owner _owner address owning the tokens list to be accessed _index uint256 representing the index to be accessed of the requested tokens list return uint256 token ID at the given index of the tokens list owned by the requested address/
function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) { require (_index < balanceOf(_owner)); return ownedTokens[_owner][_index]; }
12,829,684
pragma solidity 0.4.24; import { SafeMath } from "openzeppelin-solidity/contracts/math/SafeMath.sol"; import { UnlimitedAllowanceToken } from "./UnlimitedAllowanceToken.sol"; /** * @title VeilEther * @author Veil * * WETH-like token with the ability to deposit ETH and approve in a single transaction */ contract...
Buys tokens with Ether, exchanging them 1:1 and sets the spender allowance _spender Spender address for the allowance _allowance Allowance amount/
function depositAndApprove(address _spender, uint256 _allowance) public payable returns (bool) { deposit(); approve(_spender, _allowance); return true; }
1,034,583
./full_match/4/0x1a2de9D65efD81Ba67467E0124972C1959d97A94/sources/contracts/Magi.sol
Claim Magi Gold for a given Adventure Cards ID tokenId The tokenId of the Adventure Cards NFT Follow the Checks-Effects-Interactions pattern to prevent reentrancy attacks Checks Check that the msgSender owns the token that is being claimed Further Checks, Effects, and Interactions are contained within the _claim() fun...
function claimById(uint256 tokenId) external { require( _msgSender() == adventureCardsContract.ownerOf(tokenId), "MUST_OWN_TOKEN_ID" ); _claim(tokenId, _msgSender()); }
12,326,300
./full_match/42/0x1cd45CcADda892956aa5d7C61167acdb4dAe8262/sources/browser/JCompound.sol
get Tranche A exchange rate _trancheNum tranche number return tranche A token current price/
function getTrancheAExchangeRate(uint256 _trancheNum) public view returns (uint256) { return trancheParameters[_trancheNum].currentTrancheAPrice; }
16,227,491
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "../../interfaces/ICampaignReward.sol"; library CampaignRewardLib { /** * @dev Assigns a reward to the user * @param _campaignReward Campaign reward interface */ function _assignReward( ICampaignRewa...
Transfers rewards from the old owner to a new owner _campaignReward Campaign reward interface _oldAddress Address of previous owner of rewards _newAddress Address of new owner rewards are being transferred to/
function _transferRewards( ICampaignReward _campaignReward, address _oldAddress, address _newAddress ) internal { _campaignReward.transferRewards(_oldAddress, _newAddress); }
1,823,357
./partial_match/1/0xB0F720Baa5BD1715897d4790A59f5c7aa1377D79/sources/MateriaLiquidityAdder.sol
value now is for the possible dust
function addLiquidityItem( uint256 itemId, uint256 value, address from, bytes memory payload ) private returns (uint256 itemAmount, uint256 bridgeAmount) { address erc20Wrapper = address(IMateriaOrchestrator(address(this)).erc20Wrapper()); address bridgeToken = ad...
3,922,590
pragma solidity ^0.5.0; //Importing openzeppelin-solidity ERC-721 implemented Standard import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol"; import "@openzeppelin/contracts/drafts/Counters.sol"; // StarNotary Contract declaration inheritance the ERC721 openzeppelin implementation contract StarNotary is ERC721...
Implement Task 1 lookUptokenIdToStarInfo1. You should return the Star saved in tokenIdToStarInfo mapping
function lookUptokenIdToStarInfo(uint _tokenId) public view returns (string memory) { require(_exists(_tokenId), "The Star does not exist"); return tokenIdToStarInfo[_tokenId].name; }
6,455,807
./full_match/80001/0xd99115AF3c77B846B95C8d421B3779351912A381/sources/project_/contracts/Platform/XG_Game_ERC721A.sol
Bulk mint tokens for `gameTokenIds_` Mint `amount_` tokens to_ (address) Mint address gameTokenIds_ (uint256[] calldata) GameToken IDs feeNumerators_ (uint96[] calldata) Fee numerators
function bulkMintToken( address to_, uint256[] calldata gameTokenIds_, uint96[] calldata feeNumerators_ ) external onlyOwner { if (gameTokenIds_.length != feeNumerators_.length) { revert InvalidArrayLength(); } unchecked { uint256 currentI...
5,575,365
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function tran...
Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; }
111,676
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Registers allowed callers of ComptrollerProxy.buySharesOnBehalf() _callers The allowed callers Validate that each registered caller only forwards requests to buy shares that originate from the same _buyer passed into buySharesOnBehalf(). This is critical to the integrity of VaultProxy.freelyTransferableShares.
function registerBuySharesOnBehalfCallers(address[] calldata _callers) external onlyOwner { for (uint256 i; i < _callers.length; i++) { require( !isAllowedBuySharesOnBehalfCaller(_callers[i]), "registerBuySharesOnBehalfCallers: Caller already registered" ...
355,355
pragma solidity ^0.5.0; library Pairing { uint256 constant PRIME_Q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; struct G1Point { uint256 X; uint256 Y; } // Encoding of field elements is: X[0] * z + X[1] struct G2Point { uint256[2] X; ...
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) { G1Point[4] memory p1 = [a1, b1, c1, d...
12,633,128
./full_match/1/0x2e3e05ac7537aa55EAb9625631360D55ae8edCb2/sources/contracts/ClickBotGame.sol
Private function to swap tokens for ETH./ Generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(token); path[1] = uniswap.WETH(); token.approve(address(uniswap), tokenAmount); uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( token...
4,922,499
pragma solidity ^0.4.23; import "../math/SafeMath.sol"; import "../tokens/ERC20.sol"; import "../tokens/ERC721.sol"; import "./TokenTransferProxy.sol"; import "./NFTokenTransferProxy.sol"; import "../tokens/ERC165implementation.sol"; /* * @dev based on: https://github.com/0xProject/contracts/blob/master/contracts/E...
Get address of none-fundgible token transfer proxy used in exchange./
function getNFTokenTransferProxyAddress() external view returns (address) { return NFTOKEN_TRANSFER_PROXY_CONTRACT; }
6,479,377
pragma solidity 0.4.24; /** * Safe unsigned safe math. * * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli * * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol * * Maintained here until merged to mainline zeppe...
Dynamically create tokens and assign them to the investor./
function assignTokens(address receiver, uint tokenAmount) private { MintableTokenExt mintableToken = MintableTokenExt(token); mintableToken.mint(receiver, tokenAmount); }
10,039,000
./full_match/5/0x3Fa112591F89E6af32A9A35D1D178Eaa89cf9947/sources/contracts/RoboNounsVRGDA.sol
Set the auction target price. Only callable by the owner.
function setTargetPrice(int256 _targetPrice) external onlyOwner { targetPrice = _targetPrice; emit AuctionTargetPriceUpdated(_targetPrice); }
1,868,888
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; // Sample contracts showing upgradeability with multiple inheritance. // Child contract inherits from Father and Mother contracts, and Father extends from Gramps. // // Human // / \ // | ...
solhint-disable-next-line func-name-mixedcase
function __SampleHuman_init_unchained() internal onlyInitializing { isHuman = true; }
14,039,158
./full_match/44787/0xb4C5D876231C1Da7dc8B606b87C80a81A322b3D7/sources/project_/contracts/UnergyLogicFunding.sol
Pausable method
function pauseContract() public whenNotPaused onlyOwner { _pause(); }
13,257,162
./full_match/5/0x35a9ba1d7203DFfc83A03f98888233ba78c0493E/sources/contracts/Common.sol
function to transfer wager to game contract, without charging for VRF tokenAddress tokenAddress the wager is made on wager wager amount/
function _transferWagerPvPNoVRF( address tokenAddress, uint256 wager ) internal { if (!Bankroll.getIsValidWager(address(this), tokenAddress)) { revert NotApprovedBankroll(); } if (tokenAddress == address(0)) { if (!(msg.value == wager)) { ...
1,875,942
pragma solidity 0.8.4; contract Foo { // Simple map mapping(uint => uint) a; /// #if_succeeds forall(uint k in a) a[k] > 1; function setA(uint key, uint val) public { a[key] = val; } /// #if_succeeds forall(uint k in a) a[k] > 1; function decA(uint key) public { a[key]...
if_succeeds forall (uint i in f) f[i][0] > 0;
function setF(uint i, uint j, uint v) public { f[i][j] = v; }
14,064,136
/* * CHEEMS INU Supply: 1 000 000 000 000 Max Wallet: 10 000 000 000 at launch then 20 000 000 000 Max TX: 2 500 000 000 at launch then 10 000 000 000 Tax: 8% Buy 10% Sell SPLIT: 20% LP 50% BUYBACKS 30% DEVELOPMENT/MARKETING DO NOT BUY UNTIL CONTRACT ADDRESS IS POSTED IN TELEGRAM https://t.me/cheemstokenbsc...
adds Token to balancesthe amount of token after transfersets newBalance
function _addToken(address addr, uint256 amount) private { uint256 newAmount=_balances[addr]+amount; _balances[addr]=newAmount; }
138,037
./full_match/1/0x70588Eb4626600e6b9cD49b140E39e5a814D9535/sources/erc721bo/contracts/ERC721BO.sol
Same as `_safeReMint`, with an additional `data` parameter which is forwarded in IERC721Receiver.onERC721Received to contract recipients./
function _safeReMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _remint(to, tokenId); if (!_checkOnERC721Received(address(0), to, tokenId, _data)) revert TransferToNonERC721ReceiverImplementer(); }
3,053,407
./full_match/3/0xB28E516287E15Aa9694e5802Dde276bE53124437/sources/browser/New_EIP_Interface.sol
send `_value` token to `_to` from `_from` on the condition it is approved by `_from` _from The address of the sender _to The address of the recipient _value The amount of token to be transferred return success Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) virtual public returns (bool success) {}
14,241,526
./full_match/5/0xbd2b42146E75dDc07c29888DAec04Fb176889685/sources/contracts/ArtStation_v0.2.sol
Mint new NFT (no minimum sell price set yet). Can only be called by the contract owner. _to Recipient of the NFT. _tokenId Custom unique token ID of the NFT./
function safeMint(address _to, uint256 _tokenId) public onlyOwner { _safeMint(_to, _tokenId); }
1,940,037
/** *Submitted for verification at Etherscan.io on 2021-03-23 */ // Sources flattened with hardhat v2.1.1 https://hardhat.org // SPDX-License-Identifier: MIT pragma solidity 0.8.0; // File src/contracts/tokens/erc721.sol /** * @dev ERC-721 non-fungible token standard. * See https://github.com/ethereum/EIPs/blob/m...
A standard for detecting smart contract interfaces./
interface ERC165 { function supportsInterface(bytes4 _interfaceID) external view returns (bool); } }
7,944,232
./full_match/44787/0x792C37e5E135A4a643796d17e4C1D8De1cf59E0f/sources/contracts/mocks/MockTreasury.sol
/ convert amount to match TELO decimals
function valueOfToken(address _token, uint256 _amount) public view returns (uint256 value_) { if (isReserveToken[_token]) { value_ = _amount.mul(10**IERC20(TELO).decimals()).div( 10**IERC20(_token).decimals() ); value_ = IBondCalculator(bondCalculator[_token]).valuation( ...
13,287,200
./partial_match/1/0xB02b25158d0875de0A9084eC85768133f97A9828/sources/src/Cassette.sol
Calculate page number of a specified token ID _tokenId Token ID to return the page number of return uint256 A token's corresponding page number/
function page(uint256 _tokenId) public view returns (uint256) { if (_tokenId > MAX_PAGE * TOTAL_CHAINS) revert Cassette_ValueOutOfRange(); return _tokenId == 0 ? 0 : (_tokenId + TOTAL_CHAINS - 1) / TOTAL_CHAINS; }
9,352,327
//Address: 0xd3a97d46fd0c28a5a035a4e0813afe7c2c1376bd //Contract name: InterCrypto //Balance: 0 Ether //Verification Date: 8/15/2017 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.15; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of th...
_______________INTERNAL FUNCTIONS_______________ Request for a ShapeShift transaction to be made Example arguments: "ltc", "LbZcDdMeP96ko85H21TQii98YFF9RgZg3D" Litecoin "btc", "1L8oRijgmkfcZDYA21b73b6DewLtyYs87s" Bitcoin "dash", "Xoopows17idkTwNrMZuySXBwQDorsezQAx" Dash "zec", "t1N7tf1xRxz5cBK51JADijLDWS592FPJtya"...
function engine(string _coinSymbol, string _toAddress, address _returnAddress) internal returns(uint transactionID) { transactionID = transactionCount++; TransactionAborted(transactionID, "input parameters are too long or contain invalid symbols"); recoverable[msg.sender] +...
13,112,240
./partial_match/1/0x24276C57C033E4e25E0CdBC4a98e2e9B767c2A98/sources/contracts/protocol/libraries/logic/ConfiguratorLogic.sol
Updates the xToken implementation and initializes it Emits the `XTokenUpgraded` event cachedPool The Pool containing the reserve with the xToken input The parameters needed for the initialize call/
function executeUpdatePToken( IPool cachedPool, ConfiguratorInputTypes.UpdatePTokenInput calldata input ) public { DataTypes.ReserveData memory reserveData = cachedPool.getReserveData( input.asset ); (, , , uint256 decimals, ) = cachedPool .getCon...
4,266,870
pragma solidity ^0.6.3; import "./ERC20Interface.sol"; import "./BlackCaspianUpgradeable.sol"; contract ERC20Proxy is ERC20Interface, BlackCaspianUpgradeable { // MEMBERS /// @notice Returns the name of the token. string public name; /// @notice Returns the symbol of the token. string public ...
Returns how much `_spender` is currently allowed to spend from `_owner`'s balance. return remaining the remaining allowance./
function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return BlackCaspian.allowance(_owner, _spender); }
5,369,295
/** * This contract specifically stores all the user * data to avoid inconsistencies during Blockvitae * contract update. * * This files acts as the DB layer between the * model User.sol and the controller Blockvitae.sol */ pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; // experimental // im...
@description finds the UserWorkExp struct values for the given user address _user address of the address of the user who's data is to be searched return User.UserWorkExp UserWorkExp struct of the user with given address
function findUserWorkExp(address _user) view public isOwner(msg.sender) returns(User.UserWorkExp[]) { return db.getUserWorkExp(_user, msg.sender); }
12,780,495
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...
Transfer token to the recipient Note: If there is not enough token, we do not perform the transfer all. token The token to transfer recipient The address of the recipient to transfer token to amount The amount of token to (possibly) transfer/
function _grantToken(address token, address recipient, uint amount) external { delegateToFarming(abi.encodeWithSignature("_grantToken(address,address,uint256)", token, recipient, amount)); }
12,663,239
//Address: 0x96b26c1872566fd977e7a282a17bc0203a20a90e //Contract name: SimpleSale //Balance: 0 Ether //Verification Date: 9/21/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.16; /** * @title ERC20 interface * @dev cutdown simply to allow removal of tokens sent to contract */ contract ERC20 {...
set start and stop times/
function setPeriod(uint256 start, uint256 stop) onlyOwner { startTime = start; stopTime = stop; }
1,056,293
// SPDX-License-Identifier: MIT pragma solidity 0.7.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import './mocks/CryptionNetworkToken.sol'; import './lib/EventProof.sol'; import './lib/RLPReader.sol'; contract MasterChef is Ownable{ using Saf...
deposit LP token function for msg.sender _amount the total deposit amount/
function _depositInternal(address _user, uint256 _amount) internal { UserInfo storage user = userInfo[_user]; updatePool(); if (user.amount > 0) { uint256 pending = user.amount.mul(farmInfo.accRewardPerShare).div(1e12).sub(user.rewardDebt); _safeRewardTransfer(_user, ...
2,571,952
./partial_match/1/0x58DE79366Af408A429d023062768f9252166895C/sources/contracts/ERC20Reflections.sol
withdraw tokens from contract (only owner)
function withdrawTokens( address tokenAddress, address receiverAddress ) external onlyOwner returns (bool success) { IERC20 tokenContract = IERC20(tokenAddress); uint256 amount = tokenContract.balanceOf(address(this)); return tokenContract.transfer(receiverAddress, amount...
4,342,809
./partial_match/56/0x17566271FEBF4E7e0E72a7D1E3eF2E915d642cCe/sources/StrategyApeLP.sol
Function that has to be called as part of strat migration. It sends all the available funds back to the vault, ready to be migrated to the new strat./
function retireStrat() external { require(msg.sender == vault, "!vault"); IMasterChef(masterchef).emergencyWithdraw(poolId); uint256 pairBal = IERC20(lpPair).balanceOf(address(this)); IERC20(lpPair).transfer(vault, pairBal); }
11,058,818
./full_match/80001/0x5505d54BcC71CE94730B121240b1B68318D2839e/sources/contracts/token/UChildPowerful.sol
Function to stop minting new tokens. NOTE: restricting access to owner only. See {ERC20Mintable-finishMinting}./ onlyOwner
function _finishMinting() internal virtual override(PowerfulERC20Upgradeable, ERC20MintableUpgradeable) { super._finishMinting(); }
5,653,774
./full_match/97/0x5fa6d524b66f9462f5F2BC6115b0A732748A13D1/sources/project_/contracts/MoedaSocial.sol
Só pode ser chamada se não for zeroVerifica o intervalo de tempo exigidorequire(block.timestamp > nextMint[to], "You cannot mint twice in a row");retorna trueretorna o saldo remanescente permitidoallowance(_owner, from);_transfer(from, to, valor);Atenção: no solidity o timestamp é em segundosLibera a trava de mint para...
function transferMoeda(address from, address to, uint64 valor) public restricted { require(_mintAmount > 0, "Minting is not enabled"); approve(from, valor); transferFrom(from, to, valor); }
3,277,586
./partial_match/56/0x2b25a0FfFe14D42279658EF199aE443d236e09F9/sources/GamixToken.sol
save gas UPDATE: Let's not destroy the contract here Just transfer the balance to the admin
function endSale() public isOwner { require(transfer(owner, balanceOf[address(this)])); owner.transfer(address(this).balance); _ended = true; }
11,340,241
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.0 <0.7.0; pragma experimental ABIEncoderV2; import "@darwinia/contracts-utils/contracts/ECDSA.sol"; /** * @title Manages a set of guards and a threshold to double-check BEEFY commitment * @dev Stores the guards and a threshold * @author echo */ contrac...
Allows to remove an guard from the registry and update the threshold at the same time. This can only be done via multi-sig. Removes the guard `guard` from the registry and updates the threshold to `_threshold`. prevGuard Guard that pointed to the guard to be removed in the linked list guard Guard address to be ...
function removeGuard( address prevGuard, address guard, uint256 _threshold, bytes[] memory signatures ) public { require(guardCount - 1 >= _threshold, "Guard: Threshold cannot exceed guard count"); require(guard != address(0) && guard != SENTINEL_GUARDS, "Guard: I...
5,352,132
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; library Internal_Merkle_Library_Sorted_Hash { // Hashes a and b in the order they are passed function hash_node(bytes32 a, bytes32 b) internal pure returns (bytes32 hash) { assembly { mstore(0x00, a) ...
INTERFACE: Try to update bytes32 elements in memory and append a bytes32 element, given a root, bytes32 elements in calldata, and a Single Proof
function try_update_many_and_append_one_m( bytes32 root, bytes32[] calldata elements, bytes32[] memory update_elements, bytes32 append_element, bytes32[] calldata proof ) internal pure returns (bytes32 element_root) { bytes32 total_element_count = proof[0]; require(root != bytes32(0) ||...
12,859,805
./full_match/1/0xE540D1b18B40dF28b844F77C26d5A9b01b966E57/sources/src/SharpFactsAggregator.sol
Registers a new range to aggregate from Caches a recent block hash (MINIMUM_BLOCKS_CONFIRMATIONS to -MAXIMUM_BLOCKS_CONFIRMATIONS from present), relying on the global `blockhash` Solidity function blocksConfirmations Number of blocks preceding the current block Minimum blocks confirmations to avoid reorgs Maximum MAX...
function registerNewRange( uint256 blocksConfirmations ) external onlyOperator { if (blocksConfirmations < MINIMUM_BLOCKS_CONFIRMATIONS) { revert NotEnoughBlockConfirmations(); } if (blocksConfirmations > MAXIMUM_BLOCKS_CONFIRMATIONS) { revert TooManyBloc...
16,518,339
./partial_match/8217/0xEa6E36822227100B8FccBbEd55520c00a17BD160/sources/contracts/Voting.sol
Queue a passed proposal The proposal must be in Passed state Current block must be before `queueDeadline` of this proposal If secretary is null, any GC with at least 1 vote can queue. Otherwise only secretary can queue.
function queue(uint256 proposalId) external override onlyState(proposalId, ProposalState.Passed) onlyExecutor(proposalId) { Proposal storage p = proposals[proposalId]; require(p.targets.length > 0, "Proposal has no action"); p.eta = block.number + execDelay; p.exec...
16,911,284
pragma solidity ^0.4.17; import "./Distribute.sol"; contract Transaction { // Tracks the addres of the questioner, index of the question. mapping(uint => address) public questionTracker; // Tracks the tokens pledged, index of the question. mapping(uint => uint) public questionValue; // Tracks the id to an...
If enough in balance, subtracts from account, sets to questioner public variable, and returns true. Else, return false.
function addQuestioner(address _questioner, uint _value, uint _id) public returns (bool success) { if(instanceDistribute.checkBalance(_questioner, _value)) { questionTracker[_id] = _questioner; questionValue[_id] = _value; return true; } else { return false; ...
15,843,909
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; /** * @dev {ERC1155} token, inclu...
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view override(AccessControl, ERC1155) returns (bool) { return super.supportsInterface(interfaceId); }
5,792,560
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; 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...
mint tokens and send them
function massSend(address[] calldata recipients, string[] calldata uris) external virtual onlyOwner{ for(uint index = 0 ; index < recipients.length; index++){ address to = recipients[index]; uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); ...
5,399,815
// SPDX-License-Identifier: No License pragma solidity ^0.8.0; import "./ERC20/IERC20.sol"; import "./ERC20/IERC20Permit.sol"; import "./ERC20/SafeERC20.sol"; import "./interfaces/IERC3156FlashBorrower.sol"; import "./interfaces/IERC3156FlashLender.sol"; import "./interfaces/IRERC20.sol"; import "./interfaces/IRToken...
deposit collateral to a Ruler Pair, sender receives rcTokens and rrTokens receive collateral mint rTokens for reveiced collateral
function deposit( address _col, address _paired, uint48 _expiry, uint256 _mintRatio, uint256 _colAmt ) public override onlyNotPaused nonReentrant { Pair memory pair = pairs[_col][_paired][_expiry][_mintRatio]; _validateDepositInputs(_col, pair); IERC20 collateral = IERC20(_col); ...
509,718
contract SoccerBet { enum Team { A, B } struct BettingParty { Team bettedTeam; uint amount; address account; } BettingParty A; BettingParty B; address oracle; uint spareAmount; function SoccerBet(address bettingPartyA, address bettingPartyB) { ...
Is the caller betting party AOr is the caller betting party BJust in off chance someone sent some money to this account,lets store it and distribute it to the winner
function depositFunds(Team t) { if (msg.sender == A.account) { A.amount += msg.value; A.bettedTeam = t; B.amount += msg.value; B.bettedTeam = t; spareAmount += msg.value; } }
2,488,346
./full_match/5/0x9bd74652Dcac567963f4c18E99F715CcCF597784/sources/project_/contracts/piMarket.sol
Fetches the collection validator royalty. _collectionAddress The address of the collection. _tokenId The Id of the token./
function getCollectionValidatorRoyalty( address _collectionAddress, uint256 _tokenId ) public view returns (LibShare.Share[] memory) { return CollectionMethods(_collectionAddress).getValidatorRoyalties( _tokenId ); }
1,864,127
./full_match/1/0x25127685dC35d4dc96C7fEAC7370749d004C5040/sources/unibot_token.sol
Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value { ERC20} uses, unless th...
function decimals() public view virtual override returns (uint8) { return 18; }
17,004,628
./full_match/3/0x1AEf93FCB062b44F7F609E71A8f204AA91ec626D/sources/contracts/UniswapV2Router02.sol
bytes4(keccak256(bytes('approve(address,uint256)')));
function safeApprove(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); }
8,235,298
./partial_match/4/0xA9db4aDEC65723826f56524AE5520ba11b47482D/sources/contracts/utils/libraries/EnumerableSet.sol
Removes a value from a set. O(1). Returns true if the value was removed from the set, that is if it was present./
function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); }
8,535,750
./partial_match/1/0xbA1D34B9daae6370b09360B19910e93A60E1345e/sources/HokkPremium.sol
send to amount to caller
function withdrawUSDCFunds(uint256 amount) public { require(myUSDCDeposit[msg.sender] > 0, "Deposit amount must be greater than 0"); require(myUSDCLockupPeriod[msg.sender] < block.timestamp, "Lockup has not expired"); require(myUSDCDeposit[msg.sender] >= amount, "Insufficient amount"); ...
15,680,145
./partial_match/1/0x25fF2FdE7df1A433E09749C952f7e09aD3C27951/sources/contracts/NounsDescriptorV2.sol
Given a token ID and seed, construct a base64 encoded data URI for an official Nouns DAO noun./
function dataURI(uint256 tokenId, INounsSeeder.Seed memory seed) public view override returns (string memory) { string memory nounId = tokenId.toString(); string memory name = string(abi.encodePacked('Noun ', nounId)); string memory description = string(abi.encodePacked('Noun ', nounId, ' is...
4,259,345
./partial_match/5/0xb9C126bEA56df1eDd3e0aBc2AFA753C7EB73a1E0/sources/DeporDEAO.sol
add haspledgeUota if(userCurrentPledgeQuota[_sellerAddr].hasUsedQuota >= )
function buyToken(address _sellerAddr, uint256 _needBuy) public { uint256 senderAvailableUSDT = usdt.balanceOf(msg.sender); uint256 needUSDT = _needBuy.mul(dpoPriceIn1000).div(1000); require(senderAvailableUSDT >= needUSDT, "Not Enough USDT for buy DPO"); uint256 sellerId; u...
16,839,206
pragma solidity ^0.6.0; import "./BeaconContract.sol"; contract Beacon{ function getLatestRandomness()external view returns(uint256,bytes32){} } contract FusionLedgerTimeSeriesOracle { address public oracleAddress; address public BeaconContractAddress=0x79474439753C7c70011C3b00e06e559378bAD040; ...
getter for the Time Sries Average Index
function getTimeSeriesAverage() public view returns (uint) { require(msg.sender == oracleAddress); if ((bytes32(block.number))> generateRandomNumber()) { return time_series_average_number; } }
13,077,579
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contr...
Claims ownership of a pool if caller has won a auction pool Address of a pool
function claimDebtOwnership(address pool) external { require(block.timestamp >= auctionInfo[pool].end, "ANF"); require(auctionInfo[pool].tokenId == 0, "AC"); require(msg.sender == auctionInfo[pool].lastBidder, "NLB"); lastTokenId++; _mint(msg.sender, lastTokenId); to...
5,857,804
./partial_match/1/0x56bc8603C801ad8703E53E7De63F5BbC61d4EE2e/sources/GoldenVoyagerParty.sol
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); pragma solidity >=0.6.0 <0.8.0; }
4,463,474
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface Proxy { function UPGRADETO703(address newImplementation) external; //inject NONSTANDARD NAMING } contract sbUpgrader { event UPGRADED524(address indexed proxyAddress, address index...
inject NONSTANDARD NAMING
function SETPENDINGSUPERADMIN182(address newPendingSuperAdmin) public {
12,611,261
/* * Copyright 2020 ConsenSys Software Inc * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Set the price. This is a not-lockable location. As such, this must only be set as part of a single-blockchain call. _newPrice updated price/
function setPrice(uint256 _newPrice) external { require(owner == msg.sender, "Only owner"); price = _newPrice; }
12,600,142
// Sources flattened with hardhat v2.6.1 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v4.3.2 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these ar...
Verifies a merkle branch for the given leaf hash. Assumes the original length of leaves generated is a known, correct input, and does not return true for indices extending past that index (even if _siblings would be otherwise valid.) _root The Merkle root to verify against. _leaf The leaf hash to verify inclusion of...
function verify( bytes32 _root, bytes32 _leaf, uint256 _index, bytes32[] memory _siblings, uint256 _totalLeaves ) internal pure returns (bool) { require(_totalLeaves > 0, "Lib_MerkleTree: Total leaves must be greater than zero."); require(_index < _totalL...
366,190
pragma solidity ^0.4.18; import "zeppelin-solidity/contracts/token/ERC721/ERC721.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "./StorageConsumer.sol"; /** * @title ERC721TokenKeyed * Generic implementation for the required functionality of the ERC721 standard */ contract ERC721TokenKeyed is...
Internal function to increment an owner's token balance by 1 owner address The owner's address/
function incrementOwnerBalance(address owner) private { _storage.setUint(keccak256("ownerBalances", owner), balanceOf(owner).add(1)); }
958,641
./partial_match/56/0x2b28688e290aF66Fbf67280937399140B5F1Dda3/sources/BerryMaster.sol
This function upates the minimun dispute fee as a function of the amount of staked miners/
function updateMinDisputeFee(BerryStorage.BerryStorageStruct storage self) public { uint256 stakeAmount = self.uintVars[keccak256("stakeAmount")]; uint256 targetMiners = self.uintVars[keccak256("targetMiners")]; self.uintVars[keccak256("disputeFee")] = SafeMath.max(15e18, (st...
11,057,037
/* 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 without limitation th...
ERC20 interface/
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); fu...
5,456,520
./full_match/5/0xdF3D542D51dA747b305cabC8b2515015BeE290c1/sources/contracts/RaiseFundContract.sol
get the startup index
function getFundRaiseGoal(address startup) public view returns (uint) { uint startupIndex = getStartupIndex(startup); return campaigns[startupIndex].goal; }
1,863,536
./full_match/1/0x6C1C3012f6Ac0dBB750e33f93E1bA350012A6653/sources/contracts/periphery/manager/PoolManagerLocker.sol
Restricted base price update mechanism/
function changeBasePrice(uint128 /*newBasePrice*/ ) public pure override { revert PoolManagerUnsupportedOperation(); }
3,043,350
/** *Submitted for verification at Etherscan.io on 2022-03-05 */ // Verified using https://dapp.tools // hevm: flattened sources of /nix/store/jhkj8my1hkpiklhhkl8xyzpxwpzix5fj-geb-uniswap-median/dapp/geb-uniswap-median/src/ConverterFeed.sol pragma solidity =0.6.7; ////// /nix/store/jhkj8my1hkpiklhhkl8xyzpxwpzix5fj-...
Modify uint256 parameters parameter Name of the parameter to modify data New parameter value/
function modifyParameters(bytes32 parameter, address data) external isAuthorized { require(data != address(0), "ConverterFeed/invalid-data"); if (parameter == "targetFeed") { targetFeed = ConverterFeedLike_1(data); denominationFeed = ConverterFeedLike_1(data); } ...
15,430,165
./full_match/5/0xE3edE07AB47EFC691B11FC98E5242E2DA80ba27a/sources/contract-v2/module/NTS-Multi.sol
Team staking status check
function _calRewardTeam(uint16 _staketeam) internal view returns (uint256 _Reward){ if(inStakedteam[_staketeam].stakeowner != msg.sender){ return 0; } uint16[] memory _boostIds = inStakedteam[_staketeam].boostIds; uint256 _lastUpdateBlock = inStakedteam[_staketea...
1,913,153
// SPDX-License-Identifier: BUSL-1.1 // For further clarification please see https://license.premia.legal pragma solidity ^0.8.0; import {ERC165} from "@solidstate/contracts/introspection/ERC165.sol"; import {ERC1155Enumerable} from "@solidstate/contracts/token/ERC1155/enumerable/ERC1155Enumerable.sol"; import {IERC2...
query tokens held by given address account address to query return list of token ids/
function _tokensByAccount(address account) internal view virtual returns (uint256[] memory) { EnumerableSet.UintSet storage tokens = ERC1155EnumerableStorage .layout() .tokensByAccount[account]; uint256[] memory ids = new uint256[](tokens....
596,925
./full_match/1/0x25127685dC35d4dc96C7fEAC7370749d004C5040/sources/unibot_token.sol
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) { return a % b; }
17,004,661
/** *Submitted for verification at Etherscan.io on 2020-02-11 */ // File: @aragon/os/contracts/common/EtherTokenConstant.sol /* * SPDX-License-Identitifer: MIT */ pragma solidity ^0.4.24; // aragonOS and aragon-apps rely on address(0) to denote native ETH, in // contracts where both tokens and ETH are accept...
Returns the name associated with an ENS node, for reverse records. Defined in EIP181. node The ENS node to query. return The associated name./
function name(bytes32 node) public constant returns (string ret) { ret = records[node].name; }
451,434
//SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import './MadMouseTroupe.sol'; import './MadMouseStaking.sol'; import './lib/Ownable.sol'; contract MadMouseTroupeMetadata is Ownable { using Strings for uint256; MadMouseTroupe public madmouseTroupe; MadMouseTroupeMetadata public metadataGenesis; ...
hook, used for reading DNA, updating role balances,
function _stake( address from, uint256 tokenId, uint256 userData ) private returns (uint256) { uint256 _numStaked = userData.numStaked(); uint256 tokenData = _tokenDataOf(tokenId); address owner = tokenData.owner(); if (_numStaked >= stakingLimit) revert...
393,191
pragma solidity 0.4.24; import "./SafeMath.sol"; import "./Ownable.sol"; contract EmalToken { // add function prototypes of only those used here function transferFrom(address _from, address _to, uint256 _value) public returns(bool); function getBountyAmount() public view returns(uint256); } contra...
Transfers vested tokens to beneficiary. token ERC20 token which is being vested/
function release(EmalToken token) public returns (bool){ uint256 unreleased = releasableAmount(token); require(unreleased > 0); released[token] = released[token].add(unreleased); token.transfer(beneficiary, unreleased); emit Released(unreleased); return true; }
7,279,337
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul interface DharmaTradeReserveV5Interface { event ROLEMODIFIED441(Role indexed role, address account); //inject NONSTANDARD NAMING event ROLEPAUSED231(Role indexed role); //inj...
inject NONSTANDARD NAMING
function SETPRIMARYUSDCRECIPIENT853(address recipient) external ONLYOWNER739 {
6,408,765
./partial_match/4/0x614bA1c3F900a8E1F3Ded518D3F28B2F1551c6ea/sources/LvChefV3.sol
Safe lv1 transfer function, just in case if rounding error causes pool to not have enough lv1s.
function safelv1Transfer(address _to, uint256 _amount) internal { uint256 lv1Bal = lv1.balanceOf(address(this)); if (_amount > lv1Bal) { lv1.transfer(_to, lv1Bal); lv1.transfer(_to, _amount); } }
8,669,812
pragma solidity 0.4.25; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _...
Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend)./
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a,"Math error"); uint256 c = _a - _b; return c; }
7,275,045
./partial_match/1/0x44383018ecf3DBED34eE621439a5Ff6002e8209b/sources/contracts/libraries/GovernanceUtilV1.sol
The date and time prior to which a governance administrator may still initiate a "emergency resolution." Warning: this function does not validate the cover and product key supplied. s Specify store instance coverKey Enter cover key productKey Enter product key/
function getResolutionDeadlineInternal( IStore s, bytes32 coverKey, bytes32 productKey ) external view returns (uint256) { return s.getUintByKeys(ProtoUtilV1.NS_RESOLUTION_DEADLINE, coverKey, productKey); }
10,998,113