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; pragma experimental ABIEncoderV2; import "../token/ERC721/extensions/ERC721Enumerable.sol"; import "../token/ERC721/extensions/ERC721URIStorage.sol"; import "../access/AccessControlEnumerable.sol"; import "../token/ERC20/IERC20.sol"; contract Tatum721 is ERC7...
checking cashback addresses exists and sum of cashbacks transferring cashback to authors transferring cashback to authors
function safeTransfer(address to, uint256 tokenId) public payable { address erc = _customToken[tokenId]; IERC20 token; if (erc != address(0)) { token = IERC20(erc); } if (_cashbackRecipients[tokenId].length != 0) { require( _cashbackRec...
1,822,602
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "hardhat/console.sol"; /// @title Token /// @author cybertelx /// @notice The token con...
Pause/unpause an account, rendering it incapable of transacting. Only executable by a moderator. addr The address to pause toggle Paused? Yes or No
function setPause(address addr, bool toggle) public { require(hasRole(MODERATOR, msg.sender), "You aren't a mod!"); paused[addr] = toggle; }
1,030,054
./full_match/77/0xFAD08dB559EB7D84AD58C9dfDe1A8fC8Acb33f65/sources/contracts/rollup/facets/AbsRollupUserFacet.sol
Calculate the number of zombies staked on the given node This function could be uncallable if there are too many zombies. However, removeZombie and removeOldZombies can be used to remove any zombies that exist so that this will then be callable node The node on which to count staked zombies return The number of zombi...
function countStakedZombies(INode node) public view override returns (uint256) { uint256 currentZombieCount = zombieCount(); uint256 stakedZombieCount = 0; for (uint256 i = 0; i < currentZombieCount; i++) { if (node.stakers(zombieAddress(i))) { stakedZombieCount++...
5,047,680
./partial_match/4/0xF43318b1793DdC37a1265A6e42f677c1AEe598a6/sources/GovTreasurer.sol
VALIDATION | ELIMINATES POOL DUPLICATION RISK
function checkPoolDuplicate(IERC20 _lpToken) public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { require(poolInfo[pid].lpToken != _lpToken, "add: existing pool?"); } }
8,687,696
// File: contracts/Ownable.sol pragma solidity 0.5.0; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; address pr...
Set the blacklistStore _newblacklistStore The blacklistStore address to set/
function setBlacklistStore(address _newblacklistStore) public onlyOwner returns (bool) { emit BlacklistStoreSet(address(blacklistStore), _newblacklistStore); blacklistStore = BlacklistStore(_newblacklistStore); return true; }
13,138,442
./partial_match/42/0x631FFD1AA2A854736727b02379a147cBE0E98F9f/sources/UBXGStaking.sol
return the address of the owner./
function owner() public view returns(address) { return _owner; }
3,328,029
./partial_match/1/0xd6D2e3409Fd835A31CaF3f20dCF98c0C1F15184d/sources/ExchangeNFTCreator.sol
Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ...
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } } function isContract(address account) internal view returns (bool) { return account.code.len...
15,573,770
./full_match/1/0xac30e1e3bA2810a758f1a3ae91Ad42D1950010a9/sources/localhost/picontract/picontract.sol
_pi 是指 pi token 的合约 _entrance 指 pi token 的铸币合约 _balancer 是 pi token/weth 合约的地址 buy token at balancer exit the pie pool check result
function balancerToPi( address _entrance, address _balancer ) public payable onlyTrader { uint256 ethIn = (msg.value % (1 ether)) * 100; uint256 maxPrice = 1000000000000000000000000000; IEntrance entrance = IEntrance(_entrance); address _pi = entrance.pip...
2,958,302
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ // Dependency file: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While...
Called by a registered FarmGenerator upon Farm creation _farmAddress Address of the farm/
function registerFarm(address _farmAddress) external { require(farmGenerators.contains(msg.sender), "FORBIDDEN"); farms.add(_farmAddress); }
15,310,094
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract SmartChefMarket is Ownable { using SafeERC20 for IERC20; uint ...
Update reward variables of the given pool to be up-to-date.
function updatePool() public { uint multiplier = getMultiplier(lastRewardBlock, block.number); if(multiplier == 0){ return; } lastRewardBlock = block.number; if(_totalTokenPlaced == 0){ return; } for(uint i = 0; i < listRewardTokens.le...
13,016,432
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/access/manager/AccessManager.sol
Extracts the selector from calldata. Panics if data is not at least 4 bytes/
function _checkSelector(bytes calldata data) private pure returns (bytes4) { return bytes4(data[0:4]); }
8,082,779
pragma solidity ^0.4.16; // BitDrive Smart contract based on the full ERC20 Token standard // https://github.com/ethereum/EIPs/issues/20 // Verified Status: ERC20 Verified Token // BITDRIVE tokens Symbol: BTD contract BITDRIVEToken { /* This is a slight change to the ERC20 base standard. function totalSupply...
Public variables of the token //
function BITDRIVE(){ }
1,980,486
./full_match/1/0x73BCA358e83dE2e1e4B328a3F200aBFed32BE654/sources/contracts/v4/extensions/Whitelistable.sol
Update a Whitelist configuration _editionId Edition ID of the WL to be updated _amount Amount of the WL to be updated mintPriceInFinney Price of the WL to be updated newAmount New Amount newMintPriceInFinney New mint price in Finney newMintStartTS New Mint time newMerkleRoot New Merkle root Note: When changing a...
function updateWLConfig( uint256 _editionId, uint8 _amount, uint24 mintPriceInFinney, uint8 newAmount, uint24 newMintPriceInFinney, uint32 newMintStartTS, uint32 newMintEndTS, bytes32 newMerkleRoot ) public onlyAdmin { WhitelistableState.WL...
16,448,669
./partial_match/1/0x4eeF4C43734690ffe34a00A872234037676D7990/sources/contracts/Manager.sol
Requested by Valerio Di Napoli. _raffleId id of the raffle _amountOfEntries amount of entries. Must be lower than maxEntriesPerUser _player The address of the player Called by other contract created by Valerio, that minted an NFT and after that call this method add entries but they are free so no payable if can bu...
function createFreeEntriesFromExternalContract( uint256 _raffleId, uint256 _amountOfEntries, address _player ) external onlyRole(MINTERCONTRACT_ROLE) nonReentrant { bytes32 hash = keccak256(abi.encode(_player, _raffleId)); RaffleStruct storage raffle = raffles[_raffleId...
3,577,071
./full_match/4/0x6B473bB10A8b6B8Bea4a0F0D23811f3b620e8384/sources/contracts/token/TokenERC721.sol
Collects and distributes the primary sale value of tokens being claimed.
function collectPrice(MintRequest memory _req) internal { if (_req.price == 0) { return; } uint256 totalPrice = _req.price; uint256 platformFees = (totalPrice * platformFeeBps) / MAX_BPS; (address twFeeRecipient, uint256 twFeeBps) = thirdwebFee.getFeeInfo(address...
661,258
./full_match/4/0xB62652A9f4ac3D85F09dA08F31963108Dd2BfD23/sources/contracts/OptionMarketPricer.sol
Calculates the impact a trade has on the base IV of the OptionBoard and the skew of the OptionListing. listing The OptionListing. trade The Trade. pricingGlobals The PricingGlobals. boardBaseIv The base IV of the OptionBoard./
function ivImpactForTrade( IOptionMarket.OptionListing memory listing, IOptionMarket.Trade memory trade, ILyraGlobals.PricingGlobals memory pricingGlobals, uint boardBaseIv ) public pure override returns (uint, uint) { uint orderSize = trade.amount.divideDecimal(pricingGlobals.standardSize); ...
12,434,390
pragma solidity ^0.5.0; import "./HitchensUnorderedKeySet.sol"; /** * @title A distributed tournament ledger * @author James Richards * @notice This is a pre-release work-in-progress. Use at your own risk! * * A competitive tournament among a number of competitors who participate in matches. * Competitors m...
Creates a rule for the tournament or a particular sport or division, such as cleanliness requirements, or weight limitations for a division name human friendly name of the rule description detailed description of the rule return bytes32 uniquely identifying the created rule/
function addRule(string memory name, string memory description) public onlyAdmin returns (bytes32) { bytes32 rlId = this.newId(); rulesRegistry.insert(rlId); Rule storage rl = rules[rlId]; rl.id = rlId; rl.name = name; rl.description = description; emit RuleAdded(rl.id, rl.name); ...
952,014
./partial_match/1/0xcd351d3626Dc244730796A3168D315168eBf08Be/sources/KeyManager.sol
Update the Community Key. Can only be called by the current Community Key. newCommKey New Community key address./
function setCommKeyWithCommKey(address newCommKey) external override onlyCommunityKey nzAddr(newCommKey) { emit CommKeySetByCommKey(_commKey, newCommKey); _commKey = newCommKey; }
9,408,009
// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT // pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupp...
Returns the value of the `string` type that mapped to the given key./
function getString(bytes32 _key) external view returns (string memory) { return stringStorage[_key]; }
342,390
./full_match/80001/0x7B5889b444E3D71b86C3CF4e86ea588F5cB4D86b/sources/project_/contracts/QBEMetadata.sol
final tokenURI json
function tokenURI(uint256 tokenId) external view returns (string memory) { string memory _tokenId = tokenId.toString(); bytes memory dataURI = abi.encodePacked( "{", '"name": "QBE #', _tokenId, _tokenId, domain, "/screenshotView...
5,612,654
./full_match/97/0x39d71a752bAF5aA4012fF3830cb3775311F9bce0/sources/Users/oscar1/Crocoswapv2/Crocoswap-token/contracts/Croco.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, ...
3,265,232
/* Copyright 2018 dYdX Trading 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 ...
if user has enough tokens, allow the close to occur
function getCloseAmounts( uint256 requestedCloseAmount, uint256 balance, uint256 positionPrincipal ) private view returns ( uint256 /* tokenAmount */, uint256 /* allowedCloseAmount */ ) { uint256 positionBalance = Margin...
5,505,783
pragma solidity 0.4.26; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterAnchor.sol"; import "./interfaces/IConverterUpgrader.sol"; import "./interfaces/ISovrynSwapFormula.sol"; import "../ISovrynSwapNetwork.sol"; import "../utility/ContractRegistryClient.sol"; import "../utility/ReentrancyGuard.sol...
updates the current conversion fee can only be called by the contract owner _conversionFee new conversion fee, represented in ppm/
function setConversionFee(uint32 _conversionFee) public ownerOnly { require(_conversionFee <= maxConversionFee, "ERR_INVALID_CONVERSION_FEE"); emit ConversionFeeUpdate(conversionFee, _conversionFee); conversionFee = _conversionFee; }
15,790,703
./full_match/4/0x8B1e99D7658C9dB89b24167e621c64Ad0aeBbec6/sources/browser/comp2.sol
Sender borrows assets from the protocol to their own address borrowAmount The amount of the underlying asset to borrow return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ return borrowInternal(borrowAmount);
function borrow(uint borrowAmount) external returns (uint) { }
13,338,509
pragma solidity ^0.6.0; ...
inject NONSTANDARD NAMING
function LOG40(address p0, bool p1, bool p2) internal view {
1,018,954
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.10; import {ReentrancyGuard} from "@rari-capital/solmate/src/utils/ReentrancyGuard.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {ERC721TransferHelper} from "../../../transferHelpers/ERC721TransferHelper.sol"; import {Uni...
Ensure that we aren't somehow paying out more than we have Payout each royalty recipient
function _handleRoyaltyEnginePayout( address _tokenContract, uint256 _tokenId, uint256 _amount, address _payoutCurrency for (uint256 i = 0; i < recipients.length; i++) { require(remainingAmount >= amounts[i], "insolvent"); _handleOutgoingTransfer(recip...
12,707,318
./full_match/3/0xD299D9FC11E2ef20847564C81cc62807587da44f/sources/NETR-ICO/CrowdSaleBase.sol
calculate token amount to be created
function buyTokens(uint256 _weiAmount) private { require(validPurchase(), "Requirements to buy are not met"); uint256 rate = getRate(); uint256 amount = 0; uint256 tokens = 0; uint256 newBalance = 0; participations[msg.sender] = participations[msg.sender].safe...
8,268,466
pragma solidity ^0.4.18; // @author - vivekjibw@gmail.com // Website: http://CryptoStockMarket.co // Only CEO can change CEO and CFO address contract CompanyAccessControl { address public ceoAddress; address public cfoAddress; bool public paused = false; modifier onlyCEO() { require(msg...
Whenever there is transfer of tokens from _from to _to, CEO of company might get changed!
function _updateCEOIfRequired(Company storage _company, uint _companyId, address _to) internal { uint sharesRequiredToBecomeCEO = (_company.sharesInCirculation/2 ) + 1; address currentCEO = _company.ceoOfCompany; if (_company.shareHolders.ownerAddressToShares[currentCEO] >= sha...
270,897
./partial_match/42/0x60fceA9D25a9E06d3fFFA57191F727623451d02a/sources/L2.sol
NOTE: theoretically possible overflow of (_offset + 32)
function readBytes32(bytes memory _data, uint256 _offset) internal pure returns (uint256 newOffset, bytes32 r) { newOffset = _offset + 32; r = bytesToBytes32(_data, _offset); }
3,304,201
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol'; import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20....
Receive an exact amount `amountToReceive` of `assetToSwapTo` tokens for as few `assetToSwapFrom` tokens as possible. assetToSwapFrom Origin asset assetToSwapTo Destination asset maxAmountToSwap Max amount of `assetToSwapFrom` allowed to be swapped amountToReceive Exact amount of `assetToSwapTo` to receive return th...
function _swapTokensForExactTokens( address assetToSwapFrom, address assetToSwapTo, uint256 maxAmountToSwap, uint256 amountToReceive, bool useEthPath ) internal returns (uint256) { uint256 fromAssetDecimals = _getDecimals(assetToSwapFrom); uint256 toAssetDecimals = _getDecimals(assetToSw...
68,082
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.7.6; pragma abicoder v2; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC721Receiv...
Lock ERC720 amount in vault until expires, redeemable by recipient recipient Address with right to withdraw after expires token Address of token to lock amount Amount of token to lock expires Timestamp when recipient is allowed to withdraw
function timeLockERC20(address recipient, address token, uint256 amount, uint256 expires) public onlyOwner { require( IERC20(token).allowance(msg.sender, address(this)) >= amount, "Amount not approved" ); require( expires > block.timestamp, "Expires must be in f...
13,630,967
./partial_match/42/0x7Dab59e2Ca3a043316C2039453989d8519756d92/sources/DisposableGovernance.sol
Updates the Timestamp at which result of oracalize call is received./
function updateDateUpdOfAPI(bytes32 myid) external onlyInternal { allAPIid[myid].dateUpd = uint64(now); }
3,299,851
./full_match/43113/0x4BaF61EF436Ca3BC7881F8085e597cB4b4904729/sources/contracts/Pantheon_Finance_Testing/MasterChef_to_check.sol
Safe $Drach transfer function, just in case if rounding error causes pool to not have enough $Drachs.
function safe$DrachTransfer(address _to, uint256 _amount) internal { uint256 $DrachBal = $Drach.balanceOf(address(this)); if (_amount > $DrachBal) { $Drach.transfer(_to, $DrachBal); $Drach.transfer(_to, _amount); } }
7,164,762
pragma solidity ^0.5.0; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "../container/ContainerContext.sol"; import "./MyERC20Mintable.sol"; import "./MyERC20Detailed.sol"; /** * @title 用户转账无需 Gas 的 ERC20 Token * @dev 角色设计: * 1. Token Issuer, token 的发行者,初始铸造的 token 都记在 issuer 账户上 * 2. Token M...
Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./
function increaseAllowance(address spender, uint256 addedValue) public onlyContainer() returns (bool) { return MyERC20.increaseAllowance(spender, addedValue); }
1,054,598
./full_match/80001/0x241AFF7e7b347e8Ca6b040dAAA2e67Ca4884bb6E/sources/project_/contracts/MysticGalacticMission1.sol
Sets a new recovery event date as a Unix timestamp. Can only be called by the owner or an admin. The new recovery event date must be greater than the current block timestamp and the launch event date. _recoveryEventDate The new recovery event date as a Unix timestamp./
function setRecoveryEventDate(uint256 _recoveryEventDate) external onlyOwnerOrAdmin { require(_recoveryEventDate > block.timestamp, "Recovery event date must be in the future"); if (launchEventDate != 0) { require(_recoveryEventDate > launchEventDate, "Recovery event date must be greater...
5,624,112
./full_match/1/0xd1d7E71869034D19716B3EED3017014ac0928154/sources/contracts/PerfectSafemoonFundFeeBNB.sol
The TaxFee is the total fee we tax on transfer on the Transaction on the contract.
function _transfer(address sender, address recipient, uint256 amount) internal override { if(isSwapEnabled && !inSwap && sender != uniswapV2Pair){ swapAndDistribute(); } uint256 transferAmount = amount; if(isTaxActive && !isTaxless[sender] && !isTaxless[recipient]) { ...
8,306,062
/** *Submitted for verification at Etherscan.io on 2021-12-14 */ /** *Submitted for verification at Etherscan.io on 2021-10-07 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's bu...
Performs a Solidity function call using a low level `call`. A plain `call` is an unsafe replacement for a function call: use this function instead. If `target` reverts with a revert reason, it is bubbled up by this function (like regular Solidity function calls). Returns the raw returned data. To convert to the expecte...
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
1,274,347
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT OR Apache-2.0 import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; im...
Accrues users balances from deposit priority requests in Exodus mode WARNING: Only for Exodus mode Canceling may take several separate transactions to be completed _n number of requests to process
function cancelOutstandingDepositsForExodusMode(uint64 _n, bytes[] memory _depositsPubdata) external nonReentrant { uint64 toProcess = Utils.minU64(totalOpenPriorityRequests, _n); require(toProcess == _depositsPubdata.length, "A"); uint64 currentDepositIdx = 0; for (uint64 id = first...
72,123
pragma solidity ^0.5.0; // ---------------------------------------------------------------------------- // 'FLETA' 'Fleta Token' token contract // // Symbol : FLETA // Name : Fleta Token // Total supply: 2,000,000,000 (Same as 0x7788D759F21F53533051A9AE657fA05A1E068fc6) // Decimals : 18 // // Enjoy. // // (c) Sam J...
------------------------------------------------------------------------ Owner can transfer out any accidentally sent ERC20 tokens ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); }
373,994
// File: @openzeppelin\contracts-ethereum-package\contracts\token\ERC20\IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of...
Operator should call this to exchange CRV to DAI/
function performStrategyStep2(bytes calldata dexagSwapData, address swapStablecoin) external onlyDefiOperator { uint256 crvAmount = IERC20(crvToken).balanceOf(address(this)); IERC20(crvToken).safeApprove(dexagApproveHandler, crvAmount); (bool success, bytes memory result) = dexagProxy.call(d...
2,397,376
/** *Submitted for verification at Etherscan.io on 2021-03-26 */ pragma experimental ABIEncoderV2; pragma solidity 0.6.4; // SPDX-License-Identifier: MIT library EthAddressLib { /** * @dev returns the address used within the protocol to identify ETH * @return the address assigned to ETH */ fu...
SPDX-License-Identifier: MIT
interface IPriceOracles { function get(address token) external view returns (uint256, bool); }
2,375,615
// File: helpers/IUniswapV2Factory.sol // SPDX-License-Identifier: bsl-1.1 /* Copyright 2020 Unit Protocol: Artem Zakharov (az@unit.xyz). */ pragma solidity ^0.6.8; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function getPair(address...
USD token's rate is UniswapV2 Token/WETH pool's average price between proof's blockNumber and current block number Merkle proof must be in range [MIN_BLOCKS_BACK ... MAX_BLOCKS_BACK] blocks ago {Token}/WETH pair must be registered on Uniswap asset The token address amount Amount of tokens proofData Merkle proof da...
function assetToEth(address asset, uint amount, UniswapOracle.ProofData memory proofData) public override view returns (uint) { IUniswapV2Pair pair = IUniswapV2Pair(uniswapFactory.getPair(asset, WETH)); require(address(pair) != address(0), "Unit Protocol: UNISWAP_PAIR_DOES_NOT_EXIST"); (uint...
5,916,780
./partial_match/1/0x4c7fbeEC0412976f59D83eAdee34BFE7ca2540DC/sources/Pyromaniac.sol
Returns the integer division of two unsigned integers, reverting with custom message on division by zero. The result is rounded towards zero. Counterpart to Solidity's `/` operator. Note: this function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consumi...
function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } }
4,032,311
./full_match/1/0x33a0d1F7498b5DAB6ef42f332D0fCd1b0a3ad2A9/sources/contracts/joint.sol
this function is called by Joint to see if it needs to stop initiating new epochs due to too high volatility if we are closing the position before 50% of hedge period has passed, we did something wrong so auto-init is stopped NOTE: if timeToMaturity is 0, it means that the epoch has finished without being exercised Som...
function _autoProtect() internal view override returns (bool) { uint256 timeToMaturity = getTimeToMaturity(); if (activeCallID != 0 && activePutID != 0) { if ( timeToMaturity == 0 || timeToMaturity > period.mul(50).div(100) ) { return true; ...
3,009,087
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import "./FuseGuardian.sol"; import "./IMasterOracle.sol"; contract FuseAdmin is FuseGuardian { error ComptrollerError(); /// @param _core address of core contract /// @param _comptroller the fuse comptroller constructor( a...
Set the given borrow caps for the given cToken markets. Borrowing that brings total borrows to or above borrow cap will revert. Admin or borrowCapGuardian function to set the borrow caps. A borrow cap of 0 corresponds to unlimited borrowing. cTokens The addresses of the markets (tokens) to change the borrow caps for ...
function _setMarketBorrowCaps(CToken[] memory cTokens, uint[] calldata newBorrowCaps) external isGovernorOrGuardianOrAdmin { _setMarketBorrowCapsInternal(cTokens, newBorrowCaps); }
4,092
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.11; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ ...
Approve the metapool LP tokens for zapper contract Withdraw FRAX, USDC, and USDT from the metapool at the current balance
function metapoolWithdrawAtCurRatio( uint256 _metapool_lp_in, uint256 min_frax, uint256 min_dai, uint256 min_usdc, uint256 min_usdt ) external onlyByOwnGov returns (uint256 frax_received, uint256 dai_received, uint256 usdc_received, uint256 usdt_received) { fr...
7,263,869
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/IStaking.sol"; contract YieldFarmGenericToken { // lib using SafeMath for uint; using...
checks for requested epoch
function harvest (uint128 epochId) external returns (uint){ require (_getEpochId() > epochId, "This epoch is in the future"); require(epochId <= NR_OF_EPOCHS, "Maximum number of epochs is 12"); require (lastEpochIdHarvested[msg.sender].add(1) == epochId, "Harvest in order"); uint use...
26,431
./full_match/1/0xF380F025675A868eD5614a1Dd77c6b05f4147004/sources/contracts/SiloRouterV2.sol
Resolve asset to send back to user on finish of the actions. Usually, it is the equal to `_action.asset`. Returns the address of underlying asset in case of the `Unwrap` action. _action specific action struct return asset address
function _resolveAssetToSend(Action calldata _action) internal view virtual returns (IERC20 asset) { if (_action.actionType == ActionType.Unwrap) { asset = IERC20(IConvexSiloWrapper(address(_action.asset)).underlyingToken()); asset = _action.asset; } }
8,363,527
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.3; import "../interfaces/IERC20.sol"; import "../libraries/History.sol"; import "../libraries/VestingVaultStorage.sol"; import "../libraries/Storage.sol"; import "../interfaces/IVotingVault.sol"; contract VestingVault is IVotingVault { // Bring our libra...
Claim all withdrawable value from a grant. claiming value resets the voting power, This could either increase or reduce the total voting power associated with the caller's grant. load the grant get the withdrawable amount transfer the available amount only move range bound if grant was accepted
function claim() public { VestingVaultStorage.Grant storage grant = _grants()[msg.sender]; uint256 withdrawable = _getWithdrawableAmount(grant); token.transfer(msg.sender, withdrawable); grant.withdrawn += uint128(withdrawable); if (grant.range[1] > 0) { grant.r...
13,511,862
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/helpers/PointerLibraries.sol
Reads the int72 at `rdPtr` in returndata.
function readInt72( ReturndataPointer rdPtr ) internal pure returns (int72 value) { assembly { returndatacopy(0, rdPtr, _OneWord) value := mload(0) } }
4,300,489
./full_match/1/0xc3f2C8F9d5F0705De706b1302B7a039e1e11aC88/sources/contracts/adapt/Relay.sol
Executes multicall batch _requireSuccess - Whether transaction should throw on call failure _calls - multicall array/
function multicall(bool _requireSuccess, Call[] calldata _calls) external payable onlySelfIfExecuting { _multicall(_requireSuccess, _calls); }
17,076,202
./full_match/7672/0x04742440f3272232Dd46FCDb3e86A4c2961d5164/sources/contracts/payments/ticketing/RewardsManager.sol
Call this function to calculate the total reward owed to a staker. This value will include all epochs since the last claim was made up to the previous epoch. This will also add any pending rewards to the final value as well. This function will utilize the cumulative reward factor to perform the calculation, keeping th...
function calculateStakerClaim(address stakee, address staker) public view returns (uint256) { if (stakee == address(0)) { revert StakeeCannotBeZeroAddress(); } if (staker == address(0)) { revert StakerCannotBeZeroAddress(); } bytes32 stakerKey = getSt...
16,296,048
./partial_match/56/0x49d11b03ac6C9290F894af93b378d7e27Ce8aBBF/sources/GanjaFarm.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transferFrom(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: Owner of Ganja"); require(recipient != address(0), "BEP20: Recipemt of Ganja"); _balances[sender] = _balances[sender].sub(amount, "BEP20: Not enough Ganja"); _balances[recipient]...
11,242,072
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; import "./IPCVDripController.sol"; import "./Incentivized.sol"; import "./Timed.sol"; /// @title a PCV dripping controller /// @author Fei Protocol contract PCVDripController is IPCVDripController, CoreRef, Timed, Incentivized { /// @notice ...
checks whether the target balance is less than the drip amount
function dripEligible() public view virtual override returns(bool) { return target.balance() < dripAmount; }
401,886
./partial_match/100/0x917593D7d4f5F8c1B2a4EE957d49eC9f6C6dbF96/sources/EthicHubLending.sol
Waiting for Exchange
function sendFundsToBorrower() external onlyOwnerOrLocalNode { require(state == LendingState.Funded, "State has to be AcceptingContributions"); uint256 systemFee = totalLendingAmount.mul(systemFees).mul(interestBaseUint).div(interestBasePercent); uint256 teamFee = totalLendingAmount.mul(ethi...
16,648,792
./partial_match/1/0xD82f93E193526975d4783604dC9490B916Dd0b0C/sources/contracts/interfaces/IBackingManager.sol
IBackingManager The BackingManager handles changes in the ERC20 balances that back an RToken. - It computes which trades to perform, if any, and initiates these trades with the Broker. - If already capitalized, excess assets are transferred to RevenueTraders. `manageTokens(erc20s)` and `manageTokensSortedOrder(erc...
interface IBackingManager is IComponent, ITrading { event TradingDelaySet(uint48 indexed oldVal, uint48 indexed newVal); event BackingBufferSet(uint192 indexed oldVal, uint192 indexed newVal); function init( IMain main_, uint48 tradingDelay_, uint192 backingBuffer_, uint192 ...
16,032,507
./full_match/1/0x3c1164531d5857029ae5412E49999306547834d8/sources/@rmrk-team/evm-contracts/contracts/RMRK/equippable/RMRKMinifiedEquippable.sol
@inheritdoc IERC5773/
function getAssetMetadata( uint256 tokenId, uint64 assetId ) public view virtual returns (string memory) { if (!_tokenAssets[tokenId][assetId]) revert RMRKTokenDoesNotHaveAsset(); return _assets[assetId]; }
9,657,755
./partial_match/1/0x2234a7c690AF5de948B3a1CcbEa43705E4583D2d/sources/src/contracts/IncentivizingLiquidityAMO.sol
Function to deposit incentives to all active pools (based on TVL ratio) _totalIncentAmount Total Incentive budget _FixedIncent Incentivize considering FixedIncent
function incentivizeAllPoolsByTvl(uint256 _totalIncentAmount, bool _FixedIncent) public onlyByOwnerOperator { uint256 _totalTvl = showActivePoolsTvl(); for (uint i = 0; i < poolArray.length; i++) { if (_FixedIncent && poolHasFixedIncent[poolArray[i]]) { incentivizePoolByF...
16,140,186
// SPDX-License-Identifier: MIT /* /$$ /$$ | $$ | $$ /$$$$$$$ /$$$$$$ /$$ /$$ /$$$$...
set minting condition minting requires 1) to have 100 churu 2) msg.value > cost non-whitelist mint costs 0.03 ether whitelist can mint free for up to 10 giveaways(total)
function mint(address to, uint256 tokenId) public payable whenNotPaused setCost{ require(churu.balanceOf(to) > requiredChuru, "Should own 100+ Churu"); if (!whitelist[to]) { require(msg.value > cost, "Enter a proper ether amount."); mintNFT(to, tokenId); } ...
6,480,778
//SPDX-License-Identifier: GPL-3.0 pragma solidity 0.7.3; import { IUniswapV3Pool } from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {DSMath} from "../libraries/DSMath.sol"; import {OracleLibrary} from "../libraries/OracleLi...
Calculate the variance using the existing tuple (count, mean, m2) count is the length of the dataset m2 is the sum of square errors/
function variance(uint256 count, uint256 m2) internal pure returns (uint256) { require(count > 0, "!count"); return m2 / count; }
13,669,921
/** *Submitted for verification at Etherscan.io on 2021-06-28 */ // SPDX-License-Identifier: NONE pragma solidity 0.5.17; pragma experimental ABIEncoderV2; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a con...
The function for token minting. It creates a new token. Can be called only by the contract owner. Must contain the signature of the format: `sha3(tokenContract.address.toLowerCase() + tokenId)`. Where `tokenContract.address` is the address of the contract and tokenId is the id in uint256 hex format. ...
function mint(uint256 tokenId, uint8 v, bytes32 r, bytes32 s, Fee[] memory _fees, string memory tokenURI) public { super.mint(tokenId, v, r, s, _fees, tokenURI); }
10,557,498
pragma solidity ^0.8.6; // SPDX-License-Identifier: MIT /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
Override isApprovedForAll to whitelist proxy accounts/ Opensea address
function isApprovedForAll(address _owner, address _operator) public override view returns (bool isOperator) { if ( _operator == address(openseaProxyAddress) ) { return true; } return super.isApprovedForAll(_owner, _operator...
7,877,330
pragma solidity 0.4.24; import "./Ownable.sol"; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; contract Managed is Ownable, ReentrancyGuard { using SafeMath for uint256; /** * @dev keeping addresses who allowed to exec onlyManager functions * @knownIssue "private" modifier don't make it invis...
CONTRACT BODY / Adds new manager, called from backend/
function addManager( address newManager ) public onlyOwner nonReentrant { require( !isManager[newManager], "This address is already a manager" ); require(managers.length < 10); managers.push(newManager); isManager[newManager] = true; emit NewManagerAdded(newManage...
12,996,114
./full_match/4/0x8788C182D3f3A943F341cF6E8e10Dcbe9E49f9e1/sources/ERC721A_flat.sol
mint first drop on deployment.
function _beforeTokenTransfer( address from, address to, uint256 tokenId function _afterTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.4; constructor() ERC721("Sussy Kneels", "KNEEL") { safeMintBatch(owner(), "Q...
12,530,233
pragma solidity ^0.4.24; /* _____ _ /__ \_ __ ___ __ _ ___ _ _ _ __ ___ /\ /\_ _ _ __ | |_ / /\/ '__/ _ \/ _` / __| | | | '__/ _ \ / /_/ / | | | '_ \| __| / / | | | __/ (_| \__ \ |_| | | | __/ / __ /| |_| | | | | |_ \/ |_| \___|...
reset valuesdelete usedNumbers;
function restartGame() internal { prizeCount = 0; delete numbers; delete PrizeNums; delete bytesArray; gameCount = gameCount + 1; numberCount = 0; for (uint8 i = 0; i<101; i++) { usedNumbers[i] = false; } emit Restart(gameCount); ...
12,809,534
./full_match/4/0x30FA9fE63609af35b2b0fC454a22f33Fb84b1522/sources/contracts/Uniswap/UniswapAnchoredView.sol
Post open oracle reporter prices, and recalculate stored price by comparing to anchor We let anyone pay to post anything, but only prices from configured reporter will be stored in the view. messages The messages to post to the oracle signatures The signatures for the corresponding messages symbols The symbols to c...
function postPrices(bytes[] calldata messages, bytes[] calldata signatures, string[] calldata symbols) external { require(messages.length == signatures.length, "messages and signatures must be 1:1"); for (uint i = 0; i < messages.length; i++) { priceData.put(messages[i], signatures[i]);...
803,291
pragma solidity ^0.4.24; import "./NakamonstaERC721.sol"; contract NakamonstaBase is NakamonstaERC721 { struct Nakamonsta { string name; uint genes; uint64 birthDate; uint64 readyDate; uint64 motherId; uint64 fatherId; } Nakamonsta[] public nakamonstas; event NakamonstaBirth(uint na...
-------------------------------- Public methods --------------------------------
function createGen0Nakamonsta(address _to, string memory _name, uint _genes) public onlyOwner returns (uint) { require(nakamonstas.length != 0, "Genesis must be created"); return _createNakamonsta(_to, _name, _genes, 0, 0); }
7,235,950
./full_match/1/0x13Bdb00E3Ad547aD392E9B4f1f91EDE8ACDb77CF/sources/contracts/CIV-Vault.sol
Fetches the deposit parameters for a given strategy _id. _id The _id of the strategy to fetch the information for. _user The address of the user to fetch the information for. _index The index of the deposit to fetch the information for. return userEpochStruct The UserInfoEpoch struct associated with the provided _id...
function getUserInfoEpoch( uint _id, address _user, uint _index ) external view checkStrategyExistence(_id) returns (UserInfoEpoch memory userEpochStruct) { userEpochStruct = _userInfoEpoch[_id][_user][_index]; }
9,693,332
pragma solidity >=0.5.3 < 0.6.0; import { BaseTokenManager } from "../BaseTokenManagerV1.sol"; import { IERC20 } from "../../../_resources/openzeppelin-solidity/token/ERC20/IERC20.sol"; /// @author Ben, Veronica & Ryan of Linum Labs /// @author Ryan N. RyRy79261 /// @title Basic Linear Token Manager c...
Transfer tokens from one address to another _from :address The address which you want to send tokens from _to :address The address which you want to transfer to _value :uint256 the amount of tokens to be transferred This is to allow the membership manager elevated access for managing tokens
function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from], "Requested amount exceeds balance"); if(msg.sender != membershipManager_){ require(_value <= allowed[_fr...
12,954,590
// 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,...
Retrieves the debt assets (negative value) of the external position return assets_ Debt assets return amounts_ Debt asset amounts
function getDebtAssets() external override returns (address[] memory assets_, uint256[] memory amounts_) { assets_ = borrowedAssets; amounts_ = new uint256[](assets_.length); for (uint256 i; i < assets_.length; i++) { amounts_[i] = ERC20(getDebtTokenF...
381,982
// 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 ISGLOBALCONSTRAINTREGISTERED605(address _globalConstraint, address _avatar) external view returns(bool);
15,855,730
./full_match/1/0xDbadeFb972132C82BE8601Fa7b9Ba4801262271d/sources/@exoda/contracts/token/ERC20/ERC20.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(account != address(0), "ERC20: mint to address(0)"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); }
16,409,173
./partial_match/1/0x3b025EABf29b05566BDcbd3bCb46801Cb6C6F372/sources/CommunityTokenHolder.sol
return Total eth that still available for collection in weis.
function weiToCollect() public constant returns(uint256) { return totalWeiCap > totalWeiCollected ? totalWeiCap.sub(totalWeiCollected) : 0; }
2,799,657
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IExchange.sol"; import "./interfaces/ISortedOracles.sol"; import "./interfaces/IReserve.sol"; import "./interfaces/IStableToken.sol"; import "../commo...
Allows owner to set the Reserve Fraction newReserveFraction The new value for the reserve fraction/
function setReserveFraction(uint256 newReserveFraction) public onlyOwner { reserveFraction = FixidityLib.wrap(newReserveFraction); require(reserveFraction.lt(FixidityLib.fixed1()), "reserve fraction must be smaller than 1"); emit ReserveFractionSet(newReserveFraction); }
2,472,861
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721A.sol"; contract Playfuldegens is Ownable, ERC721A, ReentrancyGuard { uin...
this is reserved function which used to gift the degens to the given account address
function releaseReserved(address userAddress, uint256 numberOfTokens) external onlyOwner { require(RESERVED_MINTS_AVAILABLE - numberOfTokens >= 0, "Purchase would exceed reserved tokens"); }
14,505,969
./partial_match/1/0x79e6059BcBEE63b26E602830148584Fd71b5e2fD/sources/EIP20Gateway.sol
Activate Gateway contract. Can be set only by the Organization address only once by passing co-gateway address. _coGatewayAddress Address of cogateway. return success_ `true` if value is set/ update the encodedGatewayPath
function activateGateway( address _coGatewayAddress ) external onlyOrganization returns (bool success_) { require( _coGatewayAddress != address(0), "Co-gateway address must not be zero." ); require( remoteGatewa...
15,657,187
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; /// @author: manifold.xyz ////////////////////////////////////////////////////////// // // // // // XX XX //...
See {INFT2ERC20-burnToken}./
function burnToken(address tokenContract, uint256[] calldata args, string calldata spec, address receiver) public override nonReentrant { _burnToken(tokenContract, args, spec, receiver); }
12,898,103
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; import "https://github.com/vigilance91/solidarity/libraries/unsigned/uint256Constraints.sol"; import "https://github.com/vigilance91/solidarity/libraries/msg/sender/value/msgValueLogic.sol"; /// /// @title msg.v...
msg.value != 0 && msg.value >= rhs''
function requireMsgValueGreaterThanOrEqualAndNonzero( uint256 rhs )internal view { (msgValueLogic.msgValueGreaterThanZero() && rhs.msgValueGreaterThanOrEqual()).requireTrue( ); }
895,641
./full_match/137/0x45c98916d85e9325C9266e9BFad04629172baEF7/sources/project_/contracts/market/ERC721Listings.sol
check if delisting action is valid if not valid, return the reason/
function _checkDelistAction( address erc721Address, uint256 tokenId ) private view returns (bool isValid, string memory message) { isValid = false; Listing memory listing = _erc721Listings[erc721Address].listings[ tokenId ]; if (listing.seller == add...
4,752,296
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract Constant { string constant ERR_CONTRACT_SELF_ADDRESS = "ERR_CONTRACT_SELF_ADDRESS"; string constant ERR_ZERO_ADDRESS = "ERR_ZERO_ADDRESS"; string constant ERR_NOT_OWN_ADDRESS = "ERR_NOT_OWN_ADDRESS"; string constant ERR_VALUE_IS_ZERO = "E...
withdraw token by owner/
function withdrawToken(address _token, uint256 _amount) external onlyOwner() returns (bool) { require(listedToken[_token], "ERR_TOKEN_IS_NOT_LISTED"); require(totalTokens[_token] == 0, "ERR_TOTAL_TOKENS_NEEDS_TO_BE_0_FOR_WITHDRAWL"); ERC20Interface(_token).transfer(msg.sender, _amount); ...
11,957,299
// 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,...
Gives a pool with largest liquidity for a given token and a given tokenset (either keyTokens or pricingTokens)
function getLargestPool(address token, address[] memory tokenList) public virtual override view returns (address, address, uint256){ uint256 largestPoolSize = 0; address largestKeyToken; address largestPool; uint256 poolSize; uint256 i; for (i=0;i<tokenList.length;i++) { address poolAddr...
6,161,625
./partial_match/3/0xC0836fA3bB9b302890f06ac5A1De8fbfb49eFa6D/sources/KamaiX.sol
Function that mints an amount of the token and assigns it to a given address. This modify the the balance such that the proper events are emitted. This function is restricted to only owner of the contract account The account that will receive the created tokens. value The amount that will be created./
function mint(address account, uint256 value) external onlyOwner { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); }
5,154,138
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity ^0.6.12; import "./Interfaces/LiquidityMathModelInterface.sol"; import "./MToken.sol"; import "./Utils/ErrorReporter.sol"; import "./Utils/ExponentialNoError.sol"; import "./Utils/AssetHelpers.sol"; import "./Moartroller.sol"; import "./...
Calculate account votes as of a specific block _account address whose votes are counted _blockNumber from which votes are being counted return number of votes counted/
function getVoteCountAtBlock( address _account, uint256 _blockNumber) public view returns (uint256) { uint256 voteCount = 0; if(_blockNumber < block.number) { if(m_accountVotingCheckpoints[_account] != 0) { if(m_votingCheckpoints[_account][m_accountVotingCheckpoints[_account].sub(1)].fr...
11,818,589
pragma solidity ^0.5.11; // Vision.Network 100G Token v2.0 // // Upgraded in Aug 2019 // // More info: // https://vision.network // https://voken.io // // Contact us: // support@vision.network // support@voken.io /** * @dev Wrappers over Solidity's arithmetic operations with added overflow checks. */ libra...
Returns the whitelist counter./
function whitelistCounter() public view returns (uint256) { return _whitelistCounter; }
15,798,671
pragma solidity ^0.4.21; interface ExchangeInterface { event Subscribed(address indexed user); event Unsubscribed(address indexed user); event Cancelled(bytes32 indexed hash); event Traded( bytes32 indexed hash, address makerToken, uint makerTokenAmount, address taker...
Unsubscribes user from trade hooks.
function unsubscribe() external { require(subscribed[msg.sender]); subscribed[msg.sender] = false; emit Unsubscribed(msg.sender); }
11,832,122
// SPDX-License-Identifier: AGPL-3.0-only /* SchainsInternal.sol - SKALE Manager Copyright (C) 2018-Present SKALE Labs @author Artem Payvin SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free...
Returns number of schains by schain owner./
function getSchainListSize(address from) external view override returns (uint) { return schainIndexes[from].length; }
10,373,737
./full_match/5/0x795a08a906Dba94B50b81b7489F965e05024e589/sources/contracts/upgrades/GraphProxy.sol
Admin function for new implementation to accept its role as implementation./
function acceptUpgrade() external ifAdminOrPendingImpl { _acceptUpgrade(); }
1,958,963
./full_match/1/0x833f7bDa72AcDbE7acA33F28d00bBF2dF20682d6/sources/contracts/adapters/UniswapV3.sol
Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed) params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata return amountIn The amount of the input token
function exactOutput(ExactOutputParams calldata params) external payable override nonReentrant returns (uint256 amountIn) { address creditAccount = creditManager.getCreditAccountOrRevert( msg.sender ); (address tokenOut, address tokenI...
4,976,579
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./interfaces/IContractsRegistry.sol"; im...
Update Image Uri in case it contains material that is ilegal or offensive. Only the owner of the PolicyBookAdmin can erase/update evidenceUri. _claimIndex Claim Index that is going to be updated _newEvidenceURI New evidence uri. It can be blank.
function updateImageUriOfClaim(uint256 _claimIndex, string calldata _newEvidenceURI) external override onlyPolicyBookAdmin { _allClaimsByIndexInfo[_claimIndex].evidenceURI = _newEvidenceURI; }
6,238,479
./full_match/4/0x66A9e129cEa9D102CDD518C142C412C3CE4E9165/sources/contracts/PyscheArt.sol
require breed state, make sure the parent can breed the next generation depends on the older generation add 1eth to current bonus when 500 increased address who bred Hermaphrodite one may get the 20% of current bonus value STEAL 100% with none 5st generation holders store bonus records
function breed(uint256 tokenId1, uint256 tokenId2) external payable { require(publicTime > 0 && block.timestamp > publicTime); require(revealed, "Not revealed"); require(lastBreedTime <= 0 || block.timestamp - lastBreedTime < BREED_ENDING_TIME); require(!msg.sender.isContract()); ...
12,379,781
// File: @openzeppelin/upgrades/contracts/upgradeability/Proxy.sol pragma solidity ^0.5.0; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * re...
============ Events ============ ============ Admin Functions ============ ============ Public Functions ============
interface IUnderlyingTokenValuatorV5 { event TokenInsertedOrUpdated( address indexed token, address indexed aggregator, address indexed quoteSymbol ); function initialize( address owner, address guardian, address weth, address[] calldata tokens, ...
136,717
./partial_match/8453/0xBcFF559E85791cEDcF2541d1f20c9471801D1f02/sources/contracts/Libraries/LibPayments.sol
Performs a approve function on Permit2 token The token address spender The spender address
function approveMax(address token, address spender, uint256 amount) internal { PaymentStorage storage ps = paymentStorage(); (uint256 allowance, , ) = IAllowanceTransfer(ps.PERMIT2).allowance(address(this), token, spender); if (allowance < amount) { IAllowanceTransfer(ps.PERMIT2)...
16,713,722
pragma solidity 0.5.3; import "../interface/IStorage.sol"; import "../interface/IVault.sol"; import "../interface/ISettings.sol"; import "../interface/IZalarifyCompanyFactory.sol"; /** @title It is the base smart contract for the Zalarify platform. @notice It is a base smart contract to able to update any sma...
It gets the current Vault smart contract address configured in the platform. /
function getVault() internal view returns (address) { return _storage.getAddress(keccak256(abi.encodePacked(CONTRACT_NAME, VAULT_NAME))); }
13,128,034
pragma solidity ^0.4.4; /* * Copyright© (2018) WeBank Co., Ltd. * * This file is part of weidentity-contract. * * weidentity-contract is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Soft...
Constructor - Role controller is required in delegate calls
function WeIdContract( address roleControllerAddress ) public { roleController = RoleController(roleControllerAddress); firstBlockNum = block.number; lastBlockNum = firstBlockNum; } event WeIdAttributeChanged( address indexed identity, bytes32...
12,943,281
pragma solidity ^0.5.0; contract Wikipedia { struct Article { string content; } uint[] public ids; mapping (uint => Article) public articlesById; // liste du nombre de modifications de chaque article mapping (uint => uint) public nbModifsById; // liste de chaque version de chaque article mapping ...
ajout d'un article dans la liste d'article et de son id dans la liste des id
function addNewArticle(string memory content) public { uint index = ids.length; ids.push(index); Article memory newArticle = Article(content); articlesById[index] = newArticle; }
5,527,685
pragma solidity 0.5.10; import "./base/BanReasons.sol"; import "./interfaces/IGovernance.sol"; import "./interfaces/IStakingAuRa.sol"; import "./interfaces/IValidatorSetAuRa.sol"; import "./upgradeability/UpgradeableOwned.sol"; import "./libs/SafeMath.sol"; /// @dev Lets any validator to create a ballot for some val...
Finalizes the specified ballot. Used by the `vote` and `finalize` functions. _ballotId The ballot id.
function _finalize(uint256 _ballotId) internal { require(validatorSetContract != IValidatorSetAuRa(0)); uint256 result = _calcBallotResult(_ballotId); uint256 creatorPoolId = ballotCreator[_ballotId]; uint256 targetPoolId = ballotPoolId[_ballotId]; ballotResult[_ballotId] = r...
14,121,066
./partial_match/1/0xCc392757CC8e5839B7147D2B0bb974690C874c1f/sources/ColonyCLNY.sol
Suspend token from transferring/
function pause() public onlyOwner { pzd = true; }
15,477,378
./full_match/11155111/0x8dE3a5412ac569B36430658b27baB52F3Df5e555/sources/contracts/swap.sol
Cancels the acceptance of a given order Only a whitelisted address can call this function. Checks that the order has been accepted and that the message sender is the filler of the order. Finally, it marks the order as not accepted and sets the filler to address(0). orderId The id of the order to cancel acce...
function cancelAcceptance(uint256 orderId) public onlyWhitelisted { require(orders[orderId].status.orderAccepted, "Order not accepted"); require( orders[orderId].filler == msg.sender, "Only filler can cancel acceptance" ); orders[orderId].status.orderAccepted ...
3,787,402
pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // RubleCoin TokenSale. version 1.0 // // Enjoy. (c) Slava Brall / Begemot-Begemot Ltd 2018. The MIT Licence. // ---------------------------------------------------------------------------- /** * @title...
low level token purchase function
function buyTokens() public payable { require(validPurchase()); require (isRunning); uint256 weiAmount = msg.value; if (isDiscount) { minWeiAmount = minWeiAmount.mul(3).div(4); } uint tokens = weiAmount.mul(2500).div(minWeiAmount).mul(100); uint tokensToOwner = tokens.mul(11).div(10000); ...
6,351,199
./full_match/40/0xe0dD6b3E53C62c2827E646D55F0912d03b329d2b/sources/contracts/OmniCharmTlos.sol
Modular function to set the transaction path output-lpToken0
function setOutputToWrappedPath(address[] memory _path) external onlyAdmin { require (_path[0] == output && _path[_path.length - 1] == output, "!path"); outputToWrappedPath = _path; emit SetOutputToWrappedPath(_path); }
9,550,099