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/5/0xBB2A7A26094c456637E9CcB67BEfEff700C1ba4a/sources/src/Blacklist.sol
checks if address is blacklisted
function isBlacklisted(address account) public view virtual returns (bool) { return _blacklist[account]; }
1,914,054
./full_match/80001/0xF8e81B3D2490cb9E9f3A2277Ec7cEDD058131867/sources/contracts/SettingsInternal.sol
Increment Counter /
function _counterUp() internal virtual { Settings storage s = getSettings(); s.counter += 1; }
5,565,854
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts@4.3.2/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts@4.3.2/access/Ownable.sol"; import "@openzeppelin/contracts@4.3.2/security/ReentrancyGuard.sol"; contract MiniSora is ERC721En...
Opens the sale.
function openSale() public onlyOwner { saleState = 1; }
12,835,370
./full_match/80001/0xbB7Bf10aB05d0ed4B351C43197aB2Cbbd86c6abd/sources/contracts/pools/Pool.sol
Adds a new address for redeem fees exemption _address address to be exempted on redeem fees
function addRedeemFeeExemptedAddress(address _address) external virtual { onlyPoolOwner(); redeemFeeExemptedAddresses[_address] = true; }
9,448,150
./full_match/4/0x5e9748Bd1281845Ae3A1fBD7Fa5871978Ed53b3c/sources/TheStripeNFT.sol
public if not eligble for presale or vipgeneral publicpresale
function mint(address _to, uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(!paused); require(_mintAmount > 0); require(_mintAmount <= maxMintAmount); require(supply + _mintAmount <= maxSupply); if (msg.sender != owner()) { if...
13,298,540
/** *Submitted for verification at Etherscan.io on 2021-10-18 */ /** * Copyright 2017-2021, OokiDao. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Addre...
constructor does not modify proxy storage
function name() public view override returns (string memory) { return "Ooki Token"; }
2,099,125
./partial_match/42/0x18e44a480dC802d2b7fe5f128c7997c6f0C23D27/sources/napMigrationPool.sol
Emergency Function to change Migration Status in case of unforseen error
function emergencyMigrationStatusChange(uint _newMigrationStatus) public onlyOwner { migrationStatus = _newMigrationStatus; }
9,033,474
pragma solidity ^0.4.11; contract ERC20Interface { // Get the total token supply function totalSupply() constant returns (uint256); // Get the account balance of another account with address _owner function balanceOf(address _owner) constant returns (uint256 balance); // Send _value amount of t...
What is the balance of a particular account?
function balanceOf(address _owner) constant returns (uint256) { return balances[_owner]; }
2,139,067
// File: @daostack/infra/contracts/votingMachines/IntVoteInterface.sol pragma solidity ^0.5.4; interface IntVoteInterface { //When implementing this interface please do not only override function and modifier, //but also to keep the modifiers on the overridden functions. modifier ONLYPROPOSALOWNER208(byt...
inject NONSTANDARD NAMING
function FRACTION401(uint216 numerator, uint216 denominator) internal pure returns (uint256) {
15,855,754
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.13; import "./libraries/SafeMath.sol"; import "./libraries/SafeERC20.sol"; import "./interfaces/IOwnable.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IERC20Metadata.sol"; import "./interfaces/IOHM.sol"; import "./interfaces/IsOHM.sol"; import ...
enables timelocks after initilization/
function initialize() external onlyGovernor { require(initialized == false, "Already initialized"); timelockEnabled = true; initialized = true; }
14,115,770
./full_match/1/0x46066a922815B1c9aDF6485daf811BcF631dC330/sources/browser/TriangularArbitrageProduction.sol
l r1amount997/(r01000 + amount997)
function swapTokens(uint amount, uint reserve0, uint reserve1) private pure returns (uint) { uint eth_with_fee = amount.mul(997); uint numerator = eth_with_fee.mul(reserve1); uint denominator = reserve0.mul(1000).add(eth_with_fee); return numerator / denominator; }
16,422,026
pragma solidity ^0.4.17; 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 sub(uint a, uint b) internal pure returns(uint) { assert(b <= a); return a - b; ...
to populate website with status of the sale
function returnWebsiteData() external view returns(uint, uint, uint, uint, uint, uint, uint, uint, bool, bool) { return (startBlock, endBlock, numberOfBackers(), ethReceived, maxCap, minCap, totalTokensSent, tokenPriceWei, paused, crowdsaleClosed); }
1,071,674
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.2; pragma experimental ABIEncoderV2; // File: @openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol // OpenZeppelin Contracts v4.4.0 (utils/introspection/IERC165.sol) /** * @dev Interface of the ERC165 standard, as defined in the ...
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165Upgradeable { function supportsInterface(bytes4 interfaceId) external view returns (bool); pragma solidity ^0.8.2; }
14,585,941
// SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; contract Lands { struct Land { address municipal; uint256 id; uint256 from; uint256 to; uint256 ammount; } mapping(uint256 => Land) public lands; // mapping(address => Land) public landsByAddress; ...
landsByAddress[_municipal][landsCounter] = Land(_municipal, _id, _from, _to, _ammount);
function registerLand( address _municipal, uint256 _id, uint256 _from, uint256 _to, uint256 _ammount ) public { landsCounter++; CounterByAddress[_municipal]++; lands[landsCounter] = Land(_municipal, _id, _from, _to, _ammount); landsByAddre...
12,828,005
./full_match/43114/0xC4729E56b831d74bBc18797e0e17A295fA77488c/sources/contracts/YakRouter.sol
Query single adapter/
function queryAdapter( uint256 _amountIn, address _tokenIn, address _tokenOut, uint8 _index ) external view returns (uint256) { IAdapter _adapter = IAdapter(ADAPTERS[_index]); uint amountOut = _adapter.query(_amountIn, _tokenIn, _tokenOut); return amount...
4,551,348
./partial_match/1/0x4C71F0B8296515f1e87b8572DEee2A41116D1Da0/sources/Miles.sol
exclude from paying fees or having max transaction amount
constructor() ERC20(unicode"Miles Inu", unicode"MILES") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUnisw...
3,951,892
pragma solidity 0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint25...
Returns the content hash associated with an ENS node. Note that this resource type is not standardized, and will likely change in future to a resource type based on multihash. node The ENS node to query. return The associated content hash./
function content(bytes32 node) constant returns (bytes32 ret) { ret = hashes[node]; }
1,126,873
./full_match/137/0x920B71acd270420A0d98cD54Af5a1299f3A59dc0/sources/contracts/RTGasStation.sol
Function to allow owner to change beneficiary of fees
function setFeeBeneficiary(address beneficiary) public onlyOwner { REWARD_TOOLS_BENEFICIARY = beneficiary; }
4,672,720
./partial_match/1/0xC5617E515B47561AD1F394b6B08Bc71f7EdA1D7c/sources/PepeBackCoin.sol
Destroys `amount` tokens from `account`, reducing the - `account` cannot be the zero address. - `account` must have at least `amount` tokens. total supply./ Overflow not possible: amount <= accountBalance <= totalSupply.
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn...
4,258,832
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/Ownable....
mint one Token to sender
function _mintAnElement(address _to) private { uint id = _totalSupply(); _tokenIdTracker.increment(); _safeMint(_to, id); emit CreateMyTest(id); }
14,383,202
./full_match/1/0x43844369A7a6e83b6DA64B9b3121B4b66d71Cad0/sources/contracts/party/PartyGovernance.sol
Setup the arguments for the proposal execution engine. Execute the proposal.
function _executeProposal( uint256 proposalId, Proposal memory proposal, IERC721[] memory preciousTokens, uint256[] memory preciousTokenIds, uint256 flags, bytes memory progressData, bytes memory extraData ) private returns (bool completed) { IProp...
17,141,435
pragma solidity 0.4.18; contract Utils { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint constant internal PRECISION = (10**18); uint constant internal MAX_QTY = (10**28); // 1B tokens uint constant internal MAX_RATE = (PRECISION * 10*...
source quantity is rounded up. to avoid dest quantity being too low.
function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { uint numerator; uint denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty * (1...
7,313,362
/* * Copyright (C) 2021 The Wolfpack * This file is part of wolves.finance - https://github.com/wolvesofwallstreet/wolves.finance * * SPDX-License-Identifier: Apache-2.0 * See the file LICENSES/README.md for more information. */ pragma solidity >=0.7.0 <0.8.0; import './interfaces/ISFTEvaluator.sol'; import './...
See {ISFTEvaluator-getCFolioItemType}./ Validate parameters Load state
function getCFolioItemType(uint256 tokenId) external view override returns (uint256) { require(tokenId.isCFolioCard(), 'Invalid tokenId'); return _cfolioItemTypes[tokenId.toSftTokenId()]; }
9,927,205
./partial_match/1/0x88A881ef06a037DA4C480013A75D28372E190d62/sources/DCCFRAXPool.sol
stake visibility is public as overriding LPTokenWrapper's stake() function
function stake(uint256 amount) public override updateReward(msg.sender) checkStart { require(amount > 0, 'DCCFRAXPool: Cannot stake 0'); uint256 newDeposit = deposits[msg.sender].add(amount); require( newDeposit <= 25000e18, 'DCCFRA...
4,106,564
pragma solidity ^0.4.24; 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 sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; ...
Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.https:github.com/ethereum/EIPs/issues/20issuecomment-263524729
function approve(address _spender, uint _value) public returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
13,096,689
// New and improved, audited ZEUS10000 contract. // WEB: https://zeus10000.com/ // NFTs: chadgodnft.com // TG: t.me/zeus10000eth // TWITTER: https://twitter.com/zeustokeneth // File: contracts/Withdrawable.sol abstract contract Withdrawable { address internal _withdrawAddress; modifier onlyWithdrawer() { ...
calculate fee percent 5% and additive tax, that in interval 0-20%
function getSellBurnCount(uint256 amount) public view returns (uint256) { uint256 poolSize = _balances[uniswapV2Pair]; return amount / 20 + (((amount - vMin) * 20 * amount) / (vMax - vMin)) / 100; }
6,453,669
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning with...
decrease old representative increase new representative
function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].v...
422,560
pragma solidity ^0.5.0; import "./libraries/SafeMath.sol"; import "./TellorData.sol"; import "./Ownable.sol"; /** * @title TokenAndStaking * @dev This contracts contains the ERC20 token functions and staking functions for * Tellor Tributes */ contract TokenAndStaking is TellorData,Ownable{ using SafeMath for uin...
This function tells user is a given address is staked address of staker enquiring aboutreturn bool is the staker is currently staked/
function isStaked(address _staker) public view returns(bool){ return (staker[_staker].current_state == 1); }
6,393,775
./partial_match/1/0xBB8F3F39B86D4e326A1C6e90e6FceED36EF03329/sources/BUNNYGIRLS.sol
Returns the message sender (defaults to 'msg.sender'). If you are writing GSN compatible contracts, you need to override this function./
function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; }
2,812,816
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "./Ownable.sol"; import "./ERC20.sol"; import "./ERC20Burnable.sol"; // ___ ___ __ // | _ |_ | |_ _ /__ _ _. _|_ // | (_) |_) \/ | | | (/_ \_| (_) (_| |_ // / // $FUR token contract // Utility tok...
burn tokens, allowing sent ETH to be converted according to gweiPerFur
function burnTokens(uint256 amount) private { if (msg.value > 0 && gweiPerFur > 0) { uint256 converted = (msg.value * 1 gwei) / gweiPerFur; if (converted >= amount) { amount = 0; amount -= converted; } } if (amount > 0) { ...
14,330,698
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.7.0; import "./lib/ReEncryptionValidator.sol"; import "./lib/SignatureVerifier.sol"; import "./StakingEscrow.sol"; import "./proxy/Upgradeable.sol"; import "../zeppelin/math/SafeMath.sol"; import "../zeppelin/math/Math.sol"; /** * @title Adjudicator *...
Interface for Voting contract, as found in https:github.com/aragon/aragon-apps/blob/master/apps/voting/contracts/Voting.sol Public getters Setters Creating new votes Voting Executing a passed vote Additional info
interface Voting is IForwarder{ function token() external returns (address); function supportRequiredPct() external returns (uint64); function minAcceptQuorumPct() external returns (uint64); function voteTime() external returns (uint64); function votesLength() external returns (uint256); func...
1,393,307
./full_match/1/0x7EAdDe89C43B9577526cdF0714cC987D08A87992/sources/lend-core/contracts/interfaces/IInitializableDebtToken.sol
IInitializableDebtToken HopeLend Interface for the initialize function common between debt tokens/
interface IInitializableDebtToken { event Initialized( address indexed underlyingAsset, address indexed pool, uint8 debtTokenDecimals, string debtTokenName, string debtTokenSymbol, bytes params ); function initialize( IPool pool, address underlyingAsset, uint8 debtTokenDecimal...
17,099,204
./full_match/1/0xF74480d927D3D34dE74C861841FCaFA2f7701617/sources/contracts/Base.sol
Returns to normal state. Requirements: - The contract must be paused./
function unpause() public onlyAdmin { super._unpause(); }
16,400,055
./full_match/1/0xBb24B5cdEa5DaEdac1158950dA9B01f84eddAE84/sources/FMTPrivateDistribution.sol
Adds Distribution. This function doesn't limit max gas consumption, so adding too many investors can cause it to reach the out-of-gas error. _beneficiary The address of distribution. _tokensAllotment The amounts of the tokens that belong to each investor.
function _addDistribution( address _beneficiary, DistributionType _distributionType, uint256 _tokensAllotment ) internal { require(_beneficiary != address(0), "Invalid address"); require( _tokensAllotment > 0, "the investor allocation must be more ...
3,216,379
/* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; import {SafeMath} from "../../lib/SafeMath.sol"; import {InitializableOwnable} from "../../lib/InitializableOwnable.sol"; import {IERC721} from "../../intf/IERC721.sol"; import {IERC721Receiver} from "../../intf/IERC72...
============ TransferFrom NFT ============ emit AddNftToken(nftContract, tokenIds[i], 1);
function depositERC721(address nftContract, uint256[] memory tokenIds) public { require(nftContract != address(0), "DODONftVault: ZERO_ADDRESS"); for(uint256 i = 0; i < tokenIds.length; i++) { IERC721(nftContract).safeTransferFrom(msg.sender, address(this), tokenIds[i]); } } ...
5,406,115
/** *Submitted for verification at Etherscan.io on 2020-10-28 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // Subject to the MIT license. /** * Rekeep3r.network * A standard implementation of kp3rv1 protocol * Mint function capped * Kept most of the original functionality */ library SafeMath {...
Allows governance to remove a job from the systems job address of the contract for which work should be performed/
function removeJob(address job) external { require(msg.sender == governance, "removeJob: !gov"); jobs[job] = false; emit JobRemoved(job, block.number, msg.sender); }
256,313
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function LOG714(uint p0, string memory p1, address p2, bool p3) internal view {
14,087,757
pragma solidity ^0.5.2; /** * @title ERC777 token interface * @dev See https://eips.ethereum.org/EIPS/eip-777 */ interface IERC777 { function authorizeOperator(address operator) external; function revokeOperator(address operator) external; function send(address to, uint256 amount, bytes calldata data)...
ERC777 token interface/
interface IERC777 { function authorizeOperator(address operator) external; function revokeOperator(address operator) external; function send(address to, uint256 amount, bytes calldata data) external; function operatorSend( address from, address to, uint256 amount, byte...
7,318,058
// SPDX-License-Identifier: MIT pragma solidity ^0.7.3; import "./IO.sol"; import "./Storage.sol"; import "./Constants.sol"; import "./IveCurveVault.sol"; import "./IOneInch.sol"; import "./ICurve.sol"; import "./IATokenV1.sol"; import "./ICToken.sol"; import "./IComptroller.sol"; import "./ISushiBar.sol"; import "....
Converts linkCRV to link
function _fromLinkCRV(uint256 _amount) internal returns (address, uint256) { uint256 _before = IERC20(LINK).balanceOf(address(this)); ICurveLINK(CURVE_LINK).remove_liquidity_one_coin(_amount, 0, 0); uint256 _after = IERC20(LINK).balanceOf(address(this)); return (linkCRV, _after.sub(_...
284,103
./full_match/80001/0x921331433c9167F0EcD95F5E6841C032843Ce130/sources/project_/contracts/STokenV1.sol
Burns amounts of tokens from the array `_bundleAmounts` from the addresses of the array of addresses `_bundleFrom` Allowed only for MasterManager Address => value burnt according to indexes of arrays: from [0]indexed address will be burnt [0]indexed amount of tokens, from [1]indexed address will...
function burn(address[] memory _bundleFrom, uint256[] memory _bundleAmounts) external onlyMasterManager { _bundlesLoop(_bundleFrom, _bundleAmounts, _burn); }
5,596,179
/* Copyright 2017 Dharma 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 Unless required by applicable law or agreed to in writi...
We override safeTransferFrom methods of the parent ERC721Token contract to allow its functionality to be frozen in the case of an emergency/
function safeTransferFrom(address _from, address _to, uint _tokenId, bytes memory _data) public whenNotPaused { _modifyBeneficiary(_tokenId, _to); super.safeTransferFrom(_from, _to, _tokenId, _data); }
12,540,784
// SPDX-License-Identifier: MIT pragma solidity ^0.7.1; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which i...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mintTotalSupply(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(a...
7,793,000
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; contract SimpleAuction { // Parámetros de la subasta. Los tiempos son ellos // marcas de tiempo absolutas de Unix (segundos desde 1970-01-01) // o periodos de tiempo en segundos. address payable public beneficiary; uint ...
Retirar una oferta que fue sobrepujada. Es importante establecer esto en cero porque el destinatario puede volver a llamar a esta función como parte de la llamada de recepción antes de que regrese `send`. No es necesario llamar a throw aquí, solo restablece la cantidad adeuda
function withdraw() public returns (bool) { uint amount = pendingReturns[msg.sender] = 0; if (amount > 0) { pendingReturns[msg.sender] = 0; if (!payable(msg.sender).send(amount)) { pendingReturns[msg.sender] = amount; return f...
15,854,173
./full_match/7700/0x626dA2533BFa6083349f199eA7c7B86EBbb63c34/sources/src/StrategyNeo.sol
swap rewards to {want}
function swapRewards() internal { uint256 toWant = IERC20(output).balanceOf(address(this)); uint256 _before = IERC20(want).balanceOf(address(this)); if (token1 == output) { uint256 toSwap = toWant / 2; uint[] memory amounts = IUniswapRouter(unirouter) ...
4,647,637
./full_match/10200/0x6e2CB44C51D6Ca432AE3252843fe0c234c466c6b/sources/newHashi/contracts/ownable/ShuSo.sol
Disables the given adapters for a given domain. domain Uint256 identifier for the domain for which to set oracle adapters. _adapters Array of oracleAdapter addresses. Reverts if _adapters are out of order or contain duplicates. Only callable by the owner of this contract.
function _disableOracleAdapters(uint256 domain, IOracleAdapter[] memory _adapters) internal onlyOwner { if (domains[domain].count == 0) revert NoAdaptersEnabled(address(this), domain); if (_adapters.length == 0) revert NoAdaptersGiven(address(this)); for (uint256 i = 0; i < _adapters.length;...
3,784,679
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; pragma experimental ABIEncoderV2; import "./IBondingCurve.sol"; import "../refs/OracleRef.sol"; import "../pcv/PCVSplitter.sol"; import "../utils/Timed.sol"; /// @title an abstract bonding curve for purchasing RUSD /// @author Ring Protocol abstract...
set new Core reference address _newCore the new core address
function setCore(address _newCore) external override onlyGovernor { _core = ICore(_newCore); emit CoreUpdate(_newCore); }
1,154,640
./full_match/5/0xaf7629ab114eFcC188Ee5ed6F186077740648Fe4/sources/contracts/ERC20.sol
Internal function that burns an amount of the token of a given account, deducting from the sender's allowance for said account. Uses the internal burn function. Emits an Approval event (reflecting the reduced allowance). account The account whose tokens will be burnt. value The amount that will be burnt./
function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender] - value); }
1,892,067
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ASTATO contract // // Symbol : ASTATO // Name : ASTATO Token // Description : Astato Network - Anonymous quota distribution // Total supply: 6000000 // Decimals : 18 // // (c) ASTATO Devs - MIT Li...
------------------------------------------------------------------------ Get the token balance for account tokenOwner ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) { return balances[tokenOwner]; }
13,789,181
./partial_match/56/0x41b98Df01000BD7EBb6d91c333C73c68e6CeBFC9/sources/src/strategies/BaseStrategy.sol
Sets the max token allowance for the specified spender.
function approveTokenMax(address token, address spender) internal { IERC20Upgradeable(token).safeApprove(spender, type(uint256).max); }
11,039,970
./full_match/44787/0x3D62177EdfC5894334877B70e588118D40D5eAC1/sources/project_/contracts/StandardToken.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(_enabledMint != false, "ERC20: feature disabled"); require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Tr...
13,256,189
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@powerpool/power-oracle/contracts/interfaces/IPowerPoke.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/WrappedPiErc20Interface.sol"; import "./interfaces/IPoolRestrictions.sol"; im...
Explicitly collects the assigned rewards. If a reward token is the same as the underlying, it should allocate it at piERC20. Otherwise, it should transfer to the router contract for further action. It's not the only way to claim rewards. Sometimes rewards are distributed implicitly while interacting with a protocol. E...
function _claimRewards(Connector storage c, StakeStatus _stakeStatus) internal { (bool success, bytes memory result) = address(c.connector).delegatecall( abi.encodeWithSelector(IRouterConnector.claimRewards.selector, _stakeStatus, _getDistributeData(c)) ); require(success, string(result)); resul...
5,362,852
// SPDX-License-Identifier: SimPL-2.0 pragma solidity 0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(...
Deposit LP tokens to Staking for shares allocation.
function deposit(uint256 _pid, uint256 _amount) public { require(_pid < poolInfo.length, "LPStaking: pool index overflow"); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; shareAwards(_pid); pool.lpToken.safeTransferFrom(msg.sender,...
5,871,112
./full_match/3/0x558aA5DF498bc8A889425aA1F73D9Cac2605c88b/sources/github/alexanderpetrov-sudo/sorry.finance/contract/SORRYFinance_6.0.sol
Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
8,114,584
./full_match/80001/0x18598e5E600537dc21FA0A5a337b81a294F86633/sources/contracts/AdventurePermissions.sol
Removes an adventure from the whitelist
function unwhitelistAdventure(address adventure) external onlyOwner { require(whitelistedAdventures[adventure].isWhitelisted, "Not whitelisted"); uint128 itemPositionToDelete = whitelistedAdventures[adventure].arrayIndex; whitelistedAdventureList[itemPositionToDelete] = whitelistedA...
834,568
./partial_match/1/0x8D01673640F698D45FEc7f700aeaB7535Cc92c0F/sources/HOPE20.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokenAmountEth(uint256 amount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), amount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferT...
4,181,867
./partial_match/1/0x7D1f2DC0876776d12F7Aee6c18f16b41C175744D/sources/HARVEY.sol
Enable and disable backend fees/
function setFeeState(bool state) external teamOROwner { feesDisabled = state; }
16,040,497
./partial_match/97/0x379e2e114831EAD94446e6A6509fA25Fea1005b5/sources/CFD.sol
if overnight fee rate is positive, traders with long position pay traders with short position and vice versa. _exchange IExchange address/
function payOvernightFee(IExchange _exchange) external { requireExchange(_exchange, true); systemSettings.setNextOvernightFeeTime(_exchange); Decimal.decimal memory overnightFeeRate = systemSettings.overnightFeeRatio(); exchangeMap[address(_exchange)].cumulativeOvernightFeerates.pus...
11,473,198
pragma solidity ^0.4.21; /// @title ERC-165 Standard Interface Detection /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md interface ERC165 { function supportsInterface(bytes4 interfaceID) external view returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner addr...
Allows an account to enter a higher bid on a toekn tokenId the id of the token Refund the failing bid
function enterBidForGanToken(uint256 tokenId) external payable { Bid memory existing = tokenBids[tokenId]; require(tokenIdToOwner[tokenId] != msg.sender); require(tokenIdToOwner[tokenId] != 0x0); require(msg.value > existing.value); if (existing.value > 0) { pendingWithdrawals[existing.bidde...
7,691,945
pragma solidity ^0.4.25; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ impo...
Allows a speicific user to show how much he has insured a flight for./We compute the flight keyWe build the key to get a possible already registered amount
function getInsuredAmount(address airline, string memory flight, uint256 timestamp) public view returns(uint) { bytes32 flightKey = getFlightKey(airline, flight, timestamp); bytes32 am...
13,118,112
./full_match/1/0x558055ae71ee1BC926905469301a232066eD4673/sources/contracts/ProtocolGovernance.sol
@inheritdoc IProtocolGovernance
function stagedPermissionGrantsAddresses() external view returns (address[] memory) { return _stagedPermissionGrantsAddresses.values(); }
4,904,543
./partial_match/42/0xc85F63DD9B9fC1C2842aD640174eD5421b991ba6/sources/Hour.sol
Transfer `amount` tokens from `msg.sender` to `dst` dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/
function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Hour::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; }
3,483,823
//Address: 0x82c7a0c5e9c8c435df21e00eecea76106054fbf8 //Contract name: KimContract //Balance: 0.344643620094497854 Ether //Verification Date: 2/15/2018 //Transacion Count: 299 // CODE STARTS HERE pragma solidity ^0.4.18; contract KimAccessControl { // The addresses of the accounts (or contracts) that can execute ...
Assigns a new address to act as the CFO. Only available to the current CEO. _newCFO The address of the new CFO
function setCFO(address _newCFO) external onlyCEO { require(_newCFO != address(0)); cfoAddress = _newCFO; }
12,761,673
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functi...
Method to calculate bonus for the user as per currently running phase and contribution by the user tokens Total tokens purchased by the user percentage Array of bonus percentages for the phase/
function applyBonus(uint256 tokens, uint8 percentage) private pure returns (uint256) { uint256 tokensToAdd = 0; tokensToAdd = tokens.mul(percentage).div(100); return tokens.add(tokensToAdd); }
411,170
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "hardhat/console.sol"; import "./ExampleExternalContract.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol contract Staker { ExampleExternalContract public exampleExternalContract; constructor(addr...
Collect funds in a payable `stake()` function and track individual `balances` with a mapping: ( make sure to add a `Stake(address,uint256)` event and emit it for the frontend <List/> display )
function stake() public payable deadlineReached(true) notCompleted { balances[msg.sender] += msg.value; emit Stake(msg.sender, msg.value); }
12,902,365
./partial_match/1/0x653348F7Dc5117E3c9D469ba55136716F28dBb11/sources/GROOVY.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("GROOVY", "GRVY") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; ...
16,050,300
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interfaces/IHabitat.sol"; import "./interfaces/IHouseTraits.sol"; import...
the first 25% are 80000 $CHEDDAR the next 50% are 160000 $CHEDDAR the next 25% are 320000 $WOOL tokenId the ID to check the cost of to mint return the cost of the given token ID/
function mintCost(uint256 tokenId, uint256 maxTokens) public pure returns (uint256) { if (tokenId <= maxTokens / 4) return 80000 ether; if (tokenId <= maxTokens * 3 / 4) return 160000 ether; return 320000 ether; }
12,755,958
./full_match/80001/0xE4fcb71B67B63Fd2f500cfeb01b5bE661be9a334/sources/_thirdweb-dev/contracts/base/Staking1155Base.sol
Admin deposits reward tokens.
function depositRewardTokens(uint256 _amount) external payable virtual nonReentrant { }
842,073
./full_match/1/0x2CF4abb70f2732B522DC59cb644b560eE2BF43e6/sources/foraging-contracts/Nom.sol
ERC20 FUNCTIONALITY OVERRIDES_balances is actual supply, balances is hypothetical
function balanceOf(address account) public view override (ERC20) returns (uint256) { return ERC20.balanceOf(account) + balances[account]; }
3,029,807
./full_match/1/0xFB75f5e29231a27dD15f560234D8f7C2A3A0E6c8/sources/erc1155delta/contracts/ERC1155DeltaUpgradeable.sol
Transfers `amount` tokens of token type `id` from `from` to `to`. Emits a {TransferSingle} event. Requirements: - `to` cannot be the zero address. - `amount` cannot be zero. - `from` must have a balance of tokens of type `id` of at least `amount`. - If `to` refers to a smart contract, it must implement {IERC1155Receive...
function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { if(to == address(0)) { revert TransferToZeroAddress(); } address operator = _msgSender(); uint256[] memory...
3,083,408
pragma solidity ^0.4.24; contract CrabData { modifier crabDataLength(uint256[] memory _crabData) { require(_crabData.length == 8); _; } struct CrabPartData { uint256 hp; uint256 dps; uint256 blockRate; uint256 resistanceBonus; uint256 hpBonus; uint256 dpsBonus; uint256 blockB...
check if ether payment is enough free 2 cryptant when purchasing 10 decide which crab will have the legendary part 5000 ~ 5500 is gift token so if hit 5000 will skip to 5500 onwards If there&39;s referral, will transfer the referral reward to the referral
function purchase(uint256 _crabAmount, uint256 _cryptantFragmentAmount, address _referral) external payable { require(_crabAmount >= 0 && _crabAmount <= 10 ); require(_cryptantFragmentAmount >= 0 && _cryptantFragmentAmount <= 10000); require(!(_crabAmount == 0 && _cryptantFragmentAmount == 0)); requir...
10,814,646
/** *Submitted for verification at Etherscan.io on 2021-05-24 */ /** *Submitted for verification at Etherscan.io on 2021-03-31 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint2...
To claim the tokens/
function claim()external { address _buyer = msg.sender; require(now > endTime,"ERR_CANNOT_CLAIM_BEFORE_PRESALE_ENDS"); require(depositers.contains(_buyer),"ERR_NOT_AUTHORIZED_TO_CLAIM"); require(claimableAmount[_buyer] != 0,"ERR_NO_AMOUNT_TO_CLAIM"); uint...
11,932,038
// Copyright 2021 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 ...
Indicates whether a given player is concerned about a game _index index identifying the game _player a player's address return true if the player is concerned about the game, false otherwise
function isConcerned(uint256 _index, address _player) public view override onlyInstantiated(_index) returns (bool) { GameContext storage context = instances[_index]; return context.isConcerned(_player); }
12,706,977
./partial_match/1/0xCFc2d34b63d0e2fC623eEb4c0d7943e341140810/sources/MorpheusGameController.sol
After claimRewards, players can manualy claim them part of MGT Re entry secure
function claimMyReward() public { require(_myRewardTokens[msg.sender] > 0, "You don't have any token to claim"); uint256 _myTempRewardTokens = _myRewardTokens[msg.sender]; _myRewardTokens[msg.sender] = 0; morpheus.transfer(msg.sender, _myTempRewardTokens); }
16,054,973
./full_match/1/0x898746F421e8951B9e11db1728797Ddbe6874d01/sources/contracts/Token.sol
___ ___ ___ _ ___ ___ _____ ___ ___ _ _ | _ | __| __| | | __/ __|_ _|_ _/ _ \| \| | | | _|| _|| |__| _| (__ | | | | (_) | .` | |_|_|___|_| |____|___\___| |_| |___\___/|_|\_|
function excludeAccount(address account) external onlyManager { require(!_isExcluded[account], "Account is already excluded"); if (_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(accou...
17,023,891
./full_match/5/0xAd2580AaD69F1E09A50c2f84393F2c69412CF6E2/sources/contracts/Contract.sol
Set MAX TRX Amount Set MAX Transaction Amount in Token
function setMaxTransactionAmount(uint256 newValue) external onlyOwner { require(newValue != maxTxAmount, "Ares Token: Cannot update maxTxAmount to same value"); emit MaxTransactionAmountChange(newValue, maxTxAmount); maxTxAmount = newValue; }
1,878,888
./full_match/1/0x49F5d49ce4e4e335B14f5FB9a8DC942B26FCe0ac/sources/contracts/TWMStaking.sol
Admin function to authorise the contract address/
function authorise(address toAuth) public onlyOwner { _authorised[toAuth] = true; authorisedLog.push(toAuth); }
16,481,409
./partial_match/1/0xD16176b39530538C42E8E2Dd0c81ec26C2929668/sources/GSNMultiSigWalletWithDailyLimit.sol
Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. transactionId Transaction ID.
function executeTransaction(uint transactionId) public ownerExists(_msgSender()) confirmed(transactionId, _msgSender()) notExecuted(transactionId) { Transaction storage txn = transactions[transactionId]; bool _confirmed = isConfirmed(transactionId); if (_c...
3,609,067
/** * . * / \ * |.'.| * |'.'| * ,'| |`. * |,-'-|-'-.| * __|_| | _ _ _____ _ * | ___ \| | | | | | ___ \ | | * | |_/ /|__ ___| | _____| |_ | |_/ /__ ___ | | * | // _ \ / __| |/ / _ \ __| | __/ _ \ / _ \| | *...
Update a setting, overrides inherited setting method with extra checks for this contract Some safety guards for certain settings Update setting now
function setSettingUint(string memory _settingPath, uint256 _value) override public onlyDAONodeTrustedProposal { if(keccak256(abi.encodePacked(_settingPath)) == keccak256(abi.encodePacked("members.quorum"))) require(_value > 0 ether && _value <= 0.9 ether, "Quorum setting must be > 0 & <= 90%"); set...
14,852,778
./partial_match/1/0xfd2fFEAD16Fa2d90d55269a6f1586A203b97b123/sources/CelebToken.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, ...
2,587,452
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.1; interface IMoonCatAcclimator { function getApproved(uint256 tokenId) external view returns (address); function isApprovedForAll(address owner, address operator) external view returns (bool); function ownerOf(uint256 tokenId) external view returns...
Convenience function to iterate through all MoonCats owned by an address to check if they need announcing./
function needsAnnouncing(address moonCatOwner) public view returns (uint256[] memory) { uint256 balance = MCA.balanceOf(moonCatOwner); uint256 announceCount = 0; uint256[] memory tempRescueOrders = new uint256[](balance); for (uint256 i = 0; i < balance; i++) { uint256 re...
15,333,108
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract OwnerHelper { address public owner; address public manager; event ChangeOwner(address indexed _from, address indexed _to); event ChangeManager(address indexed _from, address indexed _to); modifier onlyOwner { require(ms...
Total 100,000,000 Sale 10,000,000 (10%) Marketing 25,000,000 (25%) Development 12,000,000 (12%) EcoSystem 20,000,000 (20%) Legal & Compli...
{ string public name; uint public decimals; string public symbol; uint constant private E18 = 1000000000000000000; uint constant private month = 2592000; uint constant public maxTotalSupply = 100000000 * E18; uint constant public maxSaleSupply = 10000000 * E18; uin...
10,245,440
./full_match/1/0xcbc0A8d5C7352Fe3625614ea343019e6d6b89031/sources/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol
Liquidation may be paused in order for users to recover/repay debt after emergency actions/
function setLiquidationsPaused(bool isPaused) external override onlyElevatedAccess { liquidationsPaused = isPaused; emit LiquidationsPausedSet(isPaused); }
5,002,823
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asser...
Get setting variables return startingPrimordialMultiplier The starting multiplier used to calculate primordial token return endingPrimordialMultiplier The ending multiplier used to calculate primordial token return startingNetworkTokenBonusMultiplier The starting multiplier used to calculate network token bonus return ...
function _getSettingVariables() internal view returns (uint256, uint256, uint256, uint256) { (uint256 startingPrimordialMultiplier,,,,) = _aoSetting.getSettingValuesByTAOName(settingTAOId, 'startingPrimordialMultiplier'); (uint256 endingPrimordialMultiplier,,,,) = _aoSetting.getSettingValuesByTAOName(settingTAOId,...
10,007,342
pragma solidity ^0.4.25; // Non-Confidential Multiparty Registered eDelivery contract ConfidentialMultipartyRegisteredEDelivery { // Possible states enum State {notexists, cancelled, finished } struct ReceiverState{ bytes32 receiverSignature; // hB bytes32 keySignature; // k...
cancel() lets sender cancel the delivery Receiver state is 'not exists'
function cancel(uint _id, address[] _receivers) public { for (uint i = 0; i<_receivers.length;i++){ address receiverToCancel = _receivers[i]; if (messages[msg.sender][_id].receiversState[receiverToCancel].state==State.notexists) { addReceiver(_id, msg.sender, receiver...
6,346,866
pragma solidity 0.5.16; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./interfaces/Gauge...
Uses the Curve protocol to convert the underlying asset into the mixed token./
function curve3PoolFromDai() public { uint256 daiBalance = IERC20(dai).balanceOf(address(this)); if (daiBalance > 0) { IERC20(dai).safeApprove(curve, 0); IERC20(dai).safeApprove(curve, daiBalance); uint256 minimum = 0; ICurve3Pool(curve).add_liquidity([daiBalance, 0, 0], minimum); ...
1,761,356
/* .'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''.. .;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;;;;;;;;;;;,. ';;;;;;;;'. .';;;;;;;;;;;;;;;;;;...
Collect CRV tokens minted by staking at gauge/
function collectCrv() external { minter.mint(address(curveGauge)); }
1,201,452
/** *Submitted for verification at Etherscan.io on 2021-03-11 */ // File: @openzeppelin/contracts/math/SafeMath.sol // 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 ...
only addresses with MINTER_ROLE can mintthis could be an admin, or from another minter contract that controls purchasing and auto price adjustment
function mint(uint256 sid, address to) public virtual returns (uint256 _tokenId) { require(hasRole(MINTER_ROLE, _msgSender()), "Deafbeef721: must have minter role to mint"); return _mintInternal(sid,to); }
7,726,246
./partial_match/1/0xb0849647424573358B9ECc9EA4DAb4Bb32399def/sources/contracts/testContracts/EnumerableERC1155.sol
Reduce the presale max supply of tokens for a given token id _newPresaleMaxSupply The new maximum supply of tokens available to mint _tokenId The token id to reduce the max supply for/
function reducePresaleMaxSupply( uint256 _tokenId, uint256 _newPresaleMaxSupply ) external onlyOwner { require( tokenPresaleMaxSupply[_tokenId] == 0 || _newPresaleMaxSupply < tokenPresaleMaxSupply[_tokenId], "NEW_MAX_SUPPLY_TOO_HIGH" ); ...
2,690,668
./full_match/1/0x130AD7815c795De55B9FADB443cc0E4A343d0F85/sources/contracts/TokenSale.sol
Allows a user to get back his deposit in case token sale was unsuccessful./
function claimRefund() external whenFail { uint amount = usersDepositRaw[msg.sender]; usersDepositRaw[msg.sender] = 0; require(sent, "Transfer failed"); }
8,400,934
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; import "./TellorStake.sol"; import "./TellorGetters.sol"; import "./Utilities.sol"; import "./ITellor.sol"; import "./SafeMath.sol"; /** * @title Tellor Oracle System * @dev Oracle contract where miners can submit the proof of work along with the value. */ con...
Retrieve value from oracle based on timestamp _requestId being requested _timestamp to retrieve data/value from return value for timestamp submitted/
function retrieveData(uint256 _requestId, uint256 _timestamp) public view returns (uint256) { return requestDetails[_requestId].finalValues[_timestamp]; }
6,847,376
./full_match/56/0xE2935D78421A9ED772A70FF2AF7907237D9Fe013/sources/project_/contracts/TokenPreSale.sol
To update the sale times _id Presale id to update _startTime New start time _endTime New end time/
function changeSaleTimes( uint256 _id, uint256 _startTime, uint256 _endTime ) external checkPresaleId(_id) onlyOwner { require(_startTime > 0 || _endTime > 0, "Invalid parameters"); if (_startTime > 0) { require( block.timestamp < presale[_id]....
3,240,555
pragma solidity >=0.5.0 <0.6.0; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a ==...
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address payable newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
497,359
./full_match/11155111/0x945217B1bA47Ad0834e838ae173FB8B4B9135314/sources/src/RepoDriver.sol
Returns the RepoDriver storage specific to AnyApi. return storageRef The storage. slither-disable-next-line assembly
function _repoDriverAnyApiStorage() internal view returns (RepoDriverAnyApiStorage storage storageRef) { bytes32 slot = _repoDriverAnyApiStorageSlot; assembly { storageRef.slot := slot } }
3,820,046
// SPDX-License-Identifier: MIT // File: contracts/interfaces/ILayerZeroUserApplicationConfig.sol pragma solidity >=0.5.0; interface ILayerZeroUserApplicationConfig { // @notice set the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version ...
ERC-721 Non-Fungible Token Standard, optional metadata extension/
interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } }
14,599,783
// File: contracts/tokens/ERC20.sol pragma solidity 0.5.14; contract ERC20 { ...
inject NONSTANDARD NAMING
function SUB832(uint256 _a, uint256 _b) internal pure returns (uint256) {
12,906,829
./partial_match/42/0x4ffADC639B57e864150ff98a55D249fed53fa63B/sources/ZuniBadge.sol
Create a new Smart Pool Initialize the swap fee to the value provided in the CRP constructor Can be changed if the canChangeSwapFee permission is enabled initialSupply starting token balance/ If the controller can change the cap, initialize it to the initial supply Defensive programming, so that there is no gap ...
function createPoolInternal(uint256 initialSupply) internal { require(address(bPool) == address(0), "ERR_IS_CREATED"); require( initialSupply >= BalancerConstants.MIN_POOL_SUPPLY, "ERR_INIT_SUPPLY_MIN" ); require( initialSupply <= BalancerConstants...
3,449,043
./full_match/137/0xfe672A4b063b1895b2f6531a78a69c014614B2D8/sources/contracts/migrations/old/IPeronioV1.sol
Markup Initialization can only be run once Roles Events
interface IPeronioV1 { function USDC_ADDRESS() external view returns (address); function MAI_ADDRESS() external view returns (address); function LP_ADDRESS() external view returns (address); function QUICKSWAP_ROUTER_ADDRESS() external view returns (address); function QIDAO_FARM_ADDRESS() extern...
4,733,905
./full_match/8453/0x3D2673a5a253052bF2b46EbB70da77876Cd085ac/sources/contracts/lendingpool/ExtraInterestBearingToken.sol
Mints `amount` eTokens to `user`, only the LendingPool Contract can call this function. user The address receiving the minted tokens amount The amount of tokens getting minted/
function mint( address user, uint256 amount ) external onlyLendingPool nonReentrant { _mint(user, amount); emit Mint(user, amount); }
11,556,861
...
inject NONSTANDARD NAMING
function GETREFERRER855(address farmer) external view returns (address);
7,225,429
// File @rari-capital/solmate/src/tokens/ERC20.sol@v6.2.0 // SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Unis...
Claim Staked NFT rewards in ODDX. Also resets general holding timestamp so users can't double-claim for holding/staking. genzeeIds list of genzee ids to claim rewards for. total rewards amount to claim (all genzees) loop variables rewards for current genzee in the loop below current genzeeid in the loop below staking ...
function claimStakedNftRewards(uint256[] calldata genzeeIds) external whenNotPaused { if (genzeeIds.length == 0) revert InvalidInput(); uint256 totalRewards; uint256 rewards; uint256 genzeeId; StakingData memory stake; for (uint256 i; i < genzeeIds.length; i++) ...
5,342,448