file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256...
`msg.sender` approves `_spender` to send `_amount` tokens on its behalf, and then a function is triggered in the contract that is being approved, `_spender`. This allows users to use their tokens to interact with contracts in one function call instead of two _spender The address of the contract able to transfer the...
function approveAndCall(address _spender, uint256 _amount, bytes _extraData ) public returns (bool success) { require(approve(_spender, _amount)); ApproveAndCallFallBack(_spender).receiveApproval( msg.sender, _amount, this, _extraData ); ...
2,528,773
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; // Certik DCK-01 import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract DebloxNFT is ERC721Enum...
One time reserve function And the reserved amount can be only set when contract is created/
function reserve() public onlyOwner { require(!reserved, "NA1"); reserved = true; uint i; for (i = 0; i < rNFT; i++) { _tokenIds.increment(); uint256 newItemId = _tokenIds.current(); addrMinted[msg.sender]++; _safeMint(msg.sender...
7,218,784
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.7.4; interface INiftyswapFactory20 { /***********************************| | Events | |__________________________________*/ event NewExchange(address indexed token, address indexed currency, uint256 indexed salt, address exch...
Deposit ERC20 tokens or ETH in this contract to receive wrapped ERC20s _token The addess of the token to deposit in this contract _recipient Address that will receive the ERC-1155 tokens _value The amount of token to deposit in this contract Note: Users must first approve this contract addres on the contract...
function deposit(address _token, address _recipient, uint256 _value) public payable { require(_recipient != address(0x0), "MetaERC20Wrapper#deposit: INVALID_RECIPIENT"); uint256 id; if (_token != ETH_ADDRESS) { require(msg.value == 0, "MetaERC20Wrapper#deposit: NON_NULL_MSG_VALUE"); I...
5,748,578
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.8.3 https://hardhat.org // File contracts/Math/Math.sol /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ ...
Two different withdrawLocked functions are needed because of delegateCall and msg.sender issues (important for migration)
function withdrawLocked(bytes32 kek_id, address destination_address) nonReentrant external { require(withdrawalsPaused == false, "Withdrawals paused"); _withdrawLocked(msg.sender, destination_address, kek_id); }
193,540
/** *Submitted for verification at Etherscan.io on 2019-09-24 */ pragma solidity >=0.4.22 <0.6.0; // // * whitebetting.com - the whitest football betting game based on ethereum blockchain // on 2019-09-24 // contract WhiteBetting { mapping(address => uint) public lockTime_intou9; function increaseLockTime_intou9(...
Save the game information
function setGameInfo (uint64 _fixtureId, uint256 _timestamp, uint32 _odd_homeTeam, uint32 _odd_drawTeam, uint32 _odd_awayTeam, uint32 _odd_over, uint32 _odd_under, uint32 _odd_homeTeamAndDraw, uint32 _odd_homeAndAwayTeam , uint32 _odd_awayTeamAndDraw, uint8 _open_status ) external onlyOwner { gameList[_fixtureId]...
2,493,088
/* file: Base.sol ver: 0.2.1 updated:18-Nov-2016 author: Darryl Morris (o0ragman0o) email: o0ragman0o AT gmail.com An basic contract furnishing inheriting contracts with ownership, reentry protection and safe sending functions. This software is distributed in the hope that it will be useful, but WITH...
Returns the number of elements in the list
function sizeOf(CLL storage self) internal constant returns (uint r) { int i = step(self, HEAD, NEXT); while (i != HEAD) { i = step(self, i, NEXT); r++; } return; }
1,055,314
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/utils/EnumerableSet.sol'; import '@openzeppelin/contracts/utils/ReentrancyGuard.sol...
Set new PremiaUncut token address _uPremia New uPremia contract
function setPremiaUncutErc20(IPremiaUncutErc20 _uPremia) external onlyOwner { uPremia = _uPremia; }
7,322,734
// File: @openzeppelin\contracts-ethereum-package\contracts\math\SafeMath.sol pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assum...
This is a placeholder, which may be overrided to notify other contracts of PTK balance change/
function userBalanceChanged(address /*account*/) internal { }
33,245
./partial_match/1/0xF9f7234c2B5E000D38759eFbc104f413e1Dc17f1/sources/src/ERC20Token.sol
Override transferFrom to add whenNotPaused and notBlacklisted check. Make a function callable only when the contract is not paused and account is not blacklisted./
function transferFrom( address from, address to, uint256 amount ) public whenNotPaused notBlacklisted(msg.sender) notBlacklisted(from) notBlacklisted(to) override returns (bool) { _spendAllowance(from, _msgSender(), amount); _transfer(from, to, amount); return tru...
15,602,531
./partial_match/1/0xF36399Bf8CB0f47e6e79B1F615385e3A94C8473a/sources/contracts/utils/CreditLib.sol
see ILineOfCredit._repay called by LineOfCredit._repay during every repayment function uses uncheckd math. assumes checks have been done in caller credit - The lender position being repaid/ update individual credit line denominated in token if we arent using funds from reserves to repay then pull tokens from target
function repay( ILineOfCredit.Credit memory credit, bytes32 id, uint256 amount, address payer ) external returns (ILineOfCredit.Credit memory) { if (!credit.isOpen) { revert PositionIsClosed(); } unchecked { if (amount > credit.pri...
4,128,976
/** *Submitted for verification at Etherscan.io on 2021-11-16 */ // https://t.me/Dogeball_Official // File: openzeppelin-solidity\contracts\GSN\Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; interface IUniswapV2Router { function factory() external pure returns (address); function WETH...
return The marketing wallet/
function marketingWallet() external view returns (address) { return _marketingWallet; }
10,878,028
./full_match/43113/0x72298bEF4291ab51D19C307B6313192a9E0E00E8/sources/MMarket.sol
Sell MMarket via function. | Alternatively called on token recieved via transfer to contract.
function sellShares(uint256 amount) external returns(bool sold){ sold = _sellViaCircValue(msg.sender,amount); }
7,195,418
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol"; import "openzeppelin-solidity/contracts/access/SignatureBouncer.sol"; import "../token/GameToken.sol"; import "../payment/RefundEscrowWithFee.sol"; import "../crowdsale/distribution/RefundableCrowdsaleWithFee.sol"...
Disable token minting from this point Re-enable transfers and burn after the token sale. Transfer ownership of the token to the owner of the crowdsale
function finalization() internal onlyOwner { super.finalization(); GameToken(token).finishMinting(); GameToken(token).unpause(); GameToken(token).transferOwnership(owner); }
12,586,486
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that ...
Only callable by owner payout address for royalties payouts bps bps for royalties
function setNewRoyaltyConfig(address payout, uint16 bps) external onlyOwner { royaltyConfig.payout = payout; royaltyConfig.bps = bps; emit RoyaltyUpdate(royaltyConfig.payout, royaltyConfig.bps); }
10,374,537
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "../libraries/LibAppStorage.sol"; import "../../shared/interfaces/IERC20.sol"; import "../libraries/LibStrings.sol"; import "../libraries/LibSVG.sol"; import "../../shared/libraries/LibDiamond.sol"; import "../../shared/lib...
Check if trait boosts from consumables are still valid
function getNumericTraits(uint256 _tokenId) public view returns (uint256 numericTraits_) { int256 boostDecay = int256((block.timestamp - s.aavegotchis[_tokenId].lastTemporaryBoost) / 24 hours); uint256 temporaryTraitBoosts = s.aavegotchis[_tokenId].temporaryTraitBoosts; uint256 numericTraits...
7,305,946
// SPDX-License-Identifier: MIT /** * Author: Lambdalf the White */ pragma solidity 0.8.10; import '../../interfaces/IERC721.sol'; import "../../interfaces/IERC721Receiver.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extensio...
Safely transfers `tokenId_` token from `from_` to `to_`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. `data_` is additional data, it has no specified format and it is sent in call to `to_`. This internal function is equivalent to {safeTransferFrom...
function _safeTransfer( address from_, address to_, uint256 tokenId_, bytes memory data_ ) internal virtual { if ( to_ == address( 0 ) ) { revert IERC721_NULL_ADDRESS_TRANSFER(); } _transfer( from_, to_, tokenId_ ); if ( ! _checkOnERC721Received( from_, to_, tokenId_, data_ ) ) { revert IERC721_NON_ERC72...
5,431,506
pragma solidity ^0.4.21; /** * @title LinkedListLib * @author Darryl Morris (o0ragman0o) and Modular.network * * This utility library was forked from https://github.com/o0ragman0o/LibCLL * into the Modular-Network ethereum-libraries repo at https://github.com/Modular-Network/ethereum-libraries * It has been upd...
------------------------------------------------------------------------ Calculates the number of tokens (in unsigned integer form [decimals included]) corresponding to the weiValue passed, using the ratio specified ------------------------------------------------------------------------
function calculateTokensFromWei(uint weiValue, uint ratio) public view returns (uint numTokens) { uint calc1 = safeMul(weiValue, ratio); uint ethValue = calc1 / _factorDecimalsEthToToken; return ethValue; }
620,698
./partial_match/42/0xcaEE7DaA8C6f56Fa8DCdC5b77b2178DBc374e25C/sources/LavaWallet.sol
transfer the tokens to the 'to' field address
function transferTokensWithSignature(bytes memory methodName, address relayAuthority, address from, address to, address token, uint256 tokens,uint256 relayerRewardTokens,uint256 expires,uint256 nonce, bytes memory signature) public returns (bool success) { require(bytesEqual('transfer',(methodName)), 'Invalid...
8,978,781
./partial_match/1/0x525D99c078A7fC2Fced026f10FbC8cDC4dFB0051/sources/SKID.sol
at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
function _transfer( address from, address to, uint256 amount ) internal override { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); if (amount == 0) { super._transf...
3,628,603
//SPDX-License-Identifier: GPL-3.0 pragma solidity 0.7.3; import { IManualVolatilityOracle } from "../interfaces/IManualVolatilityOracle.sol"; import {IPriceOracle} from "../interfaces/IPriceOracle.sol"; import {DSMath} from "../libraries/DSMath.sol"; import {IERC20Detailed} from "../interfaces/IERC20Detailed.sol"...
Takes the absolute value of a given number Helper function _number The specified number return The absolute value of the number/
function abs(int256 _number) public pure returns (uint256) { return _number < 0 ? uint256(_number * (-1)) : uint256(_number); }
1,507,867
./full_match/5/0xDf3Be2F09DE440498ca5332b0eD3c5E83FD82b5A/sources/raffle.sol
Returns Illuvium Beta Raffle winners' keccak256 hashes of email addresses. return Illuvium Beta Raffle winners/
function getWinners() external view returns (bytes32[] memory) { return s_winners.values(); }
1,955,639
./full_match/421613/0x2b72e129C512db36F35adD5BE0911011Ae7b79e0/sources/project_/contracts/Settler.sol
uint256 settlerFees0;uint256 settlerFees1; accrue the fees towards the token holder's token ID
function settle( address payable pairAddress, uint256 positionId, uint256 tokenId ) public nonReentrant { require(supportedPairs[pairAddress], "pool not initiated by settler"); require(IUniV3TradingPair(pairAddress).getActivityStatus(positionId), "position is ...
11,569,263
./partial_match/42220/0x2c116311F91F5Da1f5E0563402ac1f0882587dEA/sources/src/grants/ImpactVault.sol
TODO: make this more robust, check a mapping or array instead
function isSupportedToken(address _token) public view returns (bool) { return _token == address(getGoldToken()) || _token == address(getStableToken()); }
3,495,963
./full_match/1/0x84fE05f541cee93d0B02e03cD4319c29BA0030A2/sources/src/rollup/RollupCore.sol
return Ethereum block that the most recent stake was created
function lastStakeBlock() external view override returns (uint64) { return _lastStakeBlock; }
3,877,373
./full_match/44787/0x8D38DA4eb0315582013D42a909db8076a79de277/sources/contracts/StarFarm.sol
View function to see pending STARs on frontend of nft.
function nftPendingStar(address _user,uint256 _tokenId) external view returns (uint256,uint256) { PoolInfo storage pool = poolInfo[0]; UserInfo storage user = userInfo[0][_user]; uint256 accStarPerShare = pool.accStarPerShare; uint256 lpSupply = pool.lpSupply.add(pool.extraAmount); ...
13,246,214
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.6.11; // File: @openzeppelin/contracts/utils/EnumerableSet.sol pragma solidity ^0.6.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - ...
Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role./
function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); }
2,056,031
// SPDX-License-Identifier: None // All rights reserved. @2022 /* __ ___ _ _ _____ _ _ \ \ / / | (_) | / ____| | | | | \ \ /\ / /| |__ _| |_ ___| | _ _| |__ ___| | ___ ___ ___ \ \/ \/ / | '_ \| | __/ ...
Admin can withdraw ETH to admin account
function withdrawAll() public onlyAdmin { uint256 balance = address(this).balance; require(balance > 0); _withdraw(admin, balance); }
6,085,906
./partial_match/100/0xe622347DCf5a6403383ED99a8078F58d682E27eD/sources/Centaur.sol
States: 1 = created, 2 = refunded, 3 = completed/
function setJobState(uint256 _jobId, uint256 _state) external onlyWhitelistAdmin { jobIdStates[abi.encode(_jobId)] = _state; }
16,669,391
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; /// @notice Bilateral escrow for ETH and ERC20/721. /// @author LexDAO LLC. contract LexLockerLite { uint256 lockerCount; mapping(uint256 => Locker) public lockers; mapping(address => Resolver) public resolvers; /// @dev Events to assi...
Deposits tokens (ERC20/721) into escrow - locked funds can be released by `msg.sender` `depositor` - both parties can lock for `resolver`. receiver The account that receives funds. resolver The account that unlock funds. token The asset used for funds. value The amount of funds - if `nft`, the 'tokenId'. nft If 'f...
function deposit(address receiver, address resolver, address token, uint256 value, bool nft, string calldata details) external guard payable returns (uint256 registration) { require(resolvers[resolver].active, "resolver not active"); if (msg.value != 0) { require(msg.value == value, "Wro...
5,516,735
/** *Submitted for verification at Etherscan.io on 2021-02-19 */ /* .'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''.. .;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,. .;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,. .;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;...
Execute one single proposal transaction target The target address for call to be made during proposal execution value The value to be passed to the calls made during proposal execution signature The function signature to be passed during execution data The data to be passed to the individual function call eta The ...
function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signat...
6,656,524
pragma solidity ^0.4.11; /* Bancor Buyer ======================== Buys Bancor tokens from the crowdsale on your behalf. Author: /u/Cintix */ // ERC20 Interface: https://github.com/ethereum/EIPs/issues/20 contract ERC20 { function transfer(address _to, uint _value) returns (bool success); } // I...
Buys tokens in the crowdsale and rewards the caller, callable by anyone. Record that the contract has bought the tokens. Record the time the contract bought the tokens. Transfer all the funds (less the caller reward) to the Bancor crowdsale contract to buy tokens. Throws if the crowdsale hasn't started yet or has alrea...
function buy(){ bought_tokens = true; time_bought = now; CrowdsaleController(sale).contributeETH.value(this.balance - reward)(); msg.sender.transfer(reward); }
14,027,063
./full_match/1/0x434bAc5efbE635d1bA4284Cf9Fb0938c489C468F/sources/contracts/dependencies/yoga-labs/ApeCoinStaking.sol
Private Methods - shared logic
function _deposit(uint256 _poolId, Position storage _position, uint256 _amount) private { Pool storage pool = pools[_poolId]; _position.stakedAmount += _amount; pool.stakedAmount += _amount; _position.rewardsDebt += (_amount * pool.accumulatedRewardsPerShare).toInt256(); ap...
8,328,390
./full_match/1/0xB75d77f3614f80Bf422b058C1956A9646a6F74f5/sources/GlitchLegacy.sol
Dev minting function
function mintDev(uint256 quantity) external onlyOwner { require(totalSupply() + quantity <= MAX_SUPPLY, "Minting too many"); _safeMint(msg.sender, quantity); }
8,300,778
// 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-upgradeable/access/OwnableUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/token/ERC20/ERC20BurnableUp...
burn old knc and mint new knc for msg.sender, ratio 1:1
function mintWithOldKnc(uint256 amount) external { IERC20Burnable(oldKNC).burnFrom(msg.sender, amount); super._mint(msg.sender, amount); emit Migrated(msg.sender, amount); }
12,784,920
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./Initializable.sol"; import "./UsingRegistry.sol"; import "./FixidityLib.sol"; import "../stability/interfaces/ISortedOracles.sol"; /** * @title Stores and prov...
Set a multiplier that impacts how quickly gas price minimum is adjusted. Value is expected to be < 1./
function setAdjustmentSpeed(uint256 _adjustmentSpeed) public onlyOwner { adjustmentSpeed = FixidityLib.wrap(_adjustmentSpeed); require(adjustmentSpeed.lt(FixidityLib.fixed1()), "adjustment speed must be smaller than 1"); emit AdjustmentSpeedSet(_adjustmentSpeed); }
13,023,019
pragma solidity ^0.4.24; /** * @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 OwnershipRenounced(address indexed previousOwner); ...
Returns an URI for a given token ID Throws if the token ID does not exist. May return an empty string. _tokenId uint256 ID of the token to query/
function tokenURI(uint256 _tokenId) public view returns (string) { require(exists(_tokenId)); return tokenURIs[_tokenId]; }
151,319
./partial_match/3/0xd300396C7D6Bf35A8B0bEbABF1e8c78ddcBf33b5/sources/Bumblebee_BOT.sol
Withdraw for Token/
function withdrawToken(uint tokenAmount) onlyOwner public { require(tokenAmount <= _balances[address(this)]); _transfer(address(this),owner(),tokenAmount); }
5,121,370
...
inject NONSTANDARD NAMING
function ISCONTRACT215(address account) internal view returns (bool) {
12,602,592
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import '../utils/EnumerableSet.sol'; import '../utils/Address.sol'; import '../utils/Context.sol'; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. T...
Adds two unsigned integers, reverts on overflow./
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, 'SafeMath#add: OVERFLOW'); return c; }
389,919
pragma solidity >=0.4.21 <0.7.0; pragma experimental ABIEncoderV2; /* * Contract for storing and retrieving file details uploaded to the IPFS * P2P network. This is made thanks to a "mapping" data structure, which allows * storing all file's information. More information through the source * code below. */ contra...
When calling this function the field isTrash of the specified folder gets updated. In a recursive way also subfolders and inner files get updated./
function setTrashFolder(string memory uniqueId, bool isTrash, bool isSingleDelete) public { FileDetails[] storage filesDetails = filesList[msg.sender]; for(uint i = 0; i < filesDetails.length; i++){ if(keccak256(bytes(filesDetails[i].uniqueId)) == keccak256(bytes(uniqueId))){ ...
12,718,038
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../infiniteProxy/proxy.sol"; contract InstaVault is Proxy { constructor(address admin_, address dummyImplementation_) Proxy(admin_, dummyImplementation_) {} } // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./events.s...
Returns bytes4[] sigs from implementation address. If implemenatation is not registered then returns empty array./
function _getImplementationSigs(address implementation_) internal view returns (bytes4[] memory) { bytes32 slot_ = _getImplSigsSlot(implementation_); return getSigsSlot(slot_).value; }
10,378,433
./full_match/4/0xc666C4d35Fa7399ef2506Fd4f4C0218680df8a3C/sources/contracts/1_Storage.sol
CORE
function mine(uint256 amount) public payable { require(amount > 0, "zero"); uint256 fee = amount.mul(miningFeeNumerator).div(miningFeeDenominator); require(msg.value == fee, "invalid fee"); feeCollector.transfer(msg.value); if (block.number > minerBlockLastClaimedOn[msg.sende...
13,324,200
/// SPDX-License-Identifier: Unlicensed pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access...
Mint special characters not available during the presale nor general sale
function mintSpecialCharacter(uint256 characterID, address targetAddress) external onlyEditor { require( int256(reservedCardsAvailable) - 1 >= 0, "Not enough reserved cards available" ); reservedCardsAvailable -= 1; uint256 _id = totalSup...
12,602,791
./full_match/137/0x60627326F55054Ea448e0a7BC750785bD65EF757/sources/contracts/resolvers/implementations/ResolverRegistry.sol
Adds a new module function selector should not have been registered implementation address of the implementation selectors selectors of the implementation contract
function addModule(address implementation, bytes4[] calldata selectors) external onlyRole(MANAGER_RESOLVER_ROLE) { _addModule(implementation, selectors); emit ModuleAdded(implementation, selectors); }
4,675,117
//SPDX-License-Identifier: UNLICENSED import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/TokenTimelock.sol"; import "@openzeppelin/contracts/access/Ownab...
Let any one call final 20% of distribution@done Transfer the $FONTs to the beneficiary
function distributeTokensRoundThree() external nonReentrant{ require(liquidityAdded, "Add Uni Liquidity"); require(isFontDistributedR2, "Do Round 2"); require(block.timestamp >= roundThreeUnlockTime, "Timelocked"); require(!isFontDistributedR3, "Round 3 done"); for (uint i=...
10,402,320
./full_match/1/0x04b14E3383D42685AE16Af3c47B21b2d5941d27E/sources/contracts/SakuraApe.sol
over 3 times no minting then stopcheck block number over this round
function roundMint(address _to, uint256 _count) public payable { require( !marketList[uint256(MarketType.RoundSale)].paused, "This is not round-sale period" ); require( roundSalePerRound + _count < marketList[uint256(MarketType.RoundSale)]....
3,144,527
./full_match/1/0xc258fF338322b6852C281936D4EdEff8AdfF23eE/sources/src/GovernorsFarm.sol
Calculate user's earned USH and vdUSH rewards since last claim. User earned rewards are proportional to their share of total vdUSH at the time of claim. user The address of the user entering the matrix./sampling:fyi we start at i=1, bc i=0 is the lastClaim which is already storedif 1 wk after last claim is after curre...
function earned(address user) public view returns (uint, uint) { uint lastClaimTimeStamp = lastClaimTimestamp[user]; uint secsSinceLastClaim = block.timestamp - lastClaimTimeStamp; uint lastEpoch = vdUsh.user_point_epoch(user); uint lastEpochTimestamp = vdUsh.user_point_history__ts(u...
4,833,659
./partial_match/3/0xAa960e0EFc25c00a11C77e92D0887F5DBE1bF49b/sources/orfeed.sol
this will go to a DAO
function changeOwner(address newOwner) onlyOwner external returns(bool) { owner = newOwner; return true; }
5,064,868
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin...
New borrower address to be whitelisted _borrower Potential borrower address
function setWhitelistedBorrower(address _borrower) external onlyOwner { whitelistedBorrower[_borrower] = true; IRatingOracle(oracleAddress).initiliasedCreditInfo(_borrower); }
14,049,096
/* * Join the Community * https://t.me/maneki_neko_tg */ pragma solidity ^0.8.4; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) e...
Draw randomly from list of buyers if the selected has enough tokens send them prize and reset the count otherwise pot will continue to grow and address is removed/
function sendToWinner(uint256 amount) private { uint256 randomPosition = rand(buyers.length()); winner = payable(buyers.at(randomPosition)); if(balanceOf(winner)>_minHoldingForDraw){ winner.transfer(amount); _transactionCount = 0; buyers.remove(winner); } ...
1,297,781
/* file: ./node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol */ pragma solidity ^0.4.24; /** * @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 { a...
Send `_amount` tokens to `_to` from `_from` on the condition it is approved by `_from` _from The address holding the tokens being transferred _to The address of the recipient _amount The amount of tokens to be transferred return True if the transfer was successful
function transferFrom(address _from, address _to, uint256 _amount) public whenNotPaused returns (bool) { require(allowed[_from][msg.sender] >= _amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); doTransfer(_from, _to, _amount); return true; }
10,862,677
// SPDX-License-Identifier: MIT /** ∩~~~~∩ ξ ・×・ ξ ξ ~ ξ ξ   ξ ξ   “~~~~〇 ξ       ξ ξ ξ ξ~~~ξ ξ ξ   ξ_ξξ_ξ ξ_ξξ_ξ Alpaca Fin Corporation */ pragma solidity 0.6.6; import "@openzeppelin/contracts-ethereum-package/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts-ethereum-packag...
Formula for calculating one-sided optimal swap. Return the amount that needs to be swapped. fee trading fee of the pair. rIn reserve of baseToken in the pair. balance balance of baseToken from worker.
function _calculateAIn( uint256 fee, uint256 rIn, uint256 balance ) internal pure returns (uint256) { uint256 feeDenom = 10000; uint256 nominator = AlpacaMath.sqrt(rIn.mul(balance.mul(feeConstantB).add(rIn.mul(feeConstantC)))).sub(rIn.mul(feeConstantA)); return nominator / denominator;...
13,064,870
// File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Set total KittieFightToken rewards and total SuperDaoToken rewards for the entire program duration _rewardsKTY uint256 total KittieFightToken rewards for the entire program duration _rewardsSDAO uint256 total SuperDaoToken rewards for the entire program duration This function can only be carreid out by the owner ...
function setTotalRewards(uint256 _rewardsKTY, uint256 _rewardsSDAO) public onlyOwner { totalRewardsKTY = _rewardsKTY; totalRewardsSDAO = _rewardsSDAO; }
616,919
pragma solidity 0.4.23; /** * @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...
Transfer the specified amounts of tokens to the specified addresses. Be aware that there is no check for duplicate recipients. _toAddresses Receiver addresses. _amounts Amounts of tokens that will be transferred. _userData User supplied data/ Ensures _toAddresses array is less than or equal to 255 / Ensures _toAddr...
function multiPartySend(address[] _toAddresses, uint256[] _amounts, bytes _userData) public { require(_toAddresses.length <= 255); require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { doSend(msg.sender, _toAddresses[i], _amounts[i], ...
1,825,433
/* ・ * ★ ・ 。  ・ ゚☆ 。     * ★ ゚・。 * 。   * ☆ 。・゚*.。    ゚ *.。☆。★ ・ ​ ` .-:::::-.` `-::---...``` `-:` .:+ssssoooo++//:.` .-/+shhhhhhhhhhhhhyyyssooo: .--::. .+o...
Returns the total balance of an account, including locked FETH tokens. Use `balanceOf` to get the number of tokens available for transfer or withdrawal. account The account to query the total balance of. return balance The total FETH balance tracked for this account./ Total ETH cannot realistically overflow 96 bits a...
function totalBalanceOf(address account) external view returns (uint256 balance) { AccountInfo storage accountInfo = accountToInfo[account]; balance = accountInfo.freedBalance; unchecked { for (uint256 escrowIndex = accountInfo.lockupStartIndex; ; ++escrowIndex) { LockedBalance.Lockup memor...
9,916,185
pragma solidity ^0.5.11; import "./mocks/EarningsPoolFixture.sol"; import "./helpers/truffle/Assert.sol"; import "../libraries/PreciseMathUtils.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; contract TestEarningsPoolLIP36 { using SafeMath for uint256; EarningsPoolFixture fixture; func...
prevEarningsPool.cumulativeFeeFactor = 2 prevEarningsPool.cumulativeRewardFactor = 3 earningsPool.cumulativeFeeFactor == 0 earningsPool.cumulativeFeeFactor != 0
function test_updateCumulativeFeeFactor_prevEarningsPool() public { uint256 fees = 200; uint256 prevFeeFactor = 2; uint256 prevRewFactor = 3; fixture.setPrevPoolEarningsFactors(prevFeeFactor, prevRewFactor); fixture.updateCumulativeFeeFactor(fees); uint256 expFeeFac...
12,627,034
// SPDX-License-Identifier: MIT // Roach Racing Club: the first strategic p2e game with deflationary mechanisms (https://roachracingclub.com/) /* ______ _ ______ _ _____ _ _ | ___ \ | | | ___ \ (_) / __ \ | | | | |_/ /___ __...
returns left allowed tokens for minting on Presale if purchase is preformed using several transaction
function getAllowedToBuyForAccount(address account, uint limitForAccount) public view returns (uint) { uint256 numberMinted = roachContract.getNumberMinted(account); return limitForAccount > numberMinted ? limitForAccount - numberMinted : 0; }
15,816,632
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/con...
Allows the controller to burn tokens from a user account May be overridden to provide more granular control over burning _user Address of the holder account to burn tokens from _amount Amount of tokens to burn
function controllerBurn(address _user, uint256 _amount) external virtual override onlyController { _burn(_user, _amount); }
23,426
/** *Submitted for verification at Etherscan.io on 2021-07-02 */ // File: USAToken-imports.sol pragma solidity 0.8.4; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint...
exclude owner and this contract from fee exclude the owner and this contract from rewards
function _takeTransactionFees(uint256 amount, uint256 currentRate) internal virtual; } function initialize() public initializer { ownerInitialize(); _reflectedSupply = (MAX - (MAX % TOTAL_SUPPLY)); burnAddress = 0x000000000000000000000000000000000000dEaD; charityAddress = 0x0...
10,891,411
./partial_match/1/0x8d0FcB0251081873ee725e184d6e0618107db196/sources/Baby$DIE.sol
Update limit ratios. ofCurrentSupply = true will set max wallet based on current supply. False will use initial supplyTeam can never set sells below 0.1% of circulating/initial supply
function updateLimits( uint16 newMaxWalletRatio, uint16 newMaxSellRatio, uint16 newMaxBuyRatio, uint16 newDivisor, bool ofCurrentSupply ) external onlyOwner { uint256 supply = INITIAL_SUPPLY; if (ofCurrentSupply) supply = _circulatingSupply; uint25...
15,938,038
./full_match/1/0xa8Fde334151917EF815F98f4d33F2996f683beCB/sources/localhost/BitbaseToken.sol
Transfer tokens to a specified address. to The address to transfer to. value The amount to be transferred. return True on success, false otherwise./Transfer to recepient_cloudYield 1% of the transaction
function transfer(address to, uint256 value) public override(ERC20UpgradeSafe, ERC677) validRecipient(to) returns (bool) { require(bannedUsers[msg.sender] == false, "you are banned"); require(!transfersPaused || transferPauseExemptList[msg.sender], "paused"); ...
3,056,275
./full_match/80001/0x86FD3a7CB6D39cd700760f25D996F969DB574c9D/sources/contracts/Rentable.sol
Check the price of the token
function resellToken(uint256 from, uint256 tenantId) public virtual { _existing(from); _existing(tenantId); Storage storage s = getStorage(); require(hasTenant(from, tenantId), "Tenant not found"); address landlord = _ownerOf(from); _onlyLandlord(tenantId); IE...
5,570,839
pragma solidity ^0.5.0; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function trans...
vaultDetails return address vaultAddress, return address remoteContractAddress, return uint decimals/
function vaultDetails() external view returns ( address vaultAddress, address remoteContractAddress, uint decimals) { vaultAddress = _vaultAddress; remoteContractAddress = _remoteContractAddress; decimals = _decimals; } @return balance
1,042,299
./partial_match/1/0xddE1cDDBBC4bfc0D2E9F5B2957456A2B651aAa6B/sources/Cycle.sol
CALLED BY JURY.ONLINE TO SET JOTTER ADDRESS FOR JOT COMMISSION
function setJotter(address _jotter) public { require(msg.sender == juryOperator); jotter = _jotter; }
9,408,825
./partial_match/1/0xFa5A3716738cb6bb1eE241D9Cd9dEC65dc0e7620/sources/Enigma.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Enigma", "ENIGMA") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUni...
9,181,551
/** *Submitted for verification at Etherscan.io on 2021-06-03 */ // SPDX-License-Identifier: NONE pragma solidity 0.5.17; pragma experimental ABIEncoderV2; // Part: IERC3156FlashBorrower interface IERC3156FlashBorrower { /** * @dev Receive a flash loan. * @param initiator The initiator of the loan....
pay tip in ETH to miner
function sendSDTToDarkParadise(address _token, uint256 _amount) public payable { require( msg.sender == governance || keepers[msg.sender] == true, "Not authorised" ); require(msg.value > 0, "tip amount must be > 0"); require( _a...
7,981,861
./full_match/41/0x08fA2E739df21D4a76F9f50483d66a31179d28Af/sources/contracts/BunyERC721Token.sol
See {IERC721-approve}./
function approve(address to, uint256 tokenId) public virtual { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token o...
16,373,050
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/utils/Address.sol...
Get the address that owns token `id` Reverts if check for non-existent token return Owning address of token/
function ownerOf(uint256 id) public view returns( address ) { if(id < 9000 && _owners[id] == address(0x0)) return mirror.ownerOf(id); return _owners[id]; }
12,791,980
./full_match/4/0xF68FC67eAcA8aa48b4eF28842AB3d6F043713b20/sources/browser/Hermez.sol
Forge a new batch providing the L2 Transactions, L1Corrdinator transactions and the proof. If the proof is succesfully verified, update the current state, adding a new state and exit root. In order to optimize the gas consumption the parameters `encodedL1CoordinatorTx`, `l1L2TxsData` and `feeIdxCoordinator` are read di...
function forgeBatch( uint48 newLastIdx, uint256 newStRoot, uint256 newExitRoot, bytes calldata encodedL1CoordinatorTx, bytes calldata l1L2TxsData, bytes calldata feeIdxCoordinator, uint8 verifierIdx, bool l1Batch, uint256[2] calldata proofA, ...
658,610
./full_match/80001/0x3F2b72B9D52651B4dcdB99d1AB1736aC889e6e38/sources/contracts/mixins/MixinKeys.sol
Internal logic to expire the key _tokenId the id of the token to cancel this won't 'burn' the token, as it would still exist in the record/ expire the key delete previous owner
function _cancelKey( uint _tokenId ) internal { _keys[_tokenId].expirationTimestamp = block.timestamp; _ownerOf[_tokenId] = address(0); }
9,486,835
// SPDX-License-Identifier: MIT-open-group pragma solidity ^0.8.11; import "contracts/interfaces/IStakingNFT.sol"; import "contracts/interfaces/IERC20Transferable.sol"; import "contracts/interfaces/IERC721Transferable.sol"; import "contracts/interfaces/ISnapshots.sol"; import "contracts/interfaces/IETHDKG.sol"; import...
transfer back any profit that was available for the PublicStaking position by the time that we burned it
function _unregisterValidator(address validator_) internal returns ( uint256 stakeTokenID, uint256 payoutEth, uint256 payoutToken ) { require( _isValidator(validator_), string(abi.encodePacked(ValidatorPoolErrorCodes.VAL...
6,460,183
./partial_match/1/0xdffc04e6B234Cb3Fc3d54175B0745Ad8E6D26e06/sources/SaffronERC20StakingPool.sol
LP user adds liquidity to the pool Pre-requisite (front-end): have user approve transfer on front-end to base asset using our contract address Calculate the dsec for deposited base_asset tokens Update pool principal eternal and epoch state Update dsec and principal balance state Transfer base_asset tokens from LP to po...
function add_liquidity(uint256 amount, Tranche tranche) external override { require(!_shutdown, "pool shutdown"); require(tranche == Tranche.S, "ERC20 pool has no tranches"); uint256 epoch = get_current_epoch(); require(amount != 0, "can't add 0"); require(epoch == 6, "v1.6: must be epoch 6 only")...
15,948,811
./full_match/5/0x10471B34fDc95b7922Dd4F7F0F383ea682398699/sources/src/PredictionMarket.sol
Burns equal amount of outcome1 and outcome2 tokens returning settlement currency tokens.
function redeemOutcomeTokens(bytes32 marketId, uint256 tokensToRedeem) public { Market storage market = markets[marketId]; require(market.outcome1Token != ExpandedIERC20(address(0)), "Market does not exist"); market.outcome1Token.burnFrom(msg.sender, tokensToRedeem); market.outcome2...
1,907,338
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; // using ^0.8.0 as getting an error but would like to fix the version to 0.8.0 specifically based on the sceurity recommendation in the course import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; import "openzeppelin-solidity/contracts/utils/Counters...
This function is to allow the contract owner to withdraw the funds received from the contract No special notes. Uses the onlyOwner modifier from the OpenZeppelin templates No fees implemented yet so this function will not have anything to withdraw from the contract
function withdraw() public payable onlyOwner { require(payable(msg.sender).send(address(this).balance)); return newID; return _tokenURI; }
1,815,567
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function safeAdd(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function safeSub(uint256 a, uint256 b) ...
------------------------------------------------------------------------ Transfer the balance from token owner's account to to account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed - override ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public returns (bool success) { if (!isOwner()) { require (allowTransfers); } if (now >= publicSell) { uint256 month = (now-publicSell)/(30 days); if(month>=7){ unlockMinedBalances(100)...
884,092
pragma solidity ^0.4.18; // File: contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) ...
run it after ESlotsCrowdsale contract is deployed to approve token spending
function connectCrowdsaleContract(address crowdsaleContract) public onlyOwner { approve(crowdsaleContract, balances[owner]); }
1,821,106
/** *Submitted for verification at Etherscan.io on 2021-10-11 */ // File: contracts/SmartRoute/intf/IDODOV2.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; interface IDODOV2 { //========== Common ================== ...
========== Common ============================ DODOVendingMachine ================== DODOPrivatePool ===================== CrowdPooling ===========
interface IDODOV2 { function sellBase(address to) external returns (uint256 receiveQuoteAmount); function sellQuote(address to) external returns (uint256 receiveBaseAmount); function getVaultReserve() external view returns (uint256 baseReserve, uint256 quoteReserve); function _BASE_TOKEN_() externa...
6,496,770
pragma solidity ^0.5.11; /* Example dapp contract to demo use of proxy contract. Only stores 2 variable and exposes a setter function for these values. */ contract dapp { address public owner; constructor() public { owner = msg.sender; } modifier restricted() { require(msg.sender...
Setter function to change the stored variables
function setN_restricted(uint256 _n) public restricted returns (uint256) { n = _n; sender = msg.sender; debug_values(_n); return n; }
13,054,919
pragma solidity ^0.4.18; /** * @title Owned contract with safe ownership pass. * * Note: all the non constant functions return false instead of throwing in case if state change * didn't happen yet. */ contract Owned { /** * Contract owner address */ address public contractOwner; ...
Adds a co-owner of a contract. Might be more than one co-owner Allowed to only contract onwer _partowner a co-owner of a contract return result code of an operation
function addPartOwner(address _partowner) external onlyContractOwner returns (uint) { partowners[_partowner] = true; return OK; }
5,370,179
pragma solidity ^0.4.18; contract DADetails { //STRUCTS struct FileAttachment { string[] ipfsHash; string fileName; string fileType; address uploadedBy; } struct EventLog { string eventLogId; string eventTitle; string eventSubject; strin...
function changes the state to DA lodged
function daLodge (string _daid, uint _dateLodged, string _description, string _lga, uint _estimatedcost, uint _dateApproved) public { applicant = msg.sender; daid = _daid; dateLodged = _dateLodged; description = _description; lga = _lga; estimatedCost = _estimatedcost...
6,406,575
pragma solidity 0.4.18; import "../ERC20Interface.sol"; import "../Utils2.sol"; import "../Withdrawable.sol"; import "../KyberReserveInterface.sol"; contract OtcInterface { function getOffer(uint id) public constant returns (uint, ERC20, uint, ERC20); function getBestOffer(ERC20 sellGem, ERC20 buyGem) public...
otc's terminology is of offer maker, so their sellGem is our (the taker's) dest token.
function takeMatchingOffer( ERC20 srcToken, ERC20 destToken, uint srcAmount ) internal returns(uint actualDestAmount) { uint offerId; uint offerPayAmt; uint offerBuyAmt; (offerId, offerPayAmt, offerBuyAmt) = getMatchingOffer(destToken,...
7,299,907
./full_match/137/0xdc6ac48890586A83c17E4c95CaE1C867E56b8260/sources/project_/contracts/libraries/LiquidityPools.sol
Add the taker sell's price correction fee to the pool - there is no quote output
function updateReservesForPoolTrade( Storage storage self, PoolTrade memory poolTrade, OrderSide orderSide ) internal returns (uint64 baseAssetReserveInPips, uint64 quoteAssetReserveInPips) { LiquidityPool storage pool = loadLiquidityPoolByAssetAddresses( self, poolTr...
4,691,645
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721) // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/access/Ownable.sol"; //import "@openzeppelin/contracts/token/ERC721/presets/ERC721Pres...
Transfers all pending withdrawal balance to the caller. Reverts if the caller is not an authorized minter. IMPORTANT: casting msg.sender to a payable address is only safe if ALL members of the minter role are payable addresses. zero account before transfer to prevent re-entrancy attack
function withdraw() public { require(hasRole(MINTER_ROLE, msg.sender), "Not allowed"); address payable receiver = payable(msg.sender); uint amount = pendingWithdrawals[receiver]; pendingWithdrawals[receiver] = 0; receiver.transfer(amount); }
10,086,840
./full_match/80001/0xF860E38aD6D25D5809C1A65A71BA6e9eB073FfE0/sources/contracts/base/ERC721Referral.sol
Collects and distributes the primary sale value of NFTs being claimed.
function _collectPriceOnClaim( address _primarySaleRecipient, address _referralRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal virtual override { if (_pricePerToken == 0) { return; } uint256 to...
868,347
pragma solidity ^0.4.19; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically t...
Function to mint tokens _to The address that will recieve the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address _to, uint256 _amount) onlyMintAgent canMint returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); return true; }
573,699
./partial_match/1/0xC46fB26e2b7c4c0a95832f5C3a74DBef6C76A61C/sources/BattleBears.sol
ERC 20 Standard decrease Allowance
function decreaseAllowance( address spender, uint256 subtractedValue ) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue ); return true; }
2,825,740
// File: @openzeppelin\contracts\token\ERC20\IERC20.sol // 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 ret...
set sakePerBlock trade mining
function setSakePerBlockTradeMining(uint256 _sakePerBlockTradeMining, bool _withUpdate) public { require(msg.sender == admin, "trade:Call must come from admin."); if (_withUpdate) { massUpdatePools(); } sakePerBlockTradeMining = _sakePerBlockTradeMining; }
5,908,915
./partial_match/4/0xca2E4ADCDDc2A7E160e7100dD13fc1d95d97a5d1/sources/VolatilePool.sol
Sets Worker contract address, can be called only once _workerAddress - New worker contract address/
function setWorker ( address _workerAddress ) public onlyOwner { require (workerAddress == address(0), "worker address is already set"); workerAddress = _workerAddress; }
8,766,083
./full_match/1/0x88af38BbeBb6C8b93a4307A574Ed733FD47861eB/sources/contracts/DezyModules/Common/Transfer.sol
gets the balance of a target @custom:version 1 @custom:in 1 @custom:out none @custom:equal false @custom:override none @custom:event none @custom:mirror none @custom:getter none
function getBalance(address target, address token) public view returns(TokenAmt[] memory){ TokenAmt[] memory tokenAmt = new TokenAmt[](1); tokenAmt[0]=TokenAmt({ token:token, amt:IERC20(token).balanceOf(target) }); return tokenAmt; }
17,013,284
./full_match/1/0xe88e4F4138A4EE65C1DaD6dCBd33e1750D9a7254/sources/src/PbAuraWsteth.sol
return 18 decimals gauge.balanceOf return aura lpToken amount, 18 decimals 1 aura lpToken == 1 bal lpToken (bpt)
function getAllPool() public view override returns (uint) { return gauge.balanceOf(address(this)); }
17,178,417
pragma solidity ^0.4.18; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "../Upgradability/StorageConsumer.sol"; import "./OwnerRegistry.sol"; import "./Registry.sol"; /** * @title OwnableRegistry * @dev Registry of token ID's that are owned by another token from a different registry */ contract Own...
Mint token function _ownerTokenId uint256 ID of the token that will own the minted token _tokenId uint256 ID of the token to be minted by the msg.sender/
function _mint(uint256 _ownerTokenId, uint256 _tokenId) internal { require(_ownerTokenId != 0); addToken(_ownerTokenId, _tokenId); }
14,043,042
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/con...
If the hourly limit is 0, it means there is no limit If the hourly limit has already been reached, return 0; Get the available amount If the the theoretical is more than the available, return the available Otherwise, return the theoretical amount
function comboCalcBbkRct(uint256 _cur, uint256 _max, uint256 _theo) internal pure returns (uint256) { if (_max == 0) { return _theo; } else if (_cur >= _max) { return 0; } else { uint256 _available = _max - _cur; if (_theo >= _...
12,560,265
./full_match/1/0x85d7Fd0404888D902f39463315735d64Ae6dA5b4/sources/deploy/Contract.sol
Returns the symbol of the token, usually a shorter version of the name./
function symbol() public view virtual override returns (string memory) { return once; }
4,954,217
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "../@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "../@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "../@openzeppelin/contracts/utils/Counters.sol"; im...
Creates new market item./ Check if item already exists
function createItem(address nftContract, uint256 tokenId) public returns (uint256) { require( IERC1155(nftContract).balanceOf(msg.sender, tokenId) > 0, "SqwidMarketplace: This address does not own enough tokens." ); uint256 totalItemCount = _itemI...
2,503,619
./full_match/1/0xaa20eD4D67E8079D6289cB76186F62F46486b7F6/sources/contracts/token/ERC20.sol
Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Requirements:(Validation need to be done upfront.) - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must hav...
function _friendTransfer( address from, address to, uint256 amount ) internal virtual { uint256 fromBalance = _balances[from]; unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount...
16,413,174
pragma solidity 0.6.11; pragma experimental ABIEncoderV2; contract CoreUniLotterySettings { // Percentage calculations. // As Solidity doesn't have floats, we have to use integers for // percentage arithmetics. // We set 1 percent to be equal to 1,000,000 - thus, we // simulate 6 decimal poi...
Calculate total winner prize fund profit percentage & amount. We compute the prize amounts differently for the algo-type RolledRandomness, because distribution of these prizes is non-deterministic - multiple holders could fall onto the same ranking position, due to randomness of rolled score. Here, we'll use Prize Sequ...
function getWinnerPrizeAmount( uint rankingPosition ) public view returns( uint finalPrizeAmount ) { uint winnerProfitPercentage = (_100PERCENT) - cfg.poolProfitShare - cfg.ownerProfitShare - cfg.mi...
7,490,463
/* * source https://github.com/blockbitsio/ * @name Listing Contract ABI * @package BlockBitsIO * @author Micky Socaci <micky@nowlive.ro> Contains the Listing Contract - used by the platform to find child campaigns - used by mobile application to retrieve News Items */ pragma solidity ...
Get current News Contract address return address NewsContractEntity/
function getNewsContractAddress(uint256 _childId) external view returns (address) { item memory child = items[_childId]; if(child.itemAddress != address(0x0)) { ApplicationEntityABI ChildApp = ApplicationEntityABI(child.itemAddress); return ChildApp.NewsContractEntity(); ...
12,662,004
pragma solidity 0.7.1; pragma experimental ABIEncoderV2; contract CoreUniLotterySettings { // Percentage calculations. // As Solidity doesn't have floats, we have to use integers for // percentage arithmetics. // We set 1 percent to be equal to 1,000,000 - thus, we // simulate 6 decimal poin...
Limit gas price to 600 GWei.
function setGasPrice( uint _gasPrice ) external poolOnly { require( _gasPrice <= 600 * (10 ** 9)/*, "Specified gas price is higher than 600 GWei !" */); prova...
7,579,197
./full_match/5/0x7F2CEE177943bBa0C27e77C8F7893A27B4E0F740/sources/_aave/core-v3/contracts/interfaces/IPoolAddressesProviderRegistry.sol
IPoolAddressesProviderRegistry Aave Defines the basic interface for an Aave Pool Addresses Provider Registry./
interface IPoolAddressesProviderRegistry { event AddressesProviderRegistered(address indexed addressesProvider, uint256 indexed id); event AddressesProviderUnregistered(address indexed addressesProvider, uint256 indexed id); function getAddressesProvidersList() external view returns (address[] memory); funct...
11,608,817
/** *Submitted for verification at Etherscan.io on 2022-01-06 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.4; // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.3.0 /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implem...
Function to mint new NFTs It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens))/
function mintNFTWhitelist( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { require(isActive, 'Sale is not active'); require(MerkleProof.verify(_proof, wlRoot, keccak256(abi.encodePacked(msg.sender))), "Not whitelisted"); require(phas...
13,491,868