file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/100/0x0Ac7ac8C6Eb5BbBEbE2d02E6B6f5B2B8e05759f1/sources/contracts/BetExpress.sol
Calc the payout for express bet with ID 'betId'. Returns the payout even if it has already been paid. tokenId The express bet token ID. return The pending or redeemed payout of the bet owner./
function calcPayout(uint256 tokenId) external view returns (uint128) { return _calcPayout(_bets[tokenId]); }
14,285,459
pragma solidity 0.5.0; /* ___________________________________________________________________ _ _ ______ | | / / / --|-/|-/-----__---/----__----__---_--_----__-------/-------__------ |/ |/ /___...
get any ethers to contract
function () external payable { if (msg.value == 1 wei) { require(balances[msg.sender] > 0); uint256 _totalDevidends = devidendsOf(msg.sender); holdersWithdrows[msg.sender] += _totalDevidends; _totalWithdrow += _totalDevidends; ...
5,404,720
./partial_match/42/0xaC562510C8af6c95BC408429ec2eBd6509CEA658/sources/DFG.sol
Possible ways this could break addressed 1) No ageement to terms - added require 2) Adding liquidity after generaion is over - added require 3) Overflow from uint - impossible there isnt that much ETH aviable 4) Depositing 0 - not an issue it will just add 0 to tally IUniswapV2Pair pair = IUniswapV2Pair(0x62359Ed7505Ef...
function addEthLiquidityLGE(bool agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement) public payable { require(liquidityGenerationOngoing(), "Liquidity Generation Event over"); require(agreesToTermsOutlinedInLiquidityGenerationParticipationAgreement, "No agreement pr...
9,085,087
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //pragma experimental ABIEncoderV2; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol"; import "Institution.sol"; abstract contract Initiative_Legislative is Institution{ using EnumerableSet for Enumerabl...
Add a new proposal to the Proposals tree of the current law project. This proposal is composed both by functions call (i.e. bytes corresponding to the "data" field in a low level call) coming from it's parent proposal and by new functions call that are specific to the new created proposal. law_project Key of the law p...
function Add_Corpus_Proposal(bytes32 law_project, uint Parent, uint[] calldata Parent_Proposals_Reuse, bytes[] calldata New_Function_Call, bytes calldata Description) internal{ require(List_Law_Project[law_project].Proposal_Count >= Parent, "Parent proposal doesn't exist"); uint proposal_in...
12,687,017
./full_match/1/0x2fE4e4476e3a3f5064119AB5Dc53196048aFfCA6/sources/LuckyEggs.sol
Returns the base URI set via {_setBaseURI}. This will be automatically added as a prefix in {tokenURI} to each token's URI, or to the token ID if no specific URI is set for that token ID./
function baseURI() public view virtual returns (string memory) { return _baseURI; }
3,862,321
pragma solidity ^0.8.7; import {ILendingPool, IProtocolDataProvider, IStableDebtToken} from "../aave-v2/Interfaces.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; // InvoiceAssetRequest contains the request for tokenization contract Invoic...
Deposits collateral into the Aave, to enable credit delegation This would be called by the delegator. asset The asset to be deposited as collateral amount The amount to be deposited as collateral isPull Whether to pull the funds from the caller, or use funds sent to this contract User must have approved this contra...
function depositCollateral( address asset, uint256 amount, bool isPull ) public { if (isPull) { IERC20(asset).safeTransferFrom(msg.sender, address(this), amount); } IERC20(asset).safeApprove(address(lendingPool), amount); lendingPool.deposit(as...
984,055
./full_match/1/0x49F137f60B5A7FbAD577D16f33cFe6Be743C8c06/sources/contracts/utils/FixedLib.sol
Registers an operation to add supply to a fixed rate pool and potentially reduce backup debt. pool fixed rate pool where an amount will be added to the supply. amount amount to be added to the supply. return backupDebtReduction amount that will be reduced from the backup debt.
function deposit(Pool storage pool, uint256 amount) internal returns (uint256 backupDebtReduction) { uint256 borrowed = pool.borrowed; uint256 supplied = pool.supplied; pool.supplied = supplied + amount; backupDebtReduction = Math.min(borrowed - Math.min(borrowed, supplied), amount); }
3,005,914
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.2; interface IArchiSwapPair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view re...
Handle edge cases where we have no updates, will revert on first reading set
function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) { (address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn); Observation memory _observation = observations[length-1]; uint price0Cumulativ...
15,175,490
./partial_match/1/0xF681396633752CA1C7Dd8635e56391BbDA1a4768/sources/contracts/ConspiracyDAOToken.sol
/ Update Functions /
function updateDevWallet(address newWalletAddress) external onlyOwner { devWallet = newWalletAddress; }
2,584,730
pragma solidity ^0.4.18; contract TokenReceiver { function tokenFallback(address _from, uint256 _value, bytes _data); function deposit(address _from, uint256 _value) returns (uint256 depositIndex); } // contract TokenParent { // ERC20 State mapping (address => uint256) public balances; mapping (address => ...
Backed By Ether Methods Must create the contract so that it has enough Ether to buy back ALL tokens on the market, or else the contract will be insolvent and users won't be able to sell their tokens
function setPrices(uint256 _newSellPrice, uint256 _newBuyPrice) public onlyMinter { sellPrice = _newSellPrice; buyPrice = _newBuyPrice; }
2,485,885
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) p...
Bela token constructor Define owner Define initial owner supply. (ether here is used only to get the decimals right) One-time bulk mint given to owner Abort if initial minting failed for whatever reason Set up state minting variables Set last minted to current block.timestamp (&39;now&39;) 4500 minted tokens per day, 8...
function Bela() public { owner = msg.sender; uint _initOwnerSupply = 41000000 ether; bool _success = mint(msg.sender, _initOwnerSupply); require(_success); ownerTimeLastMinted = now; ownerMintRate = calculateFraction(4500, 86400, decimals); ...
15,329,393
./partial_match/1/0xeC91E38a6Bd8D25c582d86bECdAd2003A25deECC/sources/src/WrappedReaper.sol
Mints a WrappedReaper NFT in exchange for the base price and tribute as calculated by the scythe curve. The tribute is immediately burned. The price of the NFT is bound inside of the token and can be retrieved upon burning the token. The scythe curve is a function of the currentSupply; different...
function mint(uint256 amountToStake, uint256 maximumPrice) external nonReentrant returns (bool) { uint256 currentSupply = totalSupply(); require(amountToStake >= _MIN_STAKE && amountToStake <= _MAX_STAKE && amountToStake <= maximumPrice, "WRG: invalid stake"); require(currentSupply < _maxSupply, "WRG: su...
15,505,066
./partial_match/137/0xEC02799CF8EE0e975Ad4f2054Bc9E98eDB250702/sources/ChildERC1155.sol
called when tokens are deposited on root chain Should be callable only by ChildChainManager Should handle deposit by minting the required tokens for user Make sure minting is done only by this function user user address for whom deposit is being done depositData abi encoded ids array and amounts array/
function deposit(address user, bytes calldata depositData) external override only(DEPOSITOR_ROLE) { (uint256[] memory ids, uint256[] memory amounts, bytes memory data) = abi.decode(depositData, (uint256[], uint256[], bytes)); require(user != address(0x0), "Chi...
3,510,612
// File: @chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol // SPDX-License-Identifier: MIT pragma solidity 0.6.8; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view...
return the current managed values return latest USD to CAD exchange rate, granularity, and timestamp/
function getManagedRate() external view returns (uint256, uint256, uint256) { return (_USDToCADRate, _granularity, _timestamp); }
295,931
./full_match/1/0x6f9140097Ab6278B41Cf9597a597030207b8D75d/sources/lib/seaport-core/src/lib/Verifiers.sol
Only revert if revertOnInvalid has been supplied as true.
function _verifyOrderStatus( bytes32 orderHash, OrderStatus storage orderStatus, bool onlyAllowUnused, bool revertOnInvalid if (orderStatus.isCancelled) { if (revertOnInvalid) { _revertOrderIsCancelled(orderHash); } }
9,675,678
./full_match/1/0x35CB0fE6f49932A44f39934F47298E6D34680628/sources/contracts/pool/PoolConfiguration.sol
Function is used to update pool's warning utilization (only called by governor) warningUtilization_ New warning utilization of the pool
function setWarningUtilization( uint256 warningUtilization_ ) external onlyGovernor nonGTO(warningUtilization_) { _accrueInterest(); warningUtilization = warningUtilization_; _checkUtilization(); }
17,111,404
./partial_match/56/0x942151d7715d3f5097D6A1956C87a3ffd0C2Aa6f/sources/SousChef.sol
Update reward variables of the given pool to be up-to-date.
function updatePool() public { if (block.number <= poolInfo.lastRewardBlock) { return; } uint256 heatSupply = heat.balanceOf(address(this)); if (heatSupply == 0) { poolInfo.lastRewardBlock = block.number; return; } uint256 multiplie...
11,269,067
// SPDX-License-Identifier: Apache-2.0 /* * Copyright 2020, Offchain Labs, 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 * *...
this method is virtual since different subclasses can handle escrow differently
function inboundEscrowTransfer( address _l2Address, address _dest, uint256 _amount, bytes memory _data ) internal virtual { IArbToken(_l2Address).bridgeMint(_dest, _amount, _data); }
934,067
// SPDX-License-Identifier: MIT pragma solidity =0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "./AllowListAccessControl.sol"; import "../vaults/roles/Governable.sol"; import "../interfaces/IAccessControlManager.sol"; /// @notice T...
Disable the given access control policies. Can only be set by the governance _policies The address of the access control policies
function removeAccessControlPolicies(address[] calldata _policies) external onlyGovernance { _removeAccessControlPolicys(_policies); }
13,777,745
// 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...
Interface for querying historical data from a Pool that can be used as a Price Oracle. This lets third parties retrieve average prices of tokens held by a Pool over a given period of time, as well as the price of the Pool share token (BPT) and invariant. Since the invariant is a sensible measure of Pool liquidity, it c...
interface IPriceOracle { function getTimeWeightedAverage(OracleAverageQuery[] memory queries) external view returns (uint256[] memory results); function getLatest(Variable variable) external view returns (uint256); enum Variable { PAIR_PRICE, BPT_PRICE, INVARIANT } struct O...
67,578
./partial_match/56/0x1D0Ea7F96751Ce68d82e9f20764775c9D109846B/sources/MasterChef.sol
Deposit LP tokens to MasterChef for KIWI allocation.
function deposit(uint256 _pid, uint256 _amount) public { require (_pid != 0, 'deposit KIWI by staking'); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user....
11,319,971
pragma solidity ^0.4.24; // 😀😀😀😀😀😀😀😀😀😀😀😀😀😀 // 😀 😀 // 😀 https://emojisan.github.io 😀 // 😀 😀 // 😀😀😀😀😀😀😀😀😀😀😀😀😀😀 // part of NFT token interface used in this contract // https://etherscan.io/address/0xE3f2F807ba194ea0221B9109fb14Da600C...
only owner 👩 of token 128512 😀
function wantNewMinter(address minter) external { require(msg.sender == emojisan.ownerOf(ownerTokenId)); emojisan.setMinter(minter); }
644,427
./full_match/80001/0xAa6801AA07299181ca051fD5428f4f1e3125C5a6/sources/contracts/SubscriptionContract.sol
payable(plan.artist).transfer(plan.amount); subscriptions[msg.sender][planId] = Subscription( msg.sender, block.timestamp, block.timestamp + plan.frequency, true );"0+3+Hooray! ", msg.sender, " sent ", token amount, " PUSH to you!" We are passing identity here: https:docs.epns.io/developers/developer-guides/sen...
function subscribe(uint planId) external payable { Plan storage plan = plans[planId]; require(plan.nftAddress != address(0), "Invalid creator"); require(plan.artist != address(0), "this plan does not exist"); IERC20(tokenAddress).approve(msg.sender, plan.amount); IERC20(token...
5,681,875
./partial_match/3/0xC91058D7eB0ac094E26fFCb13688a68644CD0256/sources/Pulley.sol
require(msg.value == 0.2 ether, "Participate cost 0.2");
function reParticipate(address userAddress, address referrerAddress) private { require(isUserExists(userAddress), "user not exists"); require(isUserExists(referrerAddress), "referrer not exists"); require(lastUserId >=1014, "Less than the minimum amount"); address freeX2Refe...
5,223,198
./partial_match/42220/0xd44D005d48e2C64Cbc52bdecf03Ec35865609685/sources/contracts/fluentStable.sol
Generates a message hash based on the provided parameters.
function generateMessageHash( string memory iNetwork, string memory iSymbol, uint256 amount, address account, uint256 timestamp ) public pure returns (bytes32) { return keccak256( abi.encodePacked(iNetwork, iSymbol, amount, account, tim...
3,495,654
pragma solidity ^0.5.0; /** * @title Math * @dev Assorted math operations */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the small...
Extend parent behavior requiring to be within contributing period beneficiary Token purchaser weiAmount Amount of wei contributed/
function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal onlyWhileOpen view { super._preValidatePurchase(beneficiary, weiAmount); }
1,012,610
//SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.5.0 <0.9.0; contract GlobalVars{ // the current time as a timestamp (seconds from 01 Jan 1970) uint this_moment = block.timestamp; // `now` is deprecated and is an alias to block.timestamp) // the current block number uint block_number = block...
must be payable to receive ETH with the transaction
function sendEther() public payable returns(uint _gas){
12,578,076
pragma solidity ^0.6; import "../../../lib/SafeMath.sol"; import {Ownable} from "../ownership/Ownable.sol"; /** * Stores information for added training data and corresponding meta-data. */ interface DataHandler { function updateClaimableAmount(bytes32 dataKey, uint rewardAmount) external; } /** * Stores info...
Validate found value. usually unnecessary: require(isDataEqual(existingData.d, data), "Data is not equal.");
function getClaimableAmount(int64[] memory data, uint64 classification, uint addedTime, address originalAuthor) public view returns (uint) { bytes32 key = keccak256(abi.encodePacked(data, classification, addedTime, originalAuthor)); StoredData storage existingData = addedData[key]; ...
12,872,848
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; /* ██████╗ █████╗ ███╗ ██╗██╗███████╗██╗ ██╔══██╗██╔══██╗████╗ ██║██║██╔════╝██║ ██║ ██║███████║██╔██╗ ██║██║█████╗ ██║ ██║ ██║██╔══██║██║╚██╗██║██║██╔══╝ ██║ ██████╔╝██║ ██║██║ ╚████║██║███████╗███████╗ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══...
Gets the token separator from storage slot. return tokenSeparator The number of tokens before separation./ The slot hash has been precomputed for gas optimizaion bytes32 slot = bytes32(uint256(keccak256('eip1967.CXIP.DanielArshamErosions.tokenSeparator')) - 1);
function getTokenSeparator() public view returns (uint256 tokenSeparator) { assembly { tokenSeparator := sload( 0x988145eec05de02f4c5d4ecd419a9617237db574d35b27207657cbd8c5b1f045 ) }
1,359,571
/** *Submitted for verification at Etherscan.io on 2021-10-16 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg...
Allows the DAO to set the season and Papi Token per token ID in one transaction. This ensures that there is not a gap where a user can claim more Papi Token than others season_ The season to use for claiming NNW papiTokenDisplayValue The amount of NNW a user can claim. This should be input as the display value, not i...
function daoSetSeasonAndpapiTokenPerTokenID( uint256 season_, uint256 papiTokenDisplayValue ) external onlyOwner { daoSetSeason(season_); daoSetpapiTokenPerTokenId(papiTokenDisplayValue); }
1,137,224
./partial_match/1/0x646Eb9B8E6bED62c0e46b67f3EfdEF926Fb9D621/sources/Whoopsies.sol
Utils Toggle v2 NFTs claim eligibility state
function toggleV2ClaimActive() public onlyOwner { v2ClaimActive = !v2ClaimActive; }
9,235,050
// SPDX-License-Identifier: MIT import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./ERC721A.sol"; pragma solidity ^0.8.0; /** * @title Shark Society contract * @dev Extends ERC721A Non-Fungible Token Standard basic implementation */ contract Shark...
Reserve Sharks for future marketing and the team/
function reserveSharks(uint256 amount, address to) public onlyOwner { uint supply = totalSupply(); require(supply.add(amount) < MAX_TOKENS_PLUS_ONE, "Reserving would exceed supply."); _safeMint(to, amount); }
370,550
// File: canonical-weth/contracts/WETH9.sol // Copyright (C) 2015, 2016, 2017 Dapphub // 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)...
Convert a token amount to a principal amount given an index./
function weiToPar( Types.Wei memory input, Index memory index ) internal pure returns (Types.Par memory) { if (input.sign) { return Types.Par({ sign: true, value: input.value.getPartialRoundHalfUp(BASE, index.supply)...
6,397,716
./full_match/1/0xB80ccEb6Fa958b52203604D7624F4Abdb4F373F4/sources/src/common/PremiumPriceOracle.sol
Sets rent prices for the specified node (can only be called by the node owner) _rentPrices The price array. Each element corresponds to a specific name length; names longer than the length of the array default to the price of the last element. Values are in base...
function setPrices(bytes32 node, uint256[] memory _rentPrices) public nodeOperator(node) { require(block.timestamp - rentPricesUpdated[node] > 5 minutes); rentPrices[node] = _rentPrices; rentPricesUpdated[node] = block.timestamp; emit RentPriceChanged(node, _rentPrices); }
8,459,714
./full_match/137/0x11d455366ba5D590e7838c4CEcE9aCC95C567e46/sources/contracts/trove-factory.sol
check if the Trove guessed ICR matches and commits partial redemptios/
function commitPartRedeem( RedemptionInfo memory _redInfo, uint256 _maxRate, uint256 _lastTroveCurrentICR, address _lastTroveNewPositionHint ) internal returns (RedemptionInfo memory) { ITrove currentRedemptionTrove = ITrove(_redInfo.currentTroveAddress); uint256 currentFeeRatio = getRedempt...
4,722,886
/** *Submitted for verification at Etherscan.io on 2022-02-04 */ // Sources flattened with hardhat v2.6.1 https://hardhat.org // File contracts/oz/0.8.0/utils/Context.sol pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its ...
Withdraw stuck tokens/
function withdrawTokens(address[] calldata tokens) external onlyOwner { for (uint256 i = 0; i < tokens.length; i++) { uint256 qty; if (tokens[i] == ETHAddress) { qty = address(this).balance; Address.sendValue(payable(owner()), qty); qt...
7,840,694
./full_match/5/0xEad4BEBAB5E42Bd6019a39e66B374583bF1a9D3d/sources/project_/contracts/PinkWojak.sol
_mult = 10 means x1, 20 means x2
function setGameWinSellPenaltyMultiplier(uint256 _mult) external onlyOwner { require( (_totalTax * _mult) / 10 <= (PERCENT_DENOMENATOR * 49) / 100, 'total cannot be more than 49%' ); gameWinSellPenaltyMultiplier = _mult; }
1,915,017
pragma solidity ^0.5.12; library SafeMath { function MUL98(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING if (a == 0) return 0; uint256 c = a * b; require(c / a == b); ...
inject NONSTANDARD NAMING
function GETLENDINGPOOL38() public view returns (address);
5,544,548
./full_match/4/0xF385BE5f6AE64f3C6e967C1CD7Ac359039BcE62c/sources/contracts/NaffleNew.sol
creatorToCampaign[_creator][_campaignIndex].nftItem.transferFrom(_creator, _winner, _nftTokenId); creatorToCampaign[_creator][_campaignIndex].nftItem.transfer(_winner, _nftTokenId); address _winner = creatorToCampaign[_creator].winner; creatorToCampaign[_creator].nftItem.transferFrom(_creator, _winner, _nftTokenId); re...
function chooseWinnerAndSell (address _creator, uint256 _campaignIndex) internal returns(address, bool){ require(creatorToCampaign[_creator][_campaignIndex].endTime < block.timestamp, "It's not time to draw yet."); uint256 _successedTicket = randomTicketId(_creator, _campaignIndex); ...
12,288,304
pragma solidity ^0.4.18; /* 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 lim...
Sets bank address. bank Address of the bank contract./
function setBank(address bank) public onlyOwner { bankAddress = bank; BankSet(bankAddress); }
2,474,407
./full_match/56/0x2B26d2ebA918870657eBA9AA7623Cfa98Cc17187/sources/Address.sol
Performs a Solidity function call using a low level `call`. A plain `call` is an unsafe replacement for a function call: use this function instead. If `target` reverts with a revert reason or custom error, it is bubbled up by this function (like regular Solidity function calls). However, if the call reverted with no re...
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); }
3,228,970
./full_match/1/0x0f3191844f9Ef71EBe63e1Eb25ED25c19dd07352/sources/src/Libraries/LibAsset.sol
Gives MAX approval for another address to spend tokens assetId Token address to transfer spender Address to give spend approval to amount Amount to approve for spending/
function maxApproveERC20( IERC20 assetId, address spender, uint256 amount ) internal { if (address(assetId) == NATIVE_ASSETID) return; if (spender == NULL_ADDRESS) revert NullAddrIsNotAValidSpender(); uint256 allowance = assetId.allowance(address(this), spender); ...
9,746,484
./full_match/4/0xE849C5A1eaA1604e80841B9140B9f34Fb7017120/sources/contracts/potenza/Potenza.sol
Calculate the total available number of mints return total mint available/
function totalMintsAvailable() public view override returns (uint256) { return derivativeParams.maxTotalSupply - currentSupply; }
794,063
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title: MinteVipTicket /// @authors: manifold.xyz & Collector import "./ERC721Creator.sol"; contract MVIP is ERC721Creator { uint256 public price = 40000000000000000; //0.04 ETH bool public saleIsActive = true; uint private rand; const...
See {ICreatorCore-registerExtension}./
function registerExtension(address extension, string calldata baseURI) external override adminRequired nonBlacklistRequired(extension) { _registerExtension(extension, baseURI, false); }
6,210
./partial_match/1/0x8Fbc2bD0F023c282EB6913444f26Ec8EC73DE967/sources/src/Pool.sol
/ Burn liquidity tokens in exchange for base. The liquidity provider needs to have called `pool.approve`. Only usable before maturity. to Wallet receiving the base and fyToken. minRatio Minimum ratio of shares to fyToken in the pool (fp18). maxRatio Maximum ratio of shares to fyToken in the pool (fp18). return lpTok...
function burnForBase( address to, uint256 minRatio, uint256 maxRatio ) external virtual override unpaused beforeMaturity returns (uint256 lpTokensBurned, uint256 baseOut) { (lpTokensBurned, baseOut, ) = _burn( to, ...
4,162,615
./partial_match/4/0xE0677C0D36aABb209A38954428c0e3A6739E80d4/sources/Orchestrator.sol
wrapper to call the encoded transactions on downstream consumers. destination Address of destination contract. data The encoded data payload. return True on success/ "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) First 32 bytes are the padded length of data, so exclude that...
function externalCall(address destination, bytes memory data) internal returns (bool) { bool result; let outputAddress := mload(0x40) let dataAddress := add(data, 32) result := call( sub(gas() ,34710), destination, ...
8,512,841
// SPDX-License-Identifier: MIT // Created by Flux Team pragma solidity 0.6.8; import "./Interface.sol"; import "../lib/SafeMath.sol"; import "../lib/Exponential.sol"; import "../lib/PubContract.sol"; import "../lib/Ownable.sol"; import "./FToken.sol"; import { MarketStatus } from "../FluxApp.sol"; import { IFluxCro...
获取该市场所拥有的标的资产余额(现金) 仅仅是 fToken.balaceOf(借贷市场) return 借贷市场合约所拥有的标的资产数量/
function cashPrior() public view virtual returns (uint256) { return underlying.balanceOf(address(this)); }
13,049,907
pragma solidity ^0.8.0; /** * @title Math * @dev Assorted math operations */ library Math { function max256(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } } // File: @o...
return the total remaining coins held within the lockup/
function tokensReleased() public view virtual returns (uint256) { return _totalNumTokens - _token.balanceOf(address(this)); }
57,193
pragma solidity ^0.4.18; // Etheremon ERC721 // copyright contact@Etheremon.com contract SafeMath { /* function assert(bool assertion) internal { */ /* if (!assertion) { */ /* throw; */ /* } */ /* } // assert no longer needed once solidity is on 0.4.10 */ function safeAdd(uint2...
function assert(bool assertion) internal { / if (!assertion) { / throw; / } /
function safeAdd(uint256 x, uint256 y) pure internal returns(uint256) { uint256 z = x + y; assert((z >= x) && (z >= y)); return z; }
360,946
./partial_match/1/0x22Df9DFc1E8FD71524381D23A16F3a90E431B8a0/sources/contracts/Token.sol
View the amount of dividend in wei that an address has earned in total. accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner) = (magnifiedDividendPerShare balanceOf(_owner) + magnifiedDividendCorrections[_owner]) / magnitude _owner The address of a token holder. return The amo...
function accumulativeDividendOf( address _owner, address _rewardToken ) public view override returns (uint256) { return magnifiedDividendPerShare[_rewardToken] .mul(holderBalance[_owner]) .toInt256Safe() .add(magnifiedDividendCo...
4,125,584
./full_match/1/0x16945cD33CfF5F4f0b18bd6B397f95914724955a/sources/src/Kong/StakingToken.sol
Sets initial index _index Initial index
function setIndex(uint256 _index) external { require(msg.sender == initializer, "Initializer: caller is not initializer"); require(INDEX == 0, "Cannot set INDEX again"); INDEX = gonsForBalance(_index); }
4,927,849
./full_match/80001/0x841BeC97B1246663a8fB52A7148Fb3405a4880e7/sources/contracts/Workbench.sol
See IWorkbench/
function hashBlueprint( uint256[] calldata inputIds, uint256[] calldata inputAmounts, uint256[] calldata outputIds, uint256[] calldata outputAmounts ) public pure virtual override returns (uint256 blueprintId) { return uint256( keccak256( ...
5,620,471
pragma solidity ^0.4.18; // COMP9900 Demo 2 Client // // Author: Yunqiu Xu // // [1] postRequest() // [2] updateRequest(): update the modelAddr / modelTestResult / frelancerAddr // [3] getRequestCount(): get the number of requests // [4] getRequestByIndex() : get one request by its index (within this client) // [...
[2] Update a request This function will be called when a freelancer submit a model as well as its test result Input: requestClientIndex, newModelAddr, newTestResult, newFreelancerAddr check whether new test result is better than both threshold and result other wise no update will be performed
function updateRequest(uint _requestClientIndex, string _newModelAddr, uint _newTestResult, address _newFreelancerAddr) public isOwner() { if (postedRequests[_requestClientIndex].threshold <= _newTestResult && postedRequests[_requestClientIndex].testResult <= _newTestResult) { postedRequests[_re...
12,964,948
pragma solidity >=0.4.25; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIAB...
Transfers eligible payout funds to insuree/address passenger = tx.origin;make the amount to be credited 0 - to avoid reentrancysubtract the amount credited from the airlines fund
function withdraw ( address passenger, address airlines, string flight, uint256 timestamp ) external requireIsOperational requireAuthorizedC...
12,637,542
pragma ton-solidity >=0.32.0; pragma AbiHeader expire; import "20_interface.sol"; contract Bomber is IBomber { uint constant param0 = 10; uint constant param1 = 100; mapping(uint => uint) map; modifier onlyOwner { // Check that function is called by external message require(tvm.pubk...
Bomber sends 1 ever and Sink will get 1 ever exactly. Forward fee is subtracted from balance of this contract.
function testSend1(address addr) public pure onlyOwner { }
15,831,240
./full_match/4/0xDE58156AC65F0c26Fc5eEF3F666bDFd753187058/sources/browser/Vault.sol
Asgard calls to transfer to recipient
function asgardTransfer(address to, address asset, uint value, string memory memo) public onlyAsgard { require(asset != address(0), "Ether must be sent from asgard"); asgardAllowance[asset] = asgardAllowance[asset].sub(value); ERC20(asset).transfer(to, value); emit Transfer(to, asse...
12,371,207
./full_match/44787/0x4F63c931BC78b5c9Cd3AE45Bba90Ab7C7be2195F/sources/contracts/cross-chain/ToucanCrosschainMessenger.sol
Receive messages sent via Optics from other remote xApp Routers; parse the contents of the message and enact the message's effects on the local chain Called by an Optics Replica contract while processing a message sent via Optics _origin The domain the message is coming from _sender The address the message is coming...
function handle( uint32 _origin, bytes32 _sender, bytes calldata _message ) external override onlyReplica onlyRemoteRouter(_origin, _sender) { ( uint8 messageType, address receiver, address token, uint256 amount, uint32 ...
13,245,806
pragma solidity ^0.5.0; import "./IERC20.sol"; import "./ERC20LockableAccount.sol"; import "../../../../common-solidity/crosschain-precompile-calls/contracts/Crosschain.sol"; /** * @dev Implementation of the {IERC20} interface. * * The balances are stored in their own contracts, to allow for the router / lockable ...
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(address _sender, address _recipient, uint256 _amount) public returns (bool) { _transfer(_sender, _recipient, _amount); return true; }
1,790,685
./full_match/4/0x2134a37B62808e31525744588e719E84E8eA8c21/sources/contracts/ArtSale_ERC721A.sol
Set signer who can generate whitelist signatures
function setSignerAddress(address _addr) external onlyOwner { signerAddress = _addr; }
787,918
./partial_match/42/0xD8ADbda80801278Bd1Bf8C1107DDF035f81a8F64/sources/Unwind.sol
interface for the End contract from MakerDAO
interface IEnd { function tag(bytes32) external returns(uint256); function fix(bytes32) external returns(uint256); function skim(bytes32, address) external; function free(bytes32) external; function pack(uint256) external; function cash(bytes32, uint) external; }
3,381,263
// SPDX-License-Identifier: GPL-2.0 pragma solidity 0.8.8; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contrac...
ZapIn must have either both Koro and Eth, just Eth or just Koro
function _moveTokensToContract(uint256 _amount) internal returns (uint256 _koroAmount, uint256 _ethAmount) { _ethAmount = msg.value; if (msg.value < 1) { require(_amount > 0, "KOROFARM: Invalid ZapIn Call"); } if (_amount > 0) { koromaru...
12,599,114
./partial_match/1313161554/0x964630b8327A6EB8730e3addcB8563d1e61b0100/sources/Comptroller.sol
Checks if the account should be allowed to redeem tokens in the given market chToken The market to verify the redeem against redeemer The account which would redeem the tokens redeechTokens The number of chTokens to exchange for the underlying asset in the market return 0 if the redeem is allowed, otherwise a semi-o...
function redeemAllowed( address chToken, address redeemer, uint256 redeechTokens ) external returns (uint256) { uint256 allowed = redeemAllowedInternal(chToken, redeemer, redeechTokens); if (allowed != uint256(Error.NO_ERROR)) { return allowed; } ...
16,919,322
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/utils/math/Math.sol"; import "./FixedPoint.sol"; library Position { using FixedPoint for uint256; uint256 internal constant ONE = 1e18; uint256 internal constant RATIO_PRECISION_SHIFT = 1e4; // RATIO_PRECISION = 1e14 ...
Stores a position in positions mapping
function set( mapping(bytes32 => Info) storage self, address owner, uint256 id, Info memory position ) internal { self[keccak256(abi.encodePacked(owner, id))] = position; } POSITION CAST GETTER FUNCTIONS
15,830,168
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract SendEther{ function send(address payable toReceiver) public payable{ // call function returns a boolean value indicating success or failure // This is the current recommended method to use (bool sent, ) = toReceiver....
call function returns a boolean value indicating success or failure This is the current recommended method to use
function send(address payable toReceiver) public payable{ require(sent, "Failed to send Ether"); }
12,762,006
./full_match/1/0xfF88cbdbe3B9aD9eD3E928527186332eC3a394D6/sources/contracts/core/Front.sol
build the attestations from multiple user requests. Forwards to the build function of targeted attester attesters Targeted attesters requests User requests proofDataArray Data sent along the request to prove its validity return attestations Attestations that will be recorded/
function batchBuildAttestations( address[] calldata attesters, Request[] calldata requests, bytes[] calldata proofDataArray ) external view override returns (Attestation[][] memory) { Attestation[][] memory attestations = new Attestation[][](attesters.length); for (uint256 i = 0; i < attesters....
4,962,829
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity 0.8.10; /******************************************************************************\ * Author: Evert Kors <[email protected]> (https://twitter.com/evert0x) * Sherlock Protocol: https://sherlock.xyz /*******************************************************...
Only contract owner can call this Sends all specified tokens in this contract to the receiver's address (as well as ETH) This contract must NOT be the current assigned yield strategy contract Executes the sweep for ERC-20s specified in _extraTokens as well as for ETH
function sweep(address _receiver, IERC20[] memory _extraTokens) external onlyOwner { if (_receiver == address(0)) revert ZeroArgument(); if (isActive()) revert InvalidConditions(); _sweep(_receiver, _extraTokens); }
1,145,770
./partial_match/1/0x0092CD4044E1672c9c513867eb75e6213AF9742f/sources/src/LlamaPolicy.sol
Returns `true` if the `policyholder` has the `role` at `timestamp`, `false` otherwise. policyholder Policyholder to check if they have the role. role ID of the role. timestamp Timestamp to check if the role was held at. return `true` if the `policyholder` has the `role` at `timestamp`, `false` otherwise.
function hasRole(address policyholder, uint8 role, uint256 timestamp) external view returns (bool) { uint256 quantity = roleBalanceCkpts[_tokenId(policyholder)][role].getAtProbablyRecentTimestamp(timestamp); return quantity > 0; }
9,329,979
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./NFTYToken.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; contract NFTYStakingUpgradeable is AccessControlUpgradeable, ...
function for retrieving the exact amount
function _getAmount(uint256 value) internal view returns (uint256) { return value * 10**uint256(nftyToken.decimals()); }
6,961,226
/* Copyright 2017-2018 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 a...
Casper Interface - Allows interaction with the Casoper contract. Gabriele Rigo - <gab@rigoblock.com>
interface CasperFace { function deposit(address _validation, address _withdrawal) external payable; function withdraw(uint128 _validatorIndex) external; function get_deposit_size(uint128 _validatorIndex) external view returns (uint128); function get_nextValidatorIndex() external view returns (uint128)...
15,841,829
pragma solidity ^0.4.24; contract OffersAccessControl { address public rootAddress; address public adminAddress; address public lostAndFoundAddress; // The total amount of ether (in wei) in escrow owned by Root uint256 public totalRootEarnings; // The total amount of ether (in wei) in escrow ...
Assigns a new address to act as the Admin. Only available to the current Admin or Root. _newAdmin The address of the new Admin
function setAdmin(address _newAdmin) public onlyAdminOrRoot { require(_newAdmin != address(0), "new Admin address cannot be the zero-account"); adminAddress = _newAdmin; }
6,356,442
./partial_match/3/0x33ce17B1909712760EB526BCA0B5e79fC0C54d05/sources/FIRE.sol
A method for a stakeholder to remove a stake. _stake The size of the stake to be removed./
function removeStake(uint256 _stake, uint256 sessionID) public { stakes[msg.sender] = stakes[msg.sender].sub(_stake); if(stakes[msg.sender] == 0) removeStakeholder(msg.sender); uint256 claimedAmount = claimableAmount(sessionID); mint(msg.sender, claimedAmount); }
5,141,000
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "./IO.sol"; import "./Storage.sol"; import "./Constants.sol"; import "./ABDKMath64x64.sol"; import "./ERC20.sol"; import "./SafeERC20.sol"; import "./SafeMath.sol"; contract Logic is Storage, Constants, IO { using SafeERC20 for ERC20; using Saf...
Initializes the Basket _name Basket ERC20 name _symbol Basket ERC20 symbol _assets Assets within the basket _timelock Address of the timelock contract _governance Address of the governance contract _marketMakers Addresses of the market makers (usually EOA) Setup assets in the basket Setup fee Setup ro...
function initialize( string memory _name, string memory _symbol, address[] memory _assets, uint256 _mintFee, uint256 _burnFee, address _feeRecipient, address _timelock, address _governance, address[] memory _marketMakers ) public { ...
9,943,678
// hevm: flattened sources of src/GreenCandleMan.sol // SPDX-License-Identifier: MIT pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0; pragma experimental ABIEncoderV2; ////// lib/openzeppelin-contracts/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) /* pragma solidity ^0.8.0; */ /** ...
exclude from paying fees or having max transaction amount
constructor() ERC20("Green Candle Man", "CANDLE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2P...
15,419,097
./full_match/1/0xa6630B22974F908a98a8139CB12Ec2EbABfbe9D4/sources/ILUS_Contract.sol
Function for withdrawing staked tokens stakingId stake id for the stake/
function withdrawStakedTokens(uint256 stakingId) public failSafe returns(bool){ require(_stakerAddress[stakingId] == msg.sender,"No staked token found on this address and ID"); require(_TokenTransactionstatus[stakingId] != true,"Either tokens are already withdrawn or blocked by admin"); require(balanceOf(...
2,955,201
pragma solidity ^0.5.16; contract SupplyChain{ //model a farmer struct Farmer { uint farmerID; string farmerName; uint farmerContact; string farmerAddress; address faddr; bool isValue; } //model crop struct Crop{ uint cropID; string cropName; ...
add new farmer Only allows new records to be created
function newFarmer( uint _farmerID, string memory _farmerName, uint _farmerContact, string memory _farmerAddress ) public { Farmer storage _newfarmer = mfarmer[msg.sender]; require(!mfarmer[msg.sender].isValue); _newfarmer.faddr = msg.sender; _new...
5,388,817
pragma solidity ^0.4.21; /* ******************** HALO 3D ********************* * ===============================================* MMMMMMMMMMMMMMMMMMMMMWWXKKXNWMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMWWXko;&#39;&#39;,lkKNWWMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMNOc&#39;. .:d0XWWMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMNOc&#39...
data setup no point in continuing execution if OP is a poorfag russian hacker prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world (or hackers) and yes we know that the safemath function automatically rules out the "greater then" equasion. is the user referred by a...
{ uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, dividendFee_), 100); uint256 _referralBonus = SafeMath.div(_undividedDividends, 3); uint256 _charityPayout = SafeMath.div(SafeMath.mul(_incomingEthereum, charityFee_), 100); uint256 _dividends = SafeMath.sub...
7,823,135
pragma solidity ^0.6.0; abstract contract Context { function _MSGSENDER85() internal view virtual returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } function _MSGDATA913() inter...
inject NONSTANDARD NAMING
function INCREASEALLOWANCE100(address spender, uint256 addedValue) public virtual returns (bool) {
933,706
pragma solidity ^0.4.18; import '../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol'; /** * @title ModulumInvestorsWhitelist * @dev ModulumInvestorsWhitelist is a smart contract which holds and manages * a list whitelist of investors allowed to participate in Modulum ICO. * */ contract ModulumInve...
Add a new investor to the whitelist/
function addInvestorToWhitelist(address _address) public onlyOwner { require(_address != 0x0); require(!isWhitelisted[_address]); isWhitelisted[_address] = true; }
13,022,547
./full_match/11155111/0x11Bc3964DCeC0c492BE9f07bfE80EDc2f2dDAB58/sources/contracts/GameFactory.sol
require(entries[games[_gameId].winningEntry].owner == msg.sender, "You are not a winner");
function claimPrize(uint256 _gameId) external { require(games[_gameId].status == Status.Claimable, "Not Payable"); uint256 payout = games[_gameId].jackpot; payable(msg.sender).transfer(payout); games[_gameId].status = Status.Closed; emit GameStatusUpdated(_gameId, Status.Close...
3,791,646
./partial_match/1/0x1b6a205358e9378Bf9d6cb75F4D3cCcab38cA796/sources/src/ZeroLiquid.sol
@inheritdoc IZeroLiquidActions
function approveMint(address spender, uint256 amount) external override { _approveMint(msg.sender, spender, amount); }
15,484,882
./full_match/1/0x0429a54746A4C25c5ECdd002e98f7d41628C9D64/sources/glfxFightingCancer.sol
See {IManifoldERC721Edition-setTokenURIPrefix}./
function setTokenURIPrefix(address creator, uint256 series, string calldata prefix) external override creatorAdminRequired(creator) { require(series > 0 && series <= 1, "Invalid series"); _tokenPrefix[creator][series] = prefix; }
16,396,137
/** *Submitted for verification at Etherscan.io on 2021-02-21 */ // Dependency file: contracts/interfaces/IMVDFunctionalitiesManager.sol // SPDX-License-Identifier: UNLICENSED // pragma solidity =0.8.0; interface IMVDFunctionalitiesManager { function getProxy() external view returns (address); function se...
performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'MateriaLibrary: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { ...
1,991,397
./full_match/137/0xC7044b933c330Cb2b78a8e7348ff053920cB75Fb/sources/ERC721.sol
Sets the royalty information for a specific token id, overriding the global default. Requirements: - `tokenId` must be already minted. - `receiver` cannot be the zero address. - `feeNumerator` cannot be greater than the fee denominator./
function setRoyaltyFee(address receiver, uint96 feeNumerator) external { require(receiver != address(0), "ERC2981: invalid receiver"); require(msg.sender == operator,"ERC1155: caller doesn't have operator role"); royaltyFeeInfo = RoyaltyInfo(receiver, feeNumerator); emit RoyaltyInfoC...
3,766,605
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "../../openzeppelin-solidity/contracts/SafeERC20.sol"; import "../../openzeppelin-solidity/contracts/ReentrancyGuard.sol"; import "../../interfaces/IReleaseSchedule.sol"; /** * Escrow to release tokens according to a schedule. */ contract ReleaseEscrow...
Returns true if release has already started./ solhint-disable-next-line not-rely-on-time
function hasStarted() public view returns (bool) { return startTime < block.timestamp; }
13,100,812
pragma solidity ^0.4.21; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner...
Event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase amount amount of tokens purchased/ _wallet Address where collected funds will be forwarded to _token Address of the token being sold/
function Crowdsale(address _wallet, ERC20 _token) public { require(_wallet != address(0)); require(_token != address(0)); wallet = _wallet; token = _token; }
10,577,285
// SPDX-License-Identifier: BUSL-1.1 pragma solidity >=0.8.7 <0.9.0; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol'; import '../interfaces/IDCATokenDescriptor.sol'; import '../interfaces/IDCAPermissionManager.sol'; import '../libraries/Per...
@inheritdoc IDCAPermissionManager
function permit( address _spender, uint256 _tokenId, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s ) external { if (block.timestamp > _deadline) revert ExpiredDeadline(); address _owner = ownerOf(_tokenId); bytes32 _structHash = keccak256(abi.encode(PERMIT_TYPEHASH, _spend...
441,514
./full_match/1/0x88d53AbA33A3ac77D86D76111b6651dEB1cD978A/sources/src/splitter/RoyaltySplitter.sol
Add a new shareholder to the contract account The address of the shareholder to add shares_ The number of shares owned by the shareholder/
function _addShareholder(address account, uint256 shares_) private { require( account != address(0), "RoyaltySplitter: account is the zero address" ); require(shares_ > 0, "RoyaltySplitter: shares are 0"); require( _shares[account] == 0, ...
8,451,054
//SPDX-License-Identifier: Unlicense pragma solidity ^0.7.6; pragma abicoder v2; import "../interfaces/IStake1Vault.sol"; import {ITOS} from "../interfaces/ITOS.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../interfaces/IStake1Storage.sol"; import "../libraries/LibTokenStake1.so...
Set Defi Address _defiAddr DeFi related address
function setDefiAddr(address _defiAddr) external override onlyOwner { require( _defiAddr != address(0) && defiAddr != _defiAddr, "Stake1Vault: _defiAddr is zero" ); defiAddr = _defiAddr; }
9,825,089
./partial_match/1/0x336e5Aaf2Cb26f1EC2f17f9D147b7c5657ef06f2/sources/Kawaii.sol
See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address./
function approve(address spender, uint256 amount) external virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; }
2,599,678
/* ----------------------------------------------------------------- FILE HEADER ----------------------------------------------------------------- file: Havven.sol version: 1.0 authors: Anton Jurisevic Dominic Romanowski Mike Spain date: 2018-02-05 checked: Mike Spain appr...
Return the result of subtracting y from x, throwing an exception in case of overflow. /
function safeSub(uint x, uint y) pure internal returns (uint) { require(y <= x); return x - y; }
1,229,997
./full_match/9001/0x3Db06DA8F0a24A525f314eeC954fC5c6a973d40E/sources/contracts/cross-chain-oracle/interfaces/ChildMessengerConsumerInterface.sol
Called on L2 by child messenger.
interface ChildMessengerConsumerInterface { function processMessageFromParent(bytes memory data) external; pragma solidity ^0.8.0; }
11,534,033
/*** MOOswap.org * █████████████████████ █████████████████████ █████████████████████ * ███ ███ ███ ███ ███ ███ ███ * ███ ███ ███ ███ ███ ███ ███ * ███ ███ ███ ███ █ █ ███ ███ ██...
Update dev address by the previous dev.
function dev(address _devaddr) public { require(msg.sender == devaddr, "ERROR"); devaddr = _devaddr; }
1,998,486
./partial_match/1/0xa0d7a729544A4BE2287F8943d5fdDEf5c319D81b/sources/SteroidsGame.sol
Internal function for checking if the trigger action has occured at least K times in total times_ - the K number of days return true if the trigger action has occured at least K times, else - false potential winner
function _triggerActionForAtLeastKTimes( uint256 times_ ) private view returns (bool) { if (maxWinCount >= times_) return true; else if (maxWinCount == times_ - 1) { for (uint256 i; i < settings.tokenCount; ) { address curToken = tokens[i]; if ...
4,490,482
./full_match/5/0xDF3CFaB2De111ba9b1fEc84977e09E6c3077705F/sources/contracts/staking/StakingContract.sol
Zero out the user's rewards balance Re-add the remainder of the rewards to the user's balance Check if the claimed reward amount is greater than or equal to the remaining balance
function claimRewards() public nonReentrant updateReward(msg.sender) { uint256 originalReward = rewards[msg.sender]; uint256 rewardTokenBalance = address(this).balance; if (originalReward > 0 && rewardTokenBalance > 0) { uint256 transferredReward = (originalReward > rewardTokenB...
1,932,166
./full_match/43113/0x3a7EfC389459dfF7166AE1B482a63ce2FFCDF61F/sources/contracts/avax.sol
Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IBEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ...
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "JHL: decreased allowance below zero"); unchecked { _approve(_msgSender...
7,180,687
./partial_match/1/0xDa685c7E34Cc7c67fBC3cDf4E7D38bB024e999bF/sources/TokenLockerV1.sol
withdraw all of the deposited token/
function withdraw() external onlyOwner transferLocked { require(uint40(block.timestamp) >= _unlockTime, "Wait until unlockTime to withdraw "); _token.transfer(_owner(), _balance()); emit Withdrew(); }
16,178,684
./partial_match/1/0x45791a9Dd7fdD086ADaab9edb75057660ddfF5A1/sources/ERC1155Base.sol
Check registry code length to facilitate testing in environments without a deployed registry.
function _checkFilterOperator(address operator) internal view virtual { if (operatorRestriction) { if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(op...
2,592,719
./full_match/80001/0x9a783aaE3780E922Ee628a319687Ccd8c630Fd29/sources/contracts/NextEcommerce.sol
Buscar el producto por su identificador
function buyProduct( bytes32 _pId ) external payable returns (string memory message) { Product storage product = products[0]; for (uint256 i = 0; i < numberOfProducts; i++) { if (products[i].pId == _pId) { product = products[i]; break; ...
5,598,856
pragma solidity ^0.5.3; import "testeth/Log.sol"; import "testeth/Assert.sol"; import "testeth/Account.sol"; contract Factory { event Deployed(address addr, uint256 salt); function deploy1SignerWallet(uint256 threshold, address signatory) public returns (address payable addr) { assembly { // Multisig W...
EIP712 Transaction Hash
function check_b1_buildHash_testSameWithValidNonce_useAccount1() public { recordData = "\x19\x01\x01"; data = abi.encodeWithSelector(bytes4(0x7214ae99), address(recorder), recordData); hash = keccak256(abi.encodePacked( "\x19\x01", bytes32(0xb0609d81c5f719d8a516ae2f25079b20fb63da3e07590e23fbf0...
6,460,298
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import { LibDiamondCut } from "./diamond/LibDiamondCut.sol"; import { DiamondFacet } from "./diamond/DiamondFacet.sol"; import { OwnershipFacet } from "./diamond/OwnershipFacet.sol"; import { LibDiamondStorage } from "./diamond/...
Reads a uint256 value from a position in a byte array. b Byte array containing a uint256 value. index Index in byte array of uint256 value. return result uint256 value from byte array.
function readUint256(bytes memory b, uint256 index) internal pure returns (uint256 result) { result = uint256(readBytes32(b, index)); return result; }
1,813,777