file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/// @title PropertySet /// @author Andreas Olofsson (andreas1980@gmail.com) /// @dev PropertySet is a set backed by an iterable map with (bytes32, bool) entries. /// O(1) insert, find, and remove. /// Stores a boolean, and an array index (uint) for each element, in addition to the bytes32. /// This is for easy lookup, ...
PropertySet.valueFromIndex(set, bytes32) to get a value from backing array index. Useful when iterating. Get value from index in backing array. set (PropertySet.Set) storage reference to the set. index (uint) the bytes32 return index (uint) the index return exists (bool) true if the element exists, false otherwise. ...
function valueFromIndex(Set storage set, uint index) constant returns (bytes32 value, bool exists){ if(index >= set._values.length){ return; } value = set._values[index]; exists = true; return; }
15,790,321
./partial_match/56/0xEd9Dc6A730f39C2ab80646eB535dfDEc8EfC39e9/sources/LPStakingV2.sol
Function that will allow user to claim rewards
function claimRewards(uint _tokenId) public { require(StakingNFT.ownerOf(_tokenId) == _msgSender(), "User is not owner of token"); require(NFTDetails[_tokenId]._inCirculation == true, "Stake has already been withdrawn"); updatePool(); NFT storage nft = NFTDetails[_tokenId]; ...
11,070,645
./full_match/100/0x7BD4FaE40Dce40CC61E3e5E7E85aa0Fc403297fD/sources/contracts/OrbisAlpha.sol
Private: Checks if an address is the creator of a specific post _postID: ID of the post _member: Address of the member/
) private view returns(bool) { function _updateMembershipRole( uint _membershipID, Roles _role } } function _getMembership( uint _communityID, address _member } function _getReputationBalance( uint _communityID, address _member...
14,265,342
pragma solidity ^0.6.9; //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::: @#::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //:::::...
Needs extra gas limit for additional state changes
function commitEth() public payable { commitEthFrom(msg.sender); }
79,566
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which i...
Used to track which version of `StrategyAPI` this Strategy implements. The Strategy's version must match the Vault's `API_VERSION`. return A string which holds the current API version of this contract./
function apiVersion() public pure returns (string memory) { return "0.3.4"; }
13,652,402
/** *Submitted for verification at Etherscan.io on 2019-12-27 */ /** Copyright 2019 PoolTogether LLC This file is part of PoolTogether. PoolTogether is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation under version...
A function that withdraws committed deposits for a user and emit the corresponding events. _from User to withdraw for _amount The amount to withdraw/
function _withdrawCommittedDepositAndEmit(address _from, uint256 _amount) internal returns (bool) { drawState.withdrawCommitted(_from, _amount); _withdraw(_from, _amount); emit CommittedDepositWithdrawn(_from, _amount); return true; }
14,091,932
/** *Submitted for verification at Etherscan.io on 2021-04-05 */ // File: @openzeppelin/contracts/utils/Context.sol pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * v...
Redeem Rewarded Tokens/
function redeemTokens() external returns (bool) { require(whitelist[_msgSender()].whitelist, "Sender isn't in whitelist"); Whitelist memory whitelistWallet = whitelist[_msgSender()]; require(isFinalized, "Sale isn't finalized yet"); require(!whitelistWallet.redeemed, "Redeemed befo...
2,027,997
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; contract SmartChe...
Return reward multiplier over the given _from to _to block.
function getMultiplier(uint _from, uint _to) public view returns (uint) { if(_to <= stakingEndBlock){ return _to - _from; return 0; return stakingEndBlock - _from; } }
15,824,436
pragma solidity ^0.4.22; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } func...
called by the owner to pause, triggers stopped state _reason string The reason for the pause./
function pause(string _reason) OnlyOwner IsNotPaused public { isPaused = true; pauseNotice = _reason; emit Pause(_reason); }
5,504,609
./full_match/43114/0xbFC4028Cd378Dc64a2e87473da4f993D5498702f/sources/masterchef.sol
Deposit LP tokens to MasterChef for DOG allocation. pool.lpToken.safeTransfer(vaultAddress, depositFee);
function deposit(uint256 _pid, uint256 _amount) public nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accDogPerShare).div(1e18).sub(...
4,525,103
./full_match/1/0x4cB14eA7D78Dac537b79b37345285761F626E7B6/sources/contracts/strategies/Strategy.sol
Rebalance profit, loss and investment of this strategy/
function rebalance() external override onlyKeeper { (uint256 _profit, uint256 _loss, uint256 _payback) = _generateReport(); IVesperPool(pool).reportEarning(_profit, _loss, _payback); _reinvest(); }
3,215,741
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount o...
Internal unstake function amount Amount of tokens to unstake/
function _unstake(uint256 amount) internal { require(amount <= staked[msg.sender], "TrueFarm: Cannot withdraw amount bigger than available balance"); staked[msg.sender] = staked[msg.sender].sub(amount); totalStaked = totalStaked.sub(amount); require(stakingToken.transfer(msg.sender, ...
217,487
./full_match/3/0x3Cf37975EE75D59d82515B5F943d667CB1b6A7A8/sources/contracts/EEGGSTOKEN.sol
Create a uniswap pair for this new token exclude from paying fees or having max transaction amount_mint(owner(), 7771111444 (1018));
constructor() ERC20("EEGGS", "EEGGS") { _totalSupply = 7771111444 * (10 ** 18); liquidityWallet = owner(); uniswapV2Router = IUniswapV2Router02( ); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair( address(this), uniswapV...
8,113,363
pragma solidity 0.4.24; pragma experimental ABIEncoderV2; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "solidity-bytes-utils/contracts/BytesLib.sol"; import "./IAutonomousSwapProofVerifier.sol"; import "./IFederation.sol"; import "./BytesLibEx.sol"; import "./CryptoUtils.sol"; import "./StringU...
Parses the receipt proof and process the proof data. our current Solidity version doesn't support unbound parameters (e.g., bytes) in external interface methods. _packedProof bytes The raw proof (including the resultsBlockHeader, resultsBlockProof and transactionReceiptProof.
function parsePackedProof(bytes _packedProof) internal pure returns(bytes resultsBlockHeader, bytes resultsBlockProof, bytes packedTransactionReceiptProof) { uint offset = 0; uint32 resultsBlockHeaderSize =_packedProof.toUint32BE(offset); offset = offset.add(LENGTH_SIZE); result...
12,936,361
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts...
Moves tokens `amount` from `sender` to `recipient`./ Invoke super _transfer to emit Transfer event
function _transfer(address _sender, address _recipient, uint256 _amount) internal virtual override { _checkpoint(_sender); _checkpoint(_recipient); _checkpointRewards(_sender); _checkpointRewards(_recipient); super._transfer(_sender, _recipient, _amount); _updateLiq...
6,413,588
pragma solidity ^0.5.3; import "testeth/Log.sol"; import "testeth/Assert.sol"; import "testeth/Account.sol"; contract Factory { event Deployed(address addr, uint256 salt); function deploy1SignerWallet(uint256 threshold, address signatory) public returns (address payable addr) { assembly { // Multisig W...
EIP712 Transaction Hash
function check_b3_buildHash_testInvalidSigningAccount_useAccount1() public { recordData = "\x19\x01\x01"; data = abi.encodeWithSelector(bytes4(0x7214ae99), address(recorder), recordData); hash = keccak256(abi.encodePacked( "\x19\x01", bytes32(0xb0609d81c5f719d8a516ae2f25079b20fb63da3e07590e23f...
6,460,299
./full_match/84531/0x40a5005A3EE5Cc90821b9290f1237805C08889dB/sources/contracts/OrderBook.sol
si l'ordre d'achat est de 16 oranges pour 1.50€/unité et que l'ordre de vente est de 16 oranges pour 1,20€/unité : si l'ordre d'achat est de 16 oranges pour 1,50€/unité et que l'ordre de vente est de 10 oranges pour 1.20€/unité : le trade ne prendra en compte que 10 oranges le prix à payer sera : 12 euros si l'ordre d'...
function book() private { for (uint256 i = 0; i < buyOrders.length; i++) { for (uint256 j = 0; j < sellOrders.length; j++) { if ( buyOrders[i].isActive && sellOrders[j].isActive && buyOrders[i].token1 == sellOrders[j].to...
11,499,783
./full_match/1313161554/0xcDcfe4C20d69827890f436AfC9509CC6E5c0D037/sources/src/UniswapAnchoredView.sol
In the event that a feed is failed over to Uniswap TWAP, this function can be called by anyone to update the TWAP price. This only works if the feed represented by the symbolHash is failed over, and will revert otherwise symbolHash bytes32/
function pokeFailedOverPrice(bytes32 symbolHash) public { PriceData memory priceData = prices[symbolHash]; require(priceData.failoverActive, "Failover must be active"); TokenConfig memory config = getTokenConfigBySymbolHash(symbolHash); uint256 anchorPrice = calculateAnchorPriceFromN...
13,232,830
./full_match/4/0x4ADc0A52dBDCd67f92558280BdCD6317C42d5659/sources/contracts/SingleEditionMintableCreator.sol
Creates a new edition contract as a factory with a deterministic address Important: None of these fields (except the Url fields with the same hash) can be changed after calling _name Name of the edition contract _symbol Symbol of the edition contract _description Metadata: Description of the edition entry _articleU...
function createEdition( string memory _name, string memory _symbol, string memory _description, string memory _articleUrl, bytes32 _articleHash, uint256 _editionSize, uint256 _royaltyBPS ) external returns (uint256) { uint256 newId = atContract.cur...
731,248
pragma solidity 0.5.16; interface IBasicToken { function decimals() external view returns (uint8); } contract IERC20WithCheckpointing { function balanceOf(address _owner) public view returns (uint256); function balanceOfAt(address _owner, uint256 _blockNumber) public view returns (uint256); function...
Precisely divides two units, by first scaling the left hand operand. Useful for finding percentage weightings, i.e. 8e18/10e18 = 80% (or 8e17) x Left hand input to division y Right hand input to division return Result after multiplying the left operand by the scale, and executing the di...
function divPrecisely(uint256 x, uint256 y) internal pure returns (uint256) { uint256 z = x.mul(FULL_SCALE); return z.div(y); }
204,853
./full_match/10/0x037F94DA5096c944eEfc31Fd2696B99bAb20C2d5/sources/node_modules/@zoralabs/protocol-rewards/src/interfaces/IProtocolRewards.sol
IProtocolRewards The interface for deposits & withdrawals for Protocol Rewards
interface IProtocolRewards { event RewardsDeposit( address indexed creator, address indexed createReferral, address indexed mintReferral, address firstMinter, address zora, address from, uint256 creatorReward, uint256 createReferralReward, uint...
3,782,319
./full_match/1/0xEfC6425aD281E40c2734BdD823E3abbD444141b3/sources/contracts/core/OperationsRegistry.sol
Gets an Operation from the Registry name The name of the Operation return actions Returns an array of Actions and array for optionality of coresponding Actions/
function getOperation( string memory name ) external view returns (bytes32[] memory actions, bool[] memory optional) { if (keccak256(bytes(operations[name].name)) == keccak256(bytes(""))) { revert("Operation doesn't exist"); } actions = operations[name].actions; optional = operations[name]...
8,431,419
./full_match/42161/0x0f0F2dAb7C37e477f8225DF18D2D70d84A54274a/sources/project_/src/contracts/TokenStaking.sol
get staking balance for useramount should be more than 0transfer staked tokens back to userreseting users staking balanceupdating staking status
function unstakeTokens() public { require(false, "Unstake function is available after 6 hours timestamp"); uint256 balance = stakingBalance[msg.sender]; require(balance > 0, "amount has to be more than 0"); testToken.transfer(msg.sender, balance); totalStaked = totalStaked -...
16,309,447
pragma solidity ^0.4.25; // Based on ECTools from https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d#gistcomment-1775555 // for signature to (r,s,v) conversion and https://blog.ricmoo.com/verifying-messages-in-solidity-50a94f82b2ca // for single parameter compatible signing and message prefixing library Ver...
Parses a hexchar, like 'a', and returns its hex value, in this case 10 @source https:gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6dgistcomment-1775555 bool decimals = false;
function parseInt16Char(string _char) public pure returns (uint) { bytes memory bresult = bytes(_char); if ((bresult[0] >= 48) && (bresult[0] <= 57)) { return uint(bresult[0]) - 48; return uint(bresult[0]) - 55; return uint(bresult[0]) - 87; revert(); } }
14,057,684
pragma solidity^0.4.21; contract EtheraffleInterface { uint public tktPrice; function getUserNumEntries(address _entrant, uint _week) public view returns (uint) {} } contract LOTInterface { function transfer(address _to, uint _value) public {} function balanceOf(address _owner) public view returns (ui...
Returns number of entries made in Etheraffle contract by function caller in whatever the queried week is. _address Address to be queried _weekNo Desired week number. (Use 0 for current week)/
function getNumEntries(address _address, uint _weekNo) public view returns (uint) { uint week = _weekNo == 0 ? getWeek() : _weekNo; return etheraffleContract.getUserNumEntries(_address, week); }
279,460
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; /** * @title Represents an ownable resource. */ contract Ownable { address internal _owner; event OwnershipTransferred(address previousOwner, address newOwner); /** * Constructor * @param addr The owner of the smart contract */ c...
Defines the interface for whitelisting addresses./
interface IAddressWhitelist { function enableAddress (address addr) external; function disableAddress (address addr) external; function isWhitelistedAddress (address addr) external view returns (bool); event OnAddressEnabled(address addr); event OnAddressDisabled(address addr); }
1,408,369
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/math/Math.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/Safe...
Returns the base token exchange rate for a given position. Defaults to 1 for all staked positions created prior to GIP-1 (before the `unsafeBaseTokenExchangeRate` field was added). Always use this method to get the base token exchange rate to ensure proper handling of old staked positions.
function safeBaseTokenExchangeRate(StakedPosition storage position) internal view returns (uint256) { if (position.unsafeBaseTokenExchangeRate > 0) { return position.unsafeBaseTokenExchangeRate; } return MULTIPLIER_DECIMALS; }
13,058,114
/* Copyright 2021 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...
MODULE ONLY: Hook called prior to redemption in the issuance module. Trades out of existing positions to make redemption capital withdrawable from PerpV2 vault. Sets the `externalPositionUnit` equal to the realizable value of account in position units (as measured by the trade outcomes for this redemption). Any `owedRe...
function moduleRedeemHook( ISetToken _setToken, uint256 _setTokenQuantity ) external override onlyModule(_setToken) { if (_setToken.totalSupply() == 0) return; int256 newExternalPositionUnit = _executeModuleRedemptionHook(_setToken, _setTokenQuantity,...
7,220,927
// SPDX-License-Identifier: Unlicense pragma solidity 0.8.4; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import './BlockNoteXACL.sol'; /// @author Blockben /// @title BlockNoteX /// @notice BlockNoteX implementation contract BlockNoteX is ERC20, B...
_spender Account that allows the spending _addedValue Amount which will increase the total allowance/
function increaseAllowance(address _spender, uint256 _addedValue) public override whenNotPaused returns (bool) { return super.increaseAllowance(_spender, _addedValue); }
1,818,391
pragma solidity ^0.4.23; /** _ _ _ _____ _____ _____ __ ___ _____ _____ _____ _____ _____ | | | || | || __|| __|| | ___ | _| | __||_ _|| | || __|| __ | | | | || || __|| __|| |__ | . || _| | __| | | | || __|| -| |_____||__|__||_____||_____||_...
User must have enough eth User must bet at least the minimum If the user bets more than maximum...they just bet the maximum
{ address _customerAddress = msg.sender; require(ethBalanceOf(_customerAddress) >= betEth); require(betEth >= minBet); function getBalance() public view returns (uint256) } function buyTokens() public payable nonContract g...
6,352,887
./partial_match/1/0xBFcc973A3662c91cd2C28F575Ff201927479b1D8/sources/contracts/Org.sol
Create new Organization Contract Using initializer instead of constructor for minimal proxy support. This function can only be called once in the contract's lifetime ein The U.S. Tax Identification Number for the Organization orgFactory Address of the Factory contract./
function initializeOrg(uint256 ein, address orgFactory) public initializer { require(orgFactory != address(0), "Org: Factory cannot be null address."); taxId = ein; orgFactoryContract = IFactory(orgFactory); }
2,650,369
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/lib/ConsiderationDecoder.sol
Converts an offer item into a received item, applying a given recipient. offerItem The offer item. recipient The recipient. return receivedItem The received item./
function _convertOfferItemToReceivedItemWithRecipient( OfferItem memory offerItem, address recipient ) internal pure returns (ReceivedItem memory receivedItem) { assembly { receivedItem := offerItem mstore(add(receivedItem, ReceivedItem_recipient_offset), recipien...
4,301,714
./partial_match/3/0xef709b6E24794a7c7a18de3A6991105E61a2E82a/sources/SexCoin.sol
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 { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emi...
5,166,291
./full_match/421613/0xd6061b1141286b198B2cDB197c13C48DE01e2836/sources/contracts/PachiERC721/interfaces/IERC721EnumerableUpgradeable.sol
ERC-721 Non-Fungible Token Standard, optional enumeration extension/
interface IERC721EnumerableUpgradeable is IERC721Upgradeable { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex( address owner, uint256 index ) external view returns (uint256); function tokenByIndex(uint256 index) external view returns (uint256); }
11,566,069
//SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import "./WorkflowEngine.sol"; contract SupplyChainFlow { address internal workflowEngineAddr; WorkflowEngine wfe; struct Item { uint256 id; address userAddr; uint256 lineItem1Quantity; string lineItem1Descript...
should also be sending userAddr... so createUser will be logged as the user and not the contract
function createNewItem( uint256 lineItem1Quantity, string memory lineItem1Description, string memory comment ) public { Item memory item; item.id = wfe.createNewItem("SupplyChain", "Team A", "Approve"); item.userAddr = msg.sender; item.lineItem1Quantity = ...
5,457,421
./full_match/1/0x7079579D573aD7Ae52db05c73E04c17Ee684Af20/sources/contracts/auraToken.sol
See {IERC1155-isApprovedForAll}./
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; }
9,761,946
pragma solidity ^0.4.20; /* Welcome to ETHERX * This is the Game to End All Games * Backed by a solid community, we will grow with you! * * */ contract EtherX { /*================================= = MODIFIERS = =================================*/ // only people with tokens m...
-- APPLICATION ENTRY POINTS --/ add administrators here add the ambassadors here. add the ambassadors here. add the ambassadors here. add the ambassadors here.
function EtherX() public { administrators[0xB3A5BdF73B031D315C6fa6DeC3f20C33446cB272] = true; ambassadors_[0xB265c871e2DB1c57c94F97b4945Af018664e9FeC] = true; ambassadors_[0xc4b2F02034B76283D575c5D175890541f76D9cBC] = true; ambassadors_[0x7071d7...
2,450,227
./full_match/4/0xfC7BdB813c6345B5f32fB667febCBB3CF2aDC558/sources/contracts/2_Owner.sol
Want tokens moved from user -> AUTOFarm (AUTO allocation) -> Strat (compounding)
function deposit(uint256 _pid, uint256 _wantAmt) public nonReentrant { updatePool(_pid); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; if (user.shares > 0) { uint256 pending = user.shares.mul(pool.accAUTOPerShare)...
645,418
// SPDX-License-Identifier: AGPL-3.0-only /* SlashingTable.sol - SKALE Manager Copyright (C) 2018-Present SKALE Labs @author Dmytro Stebaiev @author Artem Payvin SKALE Manager is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as...
Emitted when contract is upgraded./
function initialize() external initializer { OwnableUpgradeSafe.__Ownable_init(); }
47,613
./full_match/43113/0x1371314364F0E998f2E9667dF1a0702DEAA73E66/sources/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol
Request to whitelist `_voter` account to ftso at `_ftsoIndex`. Will revert if vote power too low. May be called by any address./
function requestWhitelistingVoter(address _voter, uint256 _ftsoIndex) external override { if (_isTrustedAddress(_voter)) { revert("trusted address"); } bool success = _requestWhitelistingVoter(_voter, _ftsoIndex); require(success, "vote power too low"); }
7,109,276
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; import {ERC20} from "@rari-capital/solmate/src/tokens/ERC20.sol"; import {SafeTransferLib} from "@rari-capital/solmate/src/utils/SafeTransferLib.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IAaveV2StablecoinCellar} fro...
In case of an emergency or contract vulnerability, we don't want users to be able to deposit more assets into a compromised contract. Must calculate before assets are transferred in. Check for rounding error on `deposit` since we round down in previewDeposit. No need to check for rounding error if `mint`, previewMint r...
function _deposit(uint256 assets, uint256 shares, address receiver) internal returns (uint256, uint256) { if (isPaused) revert ContractPaused(); if (isShutdown) revert ContractShutdown(); shares > 0 ? assets = previewMint(shares) : shares = previewDeposit(assets); if (shares == 0) ...
265,685
./full_match/137/0xDc037A4291C7bB878e0299404216f19a71a66E54/sources/locker/unilocker.sol
withdraw all tokens from lock. Current time must be greater than unlock time lockId lock id to withdraw/
function withdraw(uint256 lockId) external { TokenLock storage lock = tokenLocks[lockId]; withdrawPartially(lockId, lock.tokenAmount); }
4,749,844
./partial_match/1/0xdB9da8e3BDdB845Fa52e369357c47630D9011741/sources/TridentDistribution.sol
Give an account permission to place orders. _orderDelegate The account to be approved./
function approveOrderDelegate(address _orderDelegate) onlyOwner external returns (bool) { bool delegateFound = false; for(uint i=0; i<orderDelegates.length; i++) { if(orderDelegates[i]==_orderDelegate) { delegateFound = true; break; } } if(!delegateFound) { orderDele...
3,911,827
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "../interfaces/IVault.sol"; import "../libraries/ERC20Extends.sol"; import "../l...
Divide two 18 decimals numbers bmul overflow badd require
function bdiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "ERR_DIV_ZERO"); uint256 c0 = a * BONE; require(a == 0 || c0 / a == BONE, "ERR_DIV_INTERNAL"); uint256 c1 = c0 + (b / 2); require(c1 >= c0, "ERR_DIV_INTERNAL"); uint256 c2 = c1 / b; ...
5,843,979
./partial_match/1/0x9dE44F26C011aA308f87C15943CbB514eBCB32D3/sources/ALLIN.sol
remove limits after token is stable
function updateandmanagelimits() external onlyOwner returns (bool){ limitsInEffect = false; transferDelayEnabled = false; return true; }
3,551,844
// 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 "./dtos/InvertibleTokenDTO.sol"; import "./interfaces/CERC20.sol"; /** * @titl...
Return the address of the contract of an invertible token. This is normally required for the investor to allow the {SmartDonation} contract to use its tokens./
function getTokenAddress(bytes32 _symbol) external view returns (address) { address tokenAddress = address(invertibleTokens[_symbol].token); require(tokenAddress != address(0), "Invalid token symbol"); return tokenAddress; }
1,031,760
/** *Submitted for verification at Etherscan.io on 2022-05-04 */ pragma solidity ^0.5.3; /** * @title ERC223Interface * @dev ERC223 Contract Interface */ contract ERC223Interface { function balanceOf(address who)public view returns (uint); function transfer(address to, uint value)public returns (bool success...
Send tokens to given address./ Updating tokens sent counter Sending allowed tokens amount Updating tokens sent counter Sending allowed tokens amount Updating tokens sent counter Sending allowed tokens amount
function sendTokens (address role,uint256 tokensToSend) private { if (tokensToSend > 0) { if(role == FOUNDERS_ADDRESS){ FOUNDERS_TOKEN_SENT = FOUNDERS_TOKEN_SENT.add(tokensToSend); ERC223Interface(maxxerToken).transfer(FOUNDERS_ADDRESS, tokensToSend); ...
6,774,768
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract OwnableDelegateProxy { } contract ProxyRegistry { mapping(address => Owna...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; import "../utils/Context.sol"; constructor() { _transferOwnership(_msgSender()); }
2,991
pragma solidity ^0.4.24; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ con...
Returns whether or not a user is blacklisted. _who The address of the account in question. return `true` if the user is blacklisted, `false` otherwise./
function isBlacklistedUser(address _who) public view returns (bool) { return (!hasUserPermission(_who, BURN_SIG) && hasUserPermission(_who, BLACKLISTED_SIG)); }
1,273,890
//Address: 0xdea2bc436d38d4f8ee6f9e63b63b72a399c24e2c //Contract name: VLBCrowdsale //Balance: 0 Ether //Verification Date: 12/16/2017 //Transacion Count: 822 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization con...
returns current token price based on current presale time frame/
function getConversionRate() public constant returns (uint256) { if (now >= startTime + 106 days) { return 650; return 676; return 715; return 780; return 845; } return 0; }
1,014,489
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; interface OrgV1 { function owner() external view returns (address _owner); } interface ERC721 { event Transfer( address indexed _from, address indexed _to, uint256 indexed _tokenId); event Approval( address ...
Enable or disable approval for a third party ("operator") to manage all of `msg.sender`'s assets multiple operators per owner. _operator Address to add to the set of authorized operators _approved True if the operator is approved, false to revoke approval
function setApprovalForAll(address _operator, bool _approved) external override { require(msg.sender != _operator, "Reward: Approve to caller"); _operatorApprovals[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); }
15,815,398
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: OpenZeppelin/openzeppelin-contracts@3.4.0/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is un...
Set some Astrada aside/
function reserveTokens(uint256 _reserveAmount) public onlyOwner { uint supply = totalSupply(); require( _reserveAmount > 0 && _reserveAmount + supply <= MAX_SUPPLY, "Not enough reserve left for team" ); for (uint256 i = 0; i < _reserveAmount; i++) { ...
13,771,731
//Address: 0x6a2e025f43ca4d0d3c61bdee85a8e37e81880528 //Contract name: test //Balance: 0 Ether //Verification Date: 2/8/2018 //Transacion Count: 5 // CODE STARTS HERE pragma solidity ^0.4.0; contract test{ struct SeedComponents{ uint component1; uint component2; uint component3; ...
DEBUG, DELETE BEFORE DEPLOYMENT!!
function _myLuckyNumber() constant returns(uint n){ n = luckyNumberOfAddress(msg.sender); }
5,356,339
pragma solidity ^0.4.24; /** * @title Math * @dev Assorted math operations */ library Math { function max64(uint64 a, uint64 b) internal pure returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal pure returns (uint64) { return a < b ? a : b; } function max256(ui...
adjust token holder balance at checkpoint after a token transfer _investor address of the token holder affected/
function adjustBalanceCheckpoints(address _investor) internal { adjustCheckpoints(checkpointBalances[_investor], balanceOf(_investor)); }
319,751
// File: @openzeppelin\contracts-ethereum-package\contracts\utils\Address.sol pragma solidity ^0.5.5; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume t...
Calculates the amount that has already vested. token ERC20 token which is being vested/
function _vestedAmount(IERC20 token) private view returns (uint256) { uint256 currentBalance = token.balanceOf(address(this)); uint256 totalBalance = currentBalance.add(_released[address(token)]); if (block.timestamp < _cliff) { return 0; } else if ( block.ti...
485,359
pragma solidity 0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; require(a == 0 || c / a == b); return c; } fun...
Batch issue tokens on the presale _addresses addresses that the presale tokens will be sent to. _addresses the amounts of tokens, with decimals expanded (full).
function issueTokensMulti(address[] _addresses, uint256[] _tokens) public onlyOwner inProgress { require(_addresses.length == _tokens.length); require(_addresses.length <= 100); for (uint256 i = 0; i < _tokens.length; i = i.add(1)) { doIssueTokens(_addresses[i], _tokens[i]); ...
12,791,524
// File: contracts/sol4/ERC20Interface.sol pragma solidity 0.4.18; // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) p...
first 128 bits is value for x, next 128 bits is value for y
function encodeStepFunctionData(int128 x, int128 y) internal pure returns(int data) { require(x <= MAX_STEP_VALUE && x >= MIN_STEP_VALUE); require(y <= MAX_STEP_VALUE && y >= MIN_STEP_VALUE); data = int(uint(y) & (POW_2_128 - 1)); data |= int((uint(x) & (POW_2_128 - 1)) * POW_2_128);...
1,654,636
pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract PiBetaToken { // Public variables of the token string public name = "PiBeta Token"; string public symbol = "PBTK"; uint8 public decimals = 0;...
Constrctor function Initializes contract with initial supply tokens to the creator of the contract/
function PiBetaToken() public { creator = msg.sender; }
7,626,622
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; pragma experimental ABIEncoderV2; // Forked from Compound // See https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol contract GovernorAlpha { /// @notice The name of this contract // solhin...
solhint-disable-next-line not-rely-on-time
function state(uint proposalId) public view returns (ProposalState) { require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; ...
1,503,750
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Combines adding liquidity to the given Swap, and calls deposit() on the bridge using that LP token to address on other chain to bridge assets to chainId which chain to bridge assets onto token ERC20 compatible token to deposit into the bridge liquidityAmounts the amounts of each token to add, in their native precis...
function zapAndDeposit( address to, uint256 chainId, IERC20 token, uint256[] calldata liquidityAmounts, uint256 minToMint, uint256 deadline ) public { for (uint256 i = 0; i < baseTokens.length; i++) { if (liquidityAmounts[i] != 0) { baseTokens[i].safeTransferFrom( ...
533,808
./full_match/43113/0x78F2fA9890450B1b38452F5467301357A949aEb5/sources/LendingPool_flat.sol
mint it 1:1 to the amount put inuint256 isFirstDeposit = balances[msg.sender].isFirstDeposit;if (isFirstDeposit == 0) { get fee set first deposit to false balances[msg.sender].isFirstDeposit = 1;} Updates User balancebalances[msg.sender].balance = balances[msg.sender].balance.add(_amount); Update total deposited in ...
function deposit(uint256 _amount) external { require(_amount > 0, "Can't deposit 0"); _mint(msg.sender, _amount); IERC20(poolToken).safeTransferFrom(msg.sender, address(this), _amount); }
7,130,077
./full_match/42/0x120A2E53bf7010ebEb31fAe960672D1DF21D2Ab6/sources/browser/flashloan.sol
INSERT YOUR USE CASE HERE
function executeOperation( address _reserve, uint256 _amount, uint256 _fee, bytes calldata _params ) external { uint256 totalDebt = _amount.add(_fee); transferFundsBackToPoolInternal(_reserve, totalDebt); }
16,292,408
/** *Submitted for verification at Etherscan.io on 2021-11-17 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } pragma solidity ^0.8.0; interface IERC721 is IERC165 { event Transfer(address inde...
============================================================================= =============================================================================
function withdraw() public payable onlyOwner { require(os); }
2,038,422
./partial_match/1/0x0649CFFa638931612649DfACE45bc8554e1be176/sources/Muntface_Decal.sol
Calldata version of {processProof} _Available since v4.7._/
function processProofCalldata( bytes32[] calldata proof, bytes32 leaf ) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; }
3,697,561
./partial_match/1/0xf52AE7868e01074EaAd587060d75e996baed9aEF/sources/contracts/aggregator/mainnet/flashloan/main.sol
Middle function for route 2. Middle function for route 2. _token token address for flashloan(DAI). _amount DAI amount for flashloan. _data extra data passed./
function routeMaker( address _token, uint256 _amount, bytes memory _data ) internal { address[] memory tokens_ = new address[](1); uint256[] memory amounts_ = new uint256[](1); tokens_[0] = _token; amounts_[0] = _amount; bytes memory data_ = abi.e...
4,240,655
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; // TODO(asa): Move to uint128 if gas savings are significant enough. library FractionUtil { using SafeMath for uint256; using FractionUtil for Fraction; struct Fraction { uint256 numerator; uint256 denominator; } f...
Returns an integer that is the fraction time an integer. x A Fraction struct. y An integer. return x y/
function mul(Fraction memory x, uint256 y) internal pure returns (uint256) { return x.numerator.mul(y).div(x.denominator); }
14,092,400
pragma solidity ^0.4.1; pragma experimental ABIEncoderV2; import "../lib/Issuer"; //we import the issuer for validating an attesters key /* The purpose of this contract is to manage the list of attestation * issuer contracts and their capacity to fulfil requirements */ contract ManagedListERC { /* a manager is the...
hash address plus block.timestamp + name
function createList(List list) public { require(msg.sender == manager); bytes32 list_id = keccak256(abi.encodePacked(msg.sender, block.timestamp, list.name)); lists[list_id].push(list); }
12,553,588
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed p...
Call this function to redeem a gift of ETH. Tested in test/test_redeem.js The giftID should be 0 or positive The gift must exist and must not have already been redeemed The recipient must be the caller of this function The current datetime must be the same or after the expiry timestamp The amount must be positive becau...
function redeem (uint giftId) public { require(giftId >= 0); require(isValidGift(giftIdToGift[giftId])); address recipient = giftIdToGift[giftId].recipient; require(recipient == msg.sender); require(now >= giftIdToGift[giftId].expiry); uint amount = giftIdToGift[...
14,099,818
pragma solidity ^0.5.0; contract EthIpfsPoe { // Maps - proofs need wiring up mapping (bytes32 => bool) private proofs; mapping (address => string) ipfsInbox; // Events event ipfsSent(string _ipfsHash, address _address); event inboxResponse(string response); // Modifier: checks if inbox is full or not...
calculate and store the proof for a file - wire up into React state
function notarize(string calldata file) external { bytes32 proof = proofFor(file); storeProof(proof); }
13,018,948
./full_match/97/0x29128dEF2dbb6eE43e3Ea3eE2d708376A5689a53/sources/project_/contracts/Learning.sol
uint256 pendingReward
function GetData(address user) public view returns( uint256 maxLevel, uint256[] memory priceUpgrateLevel, uint256 delayBlockLearn, uint256 totalBlockLearn, uint256[] memory rewardPerBlockOfLevel, uint256 tokenId, uint256 levelRobotJoin, uint256 blockNu...
3,280,802
pragma solidity ^0.5.0; import "./Authors.sol"; /// @title Decentralized Research Publishing Platform , Paper's Smart contract /// @author Farhan Hameed Khan (farhankhan@blockchainsfalcon.com | farhanhbk@hotmail.com) /// @dev The main purpose of this contract is to store a paper information along its history and v...
isReviewerAlreadyAssigned - Verify if the caller who wants to get assigned on this paper is already assigned on this paper. Otherwise return false. _paperId the paper id return bool returns true if the reviewer is already assigned on this paper id otherwise false./ check if this reviewer exist already inside...
function isReviewerAlreadyAssigned(uint _paperId) public view returns(bool ret) { if(paperFiles[_paperId].totalReviewer>0) { for(uint loop =0; loop<paperFiles[_paperId].totalReviewer; loop++) { if(paperFiles[_paperId].reviewers[loop]==tx.origin) ...
13,027,334
/* Copyright 2020, 2021 Empty Set Squad <emptysetsquad@protonmail.com> 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 req...
Update the allowance of `spender` for `owner` to `value` based on a signed EIP712 message Will revert if: (1) The permit's nonce is different than expected (2) The deadline has passed (3) The permit signature is invalid owner Owner that is allowing approval spender Spender to approve for `owner` v...
function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external { bytes32 digest = LibEIP712.hashEIP712Message( DOMAIN_SEPARATOR, keccak256(abi.encode( ...
12,877,997
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually...
Shutdown contract operations, if not already shutdown.
function _shutdown() internal virtual whenNotShutdown { stopEverything = true; paused = true; emit Shutdown(_msgSender()); }
159,235
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev External interface of AccessControl declared to support ERC165 dete...
Redeem `amountInUnderlying` aToken, since 1 aToken = 1 stablecoin Transfer `amountInUnderlying` stablecoin to `msg.sender`
function withdraw(uint256 amountInUnderlying) external override onlyOwner returns (uint256 actualAmountWithdrawn) { require(amountInUnderlying > 0, "AaveMarket: amountInUnderlying is 0"); ILendingPool lendingPool = ILendingPool(provider.getLendingPool()); ...
6,963,503
./full_match/1/0x1091588Cc431275F99DC5Df311fd8E1Ab81c89F3/sources/contracts/vault/VaultCore.sol
Calculate the outputs for a redeem function, i.e. the mix of coins that will be returned/
function calculateRedeemOutputs(uint256 _amount) external view returns (uint256[] memory) { (uint256[] memory outputs, ) = _calculateRedeemOutputs(_amount); return outputs; }
2,958,588
./full_match/80001/0x3d2c839CeA58d6B3473caF39B9280eDF627189F8/sources/project_/contracts/SaleExchangeRate.sol
swap of the token to security. make swap, emit BuyTokensEvent _amountOfSecurities amount of securities you want to buy _stableCoinAddress address of the token to buy security. Token has to be Allowed. return true if the operation done successfully
function buyToken( uint256 _amountOfSecurities, address _stableCoinAddress ) public virtual onlyActive onlyAllowedTokens(_stableCoinAddress) returns (bool) { uint256 balanceBefore = IERC20(_stableCoinAddress).balanceOf( address(this...
9,521,172
./full_match/137/0x273b3c6f4796F97281A99aD6BcC366C15dEFBf22/sources/GGL_Tokne_Test/GGLToken.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "GGL::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0...
4,741,569
pragma solidity ^0.5.0; // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @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(uint25...
Can be called by owner to end the crowdsale manually
function endCrowdsale() public onlyOwner onlyActive { updateFromAssetToken(); crowdsaleData.state = CrowdsaleL.State.Ended; emit Ended(); }
1,083,316
pragma solidity ^0.4.18; contract owned { address _owner; function owner() public constant returns (address) { return _owner; } function owned() public { _owner = msg.sender; } modifier onlyOwner { require(msg.sender == _owner); ...
Set allowance for other address and notify Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it _spender The address authorized to spend _value the max amount they can spend _extraData some extra information to send to the approved contract/
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; ...
12,708,822
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/EnumerableMap.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@open...
transfer bmiX from staking to the user
function withdrawFundsWithProfit(uint256 tokenId) public override { address policyBookAddress = _stakersPool[tokenId].policyBookAddress; require(policyBookAddress != address(0), "BDS: Token doesn't exist"); require(ownerOf(tokenId) == _msgSender(), "BDS: Not a token owner"); _trans...
1,056,600
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/introspection/IERC165.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/con...
Method for listing NFT bundle _bundleID Bundle ID _nftAddresses Addresses of NFT contract _tokenIds Token IDs of NFT _quantities token amounts to list (needed for ERC-1155 NFTs, set as 1 for ERC-721) _price sale price for bundle _startingTime scheduling for a future sale
function listItem( string memory _bundleID, address[] calldata _nftAddresses, uint256[] calldata _tokenIds, uint256[] calldata _quantities, address _payToken, uint256 _price, uint256 _startingTime ) external { bytes32 bundleID = _getBundleID(_bundl...
125,401
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import './BLOBLeague.sol'; import './BLOBPlayer.sol'; import './BLOBRegistry.sol'; import './BLOBTeam.sol'; import './BLOBMatch.sol'; import './BLOBUtils.sol'; contract BLOBSeason is WithRegistry { enum SeasonState { ACTIVE, ENDSEASON, DR...
clears previous season's schedules reset nextAvailableRound reset playMinutesInSeason
function StartSeason(SeasonSchedule calldata _seasonSchedule) external leagueOnly inState(SeasonState.PRESEASON) { delete matchList; uint8 teamCount = TeamContract.teamCount(); if (teamCount < 2) revert(uint8(BLOBLeague.ErrorCode.SEASON_NOT_ENOUGH_TEAMS).toStr()); for (uint8 ...
7,277,604
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./ICryptoBees.sol"...
SPDX-License-Identifier: MIT LICENSE
interface IHoney { function mint(address to, uint256 amount) external; function mintGiveaway(address[] calldata addresses, uint256 amount) external; function burn(address from, uint256 amount) external; function disableGiveaway() external; function addController(address controller) external; ...
10,075,431
./full_match/1/0xBb504b48106251ebA3c57b4e7F2983dc4297e38E/sources/duckfi.sol
see when NFTs will be revealed
function timeOfReveal() public view returns(uint256) { require(revealTime != 0, 'NFT Reveal Time has not been determined yet!'); return revealTime; }
5,015,933
pragma solidity ^0.5.10; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /// @dev A cryptocurrency safe against overflow exploits contract SafeMintable is Ownable { using SafeMath for uint256; event Transferred(address recipient, uint256 amount); ...
Destroy currency from the account of the owner.
function burn(uint256 amount) public { balances[msg.sender] = balances[msg.sender].sub(amount); emit Burnt(amount); }
7,319,348
pragma solidity ^0.4.18; /** * @title InteractiveCrowdsaleLib * @author Majoolr.io * * version 1.0.0 * Copyright (c) 2017 Majoolr, LLC * The MIT License (MIT) * https://github.com/Majoolr/ethereum-libraries/blob/master/LICENSE * * The InteractiveCrowdsale Library provides functionality to create a crowdsale ...
If the address' personal cap is below the pointer, refund them all their ETH. if it is above the pointer, calculate tokens purchased and refund leftoever ETH self Stored crowdsale from crowdsale contract return bool success if the contract runs successfully calculate the fraction of each minimal valuation bidders...
function retreiveFinalResult(InteractiveCrowdsaleStorage storage self) internal returns (bool) { require(now > self.base.endTime); require(self.base.hasContributed[msg.sender] > 0); uint256 numTokens; uint256 remainder; bool err; if (self.valueCommitted < self.minimumRaise) { self.base...
1,761,627
./full_match/43114/0xEcD8046616bC11E9074E4c1cF2fE4984B4901021/sources/AvaxPump.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WAVAX(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForAVAXSupportingFe...
4,538,082
./full_match/80001/0xdCdf0B3d68A4E11eF2703b87020dC5a9c66babf7/sources/@superfluid-finance/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol
Delete flow with context token The token to flow sender The sender of the flow receiver The receiver of the flow ctx Context bytes (see ISuperfluid.sol for Context struct)/
function deleteFlowWithCtx( ISuperToken token, address sender, address receiver, bytes memory ctx ) internal returns (bytes memory newCtx) { (ISuperfluid host, IConstantFlowAgreementV1 cfa) = _getAndCacheHostAndCFA(token); (newCtx, ) = host.callAgreementWithContex...
855,969
pragma solidity ^0.5.0; import "./libs/ListAsRingLib.sol"; import "./libs/EntityLib.sol"; import "./libs/AddressIndexLib.sol"; import "./libs/StringIndexLib.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; contract HallOfFame is Ownable { using EntityLib for EntityLib.Entities; using Lis...
Get donator. _id donator id. return uint, string/
function getDonator(uint _id) external view returns ( uint id, string memory data, uint version, string memory index ) { (id, data, version) = donators.get(_id); return (id, data, version, donatorIndexes.getIndex(_id)); }
12,636,173
/** *Submitted for verification at Etherscan.io on 2021-07-25 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of...
return the token being sold./
function token_() public view returns (RC) { return _token; }
10,869,632
pragma solidity 0.4.24; import "@aragon/templates-shared/contracts/TokenCache.sol"; import "@aragon/templates-shared/contracts/BaseTemplate.sol"; import "./CounterApp.sol"; contract Template is BaseTemplate, TokenCache { string constant private ERROR_EMPTY_HOLDERS = "TEMPLATE_EMPTY_HOLDERS"; string constant...
Next we install and create permissions for the placeholder-app-name app--------------------------------------------------------------
function _setupCustomApp( Kernel _dao, ACL _acl, Voting _voting ) internal { CounterApp app = _installCounterApp(_dao); _createCounterAppPermissions(_acl, app, _voting, _voting); }
15,867,900
pragma solidity 0.4.24; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also teste...
Allocate tokens to provided investors/
function allocateTokens(address[] _investors) public onlyOwner { require(_investors.length <= 50); for (uint i = 0; i < _investors.length; i++) { allocateTokensInternal(_investors[i]); } }
5,424,183
./partial_match/1/0x11F5699B7fDf967b9cCea7AF7B683cA87406e2c2/sources/PayBurn.sol
------------------------------------------------------------------------ Burn the ``value` amount of tokens from the `account` ------------------------------------------------------------------------
function burnTokens(uint256 value, address from) internal{ _totalSupply = _totalSupply.sub(value); emit Transfer(from, address(0), value); }
4,152,323
/** *Submitted for verification at Etherscan.io on 2022-03-21 */ // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.2.0 pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Imple...
payable(msg.sender).transfer(balance);
function withdraw() public onlyOwner { uint256 balance = address(this).balance; uint256 treasuryCut = balance.mul(70).div(100); uint256 devCut = balance.mul(30).div(100); payable(treasury).transfer(treasuryCut); payable(mintwallet).transfer(devCut); }
166,803
pragma solidity >=0.5.0 <0.6.0; /** Author: Sik Jean Soon **/ /** * @title SafeMath for uint256 * @dev Math operations with safety checks that throw on error */ library SafeMathUint256 { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) inter...
Perform remote call Check the error string is available or not
function confirm(uint256 _transactionCode) external onlyWallet onlyEligible(_transactionCode) onlySignable(_transactionCode) returns (bool) } function revoke(uint256 _transactionCode) external onlyWallet onlyEligible(_transactionCode) returns (bool) ...
15,810,865
// the azimuth logic contract // https://azimuth.network pragma solidity 0.4.24; //////////////////////////////////////////////////////////////////////////////// // Imports //////////////////////////////////////////////////////////////////////////////// // OpenZeppelin's Ownable.sol /** * @title Ownable * @dev...
getEscapeRequestsCount(): returns the number of points _sponsor is providing service to
function getEscapeRequestsCount(uint32 _sponsor) view external returns (uint256 count) { return escapeRequests[_sponsor].length; }
1,053,531
pragma solidity 0.5.8; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; import 'openzeppelin-solidity/contracts/lifecycle/Pausable.sol'; /* * @title OnlineMarket * * @dev This contract allows the addition and removal of admins and storefront owners * */ contract OnlineMarket is Ownable, Pausable{ ...
Function is to approve the Stores storeOwner address/Updated mapping with status of approval remove it from requested store owners Add it to approved store owners
function approveStoreOwners(address storeOwner) public onlyAdmin whenNotPaused{ storeOwnerApprovalMapping[storeOwner] = true; removeRequestedStoreOwner(storeOwner); approvedStoreOwners.push(storeOwner); approvedStoreOwnersIndex[storeOwner] = approvedStoreOwners.length-1; emit...
14,123,465
./full_match/1/0xbaC6cf0eA269522002B3989AC4E89305433A9ED5/sources/contracts/AddictionBets.sol
only use to disable contract sales if absolutely necessary (emergency use only)
function updateSwapEnabled(bool enabled) external onlyOwner(){ tradingActive = enabled; }
9,767,387
./partial_match/1/0xdEd5B4faFF35547628C303CE0752bC690ac02810/sources/brAIn.sol
get balance of liquidity pair calculate amount to burn pull tokens from liquidity and move to dead address permanently
function manualBurnLiquidityPairTokens(uint256 percent) external onlyOwner returns (bool) { require(block.timestamp > lastManualLpBurnTime + manualBurnFrequency , "Must wait for cooldown to finish"); require(percent <= 100, "May not burn more than 1% of tokens in LP"); lastManualLpBurnTime =...
2,781,270
./full_match/69/0x3Fac11956cF3d574Fd490fA50106fE8aCA478232/sources/node_modules/_thirdweb-dev/contracts/base/ERC721Base.sol
Lets an authorized address mint an NFT to a recipient. The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs. _to The recipient of the NFT to mint. _baseURI The baseURI for the NFT minted. The metadata for the NFT is `baseURI/tokenId`/
function mint(address _to, string memory _baseURI) public virtual { require(_canMint(), "Not authorized to mint."); _batchMintMetadata(nextTokenIdToMint(), 1, _baseURI); _safeMint(_to, 1, ""); }
13,239,187