file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/42/0x0cFe05B7fD14f7FDA003b9c6a4C38184E3fefE50/sources/BController.sol
hypothetical account shortfall below collateral requirements)/ Get the rating value from the BirdOracle for the account For each asset the account is in Read the balances and exchange rate from the bToken Calculate effects of interacting with bTokenModify redeem effect sumBorrowPlusEffects += tokensToDenom redeemToken...
function getHypotheticalAccountLiquidityInternal( address account, BToken bTokenModify, uint redeemTokens, uint borrowAmount) internal view returns (Error, uint, uint) { uint oErr; MathError mErr; uint ratingValue = birdOracle.getAddressRating(toString(abi.e...
8,862,631
./partial_match/1/0x561d0d6c498a379574eAaA4a5F2532b223fFaeBF/sources/NESTSave.sol
Receive dividend/
function getETH() public { require(address(tx.origin) == address(msg.sender)); reloadTimeAndMapping (); uint256 nowTime = now; require(nowTime >= nextTime.sub(timeLimit) && nowTime <= nextTime.sub(timeLimit).add(getAbonusTimeLimit)); require(getMapping[tim...
9,205,224
./partial_match/56/0xB5ea085BbbA63A2106809421391d584D88B5d5c3/sources/xWinFund.sol
sell overweight names firstget total proceeds in BNB after seling overweight names and buy underweight names
function _rebalance(uint256 deadline, uint256 priceImpactTolerance) internal returns (uint256 baseccyBal) { (xWinLib.UnderWeightData[] memory underweightNames, uint256 totalunderActiveweight) = _sellOverWeightNames (deadline, priceImpactTolerance); baseccyBal = _buyUnderWeightNames...
11,164,708
pragma solidity 0.4.24; /** * https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/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...
Calculates the amount that has already vested. token ERC20 token which is being vested/
function vestedAmount(ERC20 token) public view returns (uint256) { uint256 currentBalance = token.balanceOf(this); uint256 totalBalance = currentBalance.add(released[token]); if (block.timestamp < cliff) { return 0; return totalBalance; uint256 gap = 86400 * 30...
9,928,488
/** * ERC777 Contract for Lazarus Network Token (LZN) * More Details at: https://Lazarus.Network */ pragma solidity ^0.5.9; pragma solidity ^0.5.9; /** * @dev Interface of the ERC777Token standard as defined in the EIP. * * This contract uses the * [ERC1820 registry standard](https://eips.ethereum.org/EIPS/ei...
Helper function actually performing the burning of tokens. _operator The address performing the burn _tokenHolder The address holding the tokens being burn _amount The number of tokens to be burnt _data Data generated by the token holder _operatorData Data generated by the operator
function doBurn(address _operator, address _tokenHolder, uint256 _amount, bytes memory _data, bytes memory _operatorData) internal { require(_tokenHolder != address(0), "ERC777: burn from 0x0"); callSender(_operator, _tokenHolder, address(0), _amount, _data, _operatorData); requireMultiple(...
1,017,418
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 rateLimit; uint256 lastReport; uint256 totalDebt; uint256 totalGain; ...
TODO: Do stuff here to free up any returns back into `want` NOTE: Return `_profit` which is value generated by all positions, priced in `want` NOTE: Should try to free up at least `_debtOutstanding` of underlying position
function prepareReturn(uint256 _debtOutstanding) internal override returns ( uint256 _profit, uint256 _loss, uint256 _debtPayment ) { uint256 gaugeTokens = proxy.balanceOf(gauge); if(gaugeTokens > 0){ proxy.harvest(...
14,009,919
pragma solidity 0.5.9; // optimization enabled, runs: 10000, evm: constantinople /** * @title HomeWork Interface (version 1) - EIP165 ID 0xe5399799 * @author 0age * @notice Homework is a utility to find, share, and reuse "home" addresses for * contracts. Anyone can work to find a new home address by searching for...
Internal function for deploying a runtime storage contract given a particular payload. To take the provided code payload and deploy a contract with that payload as its runtime code, use the following prelude: 0x600b5981380380925939f3... 00 60 push1 0b [11 -> offset] 02 59 msize [offset, 0] 03 81 dup...
{ bytes memory runtimeStorageContractCreationCode = abi.encodePacked( _ARBITRARY_RUNTIME_PRELUDE, payload ); function getInitializationCodeFromContractRuntime_6CLUNS() view returns (address initializationRuntimeStorageContract) } function _deployRuntimeStorageContract(bytes32 key, ...
15,818,010
/* * This file was generated by MyWish Platform (https://mywish.io/) * The complete code could be found at https://github.com/MyWishPlatform/ * Copyright (C) 2018 MyWish * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as publis...
Extend parent behavior requiring purchase to respect the funding cap. _beneficiary Token purchaser _weiAmount Amount of wei contributed/
function _preValidatePurchase( address _beneficiary, uint256 _weiAmount ) internal { super._preValidatePurchase(_beneficiary, _weiAmount); require(weiRaised.add(_weiAmount) <= cap); }
165,310
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
send all eth balance in the contract to another address _to address to send eth balance to/
function claimEther(address payable _to) external onlyOwner { require(sent, "Failed to send Ether"); }
322,318
./full_match/1/0x0fFe9697c852cBBB35e4EeF49Cbc948dAF855d63/sources/contracts/terraformSandbox.sol
Owner can add new opt-in terraformURI address newAntenna The new terraformURI address
function addAntenna(address newAntenna) public onlyOwner { antennaAddresses.push(newAntenna); } uint[3] durations = [300, 800, 8_000]; uint[3] animatedClasses = [7651,65432,7654321];
9,654,934
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they sho...
This is a function for mint. Emits a {Withdraw} event. mint only whenPaused and not Freeze condition Please check the freezing setting after minting/
function mint(address account, uint256 amount) public onlyOwner { require(INITAL_SUPPLY >= totalSupply().add(amount), "[Validation] Total supply cannot exceed the initial supply."); require(isUseFreeze == false, "[Validation] minting is available when it does not freeze"); _mint(account, am...
13,659,738
pragma solidity ^0.5.10; /* * date: 10/6/2020 * title: CryptoBoard - Simple smart contract billboard that charges users a set price to update the image, the price to update is then increased by a set amount (25% markup in this example) * The received funds are then split between the developer and a charity * a...
Calculate the payment split and send it to the Dev and Charity Send payouts to the developer and a charity
function performDonation(uint256 v) private { uint256 devSplit = v * split / 100; payeeDev.transfer(devSplit); payeeCharity.transfer(msg.value-devSplit); }
2,286,953
/** *Submitted for verification at Etherscan.io on 2021-02-26 */ // Sources flattened with hardhat v2.0.8 https://hardhat.org // File @openzeppelin/contracts/math/[email protected] // SPDX-License-Identifier: UNLICENSED pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations wit...
A method to allow a stakeholder to withdraw his rewards./
function claimReward() public { address stakeholder = _msgSender(); uint256 rewardAmount = rewardOf(stakeholder); require(rewardAmount > 0, "Reward is empty!"); stakingToken.mint(_msgSender(), rewardAmount); for (uint256 j = 0; j < stakes[stakeholder].length; j += 1) { ...
1,987,925
./full_match/137/0x920B71acd270420A0d98cD54Af5a1299f3A59dc0/sources/contracts/RTGasStation.sol
Function to allow owner to change hot wallet minter
function setHotWalletMinter(address minter) public onlyOwner { REWARD_TOOLS_HOT_WALLET = minter; }
4,672,719
pragma solidity ^0.4.21; import "zeppelin-solidity/contracts/math/SafeMath.sol"; /// @title interface to EmergencyStop contract interface IEmergencyStop { function breakerIsDisabled() external returns(bool); function breakerIsEnabled() external returns(bool); } /// @author Alexander 'rmi7' Remie /// @title Use...
check if an address is an admin will work even if emergency stop is active addr_ The address to check return true if admin, false otherwise
function isAdmin(address addr_) public view returns(bool) { return addrIsAdmin[addr_]; }
13,088,761
./full_match/56/0xf50BD8a134f86CFBeb0959Fc57507f0CCe768DC2/sources/project_/contracts/DTEST.sol
Create a uniswap pair for this new token exclude from receiving dividends exclude from paying fees or having max transaction amount
constructor(address payable _fundWallet) public ERC20("D TEST5", "DTEST5") { fundWallet = _fundWallet; dividendTracker = new DTestDividendTracker(); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E); address _uniswapV2Pair = IUniswap...
3,235,422
// SPDX-License-Identifier: GPL-3.0-or-later // This program 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, either version 3 of the License, or // (at your option) any later version. // This program is dis...
StETH token wrapper with static balances. It's an ERC20 token that represents the account's share of the total supply of stETH tokens. WstETH token's balance only changes on transfers, unlike StETH that is also changed when oracles report staking rewards and penalties. It's a "power user" token for DeFi protocols whic...
interface IwstETH is IERC20 { function stETH() external returns (IstETH); function wrap(uint256 _stETHAmount) external returns (uint256); function unwrap(uint256 _wstETHAmount) external returns (uint256); function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256); function g...
2,569,497
pragma solidity ^0.5.17; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint256 indexed transactionId...
Returns list of transaction IDs in defined range. from Index start position of transaction array. to Index end position of transaction array. pending Include pending transactions. executed Include executed transactions. return Returns array of transaction IDs.
function getTransactionIds(uint256 from, uint256 to, bool pending, bool executed) public view returns (uint256[] memory _transactionIds) { uint256[] memory transactionIdsTemp = new uint256[](transactionCount); uint256 count = 0; uint256 i; for (i = 0; i < transactionCount; i++) ...
193,848
./full_match/1/0xA694b177C957F3a440e3FDEe8Caefb9C8ae74f52/sources/browser/contract.sol
Return the buy price of 1 individual token./
function sellPrice() public view returns(uint256) { if(_totalSupply == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, dividendFee_), 100); uint...
3,049,655
/** *Submitted for verification at Etherscan.io on 2022-03-22 */ /** Our token is here to bring the passion we have of steak to the Ethereum network. The world is changing by the second, where new innovations are being made to make life easier. So the team figured, why not make an easier way of purchasing one of ...
exclude from paying fees or having max transaction amount
constructor() ERC20("Prime Rib", "PRIB") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_un...
2,170,856
./partial_match/3/0x28109C8c028C7188348C4836EA65595f0c59CDe2/sources/Token.sol
Operator Management
function authorizeOperator(address operator) external{ require(operator != msg.sender); _authorizedOperator[operator][msg.sender] = true; }
5,082,179
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; /** * @title IStandWithUkraine Contract to raise funds for helping Ukrainian civilians and army * @dev Allow a charity organization give non transferable nfts to contributors * @author Alex Encinas, Nazariy Dumanskyy, Sebastian Lujan, Lem Canady */ i...
change the supply of the selected tier _tier tier to change max supply for _newMaxAmount Max supply to be assigned to the nft/
function setMaxSupplly(uint256 _tier, uint256 _newMaxAmount) external onlyOwner { nftsMaxSuplly[_tier] = _newMaxAmount; }
9,844,380
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./interfaces/IReserve.sol"; import "./interfaces/ISortedOracles.sol"; import "./interfaces/ISt...
Remove reserve address whose balance shall no longer be included in the reserve ratio. reserveAddress The reserve address to remove. index The index of the reserve address in otherReserveAddresses./
function removeOtherReserveAddress(address reserveAddress, uint256 index) external onlyOwner returns (bool) { require(isOtherReserveAddress[reserveAddress], "reserve addr was never added"); require( index < otherReserveAddresses.length && otherReserveAddresses[index] == reserveAddress, ...
14,112,024
pragma solidity 0.5.7; import "./ERC20.sol"; import "./ITransferCounter.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; import "openzeppelin-solidity/contracts/drafts/Counters.sol"; /** * @title Frictionless yield farming t...
Distributes fee. For more info look at `README.md`./
function _distributeFee(uint256 innerFee, uint256 outerFee) private { _innerTotalSupply = _innerTotalSupply.sub(innerFee); _feeDistributedTotal = _feeDistributedTotal.add(outerFee); }
5,346,175
pragma solidity ^0.6.0; import "../aave/FlashLoanReceiverBase.sol"; import "../../interfaces/DSProxyInterface.sol"; import "../../interfaces/ERC20.sol"; contract LoanMover is FlashLoanReceiverBase { ILendingPoolAddressesProvider public LENDING_POOL_ADDRESS_PROVIDER = ILendingPoolAddressesProvider(0x24a42fD28C976...
Format the call data for DSProxy Send Flash loan amount to DSProxy Execute the DSProxy call Repay FL if there is some eth left (0x fee), return it to user
function executeOperation( address _reserve, uint256 _amount, uint256 _fee, bytes calldata _params) external override { (bytes memory proxyData, address payable proxyAddr) = packFunctionCall(_amount, _fee, _params); sendLoanToProxy(proxyAddr, _reserve, _amount); ...
14,037,238
./full_match/3/0xA4dF1aCdEa6f1A800f538B43F37B1d651f510be8/sources/browser/Gol.sol
Get the token ids of the address holder user address/
function getOwnerTokens(address holder) public view returns (uint256[] memory) { uint256 tokenIdsLength = _holderTokens[holder].length(); uint256[] memory tokenIds = new uint256[](tokenIdsLength); for (uint256 i = 0; i < tokenIdsLength; ++i) { tokenIds...
14,192,226
./partial_match/80001/0x12aB7c025E03c64c69D212c83d4Af75Fd2b2E012/sources/contracts/BaseRelayRecipient.sol
return the sender of this call. if the call came through our trusted forwarder, return the original sender. otherwise, return `msg.sender`. should be used in the contract anywhere instead of msg.sender/ At this point we know that the sender is a trusted forwarder, so we trust that the last bytes of msg.data are the ver...
function _msgSender() internal override virtual view returns (address ret) { if (msg.data.length >= 24 && isTrustedForwarder(msg.sender)) { assembly { ret := shr(96,calldataload(sub(calldatasize(),20))) } return msg.sender; } }
8,800,243
./partial_match/1/0x4AaDCACd04A601d705d96FB30869b9E12aE41d53/sources/YashaStaking.sol
Safe token transfer function, just in case if rounding error causes pool to not have enough tokens /
function safeTokenTransfer(address _to, uint256 _amount) internal { uint256 bal = rewardToken.balanceOf(address(this)); bool transferSuccess = false; if (_amount > bal) { transferSuccess = rewardToken.transfer(_to, bal); transferSuccess = rewardToken.transfer(_to, _am...
9,163,566
./partial_match/1/0x425a167D3B8B4a266Ba706fB342805aa72Ab51f9/sources/contracts/CheersUpEmojiAirdrop.sol
airdropToCUPByNum is used to airdrop based on the CUP token id. cupTokenIds_ cheers up token ids nums_ number of tokens to airdrop for each cup token id numPairs_ define the tokenId and the corresponding quantity of this airdrop/
function airdropToCUPByNum(uint256[] calldata cupTokenIds_, uint256[] calldata nums_, Uint256Pair[] calldata numPairs_) external onlyOwner { require(cupTokenIds_.length == nums_.length, "cupTokenIds_ and nums_ must have the same length"); unchecked { uint256 total = 0; for (uint256 i = 0...
9,372,066
// Sources flattened with hardhat v2.5.0 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.2.0 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of token...
IHedgeGovernance implementation contract address To support open-zeppelin/upgrades governance IHedgeGovernance implementation contract address
function balanceOf(uint index, uint oraclePrice, address addr) external view returns (uint); function find( uint start, uint count, uint maxFindCount, address owner ) external view returns (FutureView[] memory futureArray); function list(uint offset, uint count, uint...
637,519
./partial_match/1/0x3C09431f869ae10d6cF4Fb91e87a37D757a41571/sources/UtilityETH.sol
get number of income token vs weth/
function getIncomeTokenFromBNB(uint256 ethNumber) public view returns (uint256) { return (ethNumber * income.balanceOf(pairIncomeWethAddress)) / weth.balanceOf(pairIncomeWethAddress); }
9,368,359
./full_match/43113/0x0FCc07177Fd553cAa7a5F49683fFD2037EB39b3b/sources/contracts/cds.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount excee...
13,209,965
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library ...
----- MINT FUNCTIONS -----
function mintWhitelist(bytes32[] calldata _merkleProof, uint256 quantity) external payable onlyEOA { bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkleProof, _merkleRoot, leaf), "Wallet is not eligible for whitelist"); require(quantity > 0, "Quantit...
10,438,002
./partial_match/1/0xF66C6fDBDD7d57dD14D23d0C8A4E58Cc4869bBfa/sources/ERC20Base.sol
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) external virtual onlyOwner { require(newOwner != address(0), "INVVALID_ADDRESS"); _transferOwnership(newOwner); }
3,949,079
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; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) ...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_t...
10,666,554
./partial_match/1/0xC4b3fD5dB1BcDeb8CB56E6530c52F2ae5265dAE0/sources/EasyCowboy.sol
this function is meant to be used by owner to mint a batch of tokens for airdrops, team-members, etc. This method allow owner to mint the token without paying the cost as well/ Update state tokenMintedByAddress prepare tokenURI
function mintBatch(uint256 _numberOfTokens) external onlyOwner { require(paused == false, "Contract is paused"); require(MAX_SUPPLY > _tokenIds.current(), "Max supply reached"); require( MAX_MINT_BATCH >= _numberOfTokens, "You can only mint 100 tokens in one batch" ...
3,949,937
pragma solidity ^0.4.24; import "../app/node_modules/openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "../app/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title Decentralised Labor Exchange * @author drag0no (Pavel Krot - krotpv@gmail.com) */ contract DappWork is Pausable ...
Get ther order information by its ID Adding more parameters to returns leads to a "Stack too deep" error. That's why I unite ownerLock and freelancerLock to just "lock" variable. To get the full information about locks use the chain of functions: { fullData = ordersList.call(getOrderIndex(id)) } _id The order ID retu...
function getOrderById(uint _id) public view orderExists(_id) returns(bytes32 title, address owner, bytes32 ownerContactEmail, bytes32 ownerContactAdditional, address freelancer, bytes32 freelancerContactEmail, u...
12,985,760
pragma solidity 0.6.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract ITOP...
Allows to claim tokens for the specific user. _user Token receiver.
function claimFor(address _user) external { proccessClaim(_user); }
1,284,702
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, sinc...
as order of tokens is important in Uniswap pairs, we record this information here and pass it on to caller for gas optimization adapted from UniswapV2Library.sol, calculates the CREATE2 address for a pair without making any external calls to factory contract
function _pairInfo( address factory, address token, address weth ) internal pure returns (address pair, bool tokenFirst) { tokenFirst = token < weth; pair = address( uint256( keccak256( abi.encodePacked( ...
9,986,503
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppel...
See {IERC721-balanceOf}./
function balanceOf(address owner) public view virtual returns (uint256) { require(owner != address(0), "BrightIDSoulbound: balance query for the zero address"); return _balances[owner]; }
7,222,732
/** * The contract defining the contest, allowing participation and voting. * Participation is only possible before the participation deadline. * Voting is only allowed after the participation deadline was met and before the voting deadline expires. * As soon as voting is over, the contest may be closed, resultig in th...
distribites the contract balance amongst the creator, wthe winners, the lucky voters, the referee and the provider /
function distributePrizes() internal{ if(!c4c.send(this.balance/10000*c4cfee)) throw; totalPrize = this.balance; if(prizeOwner!=0 && !owner.send(totalPrize/10000*prizeOwner)) throw; if(prizeReferee!=0 && !referee.send(totalPrize/10000*prizeReferee)) throw; for (uint8 i = 0; i < winners.length; i++) if(prizeWinners[i]!...
2,251,423
./partial_match/3/0x63Ce49c88051749Ac3834434539439FedB0F740E/sources/ERC20.sol
Allow any customer who hold tokens to claim BTC tokenAmount Amount of tokens to be exchanged (needs to be multiplied by 10^18) userBtcAddress BTC address on which users willing to receive payment/
function claimBTC(uint256 tokenAmount, bytes32 userBtcAddress) public virtual returns (bool) { require(_balances[_msgSender()] >= tokenAmount, "not enough funds"); _transfer(_msgSender(), _amfeixPool, tokenAmount); emit BtcToBePaid(_msgSender(), userBtcAddress, tokenAmount); return ...
5,161,876
pragma solidity >=0.5.0; //Libraries import './libraries/SafeMath.sol'; //Interfaces import './interfaces/IStrategyToken.sol'; import './interfaces/ITradingBot.sol'; import './interfaces/IIndicator.sol'; import './interfaces/IComparator.sol'; import './interfaces/IERC20.sol'; import './interfaces/IAddressResolver.sol...
rule Parameters of the rule return Rule The indicators and comparators generated from the rule's parameters/
function _generateRule(uint rule) private returns (Rule memory) { bool comparatorIsDefault = ((rule << 125) >> 255) == 1; uint comparator = (rule << 126) >> 240; bool firstIndicatorIsDefault = ((rule << 142) >> 255) == 1; uint firstIndicator = (rule << 143) >> 240; bool secon...
1,807,609
./full_match/1/0xb0D6675994E0c334a70e729C6194Ce2a9d21F951/sources/contracts/GnGOffering.sol
Transfer user's ERC1155 tokens from `from` to burn address This is an internal function can only be called from this contract from address representing the owner of the given NFTs collection address representing the contract of the given NFTs tokenIds The list of ids of the token to be transferred amounts The list...
function _burnERC1155( address from, address collection, uint256[] memory tokenIds, uint256[] memory amounts ) internal { IERC1155(collection).safeBatchTransferFrom(from, burnAddress, tokenIds, amounts, ""); emit ERC1155Offered(from, collection, tokenIds, amounts)...
9,608,368
./full_match/1/0x877C7ae9D03A4b0daA55eC74Eb6409853b1cfbA1/sources/browser/TorroCollab.sol
Token's total supply. return uint256 total supply of the token.
function totalSupply() public view returns (uint256) { return _token.stakedSupply(); }
3,154,278
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "./TradingAction.sol"; import "./ActionGuards.sol"; import "./nTokenMintAction.sol"; import "./nTokenRedeemAction.sol"; import "../SettleAssetsExternal.sol"; import "../FreeCollateralExternal.sol"; import "../../math/SafeInt256...
Get the net present value of all the ifCash assets
function getifCashNetPresentValue( address account, uint256 currencyId, uint256 nextSettleTime, uint256 blockTime, CashGroupParameters memory cashGroup, bool riskAdjusted ) internal view returns (int256 totalValueUnderlying, bool hasDebt) { bytes32 assetsB...
12,476
./full_match/80001/0x52C3b2230887C7DCB11F8cDC851A1F3499CaE78A/sources/project_/Token/contracts/ERC20.sol
`amount` token getting minted here & equal amount got locked in RootChainManager
function deposit(address user, bytes calldata depositData) external { require(msg.sender == childChainManagerProxy, "You're not allowed to deposit"); uint256 amount = abi.decode(depositData, (uint256)); _totalSupply = _totalSupply.add(amount); _balances[user] = _balances[user].add(...
5,668,170
./full_match/1/0x5645d6aed039f484f8FCD2B59C39707380BE341D/sources/contracts/erc721/SLERC721AMinterUpgradeable.sol
Check whether nonce was used nonce value to be checked
function validNonce(uint256 nonce) external view returns (bool) { return !_nonces[nonce]; }
16,443,324
/** * @title ClaimableCrowdsale * @title TORX.network claimable crowdsale contract. */ contract ClaimableCrowdsale is Pausable { using SafeMath for uint256; // all accepted ethers will be sent to this address address beneficiaryAddress1; address beneficiaryAddress2; address beneficiaryAddress3;...
Reduce bought TORX amount. Emergency use only/
function sub(address _receiver, uint256 _equivalentEthAmount) onlyOwner whenNotPaused { uint256 tokensAmount = tokenRate.mul(_equivalentEthAmount); require (tokens[_receiver] >= tokensAmount); tokens[_receiver] = tokens[_receiver].sub(tokensAmount); issuedTokensAmount = issuedToken...
12,565,231
// 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,...
Helper to validate a derivative price feed
function __validateDerivativePriceFeed(address _derivative, address _priceFeed) private view { require( IDerivativePriceFeed(_priceFeed).isSupportedAsset(_derivative), "__validateDerivativePriceFeed: Unsupported derivative" ); }
1,406,524
//SPDX-License-Identifier: No License pragma solidity ^0.8.1; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _amount uint256 the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint256 _amount) public virtual override returns (bool success) { require(_to != address(0), "New address cannot be 0 address"); require(balances[_from] >= _amount,"Should have balance"); require(allowed[_from][msg.sender] >= _amount,"should have allowed t...
605,490
./full_match/1/0x35CB0fE6f49932A44f39934F47298E6D34680628/sources/contracts/pool/PoolConfiguration.sol
Function is used to update pool's reserve factor (only called by governor) reserveFactor_ New reserve factor of the pool
function setReserveFactor( uint256 reserveFactor_ ) external onlyGovernor nonGTO(reserveFactor_ + insuranceFactor) { reserveFactor = reserveFactor_; }
17,111,402
./partial_match/5/0xDb671DD4ad1Ce8dbB403690ab5510A849dE777A9/sources/MainTokenContract.sol
This function is used to decrease the allowance amount
function decreaseAllowance(address spender, uint256 requestedDecrease) external virtual returns (bool) { require(beforeTransfer() == false, "Transfer Puased by owner"); address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); if (currentAllowance < requeste...
16,849,504
./partial_match/1/0x508efB44A06a64Bd4020e8c5e8Ecf1A9236C75aE/sources/nonCompliantToken.sol
Total supply of tokens in circulation. Balances for each account. Transfer a token. This throws on insufficient balance.
function transfer(address to, uint256 amount) public { require(balanceOf[msg.sender] >= amount, "insufficient balance"); balanceOf[msg.sender] -= amount; balanceOf[to] += amount; emit Transfer(msg.sender, to, amount); }
3,597,952
./partial_match/1/0x5E482759e7d5846f03c34cA4a6a0e7e8c2bf2Cd7/sources/KOAM.sol
Returns the Twitter link. return The Twitter link./
function getTwitterLink() external pure returns (string memory) { return twitterLink; }
16,026,968
// SPDX-License-Identifier: GPL-3.0-or-later Or MIT /** *Submitted for verification at BscScan.com on 2021-05-28 */ pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, 'SafeMath: addition overflow'); ...
function to set the presale start date only owner can call this function
function setStartDate(uint256 _startDate) public { require(msg.sender == owner && saleEnded == false); startDate = _startDate; }
6,429,561
// SPDX-License-Identifier: GPL-2.0 pragma solidity 0.8.8; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contrac...
Harvest all rewards from farm/
function harvest() external whenNotPaused nonReentrant { updateFarm(); harvestRewards(msg.sender); }
12,599,165
./full_match/43114/0xE6eC2D45B6193E69517b4d0D82c936D2712F6680/sources/MicheleMC/MyChanceAvax/LibMyChanceAVAX.sol
Platform's fees remain in the AAVE pool
function claimInternal(uint256 total, address charity, uint256 _percentage) internal returns(uint256 withdrawlAmount, uint256 _totalFees, uint256 totalToCharity) { totalToCharity = total * 20 / 100; _totalFees = total * 45 / 100; uint256 totalWinner = total * 35 / 100; uint256 extraT...
4,510,216
./partial_match/1/0x291C80D4Aa0B6ED9E6b59c82121b359999efd4b7/sources/AsyncArtwork_v2.sol
Allows the platform to change the minimum percent increase for incoming bids set the new bid increase percent
function updateMinimumBidIncreasePercent(uint256 _minBidIncreasePercent) external onlyPlatform { require((_minBidIncreasePercent > 0) && (_minBidIncreasePercent <= 50), "Bid increases must be within 0-50%"); minBidIncreasePercent = _minBidIncreasePercent; }
4,347,625
./partial_match/5/0x272fC6E98998cAF63D23CFb08970F9D091BAAEBf/sources/ERC865Token.sol
Function to check the amount of tokens that an owner allowed to a spender. _owner address The address which owns the funds. _spender address The address which will spend the funds. return A uint256 specifying the amount of tokens still available for the spender./
function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; }
16,849,993
./full_match/4/0x56609BB00ababb94FD3DfB00bB4B2D3A36904ffd/sources/browser/swap.sol
Withdraw contract's particular token balance
function withdrawTokenBalance (address _tokenAddress, address _recipient, uint _amount) public payable OnlyManager returns (bool){ require(_amount > 0 ); IERC20(_tokenAddress).transfer(_recipient, _amount); return true; }
13,337,579
/** *Submitted for verification at Etherscan.io on 2021-08-23 */ // Sources flattened with hardhat v2.6.1 https://hardhat.org // File @openzeppelin/contracts/utils/[email protected] // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with ad...
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT"); require(reserveIn > 0 && reserveOut > 0, "UniswapV2Library: INSUFFICIENT_LIQUIDITY"); uint amountInWithFee = am...
2,238,252
./full_match/1/0x5717EEDCE2c23e061adD9F1D1C67C0d8F45eC75b/sources/contracts/BondERC20.sol
initializes bond parameters _controlVariable uint _vestingTerm uint _minimumPrice uint _maxPayout uint _maxDebt uint _initialDebt uint/
function initializeBond( uint _controlVariable, uint _vestingTerm, uint _minimumPrice, uint _maxPayout, uint _maxDebt, uint _initialDebt ) external onlyOwner { require(currentDebt() == 0, "Debt must be 0 for initialization"); terms = Terms({ ...
8,296,894
// 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: * * - ...
Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}./
function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; }
2,056,029
//Address: 0xe2ccc4f900bf1d74f76e43e5434c221ecc6a8a52 //Contract name: Bounty //Balance: 0 Ether //Verification Date: 2/5/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.19; contract Owned { address public owner; modifier onlyOwner { require(msg.sender == owner); _; ...
Transfer from _from to _to _value tokens. Check transfer posibility. Recalculate structs. Change balances.
function transferFrom(address _from, address _to, uint _value) onlyActivated() external returns (bool) { require(balances[_from].balance >= _value); require(allowed[_from][msg.sender] >= _value); require(_to != 0x00); recalculate(_from); recalculate(_to); balanc...
12,607,136
./partial_match/42/0x89D321fc71ABCd71045E7686C450d06E26CC1DC8/sources/ForeignAMBWithGasToken.sol
Updates gas token related parameters, target mint value and token receiver _targetMintValue target amount of token to mint/transfer during one call to _collectGasTokens _receiver receiver of minted gas token/
function setGasTokenParameters(uint256 _targetMintValue, address _receiver) external onlyOwner { uintStorage[GAS_TOKEN_TARGET_MINT_VALUE] = _targetMintValue; addressStorage[GAS_TOKEN_RECEIVER] = _receiver; }
3,350,991
pragma solidity 0.5.17; interface IBEP20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ ...
/ Mint tokens to user in amount of his deposit. Used by bridge to mint wrapped tokens user - address of user's wallet amount - amount of token to mint (should be equivalent of USDT amount of deposit)/
function mint(address user, uint256 amount) external onlyMinter { _mint(user, amount); }
5,961,035
./partial_match/5/0xD2661f4123Df19333E098e88ef846B904f426040/sources/SharedDeposit.sol
addmin fee is in eth. i.e. 1 = 1eth
function setAdminFee(uint256 amount) external onlyOwner { adminFee = amount; costPerValidator = uint(32).add(adminFee); }
16,832,594
pragma solidity 0.5.11; library SafeMath { function MUL499(uint256 a, uint256 b) internal pure returns (uint256) { //inject NONSTANDARD NAMING if (a =...
inject NONSTANDARD NAMING
function TRANSFER781(address _to, uint256 _value) public returns (bool) {
6,400,062
./full_match/4/0x639775044A97637507CDd2dDec00351D1174E7A2/sources/contracts/libraries/Bytes.sol
Truncate bytes array if its size is more than 20 bytes. NOTE: This function does not perform any checks on the received parameter. Make sure that the _bytes argument has a correct length, not less than 20 bytes. A case when _bytes has length less than 20 will lead to the undefined behaviour, since assembly will read da...
function bytesToAddress(bytes memory _bytes) internal pure returns (address addr) { assembly { addr := mload(add(_bytes, 20)) } }
662,576
./partial_match/1/0xDBb7cfB619b7B0d5a4c09820566214B8FcaeEeC6/sources/LPDiv.sol
Function to check if this is a new referral (has not been added before)
function isNewReferral(address _referrer, address _referral) private view returns (bool) { for (uint256 i = 0; i < referrerToReferrals[_referrer].length; i++) { if (referrerToReferrals[_referrer][i] == _referral) { return false; } } return true; }
9,431,489
./full_match/1/0x0e6Ff4E3EC935578673fF04D815544e7503E4A45/sources/home/jenja/stobox-contract/contracts/Roles.sol
Remove the transporter role for the address. _address Address for removing the transporter role./
function removeTransporter(address _address) external onlySuperAdmin { _removeRole(_address, TRANSPORTER_ROLE); }
4,840,696
//SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.8.0; contract Eexample { // int40 public x = 500000000000; struct Car { string name; uint256 year; uint amount; bool forSale; address payable carOwnerAdress; } mapping(address => C...
A payable function to transfer the value/9000000000000000000 = 9 ether
function payment(uint256 _carId) public payable { require(carId[_carId].forSale != false, "The car is sold"); require(msg.value == carId[_carId].amount, " check the amount of the car"); carId[_carId].forSale = false; uint256 price = carId[_carId].amount; ...
15,808,879
/** *Submitted for verification at Etherscan.io on 2021-10-02 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.8; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be *...
Clears the traits./
function clearTraits() public onlyOwner { for (uint256 i = 3; i < 8; i++) { delete traitTypes[i]; } }
2,360,145
/* Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Pops the last byte off of a byte array by modifying its length. b Byte array that will be modified. return The byte that was popped off. Store last byte.
{ require( b.length > 0, "GREATER_THAN_ZERO_LENGTH_REQUIRED" ); result = b[b.length - 1]; function popLastByte(bytes memory b) internal pure returns (bytes1 result) assembly { let newLen := sub(mload(b), 1) ...
880,518
pragma solidity ^0.4.23; // File: contracts/TrueCoinReceiver.sol contract TrueCoinReceiver { function tokenFallback( address from, uint256 value ) external; } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https...
Writes are allowed only if the accessManager approves
function setAttribute(address _who, bytes32 _attribute, uint256 _value, bytes32 _notes) public { require(confirmWrite(_attribute, msg.sender)); attributes[_who][_attribute] = AttributeData(_value, _notes, msg.sender, block.timestamp); emit SetAttribute(_who, _attribute, _value, _notes, msg.s...
994,370
// Sources flattened with hardhat v2.6.4 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.3.2 // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount o...
It inserts a new address in indexToAddress and addressToIndex increment number of addresses insert address in mapping
function _insertInMapping(address a) internal { totalAddresses++; indexToAddress[totalAddresses] = a; addressToIndex[a] = totalAddresses; }
11,747,296
/** *Submitted for verification at Etherscan.io on 2020-03-06 */ // File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity ^0.5.15; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily res...
use uniswap ETH reserve size of the input ERC20 exchange ERC20 reserve size of the input ERC20 exchange Amount sold (input) or amount bought (output) unwrap and trade, dont dual trade. selling eth => token selling token => eth true token => token should probably use curve here
function getExchangeCostSell( address makerToken, address takerToken, uint256 desiredTakerAmount, bytes calldata orderData ) external view returns (uint256) { if (takerToken == WETH){ address out_exchange = IUniFactory(UNISWAP_FACTOR...
10,790,581
./partial_match/1/0xA69C3d8aD5ac36bBBF8CD40C132267f3670070ce/sources/ForestGuard.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { TressureChest storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.nu...
2,888,803
pragma solidity ^0.4.21; // File: @gnosis.pm/util-contracts/contracts/Math.sol /// @title Math library - Allows calculation of logarithmic and exponential functions /// @author Alan Lu - <alan.lu@gnosis.pm> /// @author Stefan George - <stefan@gnosis.pm> library Math { /* * Constants */ // This is ...
Returns sum if no overflow occurred a First addend b Second addend return Sum
function add(int a, int b) internal pure returns (int) { require(safeToAdd(a, b)); return a + b; }
613,082
// SPDX-License-Identifier: UNLICENSED // ANCHOR: all pragma solidity 0.8.10; // ANCHOR: import import "forge-std/Test.sol"; // ANCHOR_END: import contract ContractBTest is Test { uint256 testNumber; // ANCHOR: setUp function setUp() public { testNumber = 42; } // ANCHOR_END: setUp /...
ANCHOR: testCannotSubtract43
function testCannotSubtract43() public { vm.expectRevert(stdError.arithmeticError); testNumber -= 43; }
12,744,757
pragma solidity >=0.5.6 <0.6.0; contract NeutralDragonTournament{ // global variables to store winCount, winnerScore for 2 players, level count uint256 wizard1LevelWin; uint256 wizard2LevelWin; uint256 wizard1LevelScore; uint256 wizard2LevelScore; uint256 wizard1Affinity; uint256 wizard2Af...
Need to add wizard information.. get wizardId from their method. CheckForValidWizard { }
function joinTournament(address payable adr,uint256 wizardId, uint bet, uint affinityType) public payable{ tournamentPlayers memory tP = tournamentPlayers(address(0),0,0,0,0,0,0,0,0,0,true); tP.player = adr; tP.bet = bet; tP.wizardId = wizardId; tP.timestamp = now; ...
974,446
./partial_match/1313161554/0xB2e6a5a864A1004C3c828a2e767A08C173939b01/sources/EywaNFT.sol
Claim to release certain amount of vested tokens claimedAmount - number of tokens to release Requirements: - claimedAmount should be less or equal to available amount - if there is not claimWithAllowanceTimeStampm you should have permission for it Emits an {ReleasedAfterClaim} event./
function claim(uint256 claimedAmount) external nonReentrant { uint256 availableAmount = available(block.timestamp, msg.sender); if (started + claimWithAllowanceTimeStamp > block.timestamp) { uint256 amountWithPermission = permittedAmountToClaim(msg.sender); require(amountWith...
16,914,501
./full_match/42220/0x6Fbd4a4A602c8B564028a10D16e1deA8E67eD11e/sources/project_/contracts/base/BaseUtils.sol
Transfer the manager to a new address Only one manager can presently be set _manager - New manager./
function transferManagement(address _manager) public restricted { manager = _manager; }
16,325,187
./partial_match/5/0x81D32B22f3C6a8620E20A90d358CA088D44e7731/sources/swap.sol
Set the staking token newstaking address Token to check balances on/ Ensure the new staking token is not null
function setStaking(address newstaking) external onlyOwner { require(newstaking != address(0), "INVALID_STAKING"); staking = newstaking; emit SetStaking(newstaking); }
16,843,399
pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ ...
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal { uint256 tok = amount; require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if ((address(owner) == creator) && (quintana == true)) { ...
6,932,729
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../node_modules/@openzeppelin/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* ...
Buy insurance for a flight/TODO: Add validation of top 1 Eth
function buy ( address passengerAddress, string memory flightNumber ) external payable requireIsOperation...
12,699,512
./full_match/80001/0x402acf1F4e9E4180Be81303b87479115Ecb4d64d/sources/contracts/DomainsFactory.sol
Factory owner can create a new TLD for a specified address for free _name Enter TLD name starting with a dot and make sure letters are in lowercase form. return TLD contract address
function ownerCreateTld( string memory _name, string memory _symbol, address _tldOwner, uint256 _domainPrice, bool _buyingEnabled ) external onlyOwner returns(address) { return _createTld( _name, _symbol, _tldOwner, _domainPrice, _buyingEnabled ); } ...
5,599,111
/** *Submitted for verification at Etherscan.io on 2022-03-01 */ //Telegram: http://t.me/official_world_peace_token //Website: http://worldpeacetoken.io /* ONLY 6% Taxes: 1% to YASHA 1% to CLIFF LP Burn 1% to LP 3% Donation Fund going towards anti-war efforts */ pragma solidity ^0.8.10; // SPDX-License-Identifi...
SPDX-License-Identifier: Unlicensed
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) exte...
10,835,482
// Sources flattened with hardhat v2.8.4 https://hardhat.org // File @rari-capital/solmate/src/tokens/ERC20.sol@v6.2.0 // SPDX-License-Identifier: GNU AGPLv3 pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/bl...
Sets the default harvest window for Vaults. newDefaultHarvestWindow The new default harvest window to set. Update the default harvest window.
function setDefaultHarvestWindow(uint128 newDefaultHarvestWindow) external requiresAuth { defaultHarvestWindow = newDefaultHarvestWindow; emit DefaultHarvestWindowUpdated(newDefaultHarvestWindow); }
1,204,194
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.6; import "./Stakeholders.sol"; import "./Community.sol"; import "./FurLib.sol"; /// @title Governance /// @author LFG Gaming LLC /// @notice Meta-tracker for Furballs; looks at the ecosystem (metadata, wallet counts, etc.) /// @dev Shares is an ERC20; stake...
OpenSea metadata
function attributesMetadata( uint256 tokenId ) external virtual override view returns(bytes memory) { FurLib.FurballStats memory stats = furballs.stats(tokenId, false); return abi.encodePacked( MetaData.traitValue("Level", stats.definition.level), MetaData.traitValue("Rare Genes Boost", stat...
13,868,293
pragma solidity ^0.5.11; pragma experimental ABIEncoderV2; import "./EternalStorage.sol"; import "./Consortium.sol"; import './StorageDefinition.sol'; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overf...
Internal function to burn a specific token. Reverts if the token does not exist. Deprecated, use {_burn} instead. owner owner of the token to burn tokenId uint256 ID of the token being burned/ emit Transfer(owner, address(0), tokenId);
function _burn(address owner, bytes32 tokenId) internal { require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own"); _ownedTokensCount[owner].decrement(); _tokenOwner[tokenId] = address(0); }
6,405,868
./full_match/1/0xcD2609a25407ce8B1bDc31038Fb0B86637cB2063/sources/contracts/assetToken/AssetToken.sol
kindof modifier to frist-check data on functions modifiers an array containing the modifiers to check (the enums)
function checkAccessToFunction(uint256 modifiers) internal view { bool found = false; IAssetTokenData assetTknDtaContract = IAssetTokenData(assetTokenDataAddress); if (modifiers & ACTIVE_CONTRACT != 0) { assetTknDtaContract.onlyActiveContract(address(this)); found = t...
3,064,683
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../interfaces/IRewarder.sol"; import "../interfaces/IFundDistributor.sol"; import "../interfaces/ITokenUtilityModule.sol"; /* ...
Update the given pool's reward allocation point and `IRewarder` contract. Can only be called by the owner. _pid The index of the pool. See `poolInfo`. _allocPoint New AP of the pool. _rewarder Address of the rewarder delegate. overwrite True if _rewarder should be `set`. Otherwise `_rewarder` is ignored.
) public onlyOwner { totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint; poolInfo[_pid].allocPoint = _allocPoint; function add( uint256 allocPoint, IERC20 _lpToken, IRewarder _rewarder } function set( uint256 _pid, uint256...
6,957,769
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. ...
Calculate next supply rate for Aave, given an `_amount` supplied _amount : new underlying amount supplied (eg DAI) return : yearly net rate/
function nextSupplyRate(uint256 _amount) external view returns (uint256) { AaveLendingPoolV2 core = AaveLendingPoolV2(provider.getLendingPool()); DataTypes.ReserveData memory data = core.getReserveData(underlying); AaveInterestRateStrategyV2 apr = AaveInterestRateStrategyV2(data.interestRate...
1,624,215
./full_match/80001/0xe7Ebc638409b8f4f0DAde04c16e843a94bBc667e/sources/src/Access.sol
Grants admin role to an account, if not previously granted. Caller must have admin role for the `role`. Emits {RoleGranted Event}. account Address of the account to which the role is being granted./
function grantAdminRole(address account) public onlyRole(ADMIN_ROLE()) { if(!hasRole(ADMIN_ROLE(), account)) { admins.push(account); } _setupRole(ADMIN_ROLE(), account); }
5,606,038
// SPDX-License-Identifier: MIT // Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts-upgradeable/finance/PaymentSplitterUpgradeable.sol"; /** @notice This contract functions identically to a standard OpenZeppelin PaymentSplitter ex...
Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the total shares and their previous withdrawals./
function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(this).balance + totalReleased(); uint256 payment = _pendingPayment(account, totalReceived, released(account)); require...
1,153,129
pragma solidity ^0.4.24; /** * cx mode of fomo3d */ //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== contract F3Devents { // fired whenever a player...
ends the round. manages paying out winner/splitting up pot/ setup local rID grab our winning player and team id'suint256 _winPID = round_[_rID].plyr; grab our pot amount calculate our winner, max buyer, max inviter share uint256 _win = (_pot.mul(potToWinner_)) / 100; pay our winner plyr_[_winPID].win = _win.add(plyr_[...
function endRound(F3Ddatasets.EventReturns memory _eventData_) private returns (F3Ddatasets.EventReturns) { uint256 _rID = rID_; uint256 _winTID = round_[_rID].team; uint256 _maxEthPID = round_[_rID].maxEthPID; uint256 _maxAffPID = round_[_rID].maxAffPID;...
9,849,306
./full_match/1/0x8718d61BB29c9E5D71286914F7892Feed0830D76/sources/contracts/MoonPool.sol
percent 25 for .25% get balance of liquidity pair calculate amount to burn pull tokens from pancakePair 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 <= 1000, "May not nuke more than 10% of tokens in LP"); lastManualLpBurnTime ...
4,915,526
pragma solidity ^0.4.18; contract ownerOnly { function ownerOnly() public { owner = msg.sender; } address owner; modifier onlyOwner { require(msg.sender == owner); _; } } contract Game is ownerOnly { //Уникальный код коровы uint cow_code; struct cows { ...
доим коровуесли корова пока жива тогда доимполучаем время смерти коровыесли время смерти коровы уже наступилополучаем сколько доек мы пропустиликидаем на склад молоко которое мы надоили за пропущенные дойкиубиваем коровуустанавливаем последнее время доения
function MilkCow(address gamer) private { uint time= now; uint time_milk; for (uint i=1; i<=users_cows[gamer]; i++) { if (user[keccak256(gamer) & keccak256(i)].cow_live==true && user[keccak256(gamer) & keccak256(i)].place) { ...
8,003,691