file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0xF36399Bf8CB0f47e6e79B1F615385e3A94C8473a/sources/contracts/modules/credit/LineOfCredit.sol
see ILineOfCredit.addCredit
function addCredit( uint128 drate, uint128 frate, uint256 amount, address token, address lender ) external payable override nonReentrant whileActive mutualConsent(lender, borrower) returns (bytes32) { bytes32 id = _createCredit(lender, token, amount); _se...
4,128,884
pragma solidity ^0.5.17; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(add...
Decrease the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol _spender The address which will spend the funds. ...
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit A...
283,725
./partial_match/1/0x6B1db2107d9ed632e14bBAbD08e3E17BD1e0f740/sources/contracts/RevokableOperatorFilterer.sol
Disable the isOperatorFilterRegistryRevoked flag. OnlyOwner./
function revokeOperatorFilterRegistry() external { if (msg.sender != owner()) { revert OnlyOwner(); } if (_isOperatorFilterRegistryRevoked) { revert AlreadyRevoked(); } _isOperatorFilterRegistryRevoked = true; }
16,040,536
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
owner can mint up to giveAwayCount tokens for giveaways
function mintForGiveaways(uint256 quantity) external onlyOwner { require(quantity > 0, "MG: Invalid quantity"); require(tokensMinted+quantity <= maxSupply - tokensReserved, "MG: Max supply exceeded"); require(giveAwaysReserved+quantity <= giveAwayCount, "MG: givaway count exceeded"); ...
1,593,774
pragma solidity ^0.4.21; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author MinakoKojima (https://github.com/lychees) contract ERC721 { // Required methods function totalSupply() public view returns (uint256 total); function balanceOf(address _owner) public view retur...
recycle the token. / get a random number. /
function rollDice(uint256 _tokenId) public { require(msg.sender == ownerOfToken[_tokenId]); require(packageSize > 0); _transfer(msg.sender, owner, _tokenId); result %= sigmaRatio; uint256 rt; for (uint256 i = 0; i < packageSize; i++) { if (result >= package[...
12,615,827
/** *Submitted for verification at Etherscan.io on 2021-12-26 */ /* 🔥🌟 GALACTIC BUNNY 🌟🔥 Website 🌎 : https://galacticbunny.finance/ Tg: https://t.me/galacticbunny Twiiter: https://twitter.com/GBTK____ Medium: https://medium.com/@nicolas.martins.gbtk/galactic-bunny-q-a-28e296453af6 *...
change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool){ require(newAmount >= totalSupply() * 1 / 100000, "Swap amount cannot be lower than 0.001% total supply."); require(newAmount <= totalSupply() * 9 / 1000, "Swap amount cannot be higher than 0.9% total supply."); ...
2,176,607
./partial_match/1/0xB0E83320F91C7248886deBf367f247043DFeCd3E/sources/SimpleToken.sol
Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view r...
2,876,683
pragma solidity ^0.4.19; 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); c = a - b; } function mul(uint a, uint b) internal pu...
Allow `spender` to withdraw from your account, multiple times, up to the `tokens` amount. If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
321,374
./partial_match/1/0x3D0C33dACccBda28A2c40BA2F6De0792CB94711A/sources/Morphaper.sol
Returns the number of tokens minted by `owner`./
function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; }
2,641,362
pragma solidity ^0.4.24; import "../vendingmachine/VendingMachine.sol"; contract BreedFee is Privileged { event Breed(address indexed breeder, address indexed breedee, uint256 indexed value); // Privileges uint8 constant PRIV_ROOT = 1; uint8 constant PRIV_MANAGE = 2; uint8 constant PRIV_WITHDRAW ...
Wrapper around VM's etherPurchase to implement splitting Validity of _breedee address is checked later by Minter Validity of the _itemId is checked later by Minter Could limit this further with a .gas() modifier, but we trust VM Send to unknown address/contract must come last, since it comes with code execution and cou...
function breed(address _breedee, uint256 _itemId, bytes _varData) external payable { uint256 ethPrice; uint32 quantity; (, , ethPrice, quantity, ) = vmContract.inventoryEntries(_itemId); require(quantity != 0); require(ethPrice != 0); require(msg.value == ethPrice + b...
1,085,795
pragma solidity 0.4.17; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint25...
@MintableToken token - Token Object @address wallet - Wallet Address @uint8 rate - Tokens per Ether @uint256 weiRaised - Total funds raised in Ethers/ @uint256 privateSaleStartTime - Private-Sale Start Time @uint256 privateSaleEndTime - Private-Sale End Time @uint256 preSaleStartTime - Pre-Sale Start Time @uint2...
function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) internal { require(_wallet != 0x0); token = createTokenContract(); preSaleStartTime = _startTime; preSaleEndTime = 1541581199; preICOStartTime = 1541581200; preICOEndTime = 1544000399; ICOstartTi...
12,712,551
// SPDX-License-Identifier: MIT pragma solidity >=0.6.10 <0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; im...
The fund is empty. Just return the previous recorded NAV. No NAV is recorded because the given timestamp is before the fund launches.
function _extrapolateNavM( uint256 previousDay, uint256 previousShares, uint256 timestamp, uint256 price ) private view returns (uint256) { uint256 navM; if (previousShares == 0) { navM = _historicalNavs[previousDay][TRANCHE_M]; if (navM ==...
12,579,398
./full_match/43114/0xDc173BfF1F72a6Ca6beFEf0173297a00049322e1/sources/contracts/avax.sol
Unchanged OK, check 2
function setTargetLiquidity(uint256 _target, uint256 _denominator) external authorized { targetLiquidity = _target; targetLiquidityDenominator = _denominator; }
4,545,010
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018 Crossbar.io Technologies GmbH and contributors. // // 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 ...
Join the given XBR market as the specified type of actor, which must be PROVIDER or CONSUMER. marketId The ID of the XBR data market to join. actorType The type of actor under which to join: PROVIDER or CONSUMER. meta The XBR market provider/consumer metadata. IPFS Multihash pointing to a JSON file with metadata./ A...
function joinMarket (bytes16 marketId, ActorType actorType, string memory meta) public returns (uint256) { require(markets[marketId].owner != address(0), "NO_SUCH_MARKET"); require(uint8(markets[marketId].actors[msg.sender].actorType) == 0, "ACTOR_ALREADY_JOINED"); require(uint8(actorType) =...
2,513,796
pragma solidity ^0.5.0; contract SimpleBank { // // State variables // mapping (address => uint) private balances; mapping (address => bool) public enrolled; address public owner; // // Events // event LogEnrolled(address indexed accountAddress); event LogDepositMade(ad...
Enroll a customer with the bank return The users enrolled status
function enroll() public returns (bool) { enrolled[msg.sender] = true; return enrolled[msg.sender]; emit LogEnrolled(msg.sender); }
15,787,847
pragma solidity ^0.8.0; import "@c-layer/common/contracts/signer/SignerRecovery.sol"; /** * @title MultiSig * @dev MultiSig contract * @author Cyril Lapinte - <cyril@openfiz.com> * SPDX-License-Identifier: MIT * * Error messages * MS01: Valid signatures below threshold * MS02: Transaction validity has expire...
read ERC20 destination _data ERC20 transfert/ solhint-disable-next-line no-inline-assembly
function readERC20Destination(bytes memory _data) public pure returns (address) { address destination; assembly { destination := mload(add(_data, 0x24)) } return destination; }
15,868,418
pragma solidity ^0.4.18; // COMP9900 Demo 1 Seller // // Author: Yunqiu Xu // // [1] Post a model // [2] Update a model // [3] Get the number of posted models // [4] View a model by its index // [5] Test functions contract Seller { address private owner; // the owner of this contract owner = msg.sender = ...
[2] Seller updates the model (only the price)
function updateModel(uint _modelSellerIndex, uint _newPrice, uint256 _modelTime) public isOwner() returns(bool) { if (_modelSellerIndex < postedModels.length) { postedModels[_modelSellerIndex].modelPrice = _newPrice; postedModels[_modelSellerIndex].modelTime = _modelTime; ...
12,541,665
pragma solidity ^0.5.12; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transac...
Private function called by `deregister` and `slash` Flag the darknode for deregistration Emit an event
function deregisterDarknode(address _darknodeID) private { store.updateDarknodeDeregisteredAt(_darknodeID, currentEpoch.blocktime.add(minimumEpochInterval)); numDarknodesNextEpoch = numDarknodesNextEpoch.sub(1); emit LogDarknodeDeregistered(msg.sender, _darknodeID); }
7,310,778
./partial_match/1/0x967950FB577B32919fb1b4Dd52a746255F0047Ba/sources/RETSUKO.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Retsuko", "RETSUKO") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IU...
16,065,069
./partial_match/4/0xf71e850816eA9619138f3f2A10C38CaE69D0b83E/sources/OrcusToken.sol
Helper function that checks for ERC777TokensRecipient on the recipient and calls it. May throw according to `_preventLocking` _from The address holding the tokens being sent _to The address of the recipient _amount The number of tokens to be sent _userData Data generated by the user to be passed to the recipient ...
function callRecipient( address _operator, address _from, address _to, uint256 _amount, bytes _userData, bytes _operatorData, bool _preventLocking ) internal { address recipientImplementation = interfaceAddr(_to, "ERC777TokensRecipient"); i...
8,547,833
./full_match/137/0xe558726C468Ccc21cc09ca4B8B46131dC1002923/sources/project_/contracts/Exchange.sol
Settles a trade between pool liquidity and an order submitted and matched off-chain order An `Order` struct encoding the parameters of the taker order poolTrade A `PoolTrade` struct encoding the parameters of this trade execution between the order and pool liquidity/
function executePoolTrade(Order memory order, PoolTrade memory poolTrade) external onlyDispatcher { require( !isWalletExitFinalized(order.walletAddress), 'Order wallet exit finalized' ); Trading.executePoolTrade( order, poolTrade, _feeWallet, _assetRegistry, ...
4,761,975
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library ...
Sets the base token URI prefix.
function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner { baseTokenURI = _baseTokenURI; }
5,854,557
pragma solidity 0.4.18; /* Author: www.inncretech.com Email: aasim AT inncretech.com vishal AT inncretech.com GLXCoin Token public sale contract For details, please visit: https://ico.glx.com/ */ // Math contract to avoid overflow and underflow of variables contract SafeMath { function saf...
Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./
function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } }
2,575,456
./full_match/5/0x32e28ac9F548A845C2E62EFA4F32ee6ecB257F4D/sources/contracts/smart-wallet/non-upgradeable/TWAccount.sol
solhint-disable-next-line no-empty-blocks
{ using ECDSA for bytes32; State bytes32 public constant SIGNER_ROLE = keccak256("SIGNER_ROLE"); IEntryPoint private immutable entrypointContract; Constructor, Initializer, Modifiers receive() external payable virtual {} constructor(IEntryPoi...
7,085,637
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // 'Kaasy' CROWDSALE token contract // // Deployed to : 0x714c1ef3854591d4118bd6887d4740bc4d5f5412 // Symbol : KAAS // Name : KAASY.AI Token // Total supply: 500000000 // Decimals : 18 // ...
called by the owner to pause, triggers stopped state/
function pause() public onlyOwner whenNotPaused { isPaused = true; emit Pause(); }
12,867,509
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import './Context.sol'; import './Strings.sol'; import './ERC165.sol'; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { function hasRole(bytes32 role, address account) external view ...
Allow withdrawals of excess funds to be made to a particular recipient. recipient The recipient to allow./
function allowExternalRecipient( address recipient ) external nonReentrant onlyRole(OWNER_ROLE) { require(!_ALLOWED_RECIPIENTS_[recipient], 'SP1Owner: Recipient already allowed'); _ALLOWED_RECIPIENTS_[recipient] = true; emit UpdatedExternalRecipient(recipient, true); }
221,871
/** *Submitted for verification at Etherscan.io on 2022-03-10 */ /** TG: https://t.me/CatGirlsPortal NFT's - NFT Lottery - NFT Staking - Token Staking. Supply: 10 000 000 Max Wallet: 200 000 (2%) Max TX: 100 000 (1%) Tax: 10% Liquidity: 4% Marketing: 4% Development: 2% DO NOT BUY UNTIL CONTRACT ADDRESS IS POST...
Remove address from blacklist and allow sells, buys or transfers.
function removeAddressFromBlacklist(address blacklistedAddress) external onlyOwner { _isBlacklisted.remove(blacklistedAddress); emit ContractChangedAddress(blacklistedAddress); }
10,782,637
./full_match/4/0x80628b28F0a553cdc8e54603ed1a7B67e9d98a50/sources/AirnextToken.sol
Les administrateurs refusent le gros transfert
function refuseTransfer(address _sender, address _recipient) public returns(bool){ Latency storage thisBigTransfers = BigTransfers[_sender][_recipient]; require (thisBigTransfers._amount > 0, 'Ligne de tableau non valide'); require (msg.sender == addressAdminAirnext || msg.sender == addres...
13,363,330
./full_match/80001/0x9158507cF1DD97cf9f53bc7916cCC28A15Ad59e3/sources/src/MembershipNFT.sol
Returns whether shared metadata can be set in the given execution context.
function _canSetSharedMetadata() internal view virtual returns (bool) { return msg.sender == owner(); }
854,010
./partial_match/1/0x470270d1B41F494032D278A2B864B7BBF859a2BD/sources/FRIStakePool.sol
First User Stake & Reward withdrawSecond Team Reward withdraw
function _endPool(address owner) internal { _updateAllReward(); for(uint256 i=0; i<CONTRACT_LIST.length; i++){ address account = CONTRACT_LIST[i]; if(USER_REWARD[account] > 0){ uint256 rewards = USER_REWARD[account]; USER_REWARD[account] = 0; ...
4,125,943
./full_match/42/0xB32700fC2Ee6608260F7Eb0FB821bC411186D4BA/sources/browser/LuckyMachineInclusive_coordinator.sol
Returns Game ID, which can be queried for status of game using games('gameID'). This will fail if machine conditions are not met. Use safeBetFor() if all conditions have not been pre-verified./
function placeBetFor(address payable player, uint pick) public payable{ require(msg.value >= minBet, "minimum bet not met"); if(gas1 == 1) { delete gas1; delete gas2; delete gas3; delete gas4; delete gas5; delete gas6; ...
9,578,357
./partial_match/1/0x49c590F6a2dfB0f809E82B9e2BF788C0Dd1c31f9/sources/@mean-finance/dca-v2-periphery/contracts/DCAHubCompanion/DCAHubCompanionHubProxyHandler.sol
@inheritdoc IDCAHubCompanionHubProxyHandler
function increasePosition( IDCAHub _hub, uint256 _positionId, uint256 _amount, uint32 _newSwaps ) external payable verifyPermission(_hub, _positionId, IDCAPermissionManager.Permission.INCREASE) { IERC20Metadata _from = _hub.userPosition(_positionId).from; _approveHub(address(_from), _hub, _a...
2,852,600
./full_match/80001/0x99Ef070eCFe954e28412eAa05c7474886501b346/sources/project_/contracts/Amberfi/Market.sol
After NFT redeemed, claim the payment auctionId_ (uint256) Auction ID encryptionKey_ (string calldata) Encrypion key for encrypted content NFT/
function claimPayment(uint256 auctionId_, string calldata encryptionKey_) external nonReentrant whenNotPaused isValidAuction(auctionId_) { AmberfiLib.Auction storage auction = _auctions[auctionId_]; AmberfiLib.Bid memory highestBid = auction.highestBid; ad...
5,551,835
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "../core/DaoConstants.sol"; import "../core/DaoRegistry.sol"; import "../extensions/nft/NFT.sol"; import "../guards/MemberGuard.sol"; import "../guards/AdapterGuard.sol"; import "./interfaces/IConfiguration.sol"; import "../adapters/interfaces/IVoting.sol...
Add the library methods All the Token IDs that belong to an NFT address stored in the GUILD collection The internal owner of record of an NFT that has been transferred to the extension All the NFTs addresses collected and stored in the GUILD collection
{ using Address for address payable; using EnumerableSet for EnumerableSet.UintSet; using EnumerableSet for EnumerableSet.AddressSet; DaoRegistry public dao; event CollectedNFT(address nftAddr, uint256 nftTokenId); event TransferredNFT( address nftAddr, uint256 nftTokenId, ...
1,664,822
./full_match/4/0x147885688Ae169E007a7D5c392e53403c09Ff4F9/sources/contracts/teste.sol
associando denro da função o mapping:
function add_pessoa(string memory _nome, int256 _numero) public{ mapear[_nome] = _numero; }
13,334,796
// Sources flattened with hardhat v2.9.3 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.5.0 // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the E...
Withdraw staking funds
function unstake() external { uint256 stakingStartTimestamp = stakingStart[msg.sender]; require(stakingStartTimestamp != 0, "User is not staking"); require( block.timestamp >= stakingStartTimestamp + STAKE_DURATION, "Stake is still locked" ); delete ...
11,677,842
./full_match/5/0xf5B404471997A0c68327030CBeD766559bF4CD61/sources/contracts/brightid/extensions/BrightIDValidatorSignature.sol
Validate signed BrightID verification data. Requirements: - signer of signature must be a trusted validator./
function _validate( address[] calldata contextIds, uint256 timestamp, uint8 v, bytes32 r, bytes32 s ) internal view virtual { bytes32 message = keccak256(abi.encodePacked(context(), contextIds, timestamp)); address signer = message.recover(v, r, s); ...
1,902,933
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract Crowdfunding { // Data struct definition struct Project { uint init; uint end; uint target; uint amount; bool finished; string title; string description; } struct Proje...
Encerrar projeto, pode ser chamada a qualquer momento desde que o projeto não tenha sido concluido Devolve 90% do dinheiro dos doadores Somente dono do projeto ou dono do contrato pode chamar
function finishProject(address _projectOwner) public payable returns (bool) { if(checkProjectExistence(_projectOwner)){ if(msg.sender == ownerContract){ refundDonation(_projectOwner); projects[_projectOwner].finished = true; return true; ...
15,805,059
pragma solidity ^0.4.13; contract IGetImplementation { function implementation() public view returns (address); } contract IStructuredStorage { function setProxyLogicContractAndDeployer(address _proxyLogicContract, address _deployer) external; function setProxyLogicContract(address _proxyLogi...
Function which will return either is or not one of the campaign contracts validated campaign is any contract deployed during any campaign creation through TwoKeyFactory/
function isCampaignValidated(address campaign) public view returns (bool) { bytes32 hashKey = keccak256(_isCampaignValidated, campaign); return PROXY_STORAGE_CONTRACT.getBool(hashKey); }
73,050
./full_match/5/0x9255a95b953C03838f512B274420e201d497b161/sources/contracts/GEINApplication.sol
Function to Revoke GI _gein_id GEINID to be revoked _status_change_reason Status Change Reason/
function revoke_gi(uint32 _gein_id, uint8 _status_change_reason) public isGIRorQC { uint32 _application_id = GEINptr[_gein_id]; prodObj = prodptr[_application_id]; prodObj.gi_status = 6; prodObj.status_change_reason = _status_change_reason; prodptr[_application_id] = prodOb...
1,943,055
pragma solidity ^0.5.4; import "./Dependencies/Members.sol"; import "./Dependencies/VerifierInterface.sol"; import "./Dependencies/MiMCInterface.sol"; import "./Dependencies/Verifier.sol"; import "./Dependencies/MerkleTree.sol"; import "./Shared/Owned.sol"; import "./Shared/Operated.sol"; // ----------------------...
Voting functions add message to registry Helper functions
function votesIndexLength(uint256 ballotId) public view returns (uint) { return ballots[ballotId].voteKeys.length; }
12,671,067
./partial_match/1/0x7FEba38C9479d0efeE1e4338BF312c46317c17C9/sources/contracts/implementations/HeyMintERC1155ExtensionF.sol
Refund token and return the refund price to the token owner. _tokenId The id of the token to refund/
function refund(uint16 _tokenId, uint256 _numTokens) external nonReentrant { require(refundGuaranteeActive(_tokenId), "REFUND_GUARANTEE_EXPIRED"); require( balanceOf(msg.sender, _tokenId) >= _numTokens, "NOT_ENOUGH_TOKENS_OWNED" ); HeyMintStorage.State storage...
3,933,711
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contract...
view func to compute amount required for tokenIn to get fixed amount of tokenOut PoolInfo memory tokenOutPool = pools[tokenOut]; PoolInfo memory tokenInPool = pools[tokenIn]; assuming p1p2 = k, equivalent to uniswap's x y = k
function getAmountIn(address tokenIn, address tokenOut, uint256 amountOut) public view returns (uint256 tokenInPrice, uint256 tokenOutPrice, uint256 amountIn, uint256 tradeVcashValue) { require(amountOut > 0, 'MonoX:INSUFF_INPUT'); uint256 amountOutWithFee = amountOut.mul(1e5).div(1e5 - fees); ...
12,003,023
// SPDX-License-Identifier: MIT pragma solidity 0.6.6; // ...
inject NONSTANDARD NAMING
function GETAMOUNTSOUT486(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
12,546,476
/* Copyright 2018 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Decrement quantity owned of a token for a given address. Can only be called by authorized core contracts. _token The address of the ERC20 token _owner The address of the token owner _quantity The number of tokens to deattribute to owner/ Require that user has enough unassociated tokens ...
function decrementTokenOwner( address _token, address _owner, uint256 _quantity ) external onlyAuthorized { require(balances[_token][_owner] >= _quantity); balances[_token][_owner] = balances[_token][_owner].sub(_quantity); }
12,998,265
/* * Origin Protocol * https://originprotocol.com * * Released under the MIT license * https://github.com/OriginProtocol/origin-dollar * * Copyright 2020 Origin Protocol, Inc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files ...
Returns the min price of an asset in USD. return symbol Asset symbol. Example: "DAI" return price Min price from all the oracles, in USD with 8 decimal digits./ tokEthPrice has precision of 8 which ethUsdPrice has precision of 6 we want precision of 8 upscale by 2 since price oracles are precision 6
function priceMin(string calldata symbol) external returns (uint256 price) { MixConfig storage config = configs[keccak256(abi.encodePacked(symbol))]; uint256 ep; price = MAX_INT; if (config.ethOracles.length > 0) { ep = MAX_INT; for (uint256 i = 0; i < config....
10,908,105
pragma solidity 0.8.6; import "./IBondingCurve.sol"; contract BuySell { constructor( IErc20BondingCurve _usdc20BondingCurve, IETHBondingCurve _ethBondingCurve ) { usdc20BondingCurve = _usdc20BondingCurve; ethBondingCurve = _ethBondingCurve; } IErc20BondingCurve usdc20B...
Used for depositing the funds into the pool and minting the liquidity tranche ERC721 token which represents the liquidity provider's share in the pool and her unrealized P&L for this tranche. account The liquidity provider's address amount The size of the liquidity tranche minShare The minimum share in the pool for ...
function provideFrom( address account, uint256 amount, bool, uint256 minShare ) external override nonReentrant returns (uint256 share) { uint256 balance = totalBalance; share = totalShare > 0 && balance > 0 ? (amount * totalShare) / balance ...
11,680,076
./full_match/5/0x9718273F6d20D05102E27C0afD091e02a5ce2a02/sources/project_/contracts/RewardStaked.sol
Adds a new reward token. token The token to add.
function addRewardToken(address token) public onlyOwner { for (uint16 i=0; i < rewardTokens.length; i++) require(rewardTokens[i] != token, "this token is already a reward token"); rewardTokens.push(token); }
1,871,862
./partial_match/1/0xD3faD4C5e4D24646F90A0c8876314b17243E9460/sources/contracts/KounPass.sol
Pack two uint32s (allowlist and public redemptions) into a single uint64 value return Packed value Performs shift and bit operations to pack two uint32s into a single uint64/
function packMintRedemptions(uint32 _allowlistMintRedemptions, uint32 _publicMintRedemptions) private pure returns (uint64) { return (uint64(_allowlistMintRedemptions) << 32) | uint64(_publicMintRedemptions); }
2,677,019
pragma solidity >= 0.5.12; interface ERC20 { function totalSupply() external view returns (uint); function balanceOf(address tokenOwner) external view returns (uint balance); function allowance(address tokenOwner, address spender) external view returns (uint remaining); function transfer(address to, ui...
Manually resets last accepted notary block & timestamp. Only chain creator can call this method chainId ChainId that sender wants to interact with resetBlock New last accepted notary block number processRequests Flag if notary block set in vesting/deposit requests should be set unvoteValidators ...
function resetNotary(uint256 chainId, uint256 resetBlock, bool processRequests, bool unvoteValidators) external { ChainInfo storage chain = chains[chainId]; require(msg.sender == chain.creator, "Only chain creator can call this method"); uint256 lastValidBlock = chain.lastNotary.blo...
12,975,181
pragma solidity ^0.4.18; import "./TestFramework.sol"; import "./Bidders.sol"; contract DutchAuctionTest { DutchAuction testAuction; Timer t; // Adjust this to change the test code's initial balance uint public initialBalance = 1000000000 wei; //can receive money function() public payable {...
do nothing, just verify that the constructor actually ran
function testCreateDutchAuction() public { setupContracts(); }
1,051,509
pragma solidity 0.6.6; pragma experimental ABIEncoderV2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(addre...
Each instruction can only by redeemed once Verify instruction on beacon
function verifyInst( bytes memory inst, uint heights, bytes32[] memory instPaths, bool[] memory instPathIsLefts, bytes32 instRoots, bytes32 blkData, uint[] memory sigIdxs, uint8[] memory sigVs, bytes32[] memory sigRs, bytes32[...
7,597,145
// SPDX-License-Identifier: MIT pragma solidity 0.6.10; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./Ownable.sol"; import "./erc1820/ERC1820Client.sol"; import "./erc1820/ERC1820Implementer.sol"; import "./extensions/IAmpTokensSender.sol"; i...
Decreases the allowance granted to `_spender` by the caller. This is an alternative to function `Amp.approveByPartition` that can be used as a mitigation for the race condition described in Requirements: - `_spender` cannot be the zero address. - `_spender` must have allowance for the caller of at least `_subtractedV...
function decreaseAllowanceByPartition( bytes32 _partition, address _spender, uint256 _subtractedValue ) external returns (bool) { _approveByPartition( _partition, msg.sender, _spender, _allowedByPartition[_partition][msg.sender][_sp...
1,065,035
./full_match/43114/0xE3475B5B75B9f696cB28e2552aC7b62796fAf106/sources/contracts/avaxdoge.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(dexRouter), tokenAmount); address(this), tokenAmount, _marketingWallet, block.timestamp ); }
4,540,863
/** * Golden Union - Blockchain platform for direct investment in gold mining * https://goldenunion.org * ---------------------------- * telegram @golden_union * developed by Inout Corp */ pragma solidity ^0.4.23; contract ERC20Basic { function totalSupply() public view returns (uint256); func...
the function give tokens to new investors the sum is entered in whole tokens (1 = 1 token)
function giveTokens(address _newInvestor, uint256 _value) public onlyOwner { uint256 value = _value; require (_newInvestor != address(0)); require (value >= 1); value = value.mul(1 ether); token.transfer(_newInvestor, value); }
15,341,949
./partial_match/1/0x9bDfE9d2Ec5a0eb9E9B6dF935b34e5da04C497D5/sources/SwapContract.sol
multiTransferERC20TightlyPacked sends tokens from contract. _destToken The address of target token. _addressesAndAmounts The address of recipient and amount. _totalSwapped The amount of swap. _rewardsAmount The fees that should be paid. _redeemedFloatTxIds The txids which is for recording.
function multiTransferERC20TightlyPacked( address _destToken, bytes32[] memory _addressesAndAmounts, uint256 _totalSwapped, uint256 _rewardsAmount, bytes32[] memory _redeemedFloatTxIds ) external override onlyOwner returns (bool) { require(whitelist[_destToken], "...
4,191,966
./partial_match/5/0xCc83Dd82FB74B5056De897B68244D0895a9a07e4/sources/TokenFactory.sol
@TODO: Template interface check. solhint-disable-next-line no-inline-assembly call `CREATE2` w/ 4 arguments. pass along failure message from failed contract deployment and revert.
function _newToken( bytes32 key, string memory version, string memory name, string memory symbol, uint8 decimals ) internal returns (address result) { TemplateInfo memory info = _get(key); require(info.price == msg.value, "TokenFactory/Different deposited"...
16,834,363
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // should work with ^0.8.0 and below import "./FixidityLib.sol"; /** * @title NumericalMath * @author John Michael Statheros (GitHub: jstat17) * @notice This library builds on the fixed-point math in FixidityLib with * numerical approximations to tr...
Helper function to convert some large number to be between an upper and lower bound. bigNum: int256 of some large number lower: lower-bound of the output number upper: upper-bound of the output number return int256 between upper and lower (inclusive)/
function convBtwUpLo(int256 bigNum, int256 lower, int256 upper) public pure returns(int256) { return FixidityLib.add(FixidityLib.abs(bigNum) % FixidityLib.add(FixidityLib.subtract(upper, lower), 1), lower); }
12,595,758
pragma solidity 0.4.24; // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(addr...
Set the ICO smart contract address. _icoContract contract address of the ICO smart contract/ Allow to set the ICO contract only once
function setIcoContract(address _icoContract) public onlyOwner { require(icoContract == address(0)); require(_icoContract != address(0)); icoContract = _icoContract; }
10,207,857
./partial_match/1/0x3Bb6215030C4E75C82456FF9974722627ADb878D/sources/PlatinumClubToken.sol
Transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./
function _transfer(address _to, uint _value) private returns (bool){ require(msg.sender != address(0)); require(_to != address(0)); require(_to != address(this)); require(transfersUnlocked || unlocked[msg.sender], 'Transfer is locked for you'); require(_value > 0 && _value <=...
4,343,143
pragma solidity 0.5.8; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */ library SafeMath { /** * @dev Multiplie two unsigned integers, revert on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { //...
Called by the owner to pause, trigger stopped state./
function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); }
2,482,167
./partial_match/4/0x0e0B432eD4CE1B5aa13e3b44C37B9418075d2C07/sources/YVAULTMASTER.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
8,743,716
pragma solidity 0.5.10; contract Context { constructor () internal { } function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING return msg.sender; } function _MSGDATA330() ...
inject NONSTANDARD NAMING
function _BURN826(address account, uint256 amount) internal {
1,784,040
pragma solidity ^0.4.24; interface ERC165 { /// @notice Query if a contract implements an interface /// @param interfaceID The interface identifier, as specified in ERC-165 /// @dev Interface identification is specified in ERC-165. This function /// uses less than 30,000 gas. /// @return `t...
Complete the buy transaction in batch, The inventory minus one and the room night token transfer to customer _vendorId The vendor account _vendor Then vendor address _rpid The vendor's rate plan id _dates The booking date _token The token Id/ By through ETH Transfer the ETH to `_vendor` By through other digit...
function _buyInBatch(uint256 _vendorId, address _vendor, uint256 _rpid, uint256[] _dates, uint256 _token) private returns(bool) { (uint16[] memory inventories, uint256[] memory values) = dataSource.getPrices(_vendorId, _rpid, _dates, _token); uint256 totalValues = 0; for(uint256 i = 0; i < _...
13,066,657
./partial_match/80001/0x66B8c38b52Cf69B543f0eA0FdAcf701Cf7502703/sources/contracts/BundleV1.sol
Mint NFT token with tokenURI `encryptedEmail` parameter should be RSA encrypted with `rsaEncryptionPublicKey` in this contract/ Mint Add URI to tokenId Increment the counter
function mintESimBundle(address to, bytes memory encryptedEmail) public virtual { settlementToken.transferFrom(_msgSender(), settlementBeneficiary, mintPrice); _mint(to, _tokenIdTracker.current()); _tokenState[_tokenIdTracker.current()] = STATE_INIT; emit ESimMintToEmail(to, _token...
8,815,140
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /******************************************/ /* KeeperCompatibleInterface starts here */ /******************************************/ interface KeeperCompatibleInterface { /** * @notice checks if the contract requires work to be done. * @param checkDa...
Sets the stored oracle address oracleAddress The address of the oracle contract/
function setChainlinkOracle( address oracleAddress ) internal { oracle = OperatorInterface(oracleAddress); }
487,327
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; /** * ################################################################################ * ################################################################################ * ################################################################################ * ##...
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, IERC165) returns (bool) { return interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); }
256,984
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@...
Allows the DAO to change the amount of time JPEG tokens need to be locked to change the value of an NFT _newLockTime The amount new lock time amount
function setJPEGLockTime(uint256 _newLockTime) external onlyRole(DAO_ROLE) { require(address(jpegLocker) != address(0), "no_jpeg_locker"); jpegLocker.setLockTime(_newLockTime); }
1,423,292
pragma solidity ^0.4.10; // Miners create Elixor (EXOR), which they then convert to Elixir (ELIX) contract elixor { string public name; string public symbol; uint8 public decimals; uint256 public startTime; uint256 public totalSupply; bool public balanceImportsComplete; mapping (address => boo...
Prevent Freezing (Once system is ready to be locked)
function prohibitFreeze() { freezeProhibited=true; }
1,064,029
./full_match/1/0x67e1eCFA9232E27EAf3133B968A33A9a0dCa9e16/sources/lib/Bytes2.0/contracts/Staking/NeoTokyoStaker.sol
/ Retrieve the total reward rate of this S1 Citizen.
an easily-consumed fashion. This function works backwards to calculate the underlying "Credit Yield" trait value of the component Identity item of the Neo Tokyo S1 Citizen with the token ID of `_citizenId` given the reward rate of the S1 Citizen as a whole and the credit multiplier of any component Vault....
5,011,620
./partial_match/1/0x6d596FdFD3381eBB5eCd526eBcAec8cC2BA019fF/sources/contracts/protocol/libraries/paraspace-upgradeability/lib/ParaProxyLib.sol
add new implementation address if it does not exist
function replaceFunctions( address _implementationAddress, bytes4[] memory _functionSelectors ) internal { require( _functionSelectors.length > 0, "ParaProxy: No selectors in implementation to cut" ); ProxyStorage storage ds = diamondStorage(); ...
16,138,783
./full_match/1/0x84927e55Ed03EA00732F17FdAA89f482AD12c005/sources/contracts/others/ImpactXPMigration.sol
check if total deposits exceed snapshot Verify the merkle proof.
function deposit( uint256 _amount, uint256 _max, bytes32[] memory _merkleProof ) external nonReentrant { require(merkleRoot != "", "Migration not enabled"); uint256 prevAmt = (userInfo[msg.sender].amount * PERCENT_PRECISION) / (PERCENT_PRECISION - taxOfOldToken); require(_amount + pre...
3,173,971
pragma solidity ^0.4.13; import "./Fund.sol"; import "./DataFeed.sol"; import "./math/SafeMath.sol"; import "./math/Math.sol"; import "./zeppelin/DestructibleModified.sol"; /** * @title NavCalulator * @author CoinAlpha, Inc. <contact@coinalpha.com> * * @dev A module for calculating net asset value and other fund ...
Calculate nav and allocate fees setting lastCalcDate for use as "now" for this function Set the initial value of the variables below from the last NAV calculation The new grossAssetValue equals the updated value, denominated in ether, of the exchange account, plus any amounts that sit in the fund contract, excluding un...
function calculate() onlyFund constant returns ( uint lastCalcDate, uint navPerShare, uint lossCarryforward, uint accumulatedMgmtFees, uint accumulatedAdminFees ) { lastCalcDate = now; uint netAssetValue = sharesToUsd(fund.totalSupply()); uint elapsedTime ...
5,430,885
./full_match/1/0xdC16879d9Ef443151Aef5eC917ce64F083232A03/sources/MasterChefAxs.sol
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(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint.add(_allocPoint); poo...
3,004,585
/* @title TonMinter v0.0.1 ________ ________ _______ ________ ___ |\ ____\|\ __ \|\ ___ \ |\ __ \|\ \ \ \ \___|\ \ \|\ \ \ __/|\ \ \|\ \ \ \ \ \ \ \ \ _ _\ \ \_|/_\ \ \\\ \ \ \ \ \ \____\ \ \\ \\ \ \_|\ \ \ \\\ \ \ \____ \ \_______\ \__\\ _\\ \_______\ \_______\ ...
Returns the stove proofs for a given stoveID stoveID Stove ID to query/
function getProofs(address projectDeveloperAddress, uint256 stoveID) public view returns (stoveProof[] memory _stoveProofs) { return addressToProjectDevInfo[projectDeveloperAddress].stoveUUIDtoStoveProof[stoveID].proofCollection; }
1,823,217
./full_match/43113/0xb258a00a1Cd94ce2276Cb3D567BCc7613862a373/sources/contracts/SwapRouter_flattened.sol
Self Permit Functionality to call permit on any EIP-2612-compliant token for use in the route
interface ISelfPermit { function selfPermit( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; function selfPermitIfNecessary( address token, uint256 value, uint256 deadline, uint...
7,151,490
./partial_match/1/0x9aeBeCdC5829dc6b6Dd1708f3EE732c515b74C63/sources/NebulasToken.sol
User stakes their assets on the ethereum, expects to get corresponding assets on the nebulas chain. _amount Amount to stake on the ethereum. _nebulasAccount Account address on the nubelas chain to get asset./
function stake( uint256 _amount, string memory _nebulasAccount ) external whenNotPaused nonReentrant checkNebulasAccount(_nebulasAccount) returns (bool) { require(_amount > 0, "stake: Staking amount should be greater than 0!"); uint256 _originalBalance = underlyingToken.balanceOf...
3,557,514
./full_match/4/0x33453e43b81b0e889cd49C1a14C3B2a330891Fe6/sources/contracts/fantom_swap/bridge/tokenBridge.sol
emit sendsendAmount
function send(uint256 chainTo , address assetAddress , uint256 amount , address receiver ) public payable returns(bytes32){ require(isActiveNativeAsset[assetAddress] , "not_Active"); require(nativeAssets[assetAddress].isSupportedChain[chainTo] , "Chain_err"); require(amount >= nativeAssets[as...
715,710
pragma solidity ^0.5.0; contract Manager { /* Struct of a Borrow When user want to borrow money from other user Manager will create a Borrow struct for him Other user can lend money according to Borrow struct */ struct Borrow{ uint256 index; //Index of this Borrow in ...
/We require index is less than the length of debts_list hereGet the required Debt from debts_listGet the corresponding Borrow from borrow_listPut all the indexs into index_list
function getDebtInfoFromDebtsList(uint256 index) public view returns(uint256 borrow_index, uint256[] memory lend_index, uint256 lender_number){ require(index < debts_list.length); Debt storage debt = debts_list[index]; Borrow storage borrow = borrow_list[debt.borrowIndex]; uint256 count = borrow.lend...
12,672,196
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import { ERC721, ERC721TokenReceiver } from "./ERC721.sol"; /// @notice Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) Non-Fungible Token Standard, /// including the Metadata and Enumerable extension. Built to optimize for lowest gas poss...
Returns the ownership values for a token ID. id Token ID to query. return {TokenOwnership} of `id`.
function _ownershipOf(uint256 id) internal view virtual returns (TokenOwnership memory) { if (!_exists(id)) revert NonExistentToken(); unchecked { for (uint256 curr = id; curr > 0; curr--) { TokenOwnership memory ownership = _ownerships[curr]; if (ownersh...
7,327,301
pragma solidity ^0.5.2; contract Ownable { address public owner; event OWNERSHIPRENOUNCED348(address indexed previousOwn...
inject NONSTANDARD NAMING
function FREEZE250(uint256 _value) WHENNOTPAUSED770 public returns (bool) {
1,045,812
./full_match/80001/0xDE0d33CbFCBc555E935A847Cd709e5d7d3a55020/sources/contracts/StakeOrionManager.sol
if returned value > 0: amount is pending and has to be withdrawn later
function getStableReward() external nonReentrant updateReward(msg.sender) returns (uint256) { return StakeOrion(userContracts[msg.sender]).getReward(); }
872,854
pragma solidity ^0.6.9; //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::: @#::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //:::::...
The average price of each token from all commitments.
function tokenPrice() public view returns (uint256) { return amountRaised.mul(TENPOW18).div(tokenSold); }
6,363,980
./full_match/1/0xC1810aa7F733269C39D640f240555d0A4ebF4264/sources/contracts/StrategyUniverseStaking.sol
set number of batches we sell our claimed XYZ in reset our counter to be safe
function setSellsPerEpoch(uint256 _sellsPerEpoch) external onlyEmergencyAuthorized { require( 15 > _sellsPerEpoch && _sellsPerEpoch > 0, "Must be above 0 and less than 15" ); sellsPerEpoch = _sellsPerEpoch; sellCounter = 0; }
4,985,214
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.11; // Creating a contract contract Types { // Creating an enumerator enum week_days { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } // Declaring variables ...
Defining function to return default value
function getdefaultvalue() public pure returns(week_days) { return default_value; }
12,585,750
./full_match/11155111/0xBD36b1A6476781C37870756CF457D6dE13D4160f/sources/project_/contracts/MyContract.sol
ensures this can be called only once per proxy contract deployed
function constructor1() public{ require(owner == address(0)); owner = msg.sender; }
3,796,192
pragma solidity ^0.4.24; // File: contracts/ownership/OwnableProxy.sol /** * @title OwnableProxy */ contract OwnableProxy { event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /...
Allows the current owner to set the pendingOwner address. newOwner The address to transfer ownership to./
function transferOwnership(address newOwner) public onlyOwner { _setPendingOwner(newOwner); }
12,598,328
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.7.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...
See {ERC20-_beforeTokenTransfer}./
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override(ERC20, ERC20Capped) { super._beforeTokenTransfer(from, to, amount); }
411,264
./full_match/1/0x1a1Afc1C1010af336D3b884cbF63fa2b23A02B4F/sources/browser/BondingToken.sol
Burn tokens when redemptions occur from The address to burn tokens from value The number of tokens to burn/
function burn( address from, uint256 value ) public onlyOwner { _burn(from, value); }
8,363,440
./partial_match/137/0xABa4Aa7376a5c4dbF9D0ed14Ac867fb9c40AdD5b/sources/PepemonFactory.sol
Enable or disable approval for a third party ("operator") to manage all of caller's tokens _operator Address to add to the set of authorized operators _approved True if the operator is approved, false to revoke approval/ Update operator status
function setApprovalForAll(address _operator, bool _approved) external { operators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); }
3,520,492
pragma solidity 0.4.24; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import 'zeppelin-solidity/contracts/lifecycle/Destructible.sol'; import "./SwapController.sol"; contract SwapContrac...
execute transfers for all unexecuted ones that can be swapped return boolean if the entire operation completed successfully or not/ Execute transfer
function executeTransfers() onlyTokenOwner public returns (bool) { if (_numRequests == 0) return false; uint numRequests = _numRequests; ERC20 token = ERC20(tokenAddress); for (uint i = 0; i < numRequests; i++) { TransferRequest storage req = _...
14,070,644
pragma solidity ^0.4.11; import "AuthenticationManager.sol"; import "SmartInvestmentFundToken.sol"; import "SafeMath.sol"; contract TokenHolderSnapshotter { using SafeMath for uint256; /* Map all our our balances for issued tokens */ mapping (address => uint256) balances; /* Our handle to the SIFT co...
Are they already a holder? If not and no new balance then we're making no change so leave now, or if they are and balance is the same So we definitely have a change to make. If they are not a holder add to our list and update balance. If they are a holder who maintains balance update balance. Otherwise set balance ...
function snapshotUpdate(address _addr, uint256 _newBalance, string _details) adminOnly { uint256 existingBalance = balances[_addr]; if (existingBalance == _newBalance) return; if (existingBalance == 0) { allTokenHolders.length++; allTokenHolders[a...
2,497,812
./full_match/3/0x1cF64D9549671b2325F5d967C7D4902930FAe4CF/sources/browser/YearnPool.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, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); ...
8,094,282
/** *Submitted for verification at Etherscan.io on 2021-09-10 */ // File: node_modules\openzeppelin-solidity\contracts\utils\Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its d...
check boss is caller
function setImgUrl(uint256 tokenId, string memory _imgUrl) payable public { require( ownerOf(tokenId) == _msgSender(), "caller is not token owner." ); require( bytes(_imgUrl).length < 256, "string length is over limit....
6,653,477
pragma solidity ^0.5.16; import "./CToken.sol"; import "./ComptrollerStorage.sol"; /** * @title Cream's Comptroller interface extension */ interface ComptrollerInterfaceExtension { function checkMembership(address account, CToken cToken) external view returns (bool); function updateCTokenVersion(address cT...
Unregister account collateral tokens if the account still has enough collateral. This function could only be called by comptroller. account The account to unregister/ Make sure accountCollateralTokens of `account` is initialized.
function unregisterCollateral(address account) external { initializeAccountCollateralTokens(account); require(msg.sender == address(comptroller), "only comptroller may unregister collateral for user"); decreaseUserCollateralInternal(account, accountCollateralTokens[account]); }
1,264,791
./partial_match/1/0x9C3AFDDEa87a726891A44C037242393D524CAcFE/sources/contracts/PancakeV3Factory.sol
@inheritdoc IPancakeV3Factory
function setFeeAmountExtraInfo( uint24 fee, bool whitelistRequested, bool enabled ) public override onlyOwner { require(feeAmountTickSpacing[fee] != 0); feeAmountTickSpacingExtraInfo[fee] = TickSpacingExtraInfo({ whitelistRequested: whitelistRequested, ...
2,749,028
./full_match/42/0x18cC0772a934924AfAA752299E24A5591803831c/sources/assignement.sol
TODO: transfer mintership to newminter NOTE: only incumbent minter can transfer mintership NOTE: should emit `MintershipTransfer` event
function transferMintership(address newMinter) public returns (bool) { require(msg.sender == minter); minter = newMinter; emit MintershipTransfer(minter, newMinter); return true; }
16,204,960
./partial_match/1/0xaCCaaDc4F8448F5f6C6aAf1c639Ec4B8bD1A8aF4/sources/@rari-capital/solmate/src/tokens/ERC721.sol
Underflow of the sender's balance is impossible because we check for ownership above and the recipient's balance can't realistically overflow.
function transferFrom( address from, address to, uint256 id ) public virtual { require(from == _ownerOf[id], "WRONG_FROM"); require(to != address(0), "INVALID_RECIPIENT"); require( msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sende...
2,702,320
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./Neurons/Package.sol"; interface ERC721 { function ownerOf(uint256 _tokenId) external view returns (address); } /** * @title Neurons */ contract Neurons is NRN { receive() external payable {} fallback() external payable {} mapping(u...
ERC20 Interface Interface of the ERC20 standard/
interface ERC20 { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function name() external view returns (string memory); function symbol() external view returns (string memory); functi...
13,638,528
pragma solidity ^0.4.24; // File: ..\node_modules\openzeppelin-solidity\contracts\token\ERC20\IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) e...
last bracket - end public sale
function nextBracket() private { if(currentPublicBracketIndex == publicBrackets.length - 1) { isSelling = false; saleState = ICOData.SaleStates.EndPublicSale; isTransferable = true; emit EnableTransfer(); emit EndPublicSale(); } else { currentPublicBracketIndex ...
1,773,145