file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; contract DSMath { function add(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x + y) >= x); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } func...
Internal method that preforms a sell on 0x/on-chain Usefull for other DFS contract to integrate for exchanging exData Exchange data struct return (address, uint) Address of the wrapper used and destAmount if selling eth, convert to weth Try 0x first and then fallback on specific wrapper fallback to desired wrapper if...
function _sell(ExchangeData memory exData) internal returns (address, uint) { address wrapper; uint swapedTokens; bool success; uint tokensLeft = exData.srcAmount; if (exData.srcAddr == KYBER_ETH_ADDRESS) { exData.srcAddr = ethToWethAddr(exData.srcAddr); ...
1,644,453
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Pausable.sol"; import "./Ownable.sol"; import "./ReentrancyGuard.sol"; import "./AggregatorV3Interface.sol"; contract ZebrangoPriceGuess is Pausable , ReentrancyGuard, Ownable{ AggregatorV3Interface public oracle; //genesisRound boo...
Up wins down winsReserve Wins!
function _calculateRewards(uint256 episode) internal { require(rounds[episode].rewardBaseCalAmount == 0 && rounds[episode].rewardAmount == 0, "rewards already calculated."); Round storage round = rounds[episode]; uint256 rewardBaseCalAmount; uint256 feeAmount; uint256 rewardAmount; ...
1,067,936
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Context.sol"; /** * @title Hypernet Protocol Bulk Transfer Module for NFRs * @author Todd Chapman * @dev Implementation of bulk NFI transfer functionality * * See the documentation for more details: * https://docs.hyp...
a minimal interface for interacting with Hypernet Protocol NFRs
interface INfr { function safeTransferFrom(address from, address to, uint256 tokenId) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function REGISTRAR_ROLE() external view returns (bytes32); }
1,794,364
./full_match/1/0x17B00548003683C423eecce4371b4bA56eEd962b/sources/contracts/access/DramAccessControl.sol
@inheritdoc IDramAccessControl/
function grantRole( bytes32 role, address account ) external virtual override onlyRoleOrAdmin(ROLE_MANAGER_ROLE) { if (role == ADMIN_ROLE) revert DirectAdminUpdateError(); _grantRole(role, account); }
3,169,600
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./SafeMath96.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./spec_interfaces/ICommittee.sol"; import "./spec_interfaces/IProtoco...
Returns the fees and bootstrap balances of a guardian calculates the up to date balances (differ from the state) return feeBalance the guardian's fees balance return bootstrapBalance the guardian's bootstrap balance
function getFeesAndBootstrapBalance(address guardian) external override view returns (uint256 feeBalance, uint256 bootstrapBalance) { (FeesAndBootstrap memory guardianFeesAndBootstrap,) = getGuardianFeesAndBootstrap(guardian, block.timestamp); return (guardianFeesAndBootstrap.feeBalance, guardianFee...
6,441,190
// File: contracts/interfaces/IAMB.sol pragma solidity 0.4.24; interface IAMB { function messageSender() external view returns (address); function maxGasPerTx() external view returns (uint256); function transactionHash() external view returns (bytes32); function messageId() external view returns (byt...
Sets the gas limit to be used in the message execution by the AMB bridge on the other network. This value can't exceed the parameter maxGasPerTx defined on the AMB bridge. Only the owner can call this method. _requestGasLimit the gas limit for the message execution./
function setRequestGasLimit(uint256 _requestGasLimit) external onlyOwner { _setRequestGasLimit(_requestGasLimit); }
52,150
pragma solidity ^0.4.24; import "./open-zeppelin/SafeMath.sol"; import "./IssuingEntity.sol"; import "./components/Modular.sol"; /** @title Security Token @dev Expands upon the ERC20 token standard https://theethereum.wiki/w/index.php/ERC20_Token_Standard */ contract SecurityToken is Modular { using SafeMath...
/ If called by a module, the authority becomes the issuing contract. /
function transferFrom( address _from, address _to, uint256 _value ) external returns (bool) { if (isActiveModule(msg.sender)) { address _auth = address(issuer); _auth = msg.sender; } ( bytes32 _authID, bytes32[2] memory _id, address[2] memory _addr, uint8[2] memory _rating, uint1...
7,227,174
./full_match/44787/0x7527178202F14a7E24f2D3408Fe4852CCc799F86/sources/project_/contracts/Controller.sol
Transfers a local currency token between two existing wallets _fromUserId User identifier _toAddress Receiver identifier _value Amount to transfer _roundUpValue Round up value to transfer (can be zero)/
function transfer( bytes32 _fromUserId, address _toAddress, uint256 _value, uint256 _roundUpValue ) external override greaterThanZero(_value) userExist(_fromUserId) balanceAvailable(_fromUserId, (_value + _roundUpValue)) onlyRole(OP...
13,292,845
./full_match/97/0x99706Eb01A696ae19550854eaa7D28b6Ad1c0602/sources/project_/contracts/FundingPool.sol
Allows the lender to withdraw the loan bid if it is still pending. _poolId The Id of the pool. _ERC20Address The address of the erc20 funds. _bidId The Id of the bid. _lender The lender address./ Check is lender the calling the function
function Withdraw( uint256 _poolId, address _ERC20Address, uint256 _bidId, address _lender ) external nonReentrant { FundDetail storage fundDetail = lenderPoolFundDetails[_lender][_poolId][ _ERC20Address ][_bidId]; if (fundDetail.state != BidS...
3,263,784
// SPDX-License-Identifier: MIT-open-group pragma solidity ^0.8.0; import "lib/ds-test/test.sol"; import "src/tokens/StakeNFT.sol"; import "lib/openzeppelin/token/ERC20/ERC20.sol"; import "lib/openzeppelin/token/ERC721/IERC721Receiver.sol"; uint256 constant ONE_MADTOKEN = 10**18; contract MadTokenMock is ERC20 { ...
the result with re-entrance should be the same as calling collectEth only once
function test_ReentrantFiniteCollectEth() public { (StakeNFT stakeNFT, MadTokenMock madToken, , ) = getFixtureData(); UserAccount donator = newUserAccount(madToken, stakeNFT); UserAccount honestUser = newUserAccount(madToken, stakeNFT); ReentrantFiniteEthCollectorAccount user = new R...
6,424,647
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 ...
Change country limits. Can be accessed by contract owner or oracle only. _countryCode country code. _limit limit value. return result code.
function changeCountryLimit( uint _countryCode, uint _limit ) onlyOracleOrOwner external returns (uint) { uint _countryIndex = countryIndex[_countryCode]; require(_countryIndex != 0); uint _currentTokenHolderNumber = countryLimitsList[_countryIndex]....
268,145
// compiler: 0.4.21+commit.dfe3193c.Emscripten.clang pragma solidity ^0.4.21; // Ethereum Token callback interface tokenRecipient { function receiveApproval( address from, uint256 value, bytes data ) external; } // ERC223 callback interface ContractReceiver { function tokenFallback( address from, uint value, byte...
no transfers allowed before ICO ends 26MAY2018 0900 CET
function _transfer( address from, address to, uint value, bytes data ) internal { require( to != 0x0 ); require( balances_[from] >= value ); if (msg.sender != owner) require( now >= 1527321600 ); balances_[from] -= value; balanc...
9,967,827
pragma solidity ^0.4.13; contract StandardContract { // allows usage of "require" as a modifier modifier requires(bool b) { require(b); _; } // require at least one of the two conditions to be true modifier requiresOne(bool b1, bool b2) { require(b1 || b2); _; }...
moves the promise to the new state and updates the locked/pending totals accordingly
function unlockTokens(TokenPromise storage promise, PromiseState newState) internal { promisedTokenBalance = promisedTokenBalance.sub(promise.amount); if (promise.state == PromiseState.confirmed) { lockedTokenBalance = lockedTokenBalance.sub(promise.amount); } transition(promise, newState)...
2,016,851
//SPDX-License-Identifier: MIT //@dev: @null.eth & @brougkr pragma solidity ^0.8.11; import "./ERC721A.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy { } contr...
Toggles Public Mint/
function togglePublicMint() external onlyOwner { publicMintState = !publicMintState; }
14,759,119
./full_match/3/0x73C7aB0AE71B00122d50188d8AA352d52dc625C5/sources/ClaimFreeToken.sol
function to send tokens from FreeTokenClaim Wallet to an addressperform a few checks to make sure function can executeif the balance of this contract is greater then the requested amount send fundsupdates locktime 730 dasy from now
function requestTokens(address payable _requestor) public payable { require(block.timestamp > lockTime[msg.sender], "lock time has not expired. Please try again later"); require(address(this).balance > amountAllowed, "Not enough funds in the FreekTokenClaim Wallet. Please request top up"); ...
8,235,475
pragma solidity 0.5.17; // Proxy contract for testing throws // http://truffleframework.com/tutorials/testing-for-throws-in-solidity-tests contract ThrowProxy { address public target; bytes data; constructor(address _target) public { target = _target; } //prime the data using the fallback...
prime the data using the fallback function.
function() external payable { data = msg.data; }
1,032,758
pragma solidity ^0.4.24; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexe...
Validate if crowdsale has started./
function hasStarted() view public returns (bool) { return now >= openingTime; }
1,032,488
pragma solidity ^ 0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function trans...
Returns the rate of tokens per wei at the present time. return The number of tokens a buyer gets per wei at a given time/
function getPhaseRate(PhaseId _phase) public view returns (uint) { uint rate = phases[uint(_phase)].rate; assert(rate > 0); return rate; }
14,029,873
pragma solidity ^0.5.0; contract Reentrancy { mapping (address => uint) userBalance; function getBalance(address u) view public returns(uint){ return userBalance[u]; } function addToBalance() payable public{ userBalance[msg.sender] += msg.value; } function withdrawBalan...
To protect against re-entrancy, the state variable has to be change before the call
function withdrawBalance_fixed() public{ uint amount = userBalance[msg.sender]; userBalance[msg.sender] = 0; (bool ret, bytes memory mem) = msg.sender.call.value(amount)(""); if( ! ret ){ revert(); } }
7,293,763
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `o...
Set dividend payout of phoenix _phoenixId id of phoenix _payoutPercentage uint256 Desired payout percentage/
function setDividendPayout (uint256 _phoenixId, uint256 _payoutPercentage) onlyOwner inBeta { Phoenix phoenix = phoenixes[_phoenixId]; phoenix.dividendPayout = _payoutPercentage; }
1,655,298
./partial_match/1/0xEb5302954d013483091C5725d5d3Abe5A703A464/sources/src/SellerFinancing.sol
@inheritdoc ISellerFinancing
function getOfferHash(Offer memory offer) public view returns (bytes32) { return _hashTypedDataV4( keccak256( abi.encode( _OFFER_TYPEHASH, offer.price, offer.downPaymentAmount, ...
16,059,662
// SPDX-License-Identifier: UNLICENSED // This code is the property of the Aardbanq DAO. // The Aardbanq DAO is located at 0x829c094f5034099E91AB1d553828F8A765a3DaA1 on the Ethereum Main Net. // It is the author's wish that this code should be open sourced under the MIT license, but the final // decision on this would...
CG: This allocates the amount of tokens that was already bought on auction before\ switching over to this Scale Buying.
function allocateTokensRaisedByAuction() private { uint256 price = initialPrice; uint256 buyerAAmount = 7165 ether; amountsClaimable[0xEE779e4b3e7b11454ed80cFE12Cf48ee3Ff4579E] = buyerAAmount; emit Bought(0xEE779e4b3e7b11454ed80cFE12Cf48ee3Ff4579E, buyerAAmount,...
6,103,297
./partial_match/1/0xB10daee1FCF62243aE27776D7a92D39dC8740f95/sources/lib/prb-math/src/Common.sol
Calculates the square root of x using the Babylonian method. See https://en.wikipedia.org/wiki/Methods_of_computing_square_rootsBabylonian_method. Notes: - If x is not a perfect square, the result is rounded down. - Credits to OpenZeppelin for the explanations in comments below. x The uint256 number for which to calc...
function sqrt(uint256 x) pure returns (uint256 result) { if (x == 0) { return 0; } result = 1; uint256 xAux = uint256(x); if (xAux >= 2 ** 128) { xAux >>= 128; result <<= 64; } if (xAux >= 2 ** 64) { xAux >>= 64; result <<= 32; } if (xAux >= 2...
9,308,577
./full_match/1/0x3aee85207A82768EbA24f6F29067af1Ab94472ff/sources/contracts/Router/primaryRouter.sol
Buy widget logic for primary market friggTokenAddress Frigg-issued token address inputTokenAmount amount of tokens spent to buy Frigg-issued token initially users can only buy Frigg-issued asset backed tokens with USDC i.e. inputToken is USDC and outputToken is the ABT inputTokenAmount should be in the same number ...
function buy(address friggTokenAddress, uint256 inputTokenAmount) external payable override { require(inputTokenAmount > 0, "You cannot buy with 0 token"); IRouterGater gater = IRouterGater(routerGater); IERC20 inputToken = IERC20(tokenData[friggTokenAddress].issuanceTokenAddress); ...
8,396,354
pragma solidity ^0.4.17; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/Adoption.sol"; contract TestAdoption { Adoption adoption = Adoption(DeployedAddresses.Adoption()); //test adopt() function function testUserCanAdoptPet() public { uint returnedId = ado...
test retrieve of a single pet ownerexpected owner is this contract
function testGetAdopterAddressByPetId() public { address expected = this; address adopter = adoption.adopters(8); Assert.equal(adopter, expected, "owner of pet id 8 should be recorded."); }
5,366,869
./full_match/8453/0x8512BfF6a9E0DCD62A2eECeCAE41c033359E3E16/sources/contracts/Libraries/SafeTransferLib.sol
Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. Reverts upon failure. @solidity memory-safe-assembly Store the function selector of `approve(address,uint256)`, left by 6 bytes (enough for 8tb of memory represented by the free memory pointer). We waste 6-3 = 3 bytes to save on 6 runt...
function safeApprove(address token, address to, uint256 amount) internal { assembly { mstore(0x00, 0x095ea7b3000000000000) if iszero( and( or(eq(mload(0x00), 1), iszero(returndatasize())), call(gas(), token, 0, 0x16, 0x44, 0x00...
11,555,371
// Sources flattened with hardhat v2.1.2 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.0.0 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implemente...
See {IERC721Metadata-symbol}./
function symbol() public view virtual returns (string memory) { return "AMULET"; }
14,021,793
./full_match/137/0x182dC32C984679CDF2Fda20667074acF18a92701/sources/contracts/Strategic.sol
Transfer ERC20 tokens from the sender to the specified recipient address amount The amount of tokens to transfer (in 18 decimal points) return True if the transfer is successful, false otherwise/ Create an instance of the ERC20 token contract Transfer tokens from the sender to the recipient Update the user deposit Upd...
function buyBITS(uint256 amount) external returns (bool) { require(amount >= _minAmount, "Amount must be greater than or equal to the $50"); IERC20 token = IERC20(_tokenAddress); bool success = token.transferFrom(msg.sender, _recipient, amount); if (success) { _userDep...
4,694,908
./partial_match/4/0xf31b41ab52fcCD1d1d21E56c7925F0fCb4e2e092/sources/TetherToken.sol
Redeem tokens. These tokens are withdrawn from the owner address if the balance must be enough to cover the redeem or the call will fail. _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner { _totalSupply = _totalSupply.sub(amount); balances[owner] = balances[owner].sub(amount); emit Redeem(amount); emit Transfer(owner, address(0), amount); }
8,668,871
./full_match/1/0x8978e830aB2933936b8282f9561AdCd9a3393BD7/sources/contracts/Assets/DsrAsset.sol
Convert Dai to Usdx (1:1 rate)/
function _daiToUsdx(uint256 daiAmount) internal view returns (uint256) { return (daiAmount * (10 ** usdx.decimals())) / (10 ** dai.decimals()); }
4,850,515
pragma solidity ^0.4.24; import "./Ownable.sol"; /** * @title ERC721 Non-Fungible Token Standard basic implementation * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md */ contract CryptoKats is Ownable { /// @dev The Birth event is fired whenever a new kitten comes into existence. This obv...
Gets the owner of the specified token ID tokenId uint256 ID of the token to query the owner of return owner address currently marked as the owner of the given token ID/ TODO: return the owner of the provided token
function ownerOf(uint256 tokenId) public view returns (address) { }
1,792,455
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they sho...
Return reward over the given _from to _to block. Suppose it doesn't span two adjacent mining block number
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { require(_to > _from, "_to should greater than _from "); if (_from < phase1StartBlockNumber && phase1StartBlockNumber < _to && _to < phase1EndBlockNumber) { return _to.sub(phase1StartBlockNumber).mul(phase...
1,283,520
pragma solidity 0.4.23; import "../../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol"; /// @title ExchangeRate /// @author Jose Perez - <jose.perez@diginex.com> /// @notice Tamper-proof record of exchange rates e.g. BTC/USD, ETC/USD, etc. /// @dev Exchange rates are updated from off-chain serv...
Allows anyone to read the current rate. _id The rate identifier. return The current rate.
function getRate(string _id) external view returns(uint256) { return currentRates[_id]; }
5,449,524
/** *Submitted for verification at Etherscan.io on 2020-10-17 */ // SPDX-License-Identifier: GPL-3.0 // forked from Compound's autonomous proposal Factory @0x524B54a6A7409A2Ac5b263Fb2A41DAC9d155ae71 // refactored by the penguin party @penguinparty.eth pragma solidity ^0.6.10; pragma experimental ABIEncoderV2; inter...
Create a new crowd proposal Call `uni.approve(factory_address, uniStakeAmount)` before calling this method targets The ordered list of target addresses for calls to be made values The ordered list of values (i.e. msg.value) to be passed to the calls to be made signatures The ordered list of function signatures to b...
function createCrowdProposal(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, ...
5,350,440
./full_match/4/0x18Be7dB1a84062eE9e7361A686495d7b3Fc97a26/sources/contracts/TradingContractDeployer.sol
Function to add investor tradingCounter during staking
function tradingCounterAdd(address _addr) external { require(isContractCreated[msg.sender]); tradingCounter[_addr] += 1; }
658,709
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since whe...
Returns the address that signed a hashed message (`hash`) with `signature` or error string. This address can then be used for verification purposes. The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: this function rejects them by requiring the `s` value to be in the lower half order, and the `v` v...
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; assembly { r := mload(add(signature, 0x20)) ...
5,860,989
./full_match/43114/0x452B51d7b8833bEdbE83a9045565a14c2309d9ed/sources/Soccer.sol
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 {BEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; }
4,557,961
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; contract Directory_v2{ address owner; uint RelayUploadPeriod = 5; // 5 minutes uint ClientUpdatePeriod = 60; // 1 hour uint8 RIAlength = 6; uint16 relayIndex = 1; uint24 clientNum = ...
Client gets the length of the RIA.
function client_get_RIAlength() view public returns (uint8){ require(client[msg.sender].flag == true); return RIAlength; }
5,428,910
// File: contracts/escrow/EscrowBaseInterface.sol /** * Copyright 2017–2019, LaborX PTY * Licensed under the AGPL Version 3 license. */ pragma solidity ^0.4.25; interface EscrowBaseInterface { function hasCurrencySupport(bytes32 _symbol) public view returns (bool); function getServiceFeeInfo() external view ...
Computes the bitwise OR of the bit at the given 'index' in 'self', and the corresponding bit in 'other', and returns the value.
function bitOr(uint self, uint other, uint8 index) internal pure returns (uint8) { return uint8((self | other) >> index & 1); }
968,469
pragma solidity >=0.5.0 <0.6.0; import "./PriceFeeds.sol"; import "./IMoCState.sol"; import "../openzeppelin/Ownable.sol"; import "../openzeppelin/Address.sol"; contract BProPriceFeed is IPriceFeedsExt, Ownable { address public mocStateAddress; event SetMoCStateAddress(address indexed mocStateAddress, addres...
returns the update time. return always returns current block's timestamp/
function latestTimestamp() external view returns (uint256) { }
6,451,986
pragma solidity ^0.5.11; // A smart contract that allows to publish and read feedback to scientific publications transparently. // Contributors that provided feedback are identified by their ORCiDs. // Publications that are reviewed are identified by their unique bibliographic hashes (based on normalized title, au...
Returns the n-th feedback for a publication. The publication is represented by its biliographic hash. The index specifies which of all the feedbacks for that publication is returned.
function getFeedbackByBibHash(bytes16 _bibhash, uint _index) public view returns (address serviceAddress_, bytes16 orcId_, uint timestamp_, uint8 relevance_, uint8 presentation_, uint8 methodology_) { require( _index < feedbackByBibHash[_bibhash].length, "Specified index is ...
7,274,341
pragma solidity ^0.4.11; /// @dev `Owned` is a base level contract that assigns an `owner` that can be /// later changed contract Owned { /// @dev `owner` is the only address that can call a function with this /// modifier modifier onlyOwner() { require(msg.sender == owner); _; } ...
This function is overridden by the test Mocks.
function getBlockNumber() internal constant returns (uint256) { return block.number; }
1,088,438
/** *Submitted for verification at Etherscan.io on 2019-10-31 */ /************************************************************************** * ____ _ * / ___| | | __ _ _ _ ___ _ __ * | | _____ | | / _` || | | | / _ \| '__| * ...
eval unspent ETH internal/
function evalUnspentETHInternal( Investor storage _investor, uint256 _investedETH ) internal view returns (uint256) { return _investor.unspentETH.add(msg.value).sub(_investedETH); }
12,886,923
// SPDX-License-Identifier: MIT pragma solidity 0.7.0; /** * @title interface of ERC 20 token * */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, ...
Get the status of the whitelist/
function isWhitelisted(address _address) public view returns(bool){ return whitelist[_address]; }
10,438,501
./partial_match/97/0x2b219Ff20622eD0f1b768Bc8D0a94E0bEd2FD0a5/sources/GET_NFT_V3.sol
Register address data of new event Data will be publically available for the getNFT ticket explorer. eventAddress TODO eventName TODO shopUrl TODO latitude TODO longitude TODO currency TODO startingTime TODO ticketIssuer TODO callbackUrl TODO/
function registerEvent(address eventAddress, string memory eventName, string memory shopUrl, string memory latitude, string memory longitude, string memory currency, uint256 startingTime, address ticketIssuer, string memory callbackUrl) public override onlyRelayer() returns(bool success) { return super.regi...
17,209,491
pragma solidity >=0.4.21 <0.7.0; contract Pigleth { address public owner; uint public creationTime; enum Phase { Init, PayIn, PayOut, Dead, Quit } // Current Stage Phase public phase; PiglethProxy pigProx; // variables // time gets handled in weeks uint ...
fallback function: needed to receive ether
function() public payable {}
1,777,530
// SPDX-License-Identifer: MIT // File: @openzeppelin/contracts/access/IAccessControl.sol pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, repla...
activates rewards (owner) updates dailySoul and soulPerSecond staking pool
function initialize( address _soulAddress, address _seanceAddress, uint _totalWeight, uint _weight, uint _stakingAlloc , uint _startRate ) external obey(isis) { require(!isInitialized, 'already initialized'); soulAddress = _soulAddress; ...
13,076,219
./full_match/10/0xF156dc1077213AA92a3Ed6008a7FF8aEA2633186/sources/src/Facets/CBridgeFacetPacked.sol
Encodes calldata for startBridgeTokensViaCBridgeNativePacked transactionId Custom transaction ID for tracking receiver Receiving wallet address destinationChainId Receiving chain nonce A number input to guarantee uniqueness of transferId. maxSlippage Destination swap minimal accepted amount
function encode_startBridgeTokensViaCBridgeNativePacked( bytes32 transactionId, address receiver, uint64 destinationChainId, uint64 nonce, uint32 maxSlippage ) external pure returns (bytes memory) { require( destinationChainId <= type(uint32).max, ...
3,784,065
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "./Token.sol"; contract CommitteePool { Token[] pools; uint256 indx; event isLock(bool lock); event isParticipating(bool status); modifier checkPool(string memory _name, string memory _symbol) { require(_isPoolPresent...
Getting Security Should also deposit 4th part of the fixed amount
function exitCommittee(string memory _name, string memory _symbol) external checkPool(_name, _symbol) { pools[indx].transferFrom( msg.sender, address(this), pools[indx].getfixedAmount() / 2 ); pools[indx].getApprovalForToken( ...
6,470,874
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul // WARNING - `executeActionWithAtomicBatchCalls` has a `bytes[]` argument that // requires ABIEncoderV2. Exercise caution when calling that specific function. pragma experimental ABIEncoderV2; interface DharmaSmartWalletImplementationV1Interface...
Redeem all available cDAI for Dai and use that Dai to mint dDai. If any step in the process fails, the call will revert and prior steps will be rolled back. Also note that existing Sai and Dai are not included as part of this operation./
function migrateCDaiToDDai() external { _migrateCTokenToDToken(AssetType.DAI); }
6,535,000
./full_match/5/0x8956E81d76FDdAbF0de54D8Da0d06c2474DeA340/sources/contracts/flatten.sol
Owner can register a new project token with claim parameters
function registerProjectToken( address projectTokenAddress, uint256 claimAmount, uint256 startMonth, uint256 totalMonths ) external onlyOwner { s_projectTokens[projectTokenAddress] = ProjectToken(IERC20(projectTokenAddress), claimAmount, startMonth, startMonth.add(totalMo...
11,605,903
./full_match/1/0x21c2F2e8462D1090ac33d5A65cc03afFB18bB504/sources/browser/contract.sol
Allows token transfer only from whitelisted agents, or after a certain time or manually released address 0 is added to allow deployment/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { super._beforeTokenTransfer(from, to, amount); require( ( released() || releaseAgent == address(0) || releaseAgent == _msgSender() || transferAgents[fr...
9,662,239
./full_match/1/0xef165820dEa2c24C2A61675d7B183b36255e10c8/sources/contracts/Awakened.sol
Set the maximum presale mints allowed per a given transaction/
function setPresaleMintsAllowedPerTransaction( uint256 _mintsAllowed ) external onlyOwner { presaleMintsAllowedPerTransaction = _mintsAllowed; }
2,910,216
./full_match/80001/0x8815a120eE650A0b1bf94A94fc363f51aa3a5760/sources/KushoStaking.sol
If address already has ERC721 Token/s staked, calculate the rewards. Increment the amountStaked and map msg.sender to the Token Id of the staked Token to later send back on withdrawal. Finally give timeOfLastUpdate the value of now. If wallet has tokens staked, calculate the rewards before adding the new token Wallet m...
function stake(uint256[] calldata tokenIds) external nonReentrant { if (stakers[msg.sender].amountStaked > 0) { uint256 rewards = calculateRewards(msg.sender); stakers[msg.sender].unclaimedRewards += rewards; } for (uint256 i; i < tokenIds.length;) { ...
5,681,491
/* WeiFund v1.0 This contract creates a crowdfunding platform. Start, donate to, payout and refund crowdfunding campaigns on Ethereum. If the campaign goal is reached or surpassed by stated expiry, all raised funds will be paid out to the campaign's beneficiary. If the campaign goal is not reached by the stated ex...
Check to see if account is a campaign owner Determine whether a specified account address is the campaign owner _campaignID (campaign id) The campaign id _owner (owner) The owner address return is address the campaign owner or not (boolean)
function isOwner(uint _campaignID, address _owner) constant returns (bool) {}
1,796,422
./full_match/1/0x4E0528b9478C9A90B84F80fF771f6e4Cf07920F5/sources/browser/atomic.sol
generates and returns the conversion path between a given token pair in the Bancor Network _sourceToken address of the source token _targetToken address of the target token return path from the source token to the target token/
function generatePath(address _sourceToken, address _targetToken) public view returns (address[] memory) { }
3,014,072
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /*...
Allow owner to withdraw ETH from contract
function withdraw() public { payable(owner()).transfer(address(this).balance); }
8,018,644
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ /** *Submitted for verification at Etherscan.io on 2022-01-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev...
set PG smart contract./
function setPG(address _pg) public onlyOwner { PG = IWWNFT(_pg); }
6,162,321
./partial_match/3/0xEC4DA8aeb8f63E0EeA710A26062324c7a8dD7310/sources/zzz.sol
require(now >= lgeEndTime, "Liquidity generation ongoing");IERC20(tokenAddress).transfer(address(pair), initialTokenLiquidity); LP ClaimLPperETHUnit = totalLPTokensMinted.mul(1e18).div(totalETHContributed); Token Claim
function addLiquidityToUniswapPair() public onlyOwner { require(tokenAddress != address(0), "ERC20: can not zero address"); require(tokenUniswapPair != address(0), "ERC20: can not zero address"); require(LPGenerationCompleted == false, "Liquidity generation already finished"); uint25...
5,199,500
pragma solidity ^0.5.7; // Voken Public Sale // // More info: // https://vision.network // https://voken.io // // Contact us: // support@vision.network // support@voken.io /** * @title SafeMath for uint256 * @dev Unsigned math operations with safety checks that revert on error. */ librar...
Integer division of two unsigned integers truncating the quotient, reverts on division by zero./
function div(uint16 a, uint16 b) internal pure returns (uint16) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return a / b; }
12,538,011
/** *Submitted for verification at Etherscan.io on 2020-10-06 */ pragma solidity ^0.5.9; pragma experimental ABIEncoderV2; /* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of...
Retrieves the balance for a token owner. Returns `0` if the call reverts. token The address of the token contract. owner The owner of the tokens. return balance The token balance of an owner.
{ (bool didSucceed, bytes memory resultData) = token.staticcall( abi.encodeWithSelector( IERC20Token(0).balanceOf.selector, owner ) ); function balanceOf(address token, address owner) internal view returns (uint256 b...
1,062,364
./full_match/80001/0xbA3D5009025c4Dd7d67407Dc7bD0A62F78e3430D/sources/contracts/oasis-dev/OasisStakingToken.sol
Sets the OasisStake contract address. _oasisStake OasisStake contract address./
function setOasisStake(address _oasisStake) public onlyOwner { oasisStake = _oasisStake; }
5,607,332
./partial_match/42/0x603794bB9C84569CbD9e71754f86A35d51530eAb/sources/SHOPPINGmodX3.sol
See {IERC20-totalSupply}./
function TotalSupply() public view override returns (uint256) { return _totalSupply; }
9,042,748
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "./core/access/Controlled.sol"; import "./core/access/Owned.sol"; import "./core/erc20/ERC20.sol"; import "./core/lifecycle/Initializable.sol"; import "./core/math/MathLib.sol"; import "./core/math/SafeMathLib.sol"; impor...
calc fees for sender and recipient appends total rewards
function _transferBetweenHolderAccounts( address sender, address recipient, uint256 amount ) private { uint256 totalSupply_ = summary.totalSupply; { uint256 senderTotalFee; uint256 recipientTotalFee; ( senderTotalFee, senderBurnFee, ...
891,166
pragma solidity ^0.4.18; 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; } function div(uint256 a, uint256 b) internal pure ret...
Проверка актуальности ICO
function _isICO() internal view returns(bool) { return now >= ICOStartDate && now < ICOEndDate; }
5,522,687
pragma solidity ^0.4.17; import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; import 'zeppelin-solidity/contracts/ownership/HasNoTokens.sol'; import './BotTCoin.sol'; /** * @title BotTCoinSale */ contract BotTCoinSale is Ownable, HasNoTokens { using SafeMath for uint256; //uint256 private constant E18...
finalization task, called when owner calls finalize()
function finalization() internal { token.finishMinting(); token.transferOwnership(owner); }
958,053
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { event Approval( address indexed owner, address indexed spender, ui...
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve( address owner, address spender, uint256 amount ) internal { require(owner != address(0), "IERC20: approve from the zero address"); require(spender != address(0), "IERC20: approve to the zero address"); _allowances[owner][spender] = amount; ...
2,538,201
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "../../@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../../@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../../@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "../../@openzeppelin/contracts/utils/structs/...
adds the specified token as a permitted reward token at the specified drip rate WARNING: amountOfTokenPerDayPerNFT is expressed as the amount of the token to drip per day per NFT expressed in atomic units (gwei) ex. FTM has 18 decimals; therefore, 1.0 FTM = 1000000000000000000 atomic units ...
function permitRewardToken(address token, uint256 amountOfTokenPerDayPerNFT) public onlyOwner { require(!permittedRewardTokens.contains(token), "Reward token is already permitted"); permittedRewardTokens.add(token); if (!allRewardTokens.contains(token)) { allRewardTokens.add(to...
7,277,956
./full_match/5/0x1a92f04F848D527aF2EDe6e30721c0EBE43DC367/sources/scripts/Caviar.sol
Decrease the amount of tokens that an owner has allowed to a spender. spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by./
function decreaseAllowance( address spender, uint256 subtractedValue ) public override returns (bool) { uint256 oldValue = _allowedCaviar[_msgSender()][spender]; if (subtractedValue >= oldValue) { _allowedCaviar[_msgSender()][spender] = 0; _allowedCaviar[...
1,940,379
pragma solidity ^0.4.25; /** * @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) { if (a == 0) { ...
Withdraw for Ether/
function withdraw(uint withdrawAmount) onlyOwner public { if (withdrawAmount <= address(this).balance) { owner.transfer(withdrawAmount); } }
933,769
pragma solidity ^0.6.0; interface IFeeDistributor { // The _transfer function in the token contract calls this to let the distributor contract know that it received the specified amount of tokens to be distributed function addFee(uint256 amount) external; }
The _transfer function in the token contract calls this to let the distributor contract know that it received the specified amount of tokens to be distributed
interface IFeeDistributor { function addFee(uint256 amount) external; }
12,664,213
pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions...
Internal function to transfer ownership of a given token ID to another address. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. from current owner of the token to address to receive the ownership of the given token ID tokenId uint256 ID of the token to be transferred/ Clear approvals
function _transferFrom(address from, address to, uint256 tokenId) internal virtual { require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); _approve(...
1,102,588
/** ****************************************************************************************************************************************************************************************** $$$$$$$\ $$\ $$\ $...
check user registered? _addr user account return _result exist or not/
function checkUserExist(address _addr) internal view returns(bool _result) { if(userAccs[_addr].refCode != 0) return true; return false; }
13,123,140
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol'; import {SafeERC20} from '../../../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {ILendingPool} from '../../../interfaces/ILendingPo...
Returns the scaled balance of the user. The scaled balance is the sum of all the updated stored balance divided by the reserve's liquidity index at the moment of the update. aka, userBalanceScaled = userBalanceInternal/totalSupplyInternal scaledTotalSupply user The user whose balance is calculated return Th...
function scaledBalanceOf(address user) external view override returns (uint256) { return _scaledBalanceOf( super.balanceOf(user), super.totalSupply(), _scaledTotalSupply(_fetchExtData(), _totalGonsDeposited) ); }
13,851,316
./full_match/4/0xC209E294664C8Cb5B55EbF1CAE6CaCCd024Cb822/sources/contracts/ERC721A.sol
Directly sets the extra data for the ownership data `index`./ Cast `extraData` with assembly to avoid redundant masking.
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; assembly { extraDataCasted := extraData } packed...
727,704
./full_match/42/0x0b0E0235C0bac2b1D3A2597C94a77762c41295b6/sources/0c5928a00094810d2ba01fd8d1083581/ArbFreeSwap.sol
calculate price based on pair reserves BAT?ETH pair address hardcoded BAT: 0x482dc9bb08111cb875109b075a40881e48ae02cd ETH: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 Factory address on all networks 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f/
function getTokenPrice() public view returns(uint) { (uint256 ResA, uint256 ResB) = UniswapV2Library.getReserves(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f, 0x482dC9bB08111CB875109B075A40881E48aE02Cd, 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); return (ResA/ResB); }
9,587,783
pragma solidity ^0.4.24; import "../../TransferManager/ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; contract LockUpTransferManager is ITransferManager { using SafeMath for uint256; // permission definition bytes32 public constant ADMIN = "ADMIN"; // a per-user ...
solium-disable-next-line security/no-block-members/
function _addNewLockUpType( uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 _lockupName ) internal { uint256 startTime = _startTime; require(_lockupName != bytes32(0), "Invalid...
1,084,406
./full_match/42/0x5bBC30B923eA7a68b823f06A22f21003cf51bc1a/sources/browser/votetest.sol
BuoyERC20.transfer(address(this), voteWeight);
function castVote(uint256 vote, uint256 voteWeight) public { uint256 delegated = voteWeight; uint256 maxVoteWeight = BuoyERC20.balanceOf(msg.sender); require(vote == 0 || vote == 1, 'Vote must be 0 or 1'); require(delegated > 0 && delegated <= maxVoteWeight, 'Vote weight not valid');...
9,587,092
./full_match/5/0x4A50456D5Fc24C6399A90e122366F73C0679416c/sources/contracts/NFTFactory.sol
Initializer function setting the implementation and proxy admin addresses for future collections _impl The implementation address _admin The proxy admin address/
function initialize( address _impl, address _admin, address _baseOperators ) external initializer { if (_baseOperators.code.length == 0) revert NFTFactoryInvalidBaseOperators(); if (_impl == address(0)) revert NFTFactoryNewImplementationIsZeroAddress(); if (_admin...
1,917,029
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /*import "Register.sol"; import "Agora.sol"; import "Loi.sol"; import "API_Register.sol"; import "Delegation.sol"; import "IDelegation.sol"; import "Citizens_Register.sol"; import "IVote.sol"; */ import "contracts/Register.sol"; import "contracts/Agora.sol"; imp...
Deploy a {Loi} contract and returns it's address. Loi_Name Name of the Loi contract agora Addres of the Project's {Agora} contract/loi.Add_Authority(authority);
function Create_Loi(string memory Loi_Name, address agora)external returns(address){ Loi loi = new Loi(Loi_Name, agora); return address(loi); }
12,741,910
/** *Submitted for verification at Etherscan.io on 2020-11-18 */ /** *Submitted for verification at Etherscan.io on 2020-07-21 */ pragma solidity ^0.6.0; interface DMEX { function availableBalanceOf(address token, address user) external view returns (uint256); function withdraw(address token, uint256 amoun...
extract eth require(FEE_ACCOUNT.send(fee_share), "Error: eth send failed"); swap eth for DMEX Token address[] memory path = new address[](2); path[0] = UniswapV2ExchangeInterface(uniswapRouter).WETH(); path[1] = DMEX_TOKEN; uint[] memory amounts = UniswapV2ExchangeInterface(uniswapRouter).swapExactETHForTokens.value(u...
function extractFees() public { uint256 fee_share; uint256 us_share; uint256 eth_balance = DMEX(DMEX_CONTRACT).availableBalanceOf(TOKEN_ETH, address(this)); DMEX(DMEX_CONTRACT).withdraw(TOKEN_ETH, eth_balance); fee_share = eth_balance * fee_account_share / 1e18; us...
10,771,294
./full_match/97/0x50a0572373dFFd038f7487c82d5F4B2f342c0012/sources/contracts/CustomNFT8.sol
Adoge COIN DISTRIBUTION uint256 totalCoins = IERC20(coinAddress).balanceOf(address(this)); uint256 liquidityCoins = totalCoins 55 / 100; uint256 marketingCoins = totalCoins 15 / 100; uint256 prizeCoins = totalCoins 30 / 100; IERC20(coinAddress).transfer(liquidityAddress, liquidityCoins ); IERC20(coinAddress).transfe...
function withdraw() public { require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "CustomNFT6: must have admin role to withdraw"); uint256 totalBNB = address(this).balance; uint256 liquidityBNB = totalBNB * 18 / 100; uint256 marketingBNB = totalBNB * 12 / 100; uint256 priz...
3,281,382
// SPDX-License-Identifier: No License pragma solidity ^0.8.0; import "./ERC20/IERC20.sol"; import "./ERC20/IERC20Permit.sol"; import "./ERC20/SafeERC20.sol"; import "./interfaces/IRERC20.sol"; import "./interfaces/IRulerCore.sol"; import "./interfaces/IRouter.sol"; import "./interfaces/IRulerZap.sol"; import "./util...
RERC20 contract interface, implements {IERC20}. See {RERC20}. crypto-pumpkin/
interface IRERC20 is IERC20 { function mint(address _account, uint256 _amount) external returns (bool); function burnByRuler(address _account, uint256 _amount) external returns (bool); }
1,517,832
pragma solidity ^0.5.12; library SafeMath { function MUL98(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING if (a == 0) return 0; uint256 c = a * b; require(c / a == b); ...
inject NONSTANDARD NAMING
function NAME858() external view returns (string memory);
5,544,608
./full_match/1/0x24f5cf5273E56Bb5b02e3adE135dB4c5B4B63741/sources/ChainFarmers.sol
Returns a custom URI for each token id if set/ If no URI exists for the specific id requested, fallback to the default ERC-1155 URI.
function uri(uint256 _tokenId) public view override returns (string memory) { if (bytes(tokenURI[_tokenId]).length == 0) { return super.uri(_tokenId); } return tokenURI[_tokenId]; }
16,427,960
./full_match/5/0x3aD961262Ed0eB6895A418f71E133f9AC0439A10/sources/browser/github/OpenZeppelin/openzeppelin-contracts/contracts/presets/NativeCoin.sol
Pauses all token transfers. See {ERC20Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`./
function pause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "NativeCoin: must have pauser role to pause"); _pause(); }
1,873,306
./full_match/1/0xbE6e7EDb55c0b97f42cf12ddc2AF8DFD154D584C/sources/contracts/AvastarsMarketplace.sol
clear the royalty for traits/
function clearTraitRoyalty() public onlyOwner whenPaused { RoyaltyOverridden[FakeAvastarsTraitCollection] = false; delete(RoyaltyOverrides[FakeAvastarsTraitCollection]); }
8,337,947
./partial_match/1/0x6e1781678ffE6CDc109fd3bC0833c47BD0F23de1/sources/contracts/L1/L2OutputOracle.sol
Computes the block number of the next L2 block that needs to be checkpointed. If no outputs have been submitted yet then this function will return the latest block number, which is the starting block number. return Next L2 block number./
function nextBlockNumber() public view returns (uint256) { return l2Outputs.length == 0 ? latestBlockNumber() : latestBlockNumber() + SUBMISSION_INTERVAL; }
16,157,700
pragma solidity ^0.4.25; /** Triple ROI: https://12hourtrains.github.io/ Earn 4% per 3 hours, triple your ROI every 3 hours you HODL! 3 hours: 4% 6 hours: 12% 9 hours: 36% 12 hours: 108% ...etc... */ contract TripleROI { using SafeMath for uint256; mapping(address => uint256) investments; mapping(addr...
Evaluate current balance _address Address of investor/ update roi multiplier 4% flat during first 3 hours 12% flat during 6 hours 36% flat during 9 hours 108% flat after 12 hours add each percent - 4% flat during first 3 hours 12% flat during 6 hours 36% flat during 9 hours 108% flat after 12 hours etc - add all these...
function getBalance(address _address) view public returns (uint256) { uint256 minutesCount = now.sub(joined[_address]).div(1 minutes); uint256 userROIMultiplier = 3**(minutesCount / 180); uint256 percent; uint256 balance; for(uint i=1; i<userROIMult...
6,521,720
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ 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; } /** * @dev I...
determine what index the present sender is: make sure they're an owner if we're not yet working on this operation, switch over and reset the confirmation status. reset count of confirmations needed. reset which owners have confirmed (none) - set our bitmap to 0. make sure we (the message sender) haven't confirmed this ...
function confirmAndCheck(bytes32 _operation) internal returns (bool) { uint ownerIndex = m_ownerIndex[uint(msg.sender)]; require(ownerIndex != 0); var pending = m_pending[_operation]; if (pending.yetNeeded == 0) { pending.yetNeeded = c_maxOwners + m_required; ...
950,256
./full_match/1/0x4A20F53E612E6Ab515A46EcA9dd36a290a2287F7/sources/contracts/protocol/core/callable/CallableLoan.sol
If a checkpoint has not occurred, late fees may be overestimated beyond the next due time. @inheritdoc ICreditLine
function totalInterestOwed() public view override returns (uint256) { return _staleCreditLine.totalInterestOwed(); }
9,813,830
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/proxy/Clones.sol"; import "../ModuleBase.sol"; import "../../governance/IGovernance.sol"; import "../../initializable/CustomPricingCurve.sol"; contract CustomPricingCurveDeployer is IModule, ModuleBase { string public constan...
babylonian method (https:en.wikipedia.org/wiki/Methods_of_computing_square_rootsBabylonian_method)
function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } z = 1; } }
112,068
./full_match/5/0x3A3EB5283cf0128cF7B827901fDdb25E967b695c/sources/project_/contracts/Uniswap/UniswapV2Factory.sol
This creates a new contract
function createPair(address tokenA, address tokenB) external override returns (address pair) { require(tokenA != tokenB, 'UniswapV2: IDENTICAL_ADDRESSES'); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); ...
1,858,813
./full_match/1/0x353D558DD690176b03F82e3065372c0faaef88A0/sources/src/RAREDOTTAS1.sol
See {IERC165-supportsInterface}./
function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC1155, ERC2981) returns (bool) { return ERC1155.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); }
8,398,334
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./ERC677.sol"; import "./ERC777Permit.sol"; import "./utils/Ownable.sol"; import "@openzeppelin/contracts/token/ERC777/ERC777.sol"; contract XRUNE is ERC777, ERC777Permit, ERC677, Ownable { uint public constant ERA_SECONDS = 86400; uint public c...
See {IERC20-transferFrom}. Note that operator and allowance concepts are orthogonal: operators cannot call `transferFrom` (unless they have allowance), and accounts with allowance cannot call `operatorSend` (unless they are operators). Emits {Sent}, {IERC20-Transfer} and {IERC20-Approval} events./
function transferFrom(address holder, address recipient, uint256 amount) public virtual override returns (bool) { require(recipient != address(0), "ERC777: transfer to the zero address"); require(holder != address(0), "ERC777: transfer from the zero address"); address spender = _msgSender()...
1,778,746
pragma solidity 0.5.17; import { IBondedECDSAKeepFactory } from "@keep-network/keep-ecdsa/contracts/api/IBondedECDSAKeepFactory.sol"; /// @title Bonded ECDSA keep factory selection strategy. /// @notice The strategy defines the algorithm for selecting a factory. tBTC /// uses two bonded ECDSA keep factories, sele...
Sets addresses of the keep factories and the selection strategy contracts. KeepFactorySelection can work without the keep factory selection strategy set, always selecting the default KEEP-stake-based factory. Once both fully-backed keep factory and factory selection strategy are set, KEEP-stake-based factory is no long...
function setFactories( Storage storage _self, address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector ) internal { require( address(_keepStakedFactory) != address(0), "Invalid KEEP-staked factory address" ); ...
5,375,186
./full_match/1/0xCEB1aAaf0E97b7a9b6d7313e999a3a27b04d75Cb/sources/src/tokens/ERC5095.sol
Post or at maturity, returns user's PT balance. Prior to maturity, returns a previewRedeem for owner's PT balance. o The address of the owner for which withdrawal is calculated return uint256 maximum amount of underlying tokens that `owner` can withdraw.
function maxWithdraw(address o) external view override returns (uint256) { if (block.timestamp < maturity) { return previewRedeem(_balanceOf[o]); } return _balanceOf[o]; }
17,135,285
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 ...
Gets the balance of the specified address. _owner The address to query the the balance of. return An uint256 representing the amount owned by the passed address./
function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; }
2,150,287
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { Initializable } from "@openzeppelin/contracts/proxy/Initializable.sol"; imp...
This function should allow governance to set the minimum stake amount minAmount new minimum stake amount /
function setMinStakeAmount(uint256 minAmount) external onlyGovernance { minStakeAmount = minAmount; emit MinimumStakeAmount(minAmount); }
2,561,609
./partial_match/42220/0xAaa9CB9f0afCc60d8fb21F82D5D47c4557924115/sources/home/eruiz/Projects/celo/celo-monorepo/packages/protocol/contracts/governance/Election.sol
Increments the number of total and pending votes for `group`. group The validator group to vote for. value The amount of gold to use to vote. lesser The group receiving fewer votes than `group`, or 0 if `group` has the fewest votes of any validator group. greater The group receiving more votes than `group`, or 0 ...
function vote(address group, uint256 value, address lesser, address greater) external nonReentrant returns (bool) { require(votes.total.eligible.contains(group), "Group not eligible"); require(0 < value, "Vote value cannot be zero"); require(canReceiveVotes(group, value), "Group cannot recei...
3,502,091