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 experimental ABIEncoderV2; pragma solidity 0.8.10; import "../../Digibytes/Interfaces/IBEP20.sol"; import "../../Utils/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "../../Utils/Owner.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; i...
changing market order timefirst modifier says - this can do only card ownersecond checks if item exist and not rented
function changeOrderTimeToRent( ) public onlyCardOwner(itemID) itemClosedNorRented(itemID) { marketItems[itemID].timeToRent = _newTimeToRent; }
7,245,893
// ____ ___ ____ ___ _ _ __ __ // | _ \ / _ \| _ \_ _| | | | \/ | // | |_) | | | | | | | || | | | |\/| | // | __/| |_| | |_| | || |_| | | | | // |_| \___/|____/___|\___/|_| |_| // // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* --------------------------...
Public mint/ Overall checks Please pay us
function publicSaleMint(uint256 quantity) external payable nonReentrant callerNotBot whenNotPaused { require( totalSupply() + quantity <= collectionSize, "All tokens minted" ); require( numberMinted(msg.sender) + quantity <= maxMintPublic, "Allowance allocated" ); ...
410,327
./full_match/4/0x0e4E631F40Ca20017348C80320De5fFa5B6F34cB/sources/contracts/OctopolisNFT.sol
Sets the starting index of the protocol, this is the index used to construct the final provenanceHash. Prevent default sequence
function setStartingIndex() internal { require(startingIndex == 0, "Starting Index is already set"); require(startingIndexBlock != 0, "Starting index block must be set"); startingIndex = uint(blockhash(startingIndexBlock)) % MAXIMUM_MINT_COUNT; if(block.number...
12,500,551
./full_match/1/0x627a25b6Fdb55EC4630586DCBB73B97001A45D93/sources/contracts/MuonNodeManager.sol
Returns the information of a node associated with the provided node address. nodeAddress The node address. return node The node information./
function nodeAddressInfo( address nodeAddress ) external view returns (Node memory node) { node = nodes[nodeAddressIds[nodeAddress]]; }
3,031,981
pragma solidity ^0.4.15; import "../arbitration/Arbitrator.sol"; import "./VersioningProxy.sol"; /** * @title ArbitratorVersioningProxy * @author Enrique Piqueras - <epiquerass@gmail.com> * @notice An Arbitrator proxy that only exposes methods in the Arbitrator spec. */ contract ArbitratorVersioningProxy is A...
Get the status of a dispute. _disputeID The ID of the dispute. return _status The status of the dispute./
function disputeStatus(uint256 _disputeID) public view onlyIfDisputeExists(_disputeID) returns(Arbitrator.DisputeStatus _status) { return disputes[_disputeID].arbitrator.disputeStatus(disputes[_disputeID].disputeID); }
12,777,731
pragma solidity ^0.4.18; /// @title Interface for contracts conforming to ERC-721: Deed Standard /// @author William Entriken (https://phor.net), et. al. /// @dev Specification at https://github.com/ethereum/eips/XXXFinalUrlXXX interface ERC721 { // COMPLIANCE WITH ERC-165 (DRAFT) ////////////////////////////////...
gen0 monsters profit from shiny boost while shiny gen0s have potentially even higher IVs! further increasing the rarity by also doubling the shiny chance!
function getGen0IVs() external returns (uint8[7] ivs) { bool shiny = false; uint16 chance = rand(1, 4096); if (chance == 42) { shiny = true; } if (shiny) { ivs[0] = uint8(rand(15, 31)); ivs[1] = uint8(rand(15, 31)); ivs[2] = ...
1,977,410
./full_match/1/0x71CED9A5eDA49125490e8f721f5Db54FB60c36FB/sources/contracts/NestedTrade.sol
Cancels the ask for a given NFT _tokenId The ID of the Moonbird token
function cancelAsk(uint256 _tokenId) external onlyTokenSeller(_tokenId) nonReentrant { Ask memory ask = askForMoonbird[_tokenId]; require(ask.seller == msg.sender, "cancelAsk wrong seller"); if (isMoonbirdEscrowed(_tokenId)) { _withdrawBird(_tokenId); } emit Ask...
16,525,308
./partial_match/42/0x3c5406ddCE4836eA2E5817DCF021fE1E9B0796cC/sources/GebProxyIncentivesActions.sol
Exits from liquidity mining pool, removes liquidity from Uniswap and repays debt manager address coinJoin address safe uint - Safe Id incentives address - Liquidity mining pool uniswapRouter address - Uniswap V2 Router minTokenAmounts uint[2] - minimum ETH/Token amounts when providing liquidity to Uniswap (user s...
function exitRemoveLiquidityRepayDebt(address manager, address coinJoin, uint safe, address incentives, address uniswapRouter, uint[2] calldata minTokenAmounts) external { GebIncentivesLike incentivesContract = GebIncentivesLike(incentives); DSTokenLike rewardToken = DSTokenLike(incentivesContract....
3,422,546
pragma solidity ^0.5.2; import "../openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "../openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "../openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "../openzeppelin-solidity/contracts/math/SafeMath.sol"; /** @title An auction sy...
/did we get any bids?compute the amount to keepgive the seller his ETHjust give me back my token
function withdrawBundle(bytes32 bundleId) external _exists(bundleId) _expired(bundleId) { Bundle memory bundle = bundles[bundleId]; address to = bundle.highestBidder; uint256 what = bundle.amount; IERC20 token = IERC20(bundle.token); if(bundle.currentBid > 0) { ...
6,463,777
./full_match/4/0xdbcD7211b11663812D316EB1D0204Cc5ad2A15eB/sources/Users/kirillfedoseev/work/omnibridge-nft/contracts/tokens/ERC1155BridgeToken.sol
Mint a batch of new ERC1155 tokens. Only bridge contract is authorized to mint tokens. _to address of the newly created token owner. _tokenIds array of token ids to mint. _values array of corresponding mint amounts for each tokenId./
function mint( address _to, uint256[] memory _tokenIds, uint256[] memory _values ) external override onlyBridge { if (_tokenIds.length == 1 && _values.length == 1) { _mint(_to, _tokenIds[0], _values[0], new bytes(0)); _mintBatch(_to, _tokenIds, _values, ne...
12,326,822
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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, wh...
Is staking Not staking
function releaseFirstBatchTokens(uint256 _count) public onlyOwner { require(status == ContractStatus.ACCEPT_DEPOSIT); for (uint256 i = 0; i < _count; i++) { if (whitelist[depositAddresses[dIndex]].isWhitelisted) { if (whitelist[depositAddresses[dIndex]].isStaking) { tokenContract.transfer(depositAddre...
1,655,979
./full_match/1/0x5EFCE7c4c7ddeAaD73D899aa5235ca3A95Cf3d7a/sources/browser/CappedCrowdsale.sol
Checks whether the cap has been reached. return Whether the cap was reached/
function capReached() public view returns (bool) { return tokenSold() >= _cap; }
3,139,502
./partial_match/1/0x15f8Fc209A1c97a40e64Bf14C8c7D1D9c0541D0f/sources/nft.sol
withdraw funds and distribute them to the shareholders
function withdrawAll() external onlyOwner { uint balance = accountBalance(); require(balance > 0, "Balance must be greater than 0"); withdraw(payable(dev), ((balance * 5) / 1000)); withdraw(payable(shareholder1), ((balance * 2125) / 10000)); withdraw(payable(shareholder2), (...
2,747,071
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; imp...
Get number of listings
function getNumListings() external view returns (uint256) { return listingIds.length(); }
6,006,709
./partial_match/1/0x74c4a10B162EA731a7acB4366ADC6046DAC84E36/sources/ReviewContract.sol
Returns whether this hash exists or not. _hashReview Verifiable hash./
function getExistingReview(string _hashReview) public view returns(bool) { if (clientReviews[_hashReview] == true) { return true; } else return false; }
2,789,573
/* β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘ β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘ β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–ˆ...
Allows the owner to update the Fonts address. fontAddress The new Fonts address to use for the renderer. Must conform to IOKPCFont.
function setFont(address fontAddress) public onlyOwner { _font = IOKPCFont(fontAddress); }
595,452
./full_match/1/0xDF8704582C08f9A208fF86F42876dCF4308d5435/sources/browser/staking.sol
remove vote remove users vote from token remove 1 form total votes
function removeVote() external { require(usr[msg.sender].voted != address(0), "You have not voted"); tAddr[usr[msg.sender].voted]-=1; totVote-=1; usr[msg.sender].voted = address(0); }
3,101,285
/** *Submitted for verification at Etherscan.io on 2019-10-31 */ /************************************************************************** * ____ _ * / ___| | | __ _ _ _ ___ _ __ * | | _____ | | / _` || | | | / _ \| '__| * ...
returns token price/
function tokenPrice() public view returns (uint256) { return tokenPrice_; }
12,886,908
./full_match/4/0x87f0D1e1AC129f5a2B8995d21E8B6ff3D42Fd896/sources/browser/BaoMasterFarmer_flat.sol
Update % lock for Founders
function lockfounderUpdate(uint _newfounderlock) public onlyAuthorized { PERCENT_FOR_FOUNDERS = _newfounderlock; }
746,856
pragma solidity ^0.4.24; import "./ISTO.sol"; import "../../interfaces/IST20.sol"; import "../../interfaces/IOracle.sol"; import "../../RegistryUpdater.sol"; import "../../interfaces/ISecurityTokenRegistry.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/Reentra...
Modify the list of accredited addresses _investors Array of investor addresses to modify _accredited Array of bools specifying accreditation status/
function changeAccredited(address[] _investors, bool[] _accredited) public onlyOwner { require(_investors.length == _accredited.length); for (uint256 i = 0; i < _investors.length; i++) { accredited[_investors[i]] = _accredited[i]; } }
2,548,306
pragma solidity ^0.5.2; /** * @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; event OwnershipTransferred(address indexed ...
returns up to 10 transactions of device owner return _deviceIds device ID's of the msg.sender transactions/
function getDevicesByTxn(bytes32 _message, uint8 _v, bytes32 _r, bytes32 _s) public view returns(bytes32[10] memory _deviceIds) { address signer = ecrecover(_message, _v, _r, _s); uint numDevices; bytes32[10] memory devicesByTxOriginator; ...
13,008,231
pragma solidity 0.4.25; contract ParallelConfigPrecompiled { function registerParallelFunctionInternal(address, string, uint256) public returns (int); function unregisterParallelFunctionInternal(address, string) public returns (int); } contract ParallelContract { ParallelConfigPrecompiled precomp...
LogError(uint8(Errors.ORDER_EXPIRED), order.orderHash);return 0;
function fillOrder_1(address maker, address taker, address feeRecipient, uint256 fillTakerTokenAmount, bytes32 orderHash) public { Order memory order = Order({ maker: maker, taker: msg.sender, feeRecipient: feeRecipient, makerTokenAmount: 10000, ...
14,069,783
/* Copyright 2019 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 ...
Get all risk parameter limits in a single struct. These are the maximum limits at which the risk parameters can be set by the admin of Solo. return All global risk parameter limnits/
function getRiskLimits() public view returns (Storage.RiskLimits memory) { return g_state.riskLimits; }
979,739
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. ...
inject NONSTANDARD NAMING
function SYNC19() external;
12,787,850
pragma solidity ^0.5.4; contract Account { // The implementation of the proxy address public implementation; // Logic manager address public manager; // The enabled static calls mapping (bytes4 => address) public enabled; event EnabledStaticCall(address indexed module, bytes4 indexe...
Should return whether the signature provided is valid for the provided data. _data Arbitrary length data signed on the behalf of address(this) _signature Signature byte array associated with _data/
function isValidSignature(bytes calldata _data, bytes calldata _signature) external view returns (bytes4) { bytes32 msgHash = keccak256(abi.encodePacked(_data)); isValidSignature(msgHash, _signature); return ERC1271_ISVALIDSIGNATURE_BYTES; }
13,758,715
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; /** * Request testnet LINK and ETH here: https://faucets.chain.link/ * Find information on LINK Token Contracts and get the latest ETH and LINK faucets here: https://docs.chain.link/docs/link-token-co...
function withdrawLink() external {} - Implement a withdraw function to avoid locking your LINK in the contract
function bytes32ToString(bytes32 _bytes32) public pure returns (string memory) { uint8 i = 0; function requestWeather() public returns (bytes32 requestId) } function fulfill(bytes32 _requestId, bytes32 _weather) public recordChainlinkFulfillment(_requestId) } while(i < 32 && _...
13,100,513
./partial_match/1/0xDf0dbc66f85979a1d54671c4D9e439F306Be27EE/sources/_mean-finance/swappers/solidity/contracts/SwapAdapter.sol
Transfers the given amount of tokens from the contract to the recipient _token The token to check _amount The amount to send _recipient The recipient/
function _sendToRecipient( address _token, uint256 _amount, address _recipient ) internal virtual { if (_recipient == address(0)) _recipient = msg.sender; if (_token == PROTOCOL_TOKEN) { payable(_recipient).sendValue(_amount); IERC20(_token).safeTransfer(_recipient, _amount); } ...
9,345,461
/** *Submitted for verification at Etherscan.io on 2021-09-15 */ // File: core/interfaces/IImpulsevenSwapV2Callee.sol pragma solidity >=0.5.0; interface IImpulsevenSwapV2Callee { function ImpulsevenSwapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external; } // File: core/interfaces/...
update reserves and, on the first call per block, price accumulators never overflows, and + overflow is desired
function _update(uint balance0, uint balance1, uint112 _reserve0, uint112 _reserve1) private { require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'ImpulsevenSwapV2: OVERFLOW'); uint32 blockTimestamp = uint32(block.timestamp % 2**32); if (timeElapsed > 0 && _reserve0 != 0 && _reserve...
10,945,843
pragma solidity ^0.4.19; contract Spineth { /// The states the game will transition through enum State { WaitingForPlayers, // the game has been created by a player and is waiting for an opponent WaitingForReveal, // someone has joined and also placed a bet, we are now waiting for t...
Join an open game instance Sender must provide an amount of wei equal to betAmountInWei After the second player has joined, the creator will have maxRevealSeconds to reveal their bet Get the game instance and check that it exists Only allowed to participate while we are waiting for players Can't join a game that you cr...
function joinGame(uint gameId, uint wheelBet) public payable { GameInstance storage game = gameContext[gameId]; require(game.betAmountInWei > 0); require(game.state == State.WaitingForPlayers); require(game.player1 != msg.sender); require(game....
15,831,882
./full_match/43113/0x6b9c8c5ac8161a932FF63308D0dF500a76c069AF/sources/src/RToken/RToken.sol
Transfer `amount` tokens from `src` to `dst` src The address of the source account dst The address of the destination account amount The number of tokens to transfer return Whether or not the transfer succeeded/
function transferFrom(address src, address dst, uint256 amount) external nonReentrant returns (bool) { return transfeRTokens(msg.sender, src, dst, amount) == uint(Error.NO_ERROR); }
7,112,723
./partial_match/97/0xCa4BEA001f3B7281ce6FE3672Ba764B03919253b/sources/SHOWToken.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 ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
11,369,156
// contracts/CryptoshackStaking.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; interface ICryptoshackContract { function balanceOf(address owner) external view returns (uint256); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function transfer...
allow owner to remove token from stake in case of problems with contract
function ejectStakingTokens(address wallet, uint tokenId) external onlyOwner onlyEmergency { cryptoshackContract.transferFrom(address(this), wallet, tokenId); }
15,134,803
/** β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β–‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–‘β•šβ–ˆβ–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘...
Can modify the shares own by the team. They triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the total shares and their previous withdrawals. After the transfer the new shares are setup/ triggers a transfer to `account` of the amount of Ether they are owed, accordi...
function _modifyShares(address[] memory oldPayees,address[] memory newPayees , uint256[] memory shares_) internal virtual { for (uint256 i = 0; i < oldPayees.length; i++) { require(_shares[oldPayees[i]] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(t...
6,127,355
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./AelinERC20.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; contract AelinDeal is AelinERC20 { using SafeERC20 for IERC20; uint256 publ...
a function only the treasury can use so they can send both the all unvested deal tokens as well as all the vested underlying deal tokens in a single transaction for distribution to $AELIN stakers./
function treasuryTransfer(address recipient) external returns (bool) { require( msg.sender == aelinRewardsAddress, "only Rewards address can access" ); ( uint256 underlyingClaimable, uint256 claimableDealTokens ) = claimableTokens(msg.s...
1,102,371
./full_match/1/0x097194AABb2c826558A8d0b6D2c070ac7863B4a5/sources/contracts/GOAcomic.sol
Verify whitelist requirements
function whitelistMint(uint256 _mintAmount) public { require(whitelistMintEnabled, 'The Free mint sale is not enabled!'); IERC721 token = IERC721(GOAaddress); ownerAmount = token.balanceOf(msg.sender); if (ownerAmount>=1){ uint256 totalMinted = balanceOf(msg.sender) + _mintAmount; require(...
2,941,221
./full_match/7700/0x6eA48824253f64662945Ae77A790331D7183f8c0/sources/project_/contracts/access/IOwner.sol
: Classic "EIP-173" getter for owner() return: owner of contract : This is the classic "EIP-173" method of setting onlyOwner() : This is the classic "EIP-173" method of setting onlyOwner() newOwner: addres of new pending owner role
interface IOwner is IERC165 { function owner() external view returns (address); function renounceOwnership() external; function transferOwnership( address newOwner ) external; }
4,661,747
./full_match/56/0x40FAe5582FE07314456Ddc915ce6e035D67c1633/sources/contracts/BabyBurnCoin.sol
Functions required by IERC20Metadat - END / Functions required by IERC20 /
function totalSupply() external view override returns (uint256) { return TOTAL_SUPPLY; }
3,253,030
./full_match/80001/0x5A8AcB68306CE2dBEE0904897DC88ea763cC34b3/sources/contracts/BuyMeCoffee.sol
send the entire balance stored in this contract to the owner/ if (msg.sender != owner()) { revert Unauthorized(); } require(owner() == _msgSender(), "Ownable: caller is not the owner");
function withdrawTips() public { require(_owner.send(address(this).balance)); }
9,481,736
./partial_match/1/0xf7d35CA1c865871e8cF8ba58515343ECBff6A46D/sources/project:/contracts/MERC721TokenAdmin.sol
Sender enters mToken market and borrows NFT assets from the protocol to their own address. borrowUnderlyingID The ID of the underlying NFT asset to borrow return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/
function borrow(uint256 borrowUnderlyingID) external returns (uint) { borrowUnderlyingID; return fail(Error.MTROLLER_REJECTION, FailureInfo.BORROW_MTROLLER_REJECTION);
3,927,882
//Address: 0xCDa98bA916AD2561ACA6D5aC7B83C76Fe49165c8 //Contract name: Crowdsale //Balance: 0 Ether //Verification Date: 4/6/2018 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.15; pragma solidity ^0.4.15; contract Token { uint256 public totalSupply; function balanceOf(address _owner) cons...
displays number of uniq investors
function investorsCount() constant external returns(uint) { return investors.length; }
7,324,817
./partial_match/1313161554/0x30BAca27882Db094Ea1064A23E2866DFACfc5848/sources/WannaSwapProfile.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 _transfer(address sender, address recipient, uint amount) internal virtual override { super._transfer(sender, recipient, amount); _moveDelegates(_delegates[sender], _delegates[recipient], amount); }
16,930,280
/** *Submitted for verification at Etherscan.io on 2021-09-04 */ /** *Submitted for verification at Etherscan.io on 2021-09-01 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its ...
Claim Neuro Credits for a given gear ID tokenId The tokenId of the gear NFT Follow the Checks-Effects-Interactions pattern to prevent reentrancy attacks Checks Check that the msgSender owns the token that is being claimed Further Checks, Effects, and Interactions are contained within the _claim() function
function claimById(uint256 tokenId) external { require( _msgSender() == gearContract.ownerOf(tokenId), "MUST_OWN_TOKEN_ID" ); _claim(tokenId, _msgSender()); }
10,181,387
// (C) block.one all rights reserved pragma solidity ^0.4.24; import "../math/SafeMath.sol"; import "../ERC20/IERC20.sol"; import "../presale/IPresale.sol"; import "./ICrowdsale.sol"; import "../access/roles/ManagerRole.sol"; import "../access/roles/RecoverRole.sol"; contract TBNCrowdSale is ICrowdsale, ManagerRole,...
crowdsale manager can rebase the ETH price (rebase will be applied to the next interval)
function setRebase(uint256 newETHPrice) external onlyManager atStage(Stages.Crowdsale) returns (bool) { uint256 interval = getInterval(block.number); require(interval > 0, "cannot rebase in the initial interval"); _rebaseNewPrice = newETHPrice; _rebased = interval; return tru...
13,111,087
pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ ...
Creates `amount` tokens and assigns them to `msg.sender`, increasing the total supply. Requirements - `msg.sender` must be the token owner/
function mint(uint256 amount) public onlyOwner returns (bool) { require(_totalSupply == 0, "ERC20: can only be minted once"); _mint(_msgSender(), amount); return true; }
13,484,499
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { mapping(address => uint256) public balances; function totalSupply() public view returns (uint256); function balanceOf(address who) ...
Compute hash for property before write into storage _name Name of property (such as full_name, birthday, address etc.) _data Value of property/
function computePropertyHash(string _name, string _data) pure public returns (bytes32) { return sha256(_name, _data); }
6,111,692
pragma solidity 0.5.17; import "./lib/os/SafeMath.sol"; import "./lib/os/SafeERC20.sol"; import "./lib/os/IsContract.sol"; import "./lib/os/Autopetrified.sol"; import "./lib/Checkpointing.sol"; import "./standards/ERC900.sol"; import "./locking/IStakingLocking.sol"; import "./locking/ILockManager.sol"; contract Sta...
staking 0 tokens is invalid checkpoint updated staking balance checkpoint total supply pull tokens into Staking contract
function _stakeFor(address _from, address _user, uint256 _amount, bytes memory _data) internal { require(_amount > 0, ERROR_AMOUNT_ZERO); uint256 newStake = _modifyStakeBalance(_user, _amount, true); _modifyTotalStaked(_amount, true); require(stakingToken.safeTransferFrom(_from, a...
12,704,138
./full_match/5/0x5bB1a4a7AE0277588Bc7e96D33ac3F58c6b3F22e/sources/contracts/Distributor.sol
Sets a new DEX router. dexRouterAddress The address of the new DEX router smart contract to set./
function setDexRouterAddress(address dexRouterAddress) external onlyOwner { require(dexRouterAddress != address(0), "ZERO_ADDRESS_NOT_ALLOWED"); dexRouter = IDEXRouter(dexRouterAddress); }
11,586,202
./full_match/4/0x4A7b2A43faE35eC09A66e0a1168eA493566c4fA6/sources/browser/MeePreSale.sol
Validation transfer the tokens. Transfer ETH to Owner update constants.
function deposit() public payable { require(startDate > 0 && now.sub(startDate) <= DURATION); require(Token.balanceOf(address(this)) > 0); require(msg.value >= 0.1 ether); require(_whitelist[msg.sender] == true); require(!presaleClosed); uint256 amount = msg.value.mul(660); require(amount ...
806,741
pragma solidity ^0.4.23; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./bancor/token/TrxToken.sol"; contract FallbackTest is Ownable { TrxToken public trxToken; constructor (address _trxToken) { trxToken = TrxToken(_trxToken); } // function() public payable { ...
410000000000000000000000000000000000000000
function claimTokens(address _token) public onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } IERC20Token token = IERC20Token(_token); uint balance = token.balanceOf(address(this)); token.transfer(owner, balance); } ...
6,379,014
/** *Submitted for verification at Etherscan.io on 2021-07-20 */ pragma solidity ^0.6.12; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address ...
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tLiquidity) = _getBuyValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwne...
15,307,033
pragma solidity ^0.4.19; // copyright contact@emontalliance.com contract BasicAccessControl { address public owner; // address[] public moderators; uint16 public totalModerators = 0; mapping (address => bool) public moderators; bool public isMaintaining = false; function BasicAccessControl() ...
check valid _x, _y check valid move move charge when swiming except from the base go back to base no fish at that location eat the target fish update location fight and win bonus to others fight update location
function MoveFish(uint _fromPos, uint _toPos) isActive external { if (_toPos >= maxPos && _fromPos != _toPos) revert(); uint fishId = players[msg.sender]; Fish storage fish = fishMap[fishId]; if (fish.weight == 0) revert(); if (!fish.active &&...
2,267,518
pragma solidity >=0.5.0 <0.6.0; /** Author: Sik Jean Soon **/ /** * @title SafeMath for uint256 * @dev Math operations with safety checks that throw on error */ library SafeMathUint256 { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) inter...
Check transaction volume limit Check transaction volume limit Truncate timestamp (YYYYMMDD) to daily (UTC time) Reset volume on new day
function defaultRequirement(string memory _requirementType, uint256 _value) private { bytes32 t = encodePacked(_requirementType); TransactionLimit storage limit = transactionLimits[t]; if (0 < limit.upperLimit) { uint256 dt = now - (now % 86400); if (dt == limi...
15,810,828
pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' ...
Internal function that burns an amount of the token of a given account. account The account whose tokens will be burnt. value The amount that will be burnt./
function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); }
218
./full_match/1/0xcE9b49b0d4FE456aD6E4a1b7e4bBdD0699400Ef9/sources/src/vaults/borrowing/BorrowingVaultUpgradeable.sol
@inheritdoc IVaultUpgradeable
function balanceOfDebt(address owner) public view override returns (uint256 debt) { return convertToDebt(_debtShares[owner]); }
2,939,906
/** *Submitted for verification at Etherscan.io on 2022-02-10 */ // Sources flattened with hardhat v2.8.2 https://hardhat.org // File contracts/solidity/interface/INFTXLPStaking.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface INFTXLPStaking { function nftxVaultFactory() external view ret...
If the allowance has not been spent, it means we can pass it forward to next.
function _sendForReceiver( FeeReceiver memory _receiver, uint256 _vaultId, address _vault, uint256 amountToSend ) internal virtual returns (bool) { if (_receiver.isContract) { IERC20Upgradeable(_vault).safeIncreaseAllowance( _receiver.receiver,...
7,886,644
./full_match/1/0x10aEC5622602e02186508318bD6e2cD995C92705/sources/contracts/MusicRacerNFT333.sol
ΠΏΠΎΡ€ΠΎΠΆΠ΄Π°Π΅Ρ‚ Π½ΠΎΠ²ΡƒΡŽ ΠΌΠ°ΡˆΠΈΠ½Ρƒ ΡƒΠΊΠ°Π·Π°Π½Π½ΠΎΠ³ΠΎ Ρ‚ΠΈΠΏΠ° ΠΎΠ³Ρ€Π°Π½ΠΈΡ‡ΠΈΡ‚Π΅Π»ΡŒ Π±Π΅Ρ€Π΅ΠΌ Ρ‚ΠΈΠΏ ΠΌΠ°ΡˆΠΈΠ½Ρ‹ большС ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Π½ΠΎΠ³ΠΎ количСства ΠΌΠ°ΡˆΠΈΠ½Ρ‹ Π½Π΅ ΡΠΎΠ·Π΄Π°ΡŽΡ‚ΡΡ Π³Π΅Π½Π΅Ρ€ΠΈΡ€ΡƒΠ΅ΠΌ части ΠΌΠ°ΡˆΠΈΠ½Ρ‹ ΠΈΠ· Π΅Π΅ Ρ‚ΠΈΠΏΠ°
function CreateCar(uint256 carTypeId) internal returns (Car memory) { require( carTypeId > 0 && carTypeId <= CarTypesCount, "incorrect car type id" ); CarType storage carType = CarsTypes[carTypeId]; require(carType.Count < carType.MaxCount, "all cars in type ...
3,872,315
./full_match/137/0x2E78c308Fe2cAB03C04ce00597Bc79b0E7DE4682/sources/contracts/investmentVehicle/aave/AAVEV1BasePolygon.sol
https:dev.sushi.com/sushiswap/contractsalternative-networks
function _sushiRouter() internal override pure returns(address){ return 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506; }
3,771,589
./full_match/3/0x7EFaD749c69962F8BBB659196c22B5E64953507b/sources/contracts/escrow.sol
ΠŸΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ комиссию Werto
function GetFeePercent() public view returns (uint) { return feePercent; }
14,189,922
./full_match/3/0x29ACA8F703d275aa2b02e9F08DDe8fcd67348097/sources/DexToDexArb.sol
bytes4(keccak256(bytes('transfer(address,uint256)')));
function safeTransfer(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'Dex, TransferHelper: TRANSFER_FAILED'); }
8,270,609
pragma solidity ^0.4.19; contract Spineth { /// The states the game will transition through enum State { WaitingForPlayers, // the game has been created by a player and is waiting for an opponent WaitingForReveal, // someone has joined and also placed a bet, we are now waiting for t...
Cancel a game that was created but never had another player join A creator can use this function if they have been waiting too long for another player and want to get their bet funds back. NOTE. Once someone joins the game can no longer be cancelled. Get the game instance and check that it exists Can only cancel if we ...
function cancelGame(uint gameId) public { GameInstance storage game = gameContext[gameId]; require(game.betAmountInWei > 0); require(game.state == State.WaitingForPlayers); require(game.player1 == msg.sender); game.state = State.Complete; game.withdraw...
15,831,881
//Address: 0x91923a5fe80e1246aa137e8bcc0ec94d42432ab0 //Contract name: OptionsExchange //Balance: 0 Ether //Verification Date: 3/1/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.20; /* Options Exchange ======================== An Exchange for American Options, which are also reversible until ...
Allows a Maker to cancel their offchain Option order early (i.e. before its expiration). Option must be Available, which means it is valid, unexpired, unfilled, and uncancelled. Only allow the Maker to cancel their own offchain Option order. Mark the offchain Option order as cancelled onchain.
function cancelOptionOrder(address[3] tokenA_tokenB_maker, uint256[3] limitTokenA_limitTokenB_premium, uint256[2] maturation_expiration, bool makerIsSeller, bool premiumIsTokenA) external { require(...
1,008,271
pragma solidity ^0.5.0; //pragma- additional info // ^ - version this or higher contract Adoption { address[16] public adopters; // Length is pre-defined to number of dogs in the pet store // Public variables auto-generate the getter functions, however it will require a key, to get the whole array we'll w...
Check if the petId is valid. Assign the address of the message sender to the adopters in the index corresponding to the petId return id of the pet that is adopted as a confirmation.
function adopt(uint petId) public returns (uint) { require (petId >= 0 && petId <= 15); adopters[petId] = msg.sender; return petId; }
2,479,584
./full_match/80001/0xaE4f334860d10B1893D7E66aA60b2f6Ab1361c55/sources/project_/contracts/buyNow/BuyNowERC20.sol
Method that updates buyer's local balance on arrival of a payment, re-using local balance if available, and transferring to this contract only the new funds required. Unlike in native crypto payments, here the exact minimal amount required is automatically transferred by this contract from the ERC20 contract, not de...
function _updateBuyerBalanceOnPaymentReceived( address buyer, uint256 newFundsNeeded, uint256 localFunds ) internal override { if (newFundsNeeded > 0) { require( IERC20(_erc20).transferFrom(buyer, address(this), newFundsNeeded), "BuyNow...
5,663,020
// SPDX-License-Identifier: Unlicensed /** β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆ β–ˆβ–‘β–‘β–„β–€β–„β–€β–„β–€β–„β–€β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–„β–€β–„β–€β–„β–€β–„β–€β–„β–€β–‘β–‘β–ˆβ–‘β–‘β–„β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–„β–€β–‘β–‘β–ˆβ–‘β–‘β–„β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–‘β–‘β–„β–€β–‘β–‘β–ˆβ–‘β–‘β–„β–€β–„β–€β–„β–€β–„β–€β–„β–€...
exclude from paying fees or having max transaction amount
constructor() ERC20("Donna", "DONNA") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_unisw...
1,479,925
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_51(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,453,764
// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.4; import "./ERC165.sol"; import "./ERC20.sol"; // FixedTokenSupply manages a fixed amount of fungible tokens. contract FixedTokenSupply is ERC20, ERC165 { uint256 public override(ERC20) immutable totalSupply; // Balances tracks all token owners. mapping(add...
check approval operate with permission update aproval
function transferFrom(address from, address to, uint256 amount) public override(ERC20) returns (bool) { uint256 approved = allowance(from, msg.sender); require(approved >= amount, "insufficient allowance"); authorizedTransferFrom(from, to, amount); authorizedApprove(from, msg.sender, approved - amount); }
1,784,852
// Chonker Gachapon Machine contract // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC115...
amount how much token will be needed and will be burned./
function _transferAndBurnToken(uint256 amount) private { uint256 totalPaid = 0; address[6] memory accounts = [liquidityAccount, liquidityAccount, liquidityAccount, teamAccount, artistAccount, burnAccount]; IERC20 payToken = machineOption[1] == 1 ? wethToken : taiyakiToken; for(uint i...
12,590,211
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./IAccessControl.sol"; import "./ERC165.sol"; /** * @dev Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * ...
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 _isContract(address account) private view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; }
14,033,535
./full_match/5/0x75808Ee0b7A53139FF62b2a1d758C74bcf671Ad3/sources/@aave/core-v3/contracts/protocol/tokenization/AToken.sol
@inheritdoc IInitializableAToken
function initialize( IPool initializingPool, address treasury, address underlyingAsset, IAaveIncentivesController incentivesController, uint8 aTokenDecimals, string calldata aTokenName, string calldata aTokenSymbol, bytes calldata params ) public virtual override initializer { re...
7,041,199
// 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 active schains of a node./
function getActiveSchains(uint nodeIndex) external view override returns (bytes32[] memory activeSchains) { uint activeAmount = 0; for (uint i = 0; i < schainsForNodes[nodeIndex].length; i++) { if (schainsForNodes[nodeIndex][i] != bytes32(0)) { activeAmount++; ...
10,373,751
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.10; import {Ownable} from "../../lib/Ownable.sol"; import {Pausable} from "../../lib/Pausable.sol"; import {Reentrancy} from "../../lib/Reentrancy.sol"; import {ERC721, IERC721, IERC165} from "../../lib/ERC721/ERC721.sol"; import {IERC721Metadata} from "...
ensure token has an owner, or token is within the allocation
function _exists(uint256 tokenId) internal view override returns (bool) { return _owners[tokenId] != address(0) || tokenId < allocationCount; }
6,224,613
// contracts/staking/BalleStakingPoolV1.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/Re...
Function to use from Governance Gnosis Safe multisig only in case tokens get stuck. This is to be used if someone, for example, sends tokens to the contract by mistake. There is no guarantee governance will vote to return these./
function inCaseTokensGetStuck( address _token, uint256 _amount, address _to ) external onlyOwner { require(_to != address(0), "zero address"); require(_token != stakedToken, "!safe"); IERC20(_token).safeTransfer(_to, _amount); }
12,881,097
pragma solidity 0.4.24; // File: contracts/ERC677Receiver.sol contract ERC677Receiver { function onTokenTransfer(address _from, uint _value, bytes _data) external returns(bool); } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ER...
solium-disable-next-line security/no-inline-assembly
function recoverAddressFromSignedMessage(bytes signature, bytes message) internal pure returns (address) { require(signature.length == 65); bytes32 r; bytes32 s; bytes1 v; assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) ...
1,053,821
./partial_match/1/0xad1AAe5e198312dA5f07F0814B54231F1A2e9eAb/sources/CHAD.sol
Sets `amount` as the allowance of `spender` over the `owner` s tokens. This 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 virtual { require(owner != address(0), "ERCStandard: approve from the zero address"); require(spender != address(0), "ERCStandard: approve to the zero address"); _allowances[owner][spend...
15,732,496
./partial_match/1/0x6da28Db16ecB33C2468FF934CD3A3447c588309A/sources/contracts/HegicOptionsNFT.sol
Burns NFT if it does not hold any option _tokenId ID of the token to be burnt/ only allows to burn inactive options, even if still owned by the contract
function burnToken(uint _tokenId) external onlyTokenOwnerOrApproved(_tokenId) { (IHegicOptions.State state, , , , , , uint expiration , ) = getUnderlyingOptionParams(_tokenId); if(state == IHegicOptions.State.Active || expiration > block.timestamp) require(!ownedByThis[_tokenId]...
2,726,550
./full_match/42161/0xd09556ECE9783f9AABba43e1df6A04a8218e7ca1/sources/project_/contracts/mercenaries/CharacterStats.sol
Returns a characters default max health tokenID Characters ID Retrieve stats Calculate the characters health Bonus for Tank or Warrior
function getMaxHealth(uint256 tokenID) public view returns ( uint256 health ) { (uint256 stamina, uint256 strength,,,,,,,) = getStats(tokenID); health = (strength + stamina) / 2; if (strength > 95 || stamina > 95) { health +...
16,306,151
// SPDX-License-Identifier: MIT // β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ // β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ // β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ // β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ // β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ // β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ // β–β–ˆβ–ˆβ–ˆβ–ˆβ–Œ ...
Allows the Governance to mark the given vault address as trusted or no longer trusted. Vaults are not trusted by default. Trusted vault must meet the following criteria: - `IVault.onBalanceIncreased` must have a known, low gas cost. - `IVault.onBalanceIncreased` must never revert. Witho...
function setVaultStatus(address vault, bool isTrusted) external onlyOwner { isVaultTrusted[vault] = isTrusted; emit VaultStatusUpdated(vault, isTrusted); }
15,805,839
// File: contracts/tokens/ERC20.sol pragma solidity 0.5.14; /** * Abstract contract(interface) for the full ERC 20 Token standard * see https://github.com/ethereum/EIPs/issues/20 * This is a simple fixed supply token contract. */ contract ERC20 { /** * Get the total token supply */ function totalSup...
Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address _to, uint256 _amount) public hasMintPermission canMint returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; }
2,477,452
./full_match/43114/0xa655bABd370D9f028EaA2293ed4448E8573fB430/sources/contracts/test.sol
Function to return current balance of owner
function getBalance( ) public view returns(uint256){ return owner.balance; }
4,540,458
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./NectarToken.sol"; contract OfferMultiSig is Pausable { using SafeMath for uint256; stri...
solium-disable-next-line security/no-inline-assembly
function getBalanceA(bytes memory _state) public pure returns (uint256 _balanceA) { assembly { _balanceA := mload(add(_state, 192)) } }
2,509,410
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; import "../../utils/SafeMath.sol"; import "../../interfaces/IERC1155TokenReceiver.sol"; import "../../interfaces/IERC1155.sol"; import "../../utils/Address.sol"; import "../../utils/ERC165.sol"; /** * @dev Implementation of Multi-Token Standard contract */ con...
Queries the approval status of an operator for a given owner _owner The owner of the Tokens _operator Address of authorized operator return isOperator True if the operator is approved, false if not/
function isApprovedForAll(address _owner, address _operator) public virtual override view returns (bool isOperator) { return operators[_owner][_operator]; } |__________________________________*/
922,764
./full_match/1/0x4B9195D13fd61871f72621141eEECfb6426388bC/sources/localhost/DPiggyAsset.sol
Internal function to get the user asset net profit and the fee amount charged in Dai. escrowStart The Unix time for user escrow start. Zero means no escrow. userData Stored data for the user. return The user's Dai gross profit, asset net profit and the fee amount in Dai./Whether there is no Auc escrowed and the execu...
function _getUserProfitsAndFeeAmount(uint256 escrowStart, UserData storage userData) internal view returns(uint256, uint256, uint256) { if (userData.currentAllocated > 0) { uint256 accruedInterest = userData.previousProfit; uint256 assetAmount = userData.previousAssetAmount; ...
4,888,815
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./ComptrollerInterface.sol"; import "./CTokenInterfaces.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./EIP20Interface.sol"; import "./EIP20NonStandardInterface.sol"; import "./InterestRateModel.sol"; /** * @title Compound's C...
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[] calldata cTokens, uint[] calldata newBorrowCaps) external { require(msg.sender == admin || msg.sender == borrowCapGuardian, "not an admin"); uint numMarkets = cTokens.length; uint numBorrowCaps = newBorrowCaps.length; require(numMarkets != 0 && n...
564,651
./full_match/42/0xa814bfa2669B7E20b58Bf2458DBFeaB9C8913Af9/sources/transferFNX.sol
Check if RRday firstuint256 dateToday = isTodayFirstDayOfMonth();
{ marketing = 0; reflect = 0; function _getSellTaxAmounts(uint256 amount) public view returns ( uint256 send, uint256 reflect, uint256 marketing ) if (isRRwinner(msg.sender)){ uint256 sendRate = 100 - _rrwinn...
9,570,386
./full_match/8453/0x40D1243C3B84d597b60f410A36694e256B51De5c/sources/contracts/lib/CurrencyTransferLib.sol
Transfers ERC20 tokens and returns a boolean i.e. the status of the transfer. solhint-disable avoid-low-level-calls slither-disable-next-line low-level-calls
function transferCurrencyWithReturnVal( address _currency, address _from, address _to, uint256 _amount ) internal returns (bool success) { if (_amount == 0) { success = true; return success; } if (_currency == CurrencyTransferLib.N...
11,545,218
pragma solidity 0.8.10; // Copyright Balancer, BigchainDB GmbH and Ocean Protocol contributors // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import "./BToken.sol"; import "./BMath.sol"; import "../../interfaces/ISideStaking.sol"; import "../../utils/SafeERC20.sol";...
getBalance Returns the current token reserve amount token token to be checked/
function getBalance(address token) external view _viewlock_ returns (uint256) { _checkBound(token); return _records[token].balance; }
15,821,358
// SPDX-License-Identifier: MIT pragma solidity ^0.6.11; pragma experimental ABIEncoderV2; import "deps/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "deps/@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "deps/@openzeppelin/contracts-upgradeable/utils/Address...
===== View Functions =====
function getName() external override pure returns (string memory) { return "StrategyDiggRewards"; }
1,035,164
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @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; ...
return tokenUnits Number of token base units required per creation unit
function tokenUnits() external view returns (uint256[]){ uint256[] memory tokenUnits = new uint256[](tokens.length); for (uint8 i = 0; i < tokens.length; i++) { tokenUnits[i] = tokens[i].tokenUnits; } return tokenUnits; }
10,974,429
pragma solidity 0.4.24; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @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...
Calculates the amount that has already vested but hasn't been released yet./
function releasableAmount() public view returns (uint256) { return vestedAmount().sub(releasedTokens[msg.sender]); }
2,535,124
pragma solidity 0.4.25; /** * @title SafeCompare */ library SafeCompare { function stringCompare(string str1, string str2) internal pure returns(bool) { return keccak256(abi.encodePacked(str1)) == keccak256(abi.encodePacked(str2)); } } library SafeMath { /** * @dev Multiplies two...
_preValidateAddRecord, Validation of an incoming AddRecord. Use require statemens to revert state when conditions are not met. _payerAddress Address performing the pleadge. _pledgeSum the value to pleadge. _pledgeId pledge contract index number. _tokenName pledge token name./
function _preValidateAddRecord(address _payerAddress, uint256 _pledgeSum, uint256 _pledgeId, string _tokenName) view internal { require(_pledgeSum > 0 && _pledgeId > 0 && _payerAddress != address(0) && bytes(_tokenName).length > 0 && address(msg.sender).isContract() && PledgeContract(msg.s...
6,378,339
./partial_match/42/0x96567CA7b90a28CF16Bb24EB68f582A5660CBd9c/sources/Vault.sol
Allows for depositing the underlying asset in exchange for shares assigned to the holder. This facilitates depositing for someone else (using DepositHelper)/
function depositFor(uint256 amount, address holder) public { defense(); _deposit(amount, msg.sender, holder); }
3,479,708
/** *Submitted for verification at Etherscan.io on 2021-03-03 */ // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in...
Changes the name. _name The new name./
function changeName(string calldata _name) external onlyAuthor { IPropertyFactory(config().propertyFactory()).createChangeNameEvent( __name, _name ); __name = _name; }
1,970,452
/** *Submitted for verification at Etherscan.io on 2022-02-28 */ // File: @openzeppelin/contracts/utils/Address.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev ...
set reward rate for each generation _genNumber NFT collection generation _rate reward rate/
function setRewardRate(uint256 _genNumber, uint256 _rate) public onlyOwner { require(_rate > 0, "Value Cannot be 0"); require(collections[_genNumber].nftType > 0, "Generation Does Not Exist"); rewardRates[_genNumber] = _rate; }
2,379,687
./full_match/1/0x8348104A4583dfc075E6df8f8Bd98100aDc6bba4/sources/contracts/libs/BaseCollection.sol
Sets the base URI baseURI_ The base URI/
function setBaseURI(string calldata baseURI_) external onlyOwner { }
3,090,445
pragma solidity >=0.5.0; import "./BatteryInvestment.sol"; import "./BatteryEnergy.sol"; import "./Ownable.sol"; // to manage ownership addresses /// @author Yan Man /// @title A Virtual Power Plant implementation. Consensys Final Project Winter 2018/19 contract VirtualPowerPlant is Ownable { // Type declaration...
retrieve battery charge rate _batteryID battery identifier return battery charge rate
function getBatteryChargeRate (uint _batteryID) external view returns (uint) { return batteries[_batteryID].chargeRate; }
12,596,332
./full_match/4/0xF585bBb5d094Ed2B486d95f3ac3c07cb1730596B/sources/contracts/VirtualToken.sol
@inheritdoc ERC20Upgradeable `from` == address(0) when mint() not whitelisted
function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override { super._beforeTokenTransfer(from, to, amount); if (from != address(0)) { require(_whitelistMap[from], "VT_NW"); } }
651,987
./full_match/80001/0x889aD6cfb78E168BC7514D18909503821cb68E35/sources/ERC721A.sol
See {IERC721-approve}./
function approve(address to, uint256 tokenId) public override virtual { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); ...
5,638,744
/** *Submitted for verification at Etherscan.io on 2020-08-11 */ pragma solidity ^0.4.24; library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); ...
---------------------------------------------------------------------------- It invokes when someone sends ETH to this contract address ----------------------------------------------------------------------------
function() public payable { getTokens(); }
1,603,719
./full_match/421613/0xD08Ab99480d02bf9C092828043f611BcDFEA917b/sources/src/arbitration/KlerosCore.sol
Add a new supported dispute kit module to the court. _disputeKitAddress The address of the dispute kit contract. _parent The ID of the parent dispute kit. It is left empty when root DK is created. Note that the root DK must be supported by the general court./ It should be always possible to reach the root from the...
function addNewDisputeKit(IDisputeKit _disputeKitAddress, uint256 _parent) external onlyByGovernor { uint256 disputeKitID = disputeKitNodes.length; require(_parent < disputeKitID, "!Parent"); uint256 depthLevel; if (_parent != NULL_DISPUTE_KIT) { depthLevel = disputeKitNo...
11,568,739
./full_match/1/0x88dF825e83f6ED8be19209AC52B8E67CfF00D447/sources/src/NDTrading.sol
allows users to buy previously listed trait(s) on the new dawn trait martetplace transactionId specific id mapped to a specific transaction to buy
function buyTrait(uint256 transactionId) external payable { require(!buyingDisabled, "ND: buying disabled"); Transaction storage txn = transactions[transactionId]; (uint256 toSeller, uint256 toRoyaltyAddr) = calcRoyalties(txn.price); require(txn.state == TxState.Active, "ND: listi...
2,986,493