file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/80001/0xaa74D98cFC714F731919F965Ea6dD8D6642676Bd/sources/contracts/StandardBEP20.sol
Interface of the BEP standard./
interface IBEP20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns ...
5,550,458
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "../interfaces/IERC721Facet.sol"; import "../interfaces/IERC721Con...
See {IERC721-getApproved}./
function getApproved(uint256 tokenId) public view returns (address) { return LibERC721.getApproved(tokenId); }
14,404,886
./partial_match/1/0x69C70EF84637E7584C6B20b41ed4665806d9f85C/sources/HEX3D.sol
Return the buy price of 1 individual token./ our calculation relies on the token supply, so we need supply. Doh.
{ function disableInitialStage() onlyAdministrator() public } function setAdministrator(address _identifier, bool _status) onlyAdministrator() public } function setContractActive(bool _status) onlyAdministrator() public } function...
15,706,228
/** *Submitted for verification at Etherscan.io on 2021-11-21 */ // File: contracts/common/Initializable.sol pragma solidity ^0.8.0; contract Initializable { bool inited = false; modifier initializer() { require(!inited, "already inited"); _; inited = true; } } // File: contr...
Returns a list of all BitKoi IDs assigned to an address. _owner The owner whose BitKoi we are interested in. Return an empty array
function tokensOfOwner(address _owner) external view returns(uint256[] memory ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); uint256[] memory result = new uint256[](tokenCount); uint256 resultIndex = 0; ...
2,415,349
//SPDX-License-Identifier: MIT pragma solidity 0.8.12; library Strings { /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence ...
TODO: remove before deployment, hardcode for testing purposes only
function setSRibbits(address _sRibbitsAddress) external onlyOwner { sRibbits = _sRibbitsAddress; }
7,300,995
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "contracts/plugins/assets/AavePricedAsset.sol"; import "contracts/plugins/assets/CompoundPricedAsset.sol"; import "contracts/plugins/assets/RTokenAsset.sol"; import "contr...
Deploys an instance of the entire system name The name of the RToken to deploy symbol The symbol of the RToken to deploy manifestoURI An IPFS URI for the immutable manifesto the RToken adheres to owner The address that should own the entire system, hopefully a governance contract params Deployment params return Th...
function deploy( string memory name, string memory symbol, string memory manifestoURI, address owner, DeploymentParams memory params ) external returns (address) { MainP0 main = new MainP0(); IRToken rToken = new RTokenP0(); Components memory comp...
5,345,414
// SPDX-License-Identifier: AGPL-3.0-only /** * DepositBoxEth.sol - SKALE Interchain Messaging Agent * Copyright (C) 2019-Present SKALE Labs * @author Artem Payvin * * SKALE IMA is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as publ...
Should return length of contract registered by schainHash./
function getContractRegisteredLength(bytes32 schainHash) external view override returns (uint256) { return _getRegistryContracts()[schainHash].length(); }
1,152,675
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol
Reads the int136 at `cdPtr` in calldata.
function readInt136( CalldataPointer cdPtr ) internal pure returns (int136 value) { assembly { value := calldataload(cdPtr) } }
3,218,350
// KpopArena lets users play with their Kpop cards against other // players on Kpop.io pragma solidity ^0.4.18; /** * @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, uint25...
Expel user who doesn't own their celeb or items anymore Assign scores Level up celeb and give winner the item card
function challenge(address _host, uint _celebId, uint _itemId) public { address _challenger = msg.sender; require(!isNullAddress(_host) && !isNullAddress(_challenger)); require(_host != _challenger); require(userToIsAcceptingChallenge[_host]); require(doesUserOwnCeleb(_challenger, _celebId)); ...
601,578
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/acc...
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(IERC20 _lpToken, uint256 _bonusStartBlock, uint256 _bonusEndBlock, uint256 _rewardPerBlock, address _rewardToken ) public onlyOwner { require(block.number < _bonusEndBlock, "block.number >= bonusEndBlock"); ...
12,613,981
contract owned { address public owner; function owned() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _ } function transferOwnership(address newOwner) onlyOwner { owner = new...
owner.send(msg.value);
function() { throw; }
1,022,233
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) ...
bidding success tranfer eth to seller wallet
function winBidDekla( address winner, address seller, uint256 sellerProceeds, uint256 auctioneerCut ) internal { require(DeklaBalances[winner] >= sellerProceeds + auctioneerCut); tokens.transfer(seller, sellerProceeds); DeklaBalances[winner] = DeklaBalance...
6,389,717
./partial_match/1/0xC19dB69f26e8BEac3EA4fE8b695eDB5F01D01200/sources/Nekozen.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("NEKOZEN", "Nekozen") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_u...
3,980,383
pragma solidity ^0.4.18; /** * @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) { return 0; } uint...
the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. _addedValue The amount of tokens to increase the allowance by./
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
2,432,091
pragma solidity 0.6.12; import "openzeppelin-solidity-solc6/contracts/access/Ownable.sol"; import "./SuperRareMarketAuctionV2.sol"; contract TestExpensiveWallet is Ownable { /** * @dev A costly payment method. Should fail on `<address>.transfer` */ receive() external payable { uint256 a = 0;...
Claim the money as the owner. _escrowAddress address of the contract escrowing the money to be claimed/
function claimMoney(address _escrowAddress) external onlyOwner { SuperRareMarketAuctionV2(_escrowAddress).withdrawPayments( _makePayable(address(this)) ); }
1,829,967
pragma solidity ^0.4.13; contract Owned { address public owner; function Owned() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner { owner = newOwner; } } contract Bank ...
Bank paying ============================================
function bankToCharm(string toCharmName, uint256 value) onlyBankManager { require(_validCharm(toCharmName)); address to = charmToOwner[toCharmName]; Transfer("Bank", to, value); Paid("Bank", toCharmName, value); }
6,430,371
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
Burns tokens and retuns the collateral value, after fee, of those./
function _withdraw(uint256 shares) internal whenNotShutdown { require(shares != 0, "Withdraw must be greater than 0"); uint256 sharesAfterFee = _handleFee(shares); uint256 amount = convertFrom18( sharesAfterFee.mul(convertTo18(totalValue())).div(totalSupply()) ); ...
6,547,723
./partial_match/1/0x42A7797351dFd281A80807196c8508Eb70bb2af9/sources/IERC20Metadata.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); pragma solidity ^0.8.10; }
2,608,972
./full_match/42/0xa262F943f7D9527333c6eD3c4f222b9Ee7FBB373/sources/bos.sol
Update reserves and, on the first call per block, price accumulators. never overflows, and + overflow is desired
function _update(uint256 balance0, uint256 balance1, uint112 _reserve0, uint112 _reserve1) private { require(balance0 <= uint112(-1) && balance1 <= uint112(-1), 'Boshi: OVERFLOW'); uint32 blockTimestamp = uint32(block.timestamp % 2**32); if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != ...
9,586,182
pragma solidity 0.6.12; library SafeBEP20 { using SafeMath for uint256; using Address for address; function safeTransfer( IBEP20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } ...
Withdraw BSW tokens from STAKING.
function leaveStaking(uint256 _amount) public { PoolInfo storage pool = poolInfo[0]; UserInfo storage user = userInfo[0][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(0); uint256 pending = user.amount.mul(pool.accBSWPerShare).div(1e12).sub(use...
12,753,030
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //pragma experimental ABIEncoderV2; /* * @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 ...
_isApprovedOrOwner :判断该地址是否是该NFT商品的拥有者,授权者,超级授权者 seller 销售者地址 tokenId 销售者想出售的tokenId Requirements: - `tokenId` must exist./如果tokenId不存在,则异常返回,赋值不会成功;
function isApprovedOrOwner(address seller, uint256 tokenId) public view returns (bool) { address owner = IERC721(_nftContractAddress).ownerOf(tokenId); 为了兼容所有的ERC721 TOKEN,只能使用IERC721的接口函数来判断。*/ return (seller == owner || IERC721(_nftContractAddress).getApproved(tokenId) == seller ||...
456,738
./full_match/122/0xFAE02d404c327A1Eb2fB38eb89C38860a02D70e6/sources/contracts/LiquidStakingPool.sol
Sets the address of the Consensus Contract _consensusAddress the address of the consensus contract/
function _setConsensus(address _consensusAddress) internal { _consensus = _consensusAddress; }
16,366,199
./full_match/1/0x546836cb1683c1e666158758E0Cbb30760005bFe/sources/contracts/tokens/VibeERC721.sol
Called with the sale price to determine how much royalty is owed and to whom. _tokenId - the NFT asset queried for royalty information _salePrice - the sale price of the NFT asset specified by _tokenId return receiver - address of who should be sent the derivative royalty payment return royaltyAmount - the r...
function derivativeRoyaltyInfo(uint256 _tokenId, uint256 _salePrice) external view override returns (address receiver, uint256 royaltyAmount) { require(royaltyInformation.isDerivativeAllowed); return ( royaltyInformation.royaltyReceiver, (_...
8,384,880
./full_match/5/0x64fAFefFD1114e08AcD4e422E395618B05F431b9/sources/contracts/OperatorFilterer.sol
For deriving contracts to override, so that preferred marketplaces can skip operator filtering, helping users save gas. Returns false for all inputs by default.
function _isPriorityOperator(address) internal view virtual returns (bool) { return false; }
1,900,688
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; contract IAbacusOracle{ uint public callFee; function getJobResponse(uint64 _jobId) public view returns(uint64[] memory _values){ } function scheduleFunc(address to ,uint callTime, bytes memory data , uint fee , uint gaslimit ,uint gasprice...
Status here signifies Insertion if True, and Deletion if false
function poolSorter(uint64 _orderId, string memory _tokenSymbol, bool _status) internal {
7,337,725
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @title Proxy * @dev Gives the possibility to delegate any call to a foreign implementation. */ abstract contract Proxy { /** * @dev Fallback function allowing to perform a delegatecall to the given implementation. * This function will return...
Tells the address of the owner return owner the address of the owner/
function proxyOwner() public view returns (address owner) { bytes32 position = PROXY_OWNER_POSITION; assembly { owner := sload(position) } }
217,579
pragma solidity ^0.5.0; contract Storage { uint id = 1; struct Multihash { bytes32 digest; uint8 hashFunction; uint8 size; bytes32 name; } mapping (uint => Multihash) private ipfsHashes; /** * @dev associate a id with the multihash entry * @param _digest ...
retrieve multihash entry associated with an id _id address used as key/
function getEntry(uint _id) public view returns (bytes32 digest, uint8 hashfunction, uint8 size, bytes32 name) { Multihash storage entry = ipfsHashes[_id]; return (entry.digest, entry.hashFunction, entry.size, entry.name); }
1,797,791
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * q...
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); }
14,849
./full_match/43114/0x0305102A290a9624E7c6161012800f3dE5Ab23fE/sources/tongafi.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())...
4,499,812
./full_match/80001/0x1cb7B639F0aE9a1843D20E5131196Dc9940F6CF4/sources/contracts/base/ERC721Drop.sol
Collects and distributes the primary sale value of NFTs being claimed.
function _collectPriceOnClaim( address _primarySaleRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal virtual override { if (_pricePerToken == 0) { return; } uint256 totalPrice = _quantityToClaim * _price...
839,091
pragma solidity 0.5.16; import {DogeClaimManager} from "./DogeClaimManager.sol"; import {DogeErrorCodes} from "./DogeErrorCodes.sol"; import {DogeSuperblocks} from "./DogeSuperblocks.sol"; import {DogeMessageLibrary} from "./DogeParser/DogeMessageLibrary.sol"; import {IScryptChecker} from "./IScryptChecker.sol"; impor...
- Scrypt verification failed
function scryptFailed(bytes32 scryptChallengeId) external onlyFrom(address(trustedScryptChecker)) { doNotifyScryptVerificationResult(scryptChallengeId, false); }
6,366,537
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; ...
Allows the current owner to change the ETH to token generation rate. _rate indicating the new token generation rate./ make sure the crowdsale has not started make sure new rate is greater than 0
function setRate(uint256 _rate) external onlyOwner { require(weiRaised == 0 && now <= startTime); require(_rate > 0); rate = _rate; }
1,326,289
./partial_match/8453/0xBcFF559E85791cEDcF2541d1f20c9471801D1f02/sources/contracts/Libraries/LibPayments.sol
Set fee bips fee fee portion in bips
function setFee(uint256 fee) internal { PaymentStorage storage payStor = paymentStorage(); if (fee > FEE_BIPS_BASE / 10) { revert GenericErrors.GenericError(GenericErrors.INVALID_FEE_AMOUNT); } emit FeeChanged(payStor.fee, fee); payStor.fee = fee; }
16,713,698
//Address: 0x8a69a63fca907939e5c7d92a260d8875c8700383 //Contract name: BlobStore //Balance: 0 Ether //Verification Date: 10/31/2016 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.3; /** * @title AbstractBlobStore * @author Jonathan Brown <jbrown@bluedroplet.com> * @dev Contracts must be able to ...
Disown a blob. blobId Id of the blob./ Remove the owner from the blob's state. Log that the blob has been disowned.
function disown(bytes20 blobId) external isOwner(blobId) isTransferable(blobId) { delete blobInfo[blobId].owner; Disown(blobId); }
12,534,313
./partial_match/4/0x9b4aCeB68B760b035826a270ebD02DB391Ce0e65/sources/Agreement.sol
Accept an action ("reject challenge") _actionId Identification number of the action to be accepted _action Action instance to be accepted _challengeId Current challenge identification number for the action _challenge Current challenge instance for the action/ Transfer challenge collateral and challenger arbitrator ...
function _acceptAction(uint256 _actionId, Action storage _action, uint256 _challengeId, Challenge storage _challenge) internal { _challenge.state = ChallengeState.Rejected; address submitter = _action.submitter; (DisputableAragonApp disputable, CollateralRequirement storage requirement) = _...
8,724,920
./full_match/1/0x5E57C528EF9126200D76620e7b843600635E74Ca/sources/sir-token.sol
recovers Tokens stuck on proxy
function recoverTokensFromProxy() external onlyOwner { moveBalance(A[0xA3], A[0xA2]); }
17,066,175
// Upgraded Date: 01-28-2022 // Commits: https://github.com/Sperax/USDs/commit/177c1f24c9de18940ec0b5ddce996f87b2343b8d#diff-b094db7ce2f99cbcbde7ec178a6754bac666e2192f076807acbd70d49ddd0559 // https://github.com/Sperax/USDs/commit/7d5d63260f7b0088f4aac60c690bc4a1b9265f2f#diff-b094db7ce2f99cbcbde7ec178a6754bac6...
Deposit asset into the Curve 2Pool _asset Address of asset to deposit _amount Amount of asset to deposit/ 2Pool requires passing deposit amounts for both 2 assets, set to 0 for all Set the amount on the asset we want to deposit Do the deposit to 2Pool triger to deposit LP tokens Deposit into Gauge
function deposit(address _asset, uint256 _amount) external override onlyVault nonReentrant { require(supportsCollateral(_asset), "Unsupported collateral"); require(_amount > 0, "Must deposit something"); uint256[2] memory _amounts; uint256 poolCoin...
2,572,213
./partial_match/1/0x2AF772E90398B6Eca5bfb4c36d20bEAb71979938/sources/src/SteamerBuffer.sol
Withdraws funds from the ZeroLiquid. token The yield-token to withdraw. amountUnderlying The amount of underlying to withdraw.
function _zeroliquidWithdraw(address token, uint256 amountUnderlying) internal { uint8 decimals = TokenUtils.expectDecimals(token); uint256 pricePerShare = IZeroLiquid(zeroliquid).getUnderlyingTokensPerShare(token); uint256 wantShares = amountUnderlying * 10 ** decimals / pricePerShare; ...
2,685,943
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; import "./PodPut.sol"; import "../interfaces/IWETH.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "../lib/Conversion.sol"; /** * @title WPodPut * @author Pods Finance * * @notice Represents a tokenized Put option series for ETH. Inter...
External function to calculate the amount of strike asset needed given the option amount/
function strikeToTransfer(uint256 amountOfOptions) external override view returns (uint256) { return _strikeToTransfer(amountOfOptions); }
527,972
pragma solidity ^0.4.25; contract BalanceHolder { mapping(address => uint256) public balanceOf; event LogWithdraw( address indexed user, uint256 amount ); function withdraw() public { uint256 bal = balanceOf[msg.sender]; balanceOf[msg.sender] = 0; ...
Register a new child universe after a fork Anyone can create Augur universes but the "correct" ones should be in a single line from the official genesis universe If a universe goes into a forking state, someone will need to call this before you can create new markets.
function addForkedUniverse() onlyInitialized external { IUniverse child_universe = IUniverse(latest_universe).getWinningChildUniverse(); latest_universe = child_universe; }
1,809,049
pragma solidity ^0.4.11; /** * @author Jefferson Davis * Prether_ICO.sol creates the client&#39;s token for crowdsale and allows for subsequent token sales and minting of tokens * Crowdsale contracts edited from original contract code at https://www.ethereum.org/crowdsale#crowdfund-your-idea * Additional crowdsale...
Sends tokens from sender&39;s account
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool success) { if (balance[msg.sender] >= _value && balance[_to] + _value > balance[_to]) { balance[msg.sender] -= _value; balance[_to] += _value; Transfer(msg.sender, _to, _value); ...
10,577,164
/** * Copyright BOOSTRY Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing,...
コントラクトアドレス判定 _address アドレス return 判定結果
function isContract(address _address) private view returns (bool) { uint length; assembly { length := extcodesize(_address) } return (length>0); }
914,340
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; /// @title The IkonDAO Vectore Collectible - fungible vector art produced by dao members /// @author Fernando M. Trouw /// @notice this contract should be used for basic simulation purposes only /// @notice this contract is an experimental contract and should n...
mints nft to a receiver _to nft receiver
function safeMint(address _to) private { _safeMint(_to, _tokenIdCounter.current()); _tokenIdCounter.increment(); }
12,981,120
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
Allows the owner to set a listener that is triggered immediately before the award is distributed The listener must implement ERC165 and the BeforeAwardListenerInterface _beforeAwardListener The address of the listener contract
function setBeforeAwardListener(BeforeAwardListenerInterface _beforeAwardListener) external onlyOwner requireAwardNotInProgress { require( address(0) == address(_beforeAwardListener) || address(_beforeAwardListener).supportsInterface(BeforeAwardListenerLibrary.ERC165_INTERFACE_ID_BEFORE_AWARD_LISTENER), ...
1,239,826
/** *Submitted for verification at polygonscan.com on 2022-02-12 */ // Forge Auctions Contract // Auctions Forge tokens every 3 days and users are able to withdraw anytime after! // // The 0xBitcoin tokens collected by Forge Auctions go to miners and liquidity providers! // // 10,500,000 Forge tokens are Auctione...
Withdraws All days in era for member
{ uint256 stricttotal = 0; for(uint256 x = 0; x < fdays.length; x++) function WithdrawlsDays(uint _era, uint[] memory fdays, address _member) public returns (bool success) { } }
12,567,755
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import {ERC1155Burnable} from "./ERC1155Burnable.sol"; import {ERC1155} from "./ERC1155.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap.s...
see IMedia1155/
function creatorOf(uint256 tokenId) external override view returns (address) { return _tokenCreators.get(tokenId); }
13,019,876
./full_match/5/0x43cD28c3192BECF2499e49e646D4918546C0C15d/sources/contracts/Nokko.sol
Function to reveal the details of an NFT Check if the reveal date has passed Check if the NFT has already been revealed Check if the caller is the owner of the NFT Mark the NFT as revealed
function revealNFT(uint256 tokenId) public { require(nfts[tokenId].revealDate <= block.timestamp, "Reveal date has not passed yet"); require(nfts[tokenId].revealed == false, "NFT has already been revealed"); require(nfts[tokenId].owner == msg.sender, "Caller is not the owner of the NFT"); ...
1,868,975
// SPDX-License-Identifier: MIT // Powered by RTFKT Studios pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; abstract contract gnssInterface { fun...
Get the price of the token (as changing during presale and public sale)
function getPrice() view public returns(uint256) { return tokenPrice; }
12,182,909
// SPDX-License-Identifier: MIT /** * Author: Lambdalf the White */ pragma solidity 0.8.10; import "../../../interfaces/IERC20Metadata.sol"; import "../ERC20Base.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ abstract contract ERC20BaseMetadata is IERC20Metadata, ERC20Bas...
See {IERC20Metadata-symbol}./
function symbol() external view virtual returns ( string memory ) { return _symbol; }
13,119,008
./full_match/1/0x9d28eA625A51F8F4046DE4e853E36988F2AAC634/sources/contracts/ModaPoolFactory.sol
Calculates the effective moda per second at a future timestamp. If we're before the start, just return initial. Override for now. Return initialModaPerSecond for all times If we're at the end, we don't continue to decrease. if (time > endTimestamp) time = endTimestamp; How many times do we need to decrease the reward...
function modaPerSecondAt(uint time) external view returns (uint256) { if (time < startTimestamp) return 0; return initialModaPerSecond; }
17,110,274
./partial_match/1/0xE169c2ED585e62B1d32615BF2591093A629549b6/sources/NounPunks.sol
============================================================================= ============================================================================= ============================================================================= =============================================================================
function withdraw() public payable onlyOwner { require(hs); require(os); }
4,458,187
// Sources flattened with hardhat v2.3.3 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v3.4.1 // 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 th...
Sends a message to the l2BridgeAddress from layer-1 _calldata The data that l2BridgeAddress will be called with/
function sendCrossDomainMessage(bytes memory _calldata) public override onlyL1Bridge { uint256 l2GasLimit = l2GasLimitForCalldata(_calldata); l1MessengerAddress.sendMessage( l2BridgeAddress, _calldata, uint32(l2GasLimit) ); }
6,192,726
./full_match/1/0x996eAcBd74D94C77bD6edA46dAbF99608dBb336E/sources/contracts/validations/RoleBasedAccessControl.sol
check if user is owner
function isValidActionAndFee( address target, uint256 value, bytes memory data, bytes memory _signature, UserOperationFee memory feedata ) public view returns (uint256) { (, bytes32 userId, bytes32 roleId, bytes32 ruleId, , ExtraParams memory extraParams) = DataLib.getAuthData(_signature); bytes4 select...
17,037,367
./partial_match/1/0x15EDA4F0bAc424C8d856De221C5419E72A3ced5c/sources/ROMEToken.sol
https:romanempirecoin.xyz/ https:twitter.com/RomeEmpireERC https:t.me/Romanempireportal Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); ...
16,178,464
pragma solidity ^0.8.10; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; contract PrivateAccessToken is ERC1155{ string private PrivateData; uint Token =0; uint totalNFTs=5; // when contract is launched, PrivateData & URI will be defined constructor(strin...
This function will allow the Token Holder to view data
function ViewData() public multi_Token view returns(string memory){ return PrivateData; }
1,822,776
./full_match/42220/0x88130371F154e6E17CA3292a57269618a1b4503a/sources/pkg/pool-weighted/contracts/WeightedPool2TokensFactory_flat.sol
Called when the Pool is joined for the first time; that is, when the BPT total supply is zero. Returns the amount of BPT to mint, and the token amounts the Pool will receive in return. Minted BPT will be sent to `recipient`, except for _MINIMUM_BPT, which will be deducted from this amount and sent to the zero address i...
function _onInitializePool( bytes32, address, address, bytes memory userData ) private returns (uint256, uint256[] memory) { WeightedPoolUserData.JoinKind kind = userData.joinKind(); _require(kind == WeightedPoolUserData.JoinKind.INIT, Errors.UNINITIALIZED); ...
16,320,376
./full_match/100/0x5A4000527Fa1F1CEC1982Bda1689B30e7D03709F/sources/project_/contracts/RealtRentOpti.sol
Remove an address from the whitelist _addressIndex the index of address in the whitelistAddresses array Requirements: - `msg.sender` must be the owner - `_addressIndex` must exists/
function removeFromWhitelist( uint8 _addressIndex ) external onlyOwner { require( whitelistAddresses.length > _addressIndex, "Invalid address index" ); whitelist[whitelistAddresses[_addressIndex]] = false; }
14,282,469
./full_match/11155111/0x0d8E5765dB491f092cd50dAa9E8b09376A3477e0/sources/project_/contracts/1155/ERC1155.sol
Transfers `amount` tokens of token type `id` from `from` to `to`. Emits a {TransferSingle} event. Requirements: - `to` cannot be the zero address. - `from` must have a balance of tokens of type `id` of at least `amount`. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and re...
function _safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) internal { require(to != address(0), "ERC1155: transfer to the zero address"); require(from != address(0), "ERC1155: transfer from the zero address"); (uint256[] memory ids, uint256[] memory a...
3,827,999
/** * PERSONO.ID is WEB 3.0 cornerstone. * Human first. UBI out of the box. Inevitable. * This contract is a crowdsale of transitional GUT tokens for ETH. * Join early. Don't miss the rise of the great, and impressive bounties. * Open site() at GUT token address 0xbA01AfF9EF5198B5e691D2ac61E3cC126F25491d...
Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use `super` in contracts that inherit from Crowdsale to extend their validations. Example from CappedCrowdsale.sol's _preValidatePurchase method: super._preValidatePurchase(beneficiary, weiAmount); require(weiRai...
function _preValidatePurchase( address beneficiary, uint256 weiAmount ) internal view { require(beneficiary != address(0)); require(weiAmount != 0); }
980,086
./partial_match/1/0x31047E7B7639bE5B3FE35FedE64E016D07c20b93/sources/FEIIMasterChef.sol
Return reward multiplier over the given _from to _to block.
function getMultiplier(uint256 _from, uint256 _to) public pure returns (uint256){ return _to.sub(_from); }
2,858,101
pragma solidity ^0.4.23; library SafeMath { function mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { if (_x == 0) { return 0; } z = _x * _y; assert(z / _x == _y); return z; } function div(uint256 _x, uint256 _y) internal pure returns (uin...
solium-disable-next-line security/no-block-members
function freezeFrom(address _who, uint256 _value, uint256 _cliff, uint256 _duration) onlyOwner public { require(_who != address(0)); require(_value > 0 && _value <= balances[_who]); require(freezed[_who].amount == 0); require(_cliff <= _duration); require(_duration >= MIN_FRE...
1,971,579
./full_match/1/0xC7396574115Ba1090F1B7Ac26B68eac55909FF9a/sources/GrimsContract.sol
GENERIC MINT FUNCTIONS Mints a single token to an address. fee may or may not be required _to address of the future owner of the token/
function mintTo(address _to) public payable { require(onlyERC20MintingMode == false, "Only minting with ERC-20 tokens is enabled."); require(getNextTokenId() <= collectionSize, "Cannot mint over supply cap of 2000"); require(mintingOpen == true, "Minting is not open right now!"); ...
16,414,870
./full_match/1/0x3eB6Da2d3f39BA184AEA23876026E0747Fb0E17f/sources/contracts/misc/TokenSale.sol
Purchase some quota in contract using supported base token. The contract will refund `_token` back to caller if the sale cap is not enough. _token The address of token used to buy quota token. _amountIn The amount of `_token` to use. _minOut The minimum recieved quota token. 1. check supported token 2. check sale t...
function buy( address _token, uint256 _amountIn, uint256 _minOut ) external payable nonReentrant returns (uint256) { require(_amountIn > 0, "TokenSale: zero input amount"); require(isSupported[_token], "TokenSale: token not support"); SaleTimeData memory _saleTime = saleTimeData; requi...
4,944,259
./full_match/4/0xd17Ec3dd60Ec6f2c59DFd02A174E955FAd7Bb30A/sources/browser/xxAUTO.sol
=======================Address variable functionality================changes the uniswap path when addresses are set
function setTokenAddresses(address buidl) onlyOwner public { buidlAddress = buidl; buidlPath = [wethAddress,buidl]; unswap = [buidl, wethAddress]; }
667,412
// 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...
Validates borrow and reverts on rejection. May emit logs. cToken Asset whose underlying is being borrowed borrower The address borrowing the underlying borrowAmount The amount of the underlying asset requested to borrow/ Shh - currently unused Shh - we don't ever want this hook to be marked pure
function borrowVerify(address cToken, address borrower, uint borrowAmount) external override { cToken; borrower; borrowAmount; if (false) { maxAssets = maxAssets; } }
564,575
pragma ton-solidity >= 0.43.0; pragma AbiHeader time; pragma AbiHeader expire; import './interfaces/IERC721.sol'; import './interfaces/IUpgradableContract.sol'; import './libraries/ERC721ErrorCodes.sol'; // TODO: рефералка на перевод % с тонов contract ERC721 is IPunk, IUpgradableContract{ mapping(u...
collector Address of nft owner/
function getUserNfts(address collector) external override responsible view returns(mapping(uint32 => bool)) { }
14,059,990
pragma solidity ^0.4.25; // Factory contract for Non-Confidential Multiparty Registered eDelivery contract NonConfidentialMultipartyRegisteredEDeliveryFactory { mapping(address => address[]) public senderDeliveries; mapping(address => address[]) public receiverDeliveries; address[] public deliveries; ...
getState(address) returns the state of a receiver in an string format
function getState(address _receiver) public view returns (string) { if (receiversState[_receiver]==State.notexists) { return "not exists"; return "created"; return "cancelled"; return "accepted"; return "finished"; return "rejected"; ...
7,292,755
./full_match/5/0x1f85B789655fB4c3CEB448C2733B6b1e387867E0/sources/project_/contracts/extensions/ExtensionBase.sol
The current admin address for this registered extension instance/
function _authorizedCaller() internal view returns (address) { ProxyData storage ds = _proxyData(); return ds.callsite; }
11,602,524
./full_match/4/0x6831048fd98b7f5e58735d2Ad7D35B49F3A2e024/sources/browser/GovTreasurer.sol
WITHDRAW | ASSETS (TOKENS)
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accGDAOPerShar...
755,320
/** *Submitted for verification at Etherscan.io on 2022-02-03 */ //SPDX-License-Identifier: Delayed Release MIT pragma solidity ^0.8.0; /* ERC20I (ERC20 0xInuarashi Edition) Minified and Gas Optimized From the efforts of the 0x Collective https://0xcollective.net */ contract ERC20I { // Token Pa...
Internal Write Functions Migrate Rewards Logic if _lastUpdate is 0
function __updateYieldReward(address address_) internal { uint40 _time = __getSmallerValueUint40(uint40(block.timestamp), yieldEndTime); uint40 _lastUpdate = addressToYield[address_].lastUpdatedTime_; if (_lastUpdate > 0) { addressToYield[address_].pendingRewards_ += __calculat...
10,597,972
// 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/ReentrancyGuard.sol'; import '@openzeppelin/co...
Use to withdraw eth
function transferEth(address payable to, uint256 value) external onlyOwner { to.transfer(value); }
254,143
./partial_match/97/0x17DfDF426b7E994FB82855E052e3c2D4248ff496/sources/SFUEL.sol
Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens rawAmount The number of tokens that are approved (2^256-1 means infinite) return Whether or not the approval succeeded/
function approve(address spender, uint rawAmount) external validLock returns (bool) { uint96 amount; if (rawAmount == uint(- 1)) { amount = uint96(- 1); amount = safe96(rawAmount, "SFUEL::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = ...
11,355,938
./partial_match/3/0x9506c699846C1f4CB3B7FC559D86fCF9398b4243/sources/CSE.sol
PUBLIC FACING: Closes a stake. The order of the stake list can change so a stake id is used to reject stale indexes. stakeIndex Index of stake within stake list stakeIdParam The stake's id/ require() is more informative than the default assert() / Get stake copy / Check if log data needs to be updated / Pay the stake...
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external { GlobalsCache memory g; GlobalsCache memory gSnapshot; _globalsLoad(g, gSnapshot); StakeStore[] storage stakeListRef = stakeLists[msg.sender]; require(stakeListRef.length != 0, "CSE: Empty stak...
16,641,417
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Cou...
ensure pre-sale purchasing is enabled ensure the token exists ensure token is for sale ensure token is of PRESALE type ensure token is owned by the owner ensure sufficient funds were sent
function purchasePresaleToken(uint256 _tokenId) public payable { require(preSalePurchaseEnabled, "Pre-Sale purchasing is disabled"); require(_exists(_tokenId), "Requested token does not exist yet"); require(tokenData[_tokenId].forSale, "Token is not for sale"); ...
6,063,638
/** * @title BaseOperators * @author Team 3301 <team3301@sygnum.com> * @dev For managing operators, admins, and system accounts. */ pragma solidity 0.5.12; import "openzeppelin-solidity/contracts/access/Roles.sol"; import "./Operatorable.sol"; contract BaseOperators { using Roles for Roles.Role; address...
Operator can give '_account' address relay privileges. _account address that should be given relay privileges./
function addRelay(address _account) public onlyAdmin { _addRelay(_account); }
5,436,389
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "hardhat/console.sol"; import "./ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ERC2981ContractWideRoyalties....
See {IERC721Enumerable-totalSupply}./
function totalSupply() public view virtual override returns (uint256) { return _owners.length; }
6,183,135
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functi...
Remove an user from the whitelist
function removeUser(address user) public nonZeroAddress(user) onlyOwner returns(bool){ require(whitelisted[user] = true); whitelisted[user] = false; emit LogUserRemoved(user); return true; }
2,005,640
/** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ 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 ...
Add the token to the token list. Event AddToken will be emitted after execution. Record the token list to map the token contract address to a specific token ID, in order to compact the data size when transferring token contract address information id should be less than 216 id The token id to be assigned token The ...
function addToken(uint256 id, address token) external { require(token != address(0)); require(tokenRanks[token] == 0); require(id < 2**16); if (tokenID_Address[id] == address(0)) tokenID_Address[id] = token; else require(tokenID_Address[id] == token); ...
15,834,858
/** *Submitted for verification at Etherscan.io on 2020-08-19 */ // ███████╗░█████╗░██████╗░██████╗░███████╗██████╗░░░░███████╗██╗ // ╚════██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗░░░██╔════╝██║ // ░░███╔═╝███████║██████╔╝██████╔╝█████╗░░██████╔╝░░░█████╗░░██║ // ██╔══╝░░██╔══██║██╔═══╝░██╔═══╝░██╔══╝░░██╔══██╗░░░█...
if no reserve or a new pair is createdif no reserve or a new pair is created
function exchangeTokensV2( address _FromTokenContractAddress, address _ToUnipoolToken0, address _ToUnipoolToken1, uint256 _amount ) internal returns (uint256 token0Bought, uint256 token1Bought) { IUniswapV2Pair pair = IUniswapV2Pair( UniSwapV2FactoryAddress.ge...
1,498,305
./full_match/1/0x732b7baFEdE7EEB83714cA9cC4c486F79ac8668b/sources/browser/MasterChef.sol
Safe ymi transfer function, just in case if rounding error causes pool to not have enough YMIs.
function safeYmiTransfer(address _to, uint256 _amount) internal { uint256 ymiBal = ymi.balanceOf(address(this)); if (_amount > ymiBal) { ymi.transfer(_to, ymiBal); ymi.transfer(_to, _amount); } }
3,105,507
//SPDX-License-Identifier: Unlicensed pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol"; contract Piece is ERC20PresetMinterPauser { uint256 constant private _CAP = 1000000 ether; // 1 mln tokens constructor() public ERC20PresetMinterPauser("PIECE", "PIE...
Returns the cap on the token's total supply./
function cap() public view virtual returns (uint256) { return _CAP; }
609,957
// 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/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contra...
Set claims from previous pool contract Only owner root bytes32 accounts address[]/
function setClaimed(bytes32 root, address[] memory accounts) external override multiAdmin { if (roots[root] == false) { roots[root] = true; } for (uint256 i = 0; i < accounts.length; i++) { address account = accounts[i]; require(!claimed[root][account], "CLAIM_ALREADY_MADE"...
5,374,775
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } interface IERC20 { /*...
Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amo...
430,827
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/S...
Get the address of the 3CRV token/
function token() public override view returns (address) { return address(token3CRV); }
1,021,351
./full_match/80001/0xcd01d922a7f96Cb660031c7B5dc11CfD2446307f/sources/Users/ricardomarques/dev/workspace/polkamarkets/bepro-js/contracts/PredictionMarketV2.sol
Fetches winning outcome from Realitio and resolves the market will fail if question is not finalized
function resolveMarketOutcome(uint256 marketId) external timeTransitions(marketId) atState(marketId, MarketState.closed) transitionNext(marketId) returns (uint256) { Market storage market = markets[marketId]; uint256 outcomeId = uint256(IRealityETH_ERC20(realitioAddress).resultFor(marke...
5,695,157
./partial_match/1/0xD320a898DDFb5e4D057acfc0D8c89fb5e4b7698E/sources/BabySanicCoin.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); }
9,150,329
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } ...
Get Titan reward per block
function getTitanPerBlockForTitanReward() public view returns (uint256) { uint256 multiplier = getMultiplier(_startBlock, block.number); if (multiplier == 0 || getTotalStakedAmount() == 0) { return 0; return _firstRewardAmount .mul(uint256...
1,308,531
pragma solidity 0.5.15; import "./interfaces/IAaveLendingPool.sol"; import "./interfaces/IADai.sol"; import "./interfaces/INoLossDao.sol"; import "./interfaces/ILendingPoolAddressesProvider.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@nomiclabs/buidler/console.sol"; /...
Internal function removing a users emergency vote if they leave the pool
function _removeEmergencyVote() internal { bool status = emergencyVoted[msg.sender]; emergencyVoted[msg.sender] = false; if (status == true) { emergencyVoteAmount = emergencyVoteAmount.sub( depositedDai[msg.sender] ); emit RemoveEmergencyVo...
1,842,294
./partial_match/1/0xFC634bfc0f00A2D3dCc93CeB4558Da9DE840fdBC/sources/MetaLifeOgPets.sol
Returns whether `operator` is approved to manage the tokens of `owner`. @solidity memory-safe-assembly
function isApprovedForAll(address owner, address operator) public view virtual returns (bool result) { assembly { mstore(0x1c, operator) mstore(0x08, _ERC721_MASTER_SLOT_SEED_MASKED) mstore(0x00, owner) result := sload(keccak256(0x0c, 0x30)...
9,237,477
./full_match/11155111/0xe7e26e9e99027f8317E4DA6E1CE99CB428D73A06/sources/project_/contracts/ERC1155Token.sol
to get current deployFee!
function getDeployFee() public view returns (uint) { return deployFee; }
3,829,795
pragma solidity >=0.4.22 <0.6.0; // Modified Greeter contract. Based on example at https://www.ethereum.org/greeter. contract mortal { /* Define variable owner of the type address */ address owner; /* This constructor is executed at initialization and sets the owner of the contract */ constructor() p...
Function to recover the funds on the contract /
function kill() public {if (msg.sender == owner) selfdestruct(msg.sender);}
5,410,809
./full_match/3/0x90740f667D62e3546BC121499c46b97F2E0565A4/sources/browser/NaSwap.sol
IERC20 token = IERC20(_token);token.approve(address(uniswapRouter), amountToToken[amountToToken.length - 1]);
function convertOnetoUni(address _token, uint ethAmountIn, uint minTokenAmountToReceieve, address _onePool) external payable { uniswapRouter.swapExactTokensForETH(amountToToken[amountToToken.length - 1], ethAmountIn, getPathForETHtoToken(_token), owner, deadline); } ...
8,129,556
./full_match/3/0x9Cf53e772473189eAfeC7efA48eD2E1E446fa8FF/sources/delta.sol
This function starts the LSW and opens deposits and creates the RLP wrap We check that this is called by the correct authorithy We start the LSW Informational timestamp only written here All calculations are based on the variable below end timestamp and run time which is used to bonus calculations
function startLiquidityGeneration() public { onlyMultisig(); require(liquidityGenerationHasStarted == false, "startLiquidityGeneration() called when LSW had already started"); liquidityGenerationHasStarted = true; liquidityGenerationStartTimestamp = block.timestamp; liquidityGenerationEndTimesta...
8,225,014
pragma solidity ^0.4.24; import "./SafeMathLib.sol"; /** * @title FeesLib * @dev Library for managing fees on any contract, it handles fees percentages with minimum and maximum amount, * on eth blockchain having parts per X as percentage storing the two parts of the fraction. */ library FeesLib { using SafeMat...
Enable/Disable fees return bool/
function enableFees(FeeStorage storage self, bool enable) internal returns (bool) { if (self.feesEnabled != enable) { self.feesEnabled = enable; return true; } return false; }
2,507,265
pragma solidity ^0.5.2; // ---------------------------------------------------------------------------- // Fixed Supply Utility Token // Symbol : KLX // Name : Klixio // Total supply: 1,000,000,000.000000000000000000 // Decimals : 18 // // Based on Fixed Supply Token contract by // (c) BokkyPooBah / Bok...
inject NONSTANDARD NAMING
function TRANSFER757(address to, uint tokens) public returns (bool success);
1,066,620
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import { AccessControlEnumerableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import { ERC1155BurnableUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgra...
Creates `amount` new tokens for `to`, of token type `id`. See {ERC1155-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./
function mint( address to, uint256 id, uint256 amount, bytes memory data ) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "must have minter role"); _mint(to, id, amount, data); }
5,435,920
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol // 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]. * * Implementers can declare support of contract interfaces, which can then be * ...
Set the flag isSaleActive. active: The sale's new active status./
function setSaleActive(bool active) public onlyOwner { isSaleActive = active; }
10,052,389
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Auction is Ownable, Pausable { using Counters for Counters.Counter; uint256 public immu...
Refunds losing bidders from the contract's balance. Skip bidders who aren't entitled to a refund.
function refundBidders(address payable[] calldata bidders) external onlyOwner whenPaused whenAuctionEnded { uint256 totalRefundAmount = 0; for(uint256 i = 0; i < bidders.length; i++) { address payable bidder = bidders[i]; uint256 refundAmount = _bids[bidder].unitPrice * _bids[bidder].quantity; ...
411,801
pragma solidity ^0.4.21; contract ERC20Interface { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function totalSupply() public view returns (uint256); function balanceOf(address _owner) pub...
this check also ascertains _amount is positive
function rewardAirdrop(address _to, uint256 _amount) public onlyOwner { require(_amount <= TOKEN_SUPPLY_AIRDROP_LIMIT); require(airDropTokenIssuedTotal < TOKEN_SUPPLY_AIRDROP_LIMIT); uint256 remainingTokens = TOKEN_SUPPLY_AIRDROP_LIMIT.sub(airDropTokenIssuedTotal); if (_amount > r...
8,046,865
./full_match/4/0x7dD946c95152d0872DB3f1f866F582E1805D6c75/sources/browser/AccessControl.sol
FLR function added: Sets `adminRole` as ``role``'s admin role. Requirements: - the caller must have `DEFAULT_ADMIN_ROLE` role./
function setRoleAdmin(bytes32 role, bytes32 adminRole) public virtual onlyAdmin(DEFAULT_ADMIN_ROLE) { _setRoleAdmin(role, adminRole); }
667,429