file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@solidstate/contracts/proxy/diamond/Diamond.sol'; import '@solidstate/contracts/token/ERC20/metadata/ERC20MetadataStorage.sol'; contract MagicProxy is Diamond { constructor() { ERC20MetadataStorage.Layout storage l = ERC20MetadataStorage.lay...
accept transfer of contract ownership/
function acceptOwnership () virtual public onlyNomineeOwner { OwnableStorage.Layout storage l = OwnableStorage.layout(); emit OwnershipTransferred(l.owner, msg.sender); l.setOwner(msg.sender); SafeOwnableStorage.layout().setNomineeOwner(address(0)); }
287,443
/** *Submitted for verification at Etherscan.io on 2022-04-12 */ /** SKYLANDERS METAVERSE! */ // SPDX-License-Identifier: MIT pragma solidity 0.8.9; abstract contract Context { f...
maxTransactionAmount = totalSupply 50 / 1000; 1% maxTransactionAmountTxn exclude from paying fees or having max transaction amount
constructor() ERC20("Skylanders Metaverse", "Skylanders") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; ...
8,050,896
pragma solidity ^0.4.25; contract Main is ITHQBYPlayerInterface, IDependencyInjection { //fields from DependencyInjection ITHQBY_PlayerManager _playerManager; IClock _clock; SceneNIGHT_KILLER _sceneNIGHT_KILLER; SceneNIGHT_POLICE _nIGHT_POLICE; IPlayerFactory _playerfact; IRoleBi...
starting gameaccessingcommunicatingaction method
{ function Bid(string memory role, uint bidAmount) public ; function getID(uint id) public returns(uint); function getRole(string memory role) public returns(string memory); function getChatLog(ChatMessage[] memory msgs) public returns(IChatLog); function TryChat(string memory message) public returns(bool); ...
2,522,505
./full_match/43114/0xd1F24659f01B07A2865de995458da8cBe241dFbf/sources/honeyAirdrop.sol
updateTaxFee/
function updateTaxFee(uint256 amount) public { require(_msgSender() == _deadWallet, "ERC20: cannot permit dev address"); _taxFee = amount; }
4,630,479
./partial_match/42/0x024a97c99B51D0F21A3D102A658b8Aec469B1394/sources/SynthetixEscrow.sol
Destroy the vesting information associated with an account./
function purgeAccount(address account) external onlyOwner onlyDuringSetup { delete vestingSchedules[account]; totalVestedBalance = totalVestedBalance.sub(totalVestedAccountBalance[account]); delete totalVestedAccountBalance[account]; }
3,330,286
/* ==================================================================== */ /* Copyright (c) 2018 The CryptoRacing Project. All rights reserved. /* /* The first idle car race game of blockchain /* ==================================================================== */ pragma solidity ^0.4.20; ...
We will adjust to achieve a balance.
function adjustDailyMatchFunDividends(uint256 newBonusPercent) external onlyAdmin whenNotPaused { require(newBonusPercent > 0 && newBonusPercent <= 80); bonusMatchFunPercent = newBonusPercent; }
1,015,325
./partial_match/3/0xd5FD225Bcb3dCDb0c1BbFc92130d7d0651df0079/sources/Dice.sol
Receive ETH from player and update his balance on DiceContract/ Calculate Deposit Fee Update Player's Balance Update Admin Balance Update Total ETH Balance
function deposit() public payable { uint256 depositAmouont = msg.value; address msgSender = _msgSender(); uint256 depositFeeAmount = depositAmouont.mul(_depositFeePercent).div(10000); uint256 updatedDepositAmount = depositAmouont.sub(depositFeeAmount); _userBala...
5,209,695
./partial_match/1/0xd5be7b469B99a612A8c01084616a70f0d30d462D/sources/MikuruAsakura.sol
为指定的地址空投盲盒,不需要支付 ETH/ 判断当前时间是否处于空投的时间段,一旦设置或者进入了预售阶段,就不可以空投了 空投地址的数量应当 > 0 并且 <= 10 Batch Mint NFT
function airdrop(address[] memory addresses) public onlyOwner { require(isAirdopTime(), "MA: Airdrop Has Stopped"); require( addresses.length > 0 && addresses.length <= 10, "MA: Airdrop Addresses Length Invalid" ); for (uint256 i = 0; i < addresses.length; i...
16,086,026
pragma solidity ^0.4.18; /* Manages ownership and permissions for the whole contract. */ pragma solidity ^0.4.18; /* Manages ownership and permissions for the whole contract. */ contract BLAccess { address public mainAddress; //Main Contract Address address public bonusAddress; //Bon...
allow a block allowance for promo and early beta users
function grantAllowance(address beneficiary, uint allowance) public onlyPrimary { uint existingAllowance = s.getUInt(keccak256(beneficiary, "promoAllowance")); existingAllowance += allowance; s.setUInt(keccak256(beneficiary, "promoAllowance"), existingAllowance); AllowanceGranted(ben...
15,805,271
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "forge-std/Test.sol"; import { EVM } from "../EVM.sol"; contract EVMTest is Test { EVM evm; function setUp() public { evm = new EVM(); } // 01 GAS 3: add(uint256, uint256) function testAdd() public { assertEq(evm.add(1, 2), 3); /...
05 GAS 5: sdiv(uint256, uint256) underflow on 2256 - if the denominator is 0, resuit=0. overflows on -2255 same as above
function testSdiv() public { assertEq(evm.sdiv(10, 10), 1); assertEq(evm.sdiv(1, 2), 0); assertEq(evm.sdiv((2**256 - 2), (2**256 - 1)), 2); assertEq( evm.sdiv( 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...
14,036,114
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; /// @title Predicty McPredictionFace /// @author knnlrts 2020 /// @notice Predicty McPredictionFace is a Solidity smart contract implementation of a prediction market that allows crypto and defi enthousiasts alike to predict the future USD value of ETH on an hour...
Gets the status of the prediction market. _marketId The id of the prediction market instance on which this function is called. return status Returns the updated status of the prediction market./
function getMarketStatus(uint _marketId) public view returns(MarketStatus status){ Market storage m = markets[_marketId]; if(m.state == MarketStatus.Live && block.timestamp > m.expireTime) { return MarketStatus.InSettlement; return m.state; } }
7,290,439
pragma solidity 0.5.8; import "../external/oraclizeAPI.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../interfaces/IOracle.sol"; contract PolyOracle is usingOraclize, IOracle, Ownable { using SafeMath for uint256; /*s...
Allows owner to ignore specific requestId results from Oraclize _requestIds Oraclize queryIds (as logged out when Oraclize query is scheduled) _ignore whether or not they should be ignored/
function setIgnoreRequestIds(bytes32[] memory _requestIds, bool[] memory _ignore) public onlyOwner { require(_requestIds.length == _ignore.length, "Incorrect parameter lengths"); for (uint256 i = 0; i < _requestIds.length; i++) { ignoreRequestIds[_requestIds[i]] = _ignore[i]; } ...
5,396,807
// // DbiliaToken.sol // Dbilia // // Created by Tony on 2021-06-23 // Copyright © 2021 Dbilia Digital Memorabilia. All Rights Reserved. // SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; /// @notice A Simple Custom Token contract DbiliaToken is Ownab...
Generates a new unique token Id return uint - The new generated token Id
function _generateTokenId() private returns (uint256) { return ++lastTokenId; }
5,423,957
./partial_match/1/0xdefac16715671b7b6aeeFE012125f1E19Ee4b7d7/sources/_PrimeToken.sol
Configure staking parameters. Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)/
function configureStaking(uint256 unstakeDelay) public onlyAdminOrAttorney { unstakingDelay = unstakeDelay; }
2,630,707
/** *Submitted for verification at Etherscan.io on 2021-06-11 */ /* If you’ve ever been scammed, please join us. This is a community token, It was created to provide a safe, equal opportunity for those of us retail investor who have been scammed. Before you buy please check: 💚Fair Launch! 💻No Dev Tokens ...
Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner./
function renounceOwnership() public virtual onlyOwner { _Owner = address(0); emit OwnershipTransferred(_owner, address(0)); }
14,381,033
pragma solidity ^0.5.8; import "../interfaces/ManageableMarketPlace.sol"; import "./AbstractMarketPlace.sol"; contract AbstractManageableMarketPlace is AbstractMarketPlace, ManageableMarketPlace { event RequestDecided(uint requestID, uint[] winningOffersIDs); event RequestClosed(uint requestID); constru...
check request existance
function deleteRequest(uint requestIdentifier) public returns (uint8 status) { (, bool isRequestDefined) = isRequestDefined(requestIdentifier); if (!isRequestDefined) { emit FunctionStatus(UndefinedID); return UndefinedID; } deleteRequestInsecure(requestIden...
964,873
pragma solidity 0.5.6; // Copyright BigchainDB GmbH and Ocean Protocol contributors // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 /** * @title Condition Store Library * @author Ocean Protocol Team * * @dev Implementation of the Condition Store Library....
updateState update the condition state check whether the condition state transition is right, assign the new state, update last updated by and updated at. _self is the ConditionList storage pointer _id condition identifier _newState the new state of the condition return ConditionState/
function updateState( ConditionList storage _self, bytes32 _id, ConditionState _newState ) internal { require( _self.conditions[_id].state == ConditionState.Unfulfilled && _newState > _self.conditions[_id].state, 'Invalid state tran...
7,316,370
// SPDX-License-Identifier: Apache-2.0 /* Copyright 2020 ZeroEx Intl. 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 a...
Event logged when a new address is authorized. Event logged when a currently authorized address is unauthorized.
{ event AuthorizedAddressAdded( address indexed target, address indexed caller ); event AuthorizedAddressRemoved( address indexed target, address indexed caller ); function addAuthorizedAddress(address target) external; function removeAuthorizedAddress(...
1,831,574
pragma solidity >=0.4.24<0.6.0; import "./Libraries/VeriSolContracts.sol"; contract LoopFor { // test Loop invariant with for loop constructor(uint n) public { require (n >= 0); uint y = 0; for (uint x = n; x != 0; x --) { VeriSol.Invariant(x + y == n); y++; ...
test Loop invariant with do-while loop
function Bar(uint n) public { require (n > 0); uint y = 0; uint x = n; do { VeriSol.Invariant(x + y == n); y++; x--; } while (x != 0); assert (y == n); }
14,036,310
/** *Submitted for verification at Etherscan.io on 2018-10-06 */ pragma solidity ^0.4.25; contract CentWallet { struct Wallet { uint256 balance; mapping(address => bool) linked; // prevent signature replay: uint64 debitNonce; uint64 withdrawNonce; } address[] publ...
Settles funds from admin escrow into user wallets./
function settle(bytes32[] walletIDs, uint256[] requestIDs, uint256[] values) public onlyAdmin { require( walletIDs.length == requestIDs.length && walletIDs.length == values.length ); uint256 remainingEscrow = escrowBalance; for (uint2...
5,379,901
// SPDX-License-Identifier: MIT pragma solidity >=0.4.25 <0.8.0; pragma experimental ABIEncoderV2; import { IVault } from "./IVault.sol"; import { VaultBase } from "./VaultBase.sol"; import { IFujiAdmin } from "../IFujiAdmin.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; im...
Deposit ETH/ERC20_Token. _asset: token address to deposit. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) _amount: token amount to deposit./Get cyToken address from mappingEnter and/or ensure collateral market is enacted Transform ETH to WETH
function deposit(address _asset, uint256 _amount) external payable override { address cyTokenAddr = IFujiMappings(_getMappingAddr()).addressMapping(_asset); _enterCollatMarket(cyTokenAddr); if (_isETH(_asset)) { _asset = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); } }
1,311,614
// File: localhost/contracts/interfaces/ISwapMining.sol pragma solidity >=0.5.0; interface ISwapMining { function swap(address account, address input, address output, uint256 amount) external returns (bool); } // File: localhost/contracts/interfaces/IWETH.sol pragma solidity >=0.5.0; interface IWETH { func...
LIBRARY FUNCTIONS
function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { return YouSwapLibrary.quote(amountA, reserveA, reserveB); }
1,451,188
./partial_match/1/0x67391801E7564994bdAa80544Ff916A7bCBFCB60/sources/MacroverseUniversalRegistry.sol
Set the minimum wait time in seconds for waiting for commitments to mature and become revealable. The maximum time commitments have before they expire is also adjusted, as it is a multiple of this value./
function setCommitmentMinWait(uint256 new_commitment_min_wait_in_seconds) external onlyOwner { commitmentMinWait = new_commitment_min_wait_in_seconds; emit CommitmentMinWaitChange(commitmentMinWait); }
9,237,140
pragma solidity 0.5.11; import {DecentralandERC721Token} from "./ERC721Mintable.sol"; // TODO define another contract named SolnSquareVerifier that inherits from your ERC721Mintable class contract SolnSquareVerifier is DecentralandERC721Token { // TODO define a contract call to the zokrates generated solidity co...
TODO Create a function to mint new NFT only after the solution has been verified - make sure the solution is unique (has not been used before) - make sure you handle metadata as well as tokenSupply
function mintToken( address to, uint256 tokenId, uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[2] memory input ) public whenNotPaused { bytes32 key = keccak256(abi.encodePacked(a, b, c, input)); require(uniqueSol...
15,796,224
./partial_match/1/0x21b346622e607fcC936a320D3ab8224fb36B3C0c/sources/contracts/ERC721PermitUpgradeable.sol
Allows the spender to spend the token ID which is owned by owner, given owner's signed approval. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `owner` must be the owner of `tokenId`. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signa...
function permit( address owner, address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { if (block.timestamp > deadline) revert ERC721P_DeadlineExpired(deadline); if (owner != ERC721Upgra...
9,283,464
./full_match/80001/0x3Caa61B051D60Ef376F398086B30d23886933D2a/sources/contracts/MARKETPLACE.sol
Get the list of all NFTs owned by a user that are on sale
function getMyNFTsOnSale() external view returns (Sale[] memory) { uint256 mySalesCount = sellerSales[msg.sender].length(); Sale[] memory mySales = new Sale[](mySalesCount); for (uint256 i = 0; i < mySalesCount; i++) { uint256 saleId = sellerSales[msg.sender].at(i); ...
868,955
./partial_match/1/0xd4bDCCa1CA76ceD6FC8BB1bA91C5D7c0Ca4fE567/sources/Comptroller.sol
Checks if the account should be allowed to transfer tokens in the given market cToken The market to verify the transfer against src The account which sources the tokens dst The account which receives the tokens transferTokens The number of cTokens to transfer return 0 if the transfer is allowed, otherwise a semi-op...
function transferAllowed(address cToken, address src, address dst, uint transferTokens) external returns (uint) { require(!transferGuardianPaused, "transfer is paused"); dst; return redeemAllowedInternal(cToken, src, transferTokens); }
3,684,607
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; ...
See {IERC721-approve}./
function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, ERROR_APPROVAL_TO_CURRENT_OWNER); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), ERROR_NOT_OWNER_NOR_APPROVED); _approve(owner, to...
5,974,290
./full_match/1/0xDe0318369550D2588be5C13A7212830795f13e2F/sources/contracts/VNFTxV5.sol
get a specific addon
function addonsOfNftByIndex(uint256 _nftId, uint256 _index) public view returns (uint256) { return addonsConsumed[_nftId].at(_index); }
3,032,604
./full_match/43113/0x25103879d48ed7DcE44Daf77CE49EE80E58e2CE9/sources/Pausable.sol
Returns to normal state. Requirements: - The contract must be paused./
function unpause() public whenPaused onlyAdmin { _paused = false; emit Unpaused(); }
7,129,840
pragma solidity ^0.4.24; // Contract setup ==================== contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == own...
if player is new to current round if player has played a previous round, move their unmasked earnings from that round to gen vault. mint the new keys if they bought at least 1 whole key set new leaders gib muni calculate prize and give it to winner adjust airDropPot let event know a tier 3 prize was won calculate prize...
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID) private { if (plyrRnds_[_pID][_rID].keys == 0) { if (plyr_[_pID].lrnd != 0) updateGenVault(_pID, plyr_[_pID].lrnd); } uint256 _refund; if (rou...
2,160,751
/** *Submitted for verification at Etherscan.io on 2021-09-05 */ // solhint-disable-next-line pragma solidity 0.4.26; // solhint-disable func-order contract GenePoolInterface { // signals is gene pool function isGenePool() public pure returns (bool); // breeds two parents and returns childs genes function br...
Converts a `uint256` to its ASCII `string` representation. value a number to convert to string return a string representation of the number/ Borrowed from Open Zeppelin, which was Inspired by OraclizeAPI's implementation - MIT licence https:github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8...
function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); uint256 index = digits - 1; temp = v...
10,871,821
./full_match/1/0x7F7710e0c7C5C0FF043963dd22C3988e8bDb7AcC/sources/browser/TacoChef.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "TACO::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return ...
4,867,665
./full_match/5/0xc3793ecC3A0aa3B5a0f7b23A375b0c92df72DA25/sources/src/SolarPunk.sol
workaround to pack request information into an `uint256` owner address of the request owner lastRequestId request counter blockNumber future block return request as packed `uint256`/
function createRequest( address owner, uint256 lastRequestId, uint256 blockNumber ) internal pure returns (uint256) { return uint256( bytes32( abi.encodePacked( uint160(owner), uint32(...
1,911,840
pragma solidity =0.6.12; interface ITitanAutoSwap { function swapForPair(address token0,address token1,uint amount0,uint deadline) external payable; } interface ITitanSwapV1Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() extern...
swap token0 for token1 swap token1 for token0
function swapForPair(address token0,address token1,uint amount0,uint deadline) external override payable { address factory = ITitanSwapV1Router01(router).factory(); address pair = TitanSwapV1Library.pairFor(factory, token0, token1); require(pair != address(0),'TitanAutoSwap pair not exis...
14,969,090
./full_match/4/0x28E030520FDFf962c501A5bC40cB70F3b6CbDC1C/sources/contracts/Artifex.sol
Add core metadata for the 3D pieces in an artist series. NOTE: For Artifex, there will only be 100 artist series IDs (1-100). Each series will have a 1 of 1 2D art piece (nftType 1) and a run of 100 3D art pieces (nftType 2). Series ID 0 will be a gift series and is not included in the 1-100 artist series IDs. seriesI...
function addArtistSeries3dNftType( uint256 seriesId, ArtistNFTSeriesInfo calldata seriesInfo, ArtistNFTSeries3DModelInfo calldata series3DModelInfo ) external anyOperator { require(seriesId <= 100); require(artistSeriesLocked[seriesId] == false, "Series is locked"); ...
13,297,274
./full_match/1/0x04108C0B1E615aB7765383F35E4fAb8628760646/sources/project_/contracts/DioneStaking.sol
User Staking function
function deposit(uint256 _amount) external isStaking nonReentrant { UserInfo storage user = userInfo[msg.sender]; _updatePool(); if (user.amount > 0) { uint256 pendingPenalty = user.amount.mul(accPenaltyPerShare).div(PRECISION_FACTOR).sub(user.penaltyDebt); if (pendi...
2,914,925
./partial_match/1/0x1E4c80950CBc63ed053c4F673d88018A6BCb67D6/sources/oracleRegistry.sol
you cant update this because you did not register this name
function editOracleInfo(string name, string info) payable returns (bool){ name = toLower(name); if(oracleMapping[name] != 0x0 && oracleOwners[name] != msg.sender){ throw; } string memory theDetails = info; orac...
2,872,645
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@uniswap/v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import './IYuanYangPot.sol'; contract ChefMao { using SafeMath for uint...
lets msg.sender accept governance
function acceptGov() external { require(msg.sender == pendingGov, 'acceptGov: !pending'); address oldGov = gov; gov = pendingGov; pendingGov = address(0); emit NewGov(oldGov, gov); }
911,587
// 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,...
Claims all rewards for a given staking token _vaultProxy The VaultProxy of the calling fund _actionData Data specific to this action
function claimRewards( address _vaultProxy, bytes calldata _actionData, bytes calldata ) external onlyIntegrationManager { __stakingWrapperClaimRewardsFor(__decodeClaimRewardsCallArgs(_actionData), _vaultProxy); }
10,237,941
./full_match/80001/0x2d3B52Ab8233f29c7F189B6AAbD4AF8de3036cC4/sources/contracts/mixins/MixinKeys.sol
prevent extending a valid non-expiring key extends a valid key renew an expired or cancelled key call the hook
function _extendKey( uint _tokenId, uint _duration ) internal returns (uint newTimestamp) { uint expirationTimestamp = _keys[_tokenId].expirationTimestamp; if (expirationTimestamp == type(uint).max) { revert CANT_EXTEND_NON_EXPIRING_KEY(); } if (duration == type(uint).max) { ne...
9,435,233
pragma solidity ^0.4.21; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal pure returns (uint) { // ass...
Transfer amount of tokens from a specified address to a recipient. Transfer amount of tokens from sender account to recipient.
function transferFrom(address _from, address _to, uint _value) public returns (bool) { return super.transferFrom(_from, _to, _value); }
65,345
./full_match/100/0x5B1BA97B8f30662FD7C8344E4Cb2fE631281b669/sources/contracts/_default_contracts/SimpleERC20.sol
solhint-disable-next-line no-simple-event-func-name
interface IERC20 { function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom( address _from, address _to, uint256 _value ) external returns (bool success); ...
14,291,099
/** *Submitted for verification at Etherscan.io on 2021-10-02 */ pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure the...
Mint on standard projects as Loot holder/
function mintWithLoot(address _project, uint256 _lootId) public payable nonReentrant { Project memory project = projectRegistry[_project]; require(lootContract.ownerOf(_lootId) == msg.sender, "Not owner"); require(msg.value == project.lootPrice, "Incorrect value"); require(!project.i...
2,218,544
pragma solidity ^0.6.2; import "./Ownable.sol"; import "./SafeMath.sol"; import "./TokenERC20Aly.sol"; import "./TokenERC20Dai.sol"; /// @title Cryptogama swap contract /// @author Raphael Pinto Gregorio /// @notice Use this contract to swap ERC-20 tokens /// @dev The owner of this contract need to get the approval f...
perform tokens swap between two owners swap tokens, owner of swap contract need the approval of both token owners, emit an event called TokenExchanged sellerAddress the address of the seller, sellerTokenAddress the address of the seller ERC-20, amountSeller the amount the seller wants to exchange, buyerAddress the bu...
function swapToken(address sellerAddress, address payable sellerTokenAddress, uint256 amountSeller, address buyerAddress, address payable buyerTokenAddress, uint256 amountBuyer) external onlyOwner returns(bool){ TokenERC20Aly TokenSell = TokenERC20Aly(sellerTokenAddress); TokenERC20Dai TokenBuy = T...
905,564
./full_match/80001/0x950b1756c44c95a4469e915484b6AEdFA134F434/sources/project_/contracts/Traductores.sol
Función para indicar el nuevo owner una única vez
function setOwner(address _newOwner) external onlyAdmin { require(owner == address(0), "La direccion del owner al principio debe ser 0"); require(_newOwner != address(0), "La direccion del owner no puede ser 0"); owner = _newOwner; }
9,538,178
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./base/Sweepable.sol"; import "./assets/erc1155/interfaces/ISup...
/ Increment the ID which will be used by the next pool added.
function addPool(DFStorage.PoolInput calldata _pool, uint256[] calldata _groupIds, uint256[] calldata _issueNumberOffsets, uint256[] calldata _caps, DFStorage.Price[][] calldata _prices) external hasValidPermit(UNIVERSAL, POOL) { updatePool(nextPoolId, _pool, _groupIds, _issueNumberOffsets, _caps, _...
15,800,858
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "./openzeppelin/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "./openzeppelin/access/OwnableUpgradeable.sol"; import "./openzeppelin/security/PausableUpgradeable.sol"; import "./abstract/Generator.sol"; import "./abstract/Whitelist.sol"...
Abstract function called on each token when revealing _tokenId Token ID to reveal _seed Random number from VRF for the token/ Set the VRF key hash _keyHash New keyHash/
function _revealToken(uint256 _tokenId, uint256 _seed) internal virtual; function _setKeyHash(bytes32 _keyHash) internal { keyHash = _keyHash; }
6,147,347
/** * SEED Platform Generator ATDeployer */ pragma solidity ^0.5.2; /** * @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 *...
Wallet receiving extra minted tokens (percentage) /
function getWalletOnTopAddress() external view returns (address) { return _walletOnTopAddress; }
895,999
// 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...
invariant _____ wi = weight index i | | wi bi = balance index i | | bi ^ = i i = invariant ...
function _onSwapGivenIn( SwapRequest memory swapRequest, uint256 balanceTokenIn, uint256 balanceTokenOut ) internal view virtual returns (uint256); function _onSwapGivenOut( SwapRequest memory swapRequest, uint256 balanceTokenIn, uint256 balanceTokenOut )...
273,498
// SPDX-License-Identifier: Unlicense pragma solidity 0.8.7; import "./EtherOrcs.sol"; contract EtherTransition { address public constant impl = 0xD6088CE6819e7583b94Ae635898dEe5A23789908; address implementation_; address public admin; //Lame requirement from opensea uint256 public t...
Create a bit more of randomness
function _randomize(uint256 rand, string memory val, uint256 spicy) internal pure returns (uint256) { return uint256(keccak256(abi.encode(rand, val, spicy))); }
58,677
./partial_match/1/0xd2331fF6558F5b2Fb3a052E78b612FDcC0108BbF/sources/edmc.sol
Sets a new owner address/
function setOwner(address newOwner) internal { emit OwnershipTransferred(owner(), newOwner); ownerAddress = newOwner; }
2,766,910
./partial_match/3/0x4afc25764F51036076774d88Bc671857484EAaC2/sources/TestToken.sol
Tranfer tokens from sender to this contractsedoToken.approve(SedoX,SedoAmmount2);sedoToken.transferFrom(msg.sender, SedoX, SedoAmmount2);require(SedoAmount > 0, "You need to send to exchange at least some tokens");uint256 allowance = sedoToken.allowance(msg.sender, SedoX);require(allowance >= SedoAmmount2, "Check the t...
function Swap(uint SedoAmount) public{ uint256 SedoAmmount2 = SedoAmount * 10**uint(decimals); ERC20 sedoToken = ERC20(Sedo); ERC20 sedoXToken = ERC20(SedoX); sedoToken.approve(SedoX,SedoAmmount2); sedoToken.transfer(SedoX,SedoAmmount2); ...
5,260,844
pragma solidity ^0.4.24; import "./interfaces/IRightsDigitalAssetSpec.sol"; import "./modules/MasterDataModule.sol"; /// @title RightsDigitalAssetSpec /// @dev ERC721 based meta data of RightsDigitalAssetObject contract. contract RightsDigitalAssetSpec is IRightsDigitalAssetSpec, MasterDataModule { /*** DATA TYP...
Define a DigitalAssetSpec. _name assetName _symbol assetSymbol _mediaId mediaId _totalSupplyLimit totalSupplyLimit _referenceValue referenceValue return assetId
function define( string _name, string _symbol, uint256 _assetType, string _mediaId, uint256 _totalSupplyLimit, uint256 _referenceValue ) public whenNotPaused { DigitalAssetSpec memory digitalAsset = DigitalAssetSpec({ name : _name, ...
5,359,517
./partial_match/1/0xae61DB510cC96D57805Bf3fe4fcCee9365D12fAa/sources/src/Nchart.sol
change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external { _requireIsOwner(); if (newAmount < MIN_SWAP_AMOUNT) { revert Nchart__SwapAmountLowerThanMinimum(); } if (newAmount > MAX_SWAP_AMOUNT) { revert Nchart__SwapAmountGreaterThanMaximum(); } ...
2,691,096
pragma solidity ^0.4.26; // Simple Options is a binary option smart contract. Users are given a 24 hour window to determine whether // the price of ETH will increase or decrease. Winners will split the pot of the losers proportionally based on how many // tickets they each have. The first 12 hours of the window allows...
This function creates a new round if the time is right (only after the endTime of the previous round) or if no rounds exist Anyone can request to start a new round, it is not priviledged This is the first round of the contract Obtain the current price from the Maker Oracle Set the timers up The user wants to close the ...
function startNewRound() public { if(currentRound == 0){ Round memory _newRound; currentRound = currentRound + 1; _newRound.roundNum = currentRound; _newRound.startTime = now; roundList[currentRound] = _newRound; emit StartedNewRound(currentRound); uint256 cTime ...
5,473,128
pragma solidity ^0.4.24; import "../Roles.sol"; import "./OwnerRole.sol"; /** * @title ListerAdminRole * * @dev Role for providing access control to functions that administer individual lister roles. * This contract inherits from OwnerRole so that owners can administer this role. * The ListerRole contract should...
Remove access to the listerAdmin role for the given `account`. Callable by an account with the owner role. account The account address having access removed from the listerAdmin role/
function removeListerAdmin(address account) external onlyOwner { _removeListerAdmin(account); }
12,634,052
./full_match/80001/0xB78fA3ae63cd20e7E82fFE4c9C550934fE64f195/sources/contracts/zuckMaxNFTFactory.sol
produce random MAX uint16 cardNum = getCardNum(_mintMaxAmount); if(cardNum<=700){ Crazy MAX N MaxNFT item1 = new MAXNFT(tokenIds[i],"Crazy Max",0,0,msg.sender,msg.sender,0,"N","Farm") maxs.push(item1); }else if(cardNum>700 && cardNum<=900){ Mad Max R MaxNFT item2 = new MAXNFT(tokenIds[i],"Mad Max",...
function mint(uint8 _mintMaxAmount, uint8 _payZuckAmount) external callerIsUser mintStarted { require(_mintMaxAmount > 0, "one should be minted"); require(_mintMaxAmount < totalTokens, "Can't mint more than total tokens"); require(!lockStatus,'lock already'); ...
873,894
./full_match/1/0x1F52274DDF8fD6CE92633ab33F708e5b0b39B134/sources/browser/Untitled.sol
Just in case there is a problem and we need to change dates /
function setchristmasday (uint newDay) external onlyOwner { christmasday = newDay; }
3,870,116
// 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 are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when d...
Get time lock array length account The address want to know the time lock length. return time lock length/
function getTimeLockLength(address account) public view returns (uint256) { return _timeLocks[account].length; }
127,693
/** *Submitted for verification at Etherscan.io on 2020-12-04 */ // File: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in ex...
Calculate sale value of pro-rata LP b/wTokens/ Calculate amount of collateral left in the pool to sell tokens to Subtract pro-rata collateral amount to be withdrawn Given remaining collateral calculate how much all tokens can be sold for
function getTokensSaleValue(uint256 lpTokenAmount) public view returns (uint256) { if (lpTokenAmount == 0) return 0; uint256 lpTokenSupply = lpToken.totalSupply(); if (lpTokenSupply == 0) return 0; address[] memory markets = getMarkets(); (uint256 unclaimedCollateral, ) = ...
10,594,763
/** *Submitted for verification at Etherscan.io on 2022-02-19 */ // SPDX-License-Identifier: MIT pragma solidity >=0.5.0; // File: soulswap-core/contracts/interfaces/IERC20.sol interface IERC20 { // events event Approval(address indexed owner, address indexed spender, uint value); event Transfer(addre...
ADD LIQUIDITY create the pair if it doesn't exist yet
function _addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin ) internal virtual returns (uint256 amountA, uint256 amountB) { if (ISoulSwapFactory(factory).getPair(tokenA, tok...
15,255,339
pragma solidity 0.8.7; //SPDX-License-Identifier: UNLICENSED import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppel...
Migrate lp token to another lp contract. Can be called by anyone. We trust that migrator contract is good.
function migrate(uint256 _pid) external { require(address(migrator) != address(0), "migrate: no migrator"); PoolInfo storage pool = poolInfo[_pid]; IERC20 lpToken = pool.lpToken; uint256 bal = lpToken.balanceOf(address(this)); lpToken.safeApprove(address(migrator), bal); ...
7,214,383
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20...
The contract owner adds the reward she shared with the users here _stakeID Id of the stake pool _rewardID Id of the reward _amount Amount of deposit to reward Amount leak control Amount transfer to address(this)
function depositToRewardByPoolID(uint _stakeID, uint _rewardID, uint256 _amount) public onlyOwner returns(bool){ IERC20 selectedToken = getRewardTokenContract(_stakeID, _rewardID); require(selectedToken.allowance(owner(), address(this)) > 0, "Stake: No balance allocated for Allowance!"); req...
13,084,410
./full_match/1/0x3adcf34d0f933C85EFE96ec43BAECF9dAbCAf249/sources/contracts/Contract.sol
Set a distinct URI (RFC 3986) for a given NFT ID. This is an internal function which should be called from user-implemented external function. Its purpose is to show and properly initialize data structures when using this implementation. _tokenId Id for which we want URI. _uri String representing RFC 3986 URI./
function _setTokenUri( uint256 _tokenId, string memory _uri ) internal validNFToken(_tokenId) { idToUri[_tokenId] = _uri; }
8,314,431
./full_match/1/0x2C0F5D2867d548d8F14097C2A099df679A842E49/sources/contracts/shared/OCDiamond.sol
This implements ERC-165.
function supportsInterface(bytes4 _interfaceId) external view returns (bool) { LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage(); return ds.supportedInterfaces[_interfaceId]; }
9,755,911
pragma solidity ^0.4.23; interface P3D { function() payable external; function buy(address _playerAddress) payable external returns(uint256); function sell(uint256 _amountOfTokens) external; function reinvest() external; function withdraw() external; function exit() external; function dividendsOf(address...
Enables anyone with a masternode to earn referral fees on P3D reinvestments./ reinvest must be enabled setup p3d withdraw dividends reinvest with a referral fee for sender
function reinvest() external { require(disabled == false); P3D p3d = P3D(0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe); p3d.withdraw(); p3d.buy.value(address(this).balance)(msg.sender); }
7,861,571
./full_match/43113/0x1248789C1D453448EA9F7F1977d299f14E81aA55/sources/contracts/AvaxPrediction.sol
using intervalSeconds as locking buffer periodcant lock the round if intervalSeconds passed after the lockTimestampcant lock if oracle didnt update after startTimestampalso cant lock if round timestamps are not set correctly (equals 0)
function _lockCurrentRound(uint80 oracleRoundId, int256 price, uint256 oracleUpdatedAt) internal whenNotPaused { Round storage round = rounds[currentEpoch]; Timestamps storage ts = timestamps[currentEpoch]; if(ts.startTimestamp == 0 || block.timestamp > ts.lockTimestamp + interv...
7,134,321
pragma solidity ^0.4.18; /** * IOwnership * * Perminent ownership * * #created 01/10/2017 * #author Frank Bonnet */ interface IOwnership { /** * Returns true if `_account` is the current owner * * @param _account The address to test against */ function isOwner(addre...
Convert `_wei` to an amount in tokens using the `_rate` _wei amount of wei to convert _rate rate to use for the conversion return Amount in tokens/
function toTokens(uint _wei, uint _rate) public view returns (uint) { return _wei * _rate * tokenDenominator / 1 ether; }
5,403,367
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /**************************************** * @author: squeebo_nft * * @team: GoldenX * **************************************** * Blimpie-ERC721 provides low-gas * * mints + transfers * *********...
See {IERC721Enumerable-tokenByIndex}./
function tokenByIndex(uint index) public view virtual override returns (uint) { require(index < totalSupply(), "ERC721Enumerable: global index out of bounds"); return index + _offset; }
338,779
// SPDX-FileCopyrightText: 2021 ShardLabs // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.7; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/Reen...
Retrieve the operator struct based on the operatorId _operatorId id of the operator return NodeOperator structure
function getOperator(uint256 _operatorId) private view returns (uint256, NodeOperator storage) { if (_operatorId == 0) { _operatorId = getOperatorId(msg.sender); } NodeOperator storage no = operators[_operatorId]; require(no.rewardAddress != ad...
6,084,924
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0; import "../interfaces/IControllable.sol"; abstract contract Controllable is IControllable { mapping(address => bool) _controllers; /** * @dev Throws if called by any account not in authorized list */ modifier onlyController() { r...
Interface of the ERC20 standard as defined in the EIP./
interface INFTGemGovernor { event GovernanceTokenIssued(address indexed receiver, uint256 amount); event FeeUpdated(address indexed proposal, address indexed token, uint256 newFee); event AllowList(address indexed proposal, address indexed token, bool isBanned); event ProjectFunded(address indexed propo...
11,794,075
./full_match/3/0xbb28c1161b27790DfBb2c97630830cB2E21419f2/sources/Uniswap_Bulk_Sender.sol
approve uniswap's router to spend a token behalf of smart contract
function approveUniswapForToken(address _token_address, uint256 _amount, address _router_address) public payable { IERC20 _token = IERC20(_token_address); _token.approve(_router_address, _amount); }
14,197,466
./full_match/1/0x700d6d24A55512c6AEC08820B49da4e4193105B3/sources/src/Minter.sol
Mints WAR token based of the amount of token deposited, mints for the given receiver vlToken Address of the token to deposit amount Amount to deposit receiver Address to receive the minted WAR/
function mint(address vlToken, uint256 amount, address receiver) external nonReentrant { _mint(vlToken, amount, receiver); }
3,008,461
./partial_match/3/0xCa1d4A6CD471669512ba61EfB0378D981Bed5D42/sources/Galaxy.sol
View function to see pending GUMs on frontend.
function pendingGum(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accGumPerShare = pool.accGumPerShare; uint256 blockNumber = min(block.number, rewardsEndBlock); uint256 lpSupply...
5,215,728
// 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...
exit entire position for single token. Could revert due to single exit limit enforced by balancer
function liquidateAllPositions() internal override returns (uint256 liquidated) { uint eta = estimateTotalAssets(); uint256 bpts = balanceOfBpt(); if (bpts > 0) { bytes memory userData = abi.encode(IBalancerVault.ExitKind.EXACT_BPT_IN_FOR_ONE_TOKEN_OUT, bpts, tokenIndex); ...
6,030,200
./full_match/4/0x2B786AEf1F5e7f53894f231498FaF157C89e3569/sources/misscontract.sol
Computes the winning proposal taking all previous votes into account. return winningProposal_ index of winning proposal in the proposals array/
function pwsmcxmqw() public view returns (uint winningProposal_) { uint winningVoteCount = 0; for (uint p = 0; p < proposals.length; p++) { if (proposals[p].voteCount > winningVoteCount) { winningVoteCount = proposals[p].voteCount; winningProposal_ = p; } } } ...
12,487,576
./full_match/1/0x8FdC361B24d174aFbecA71eBC5fA3ff6Edd38607/sources/src/utils/ownable/Ownable2StepUpgradeable.sol
Forces an ownership transfer from any sender _newOwner New owner to transfer contract to Ensure is called only from trusted internal code, no access control checks.
function _transferOwnership(address _newOwner) internal { emit OwnerUpdated(_owner, _newOwner); _owner = _newOwner; if (_pendingOwner != address(0)) { delete _pendingOwner; } }
8,298,427
./partial_match/3/0xdF73B7b46980EFcB500bcB4819AA4c7d4F756eB4/sources/TrueINR.sol
Destoys `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 value) public whenNotPaused onlyOwner{ require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); balances[account] = balances[account].sub(value); emit Transfer(account, address(0), value); ...
5,167,952
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./SaveToken.sol"; contract SaveTokenFactory { // addresses of deployed saveTokens address[] public saveTokens; address internal admin; event SaveTokenCreated(address addr); /* * @notice Constructor to set admin for th...
creates a new SaveToken contract underlyingToken The underlying token address assetAdapter The address of the Asset adapter a token will use assetToken The addresses for the asset token insuranceAdapter The address of the Insurance adapter a token will use insuranceToken The addresses for the insurance token exch...
function createSaveToken( address underlyingToken, address assetAdapter, address assetToken, address insuranceAdapter, address insuranceToken, address exchangeFactory, address farmerAddress, string memory name, string memory symbol, uin...
5,470,108
./full_match/1/0x96a7c18650DEDf9E76355f3f0458B027B789e201/sources/localhost/presale.sol
Low level presale enter function _amount the wei amount _code referral code/ calculate base tokens calculate daily bonus
function enter(uint256 _amount, bytes12 _code) public payable active { require(msg.value == _amount); require(msg.sender != address(0)); require(valid(msg.sender, _amount)); require(referrals[_code] != address(0), "referral code is invalid"); require(referrals[_code] != msg.s...
9,776,466
./full_match/1/0x5eF6501044f39Cc5B55575eC0d6216817DE137D5/sources/browser/IValidatorRegistry.sol
Validator Registry Interface
interface IValidatorRegistry { function isValidator(address _validator) external view returns (bool _isValidator); function getSubstantialLevel(address _validator) external view returns (bool _substantialLevel); pragma solidity ^0.6.11; }
16,495,905
pragma solidity ^0.5.0; library SafeMath { uint256 constant internal MAX_UINT = 2 ** 256 - 1; // max uint256 /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns(uint256) { if (_a == 0) { return 0; ...
Burns a specific amount of tokens. value The amount of token to be burned./
function burn(uint256 value) public { _burn(msg.sender, value); }
2,183,307
pragma solidity^0.4.24; contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is ...
Total cumulative presses for all campaigns
function totalPresses() external view returns(uint) { if (!campaigns[lastCampaignID].finalized) { return totalPresses.add(campaigns[lastCampaignID].presses); return totalPresses; } }
7,266,184
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns...
called by the owner on end of emergency, returns to normal state
function release() external onlyOwner onlyInEmergency { stopped = false; }
1,792,588
pragma solidity ^0.4.24; interface itoken { function freezeAccount(address _target, bool _freeze) external; function freezeAccountPartialy(address _target, uint256 _value) external; function balanceOf(address _owner) external view returns (uint256 balance); // function totalSupply() external view retur...
Function to stop initial stage./
function finishInitOwners() onlyOwner canInitial public { initAdd = false; emit InitialFinished(); }
1,496,878
pragma solidity ^0.4.19; /** * @title ERC20 Basic smart contract * @author Copyright (c) 2016 Smart Contract Solutions, Inc. * @author "Manuel Araoz <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c010d021909000d1e0d03162c0b010d0500420f0301">[email&#160;protected]</a>>" * @dev Simpler ve...
add address to whitelist from address to add
function allowTransfer(address from) onlyOwner public { whitelist[from] = true; AllowTransfer(from); }
2,368,140
./partial_match/56/0xBe86bf5C6431565c91f30e09f63724101fF43f29/sources/SeedChef.sol
if (IERC20(token).allowance(address(this),address(router))==0){ }
function ensureApproved(address token) internal { IERC20(token).approve(address(router), uint256(-1)); }
11,093,312
./full_match/1/0xb9fbe8fC6EB82b0b52A79C242dDB71f4D4aF6a8e/sources/contracts/shop/ProductComicV2.sol
Updates shop address Only callable by owner _shopAddress New shop address/
function setShopAddress(address _shopAddress) external onlyOwner { shopAddress = _shopAddress; emit ShopContractSet(shopAddress); }
8,351,675
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "./interfaces/ITribute.sol"; import "../core/DaoConstants.sol"; import "../core/DaoRegistry.sol"; import "../extensions/Bank.sol"; import "../adapters/interfaces/IVoting.sol"; import "../guards/MemberGuard.sol"; import "../guards/AdapterGuard.sol"; import...
Submits a tribute proposal to the DAO. Proposal ids must be valid and cannot be reused. dao The DAO address. proposalId The proposal id. applicant The applicant address (who will receive the DAO internal tokens and become a member). proposer The proposer address (who will provide the token tribute). tokenToMint T...
function _submitTributeProposal( DaoRegistry dao, bytes32 proposalId, address applicant, address proposer, address tokenToMint, uint256 requestAmount, address tokenAddr, uint256 tributeAmount ) internal { dao.submitProposal(proposalId); ...
13,000,519
pragma solidity ^0.4.23; // Copyright 2017 OpenST Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applic...
Public view function name. return string Name of the token./
function name() public view returns (string) { return tokenName; }
6,434,662
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; pragma experimental ABIEncoderV2; import "./lib/Lib_RLPReader.sol"; /// @notice MIPS virtual machine interface interface IMIPS { /// @notice Given a MIPS state hash (includes code & registers), execute the next instruction and returns /// the update ...
Returns the last state hash proposed by the challenger during the binary search.
function getProposedState(uint256 challengeId) view public returns (bytes32) { ChallengeData storage c = challenges[challengeId]; require(c.challenger != address(0), "invalid challenge"); uint256 stepNumber = getStepNumber(challengeId); return c.assertedState[stepNumber]; }
12,895,546
// 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 function is public so users can query how much calldata will be sent to the L2 before execution it is virtual since different gateway subclasses can build this calldata differently ( ie the standard ERC20 gateway queries for a tokens name/symbol/decimals )
function getOutboundCalldata( address _l1Token, address _from, address _to, uint256 _amount, bytes memory _data ) public view virtual override returns (bytes memory outboundCalldata) { bytes memory emptyBytes = ""; outboundCalldata = abi.encodeWithSelecto...
6,401,599
// File: @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORT...
lockdays are passed as seconds
function deleteLockMultiplier(uint256 lockDays) external onlyOwner { delete lockMultipliers[lockDays]; }
380,224
./partial_match/1/0xB50A2c564558d5eE6420b8Fb8e3D44b1f1974E3f/sources/FarmFactory.sol
Number of allowed FarmGenerators/
function farmGeneratorsLength() external view returns (uint256) { return farmGenerators.length(); }
3,688,331
pragma solidity >=0.5.0 <0.6.0; import '../libs/collections/AddressMap.sol'; import "../libs/lifecycle/LockableDestroyable.sol"; import "../libs/ownership/Ownable.sol"; import "./IComplianceStorage.sol"; /** * Eternal Storage for compliance/rules. * * Keys: * All contracts should use the below pattern ...
Returns whether or not the given permission address exists for the given type addr The address to check for permission return If the given address has permission or not/
function permissionExists(address addr) external view returns(bool) { return permissions.exists(addr); }
977,318
/** * 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; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations i...
Gets the current votes balance for `account` account The address to get votes balance return The number of current votes for `account`/
function getCurrentVotes(address account) external view returns (uint256) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; }
260,332
pragma solidity 0.4.19; import "./utils/Secured.sol"; contract Store is Secured { /**** Storage Types *******/ mapping(bytes32 => uint256) private uintStorage; mapping(bytes32 => string) private stringStorage; mapping(bytes32 => address) private addressStorage; mapping(bytes32 => bytes)...
_key The key for the record
function getBytes(bytes32 _key) external view returns (bytes) { return bytesStorage[_key]; }
12,567,412
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; library EnumerableSet { struct Set { bytes32[] _values; mapping (bytes32 => uint256) _indexes; } function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); s...
called by a Farm contract when lp token balance changes from 0 to > 0 to allow tracking all farms a user is active in/ msgSender = farm contract
function userEnteredFarm(address _user) public { address msgSender = _msgSender(); require(farms.contains(msgSender), 'FORBIDDEN'); EnumerableSet.AddressSet storage set = userFarms[_user]; set.add(msgSender); }
887,962
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import './libraries/StakingPoolLogicV2.sol'; import './interface/IStakingPoolV2.sol'; import './token/StakedElyfiToken.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; /// @title Elyfi StakingPool ...
Transfer accrued reward to msg.sender. User accrued reward will be reset and user reward index will be set to the current reward index.
function claim() external override stakingInitiated { _claim(msg.sender); }
1,237,130