file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/** /$$$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$$ | $$_____/| $$$ /$$$| $$_____/| $$__ $$ /$$__ $$| $$_____/ | $$ | $$$$ /$$$$| $$ | $$ \ $$| $$ \__/| $$ | $$$$$ | $$ $$/$$ $$| $$$$$ | $$$$$$$/| $$ /$$$$| $$$$$ | $$__/ | $$ $$$| $$| $$__/ | $$__ $$| $$|_ $$| $$__/...
Set Fees Set Fee Wallet exclude from paying fees or having max transaction amount
constructor() ERC20("EMERGE", "EMERGE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2...
10,397,078
./partial_match/42/0x936E65F7b1a2E06515729d71df28Dc926263906D/sources/PopsicleStand.sol
Deposit LP tokens to PopsicleStand. If previously LPs were deposited by the user, safeRewardTransfer gets triggered for pendingReward
function deposit(uint256 _amount) external { UserInfo storage user = usersInfo[msg.sender]; uint256 blockNumber = (block.number > endBlock ? endBlock : block.number); if (user.amount > 0) { (uint256 projectTokenPendingReward, uint256 iceTokenPendingReward) = getUserReward(msg.sen...
8,875,063
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
Creates `amount` new tokens for `to`. See {ERC20-_mint}. Requirements: - the caller must have the `MINTER_ROLE`./
function mint(address to, uint256 amount) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "RIOToken: must have minter role to mint"); require(!getIsMintLocked(), "RIOToken: mint is locked"); _mint(to, amount); }
1,223,376
./partial_match/1/0xaF4ce7CD4F8891ecf1799878c3e9A35b8BE57E09/sources/src/newFolder/ERC4626.sol
See {IERC4626-convertToShares}./
function convertToShares(uint256 assets) public view virtual override returns (uint256) { return _convertToShares(assets, Math.Rounding.Down); }
2,721,971
//Address: 0xfa2632a88bd0c11535a38f98a98db8251ccbaa9e //Contract name: GTA //Balance: 0 Ether //Verification Date: 10/19/2017 //Transacion Count: 7987 // CODE STARTS HERE pragma solidity ^0.4.11; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the cont...
send ether to the fund collection wallet override to create custom fund forwarding mechanisms
function forwardFunds() internal { wallet.transfer(msg.value); }
7,280,425
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; library ExistenceProof { //struct definition struct Data { bytes key; bytes value; LeafOp.Data leaf; InnerOp.Data[] path; } // Decoder section /** * @dev The...
The decoder for reading a field p The offset of bytes array to start decode bs The bytes array to be decoded r The in-memory struct counters The counters for repeated fields return The number of bytes decoded/ if `r` is NULL, then only counting the number of fields./
function _read_child_size( uint256 p, bytes memory bs, Data memory r, uint[7] memory counters ) internal pure returns (uint) { (int32 x, uint256 sz) = ProtoBufRuntime._decode_int32(p, bs); if (isNil(r)) { counters[2] += 1; r.child_size = x; if (counters[2] > 0) counters[2] ...
13,050,370
pragma solidity >=0.5.0 <0.6.0; import "../compliance/Compliance.sol"; import "../libs/collections/AddressMap.sol"; import "../libs/lifecycle/LockableDestroyable.sol"; import "../libs/math/AdditiveMath.sol"; import "../libs/ownership/Ownable.sol"; import "./IT0ken.sol"; contract T0ken is IT0ken, Ownable, LockableDe...
Set the issuer address. newIssuer The address of the issuer./
function setIssuer(address newIssuer) public isUnlocked onlyOwner { require(holders.exists(newIssuer) == false, "New issuer can't be a shareholder"); transferTokens(issuer, newIssuer, balances[issuer]); issuer = newIssuer; emit IssuerSet(issuer, newIssuer); }
7,311,020
pragma solidity ^0.4.15; 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 autom...
Returns the total Servus token supply at the given block number _blockNumber {uint256} return total supply {uint256}/ These next few lines are used when the totalSupply of the token is requested before a check point was ever created for this token, it requires that the `parentToken.totalSupplyAt` be queried at the ...
function totalSupplyAt(uint256 _blockNumber) public constant returns(uint256) { if ((totalSupplyHistory.length == 0) || (totalSupplyHistory[0].fromBlock > _blockNumber)) { if (address(parentToken) != 0) { return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock)); ret...
2,510,847
/** *Submitted for verification at Etherscan.io on 2021-02-02 */ // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol pragma solidity ^0.5.2; /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { function transfer(address to, uint256 value) external re...
Unlocks the unlockable tokens of a specified address _of Address of user, claiming back unlockable tokens/
function unlock(address _of) public returns (uint256 unlockableTokens) { uint256 lockedTokens; for (uint256 i = 0; i < lockReason[_of].length; i++) { lockedTokens = tokensUnlockable(_of, lockReason[_of][i]); if (lockedTokens > 0) { unlocka...
2,239,207
pragma solidity ^0.5.0; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABLE...
Credits payouts to insurees/
function creditInsurees(bytes32 flightKey, uint payoutRate) external requireIsOperational requireCallerAuthorized { bytes32[] storage insuranceKeys = flightInsurances[flightKey]; for (uint i = 0; i < insuranceKeys.length; i++) { Insurance storage insurance = ...
12,944,923
./partial_match/42/0x4290ee89b1E3Fe318eEbceBF24F939A0cC4287a1/sources/CyclopsBank.sol
0 means max amount for ERC20 compatible and ignored for ERC721
function kill(address payable killAddress) external onlyOwner for (uint i = 0; i < dpl; i++){ (,,uint8 p_dep_type,address p_tok_addr,,) = depProfilesRegister.depositProfiles(i); ownerWithdrawTokens(killAddress, p_tok_addr, p_dep_type, 0); } ...
3,302,543
// SPDX-License-Identifier: GPL-2.0-or-later // Gearbox Protocol. Generalized leverage for DeFi protocols // (c) Gearbox Holdings, 2021 pragma solidity ^0.7.4; pragma abicoder v2; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import {ERC2...
Takes credit account back and adds it to the stock Before: --------- head ⬇ ------- ------- ------- ------- | VA1 | -> | VA2 | -> | VA3 | -> | VA4 | -> address(0) ------- ------- ------- ------- ...
function returnCreditAccount(address usedAccount) external override { require( creditAccountsSet.contains(usedAccount), Errors.AF_EXTERNAL_ACCOUNTS_ARE_FORBIDDEN ); require( ICreditAccount(usedAccount).since() != block.number, ...
5,894,653
./full_match/1/0x0e41986DB14eD784ff959c26D7FD7F2B7375F074/sources/browser/KeyMaster.sol
Return reward halving multiplier over the given _from to _to block, assuming _from >= bonusEndBlock
function _getHalvingMultiplier(uint256 _from, uint256 _to) private view returns (uint256) { uint256 fromTier = _from.sub(bonusEndBlock).div(halvingInterval); uint256 toTier = _to.sub(bonusEndBlock).div(halvingInterval); uint256 halving = 1e12; uint256 star...
3,860,406
pragma solidity ^0.5.7; contract SafeTransfer { function _SAFETRANSFER911(ERC20Token _token, address _to, uint256 _value) internal returns (bool result) { //inject NONSTANDARD NAMING _token.TRANSFER494(_to, _value); assembly { ...
inject NONSTANDARD NAMING
function BUY699() external returns(uint) {
12,593,822
pragma solidity ^0.6.2; import "./ERC777GSN.sol"; import "./ERC777WithAdminOperatorUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; contract PToken is Initializable, AccessControlUpgradeabl...
See {ERC20-decimals}. Always returns 18, as per the/
function decimals() public pure virtual returns (uint8) { return 18; }
21,376
./full_match/1/0xE540D1b18B40dF28b844F77C26d5A9b01b966E57/sources/src/lib/Uint256Splitter.sol
Merges two uint128s (low, high) into one uint256. lower The lower uint256. The caller is required to pass a value that is less than 2^128 - 1. upper The upper uint256. return (upper << 128) | lower;
function merge128( uint256 lower, uint256 upper ) internal pure returns (uint256 a) { require(lower <= _MASK, "Uint256Splitter: lower exceeds uint128"); assembly { a := or(shl(128, upper), lower) } }
16,518,376
pragma solidity ^0.4.18; /** * zeppelin-solidity 1.4.0 */ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a =...
Constructor that gives msg.sender all of existing tokens./
function XEVENUE() public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; }
1,324,335
./full_match/3/0x6d474F9119A1e940111e52341bD6E89Af51B3973/sources/github/encoderafat/disperse/truffle/contracts/disperse.sol
https:ropsten.etherscan.io/token/0xF926701DBE68b78a6ef26ADab5Fca499404cd0e7
function disperseMKSToken(address[] calldata recipients, uint256[] calldata values) external { IERC20 token = IERC20(0x70AD45bf61F75e12358B6E835130BfffDe8f095a); _disperseTokenInternal(token, recipients, values); }
14,178,766
./partial_match/1/0x0ace20a35eE382Bda90D1D93CEE65f5970FC01c8/sources/Chip.sol
Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } ...
4,257,951
pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./MoonT...
Perform LP token migration from legacy UniswapV2 to MoonSwap. Take the current LP token address and return the new LP token address. Migrator should have full access to the caller's LP token. Return the new LP token address. Move Asset to conflux chain mint cToken
interface IMigratorStar { function migrate(IERC20 token) external returns (IERC20); }
987,063
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
Remove liquidity from the pool all in one token. self Swap struct to read from and write to tokenAmount the amount of the lp tokens to burn tokenIndex the index of the token you want to receive minAmount the minimum amount to withdraw, otherwise revert return amount chosen token that user received/
function removeLiquidityOneToken( Swap storage self, uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount ) external returns (uint256) { LPToken lpToken = self.lpToken; IERC20[] memory pooledTokens = self.pooledTokens; require(tokenAmount <= lpToken.b...
1,703,680
./full_match/5/0xa0c880F3C46a376aCa23E7ea1311E567e9794DA3/sources/contracts/Contract.sol
Function to reset the votes for the current question
function resetVotes() public onlyOwner { require(yesVotes[question] + noVotes[question] > 0, "There are no votes to reset for this question"); for (uint256 i = 0; i < addressList.length; i++) { hasVoted[addressList[i]][question] = false; } yesVotes[quest...
1,873,537
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; contract Rifi { /// @notice EIP-20 token name for this token string public constant name = "Rikkei Finance"; /// @notice EIP-20 token symbol for this token string public constant symbol = "RIFI"; /// @notice EIP-20 token decimals for this...
Transfer `amount` tokens from `msg.sender` to `dst` dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/
function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "Rifi::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; }
14,586,426
./partial_match/3/0xfbcF53b85277EEC0cfD3B564d3a0B7e2ec07D96F/sources/MyContract.sol
loop through teams mapping
function calDistanceByEachTeam() public { delete teamsDistance; uint lenght = teams.teamCount; for(uint i = 0; i < lenght; i++){ string memory tempTeamName = teams.teamNames[i]; uint distanceTraveled = 0; for(uint j = 0; j < allAthletes.athleteCount; j++){...
5,212,559
./full_match/4/0xD294Ca2800957021DC486F1959AF022b0B4FCcab/sources/EasyBakeFactory.sol
this low-level function should be called from a contract which performs important safety checks
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock { require(amount0Out > 0 || amount1Out > 0, 'EasyBake: INSUFFICIENT_OUTPUT_AMOUNT'); require(amount0Out < _reserve0 && amount1Out < _reserve1, 'EasyBake: INSUFFICIENT_LIQUIDITY'); uint balance0; ...
727,164
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; import "../libraries/Address.sol"; import "../libraries/SafeMath.sol"; import "../libraries/SafeERC20.sol"; import "../interfaces/IERC20.sol"; import "../interfaces/ITreasury.sol"; import "../types/OlympusAccessControlled.sol"; interface ICurve3Po...
add new reward token to be harvested/
function addRewardTokens(address baseToken, address[] memory rewardTokens) external onlyGuardian { tokenInfo[baseToken].rewardTokens = rewardTokens; }
13,139,153
pragma solidity ^0.4.13; import 'zeppelin-solidity/contracts/math/SafeMath.sol'; import './PresaleToken.sol'; contract Presale { using SafeMath for uint256; // Miniml possible cap uint256 public minimalCap; // Maximum possible cap uint256 public maximumCap; // Presale token PresaleToke...
return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) { bool withinPeriod = ((now >= startTime || msg.value >= early_bird_minimal) && now <= endTime); bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; }
12,773,995
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
Toggles whether Loot and mintpass holders can mint early
function toggleEarly() public onlyOwner { earlyMintActive = !earlyMintActive; }
13,120,778
// File: contracts/IERC2981Royalties.sol pragma solidity ^0.8.0; /// @title IERC2981Royalties /// @dev Interface for the ERC2981 - Token Royalty standard interface IERC2981Royalties { /// @notice Called with the sale price to determine how much royalty // is owed and to whom. /// @param _tokenId...
Allows to set the royalties on the contract This function should be protected with a onlyAdmins, onlyMultisig (or equivalent) modifier recipient the royalties recipient value royalties value
function setRoyalties(address recipient, uint256 value) public onlyAdmins { _setRoyalties(recipient, value); } MultisigContract multisigContract; bool public saleActive = false; bool public presaleActive = true; bool public promoSaleActive = true; string interna...
12,050,361
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; // ============ Imports ============ import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/SafeMa...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Royalty implementation based on @abbouali https:github.com/abbouali/sample_erc1155_with_eip2981 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Define the fee for the token specify tokenId uint256 token ID to specify recipient address account that...
function setTokenRoyalty( uint256 tokenId, address recipient, uint16 bps ) public override onlyOwner { _tokenRoyalties[tokenId] = TokenRoyalty(recipient, bps); emit TokenRoyaltySet(tokenId, recipient, bps); }
1,764,131
./full_match/42161/0xaDB8c61Da2C62D81D35122275F4623D02fad45fe/sources/project_/src/active/MemepadStakingV2.sol
View function to get users. _offset: offset for paging _limit: limit for paging return get users, next offset and total users/
function getUsersPaging(uint _offset, uint _limit) public view returns ( UserInfo[] memory users, uint nextOffset, uint total ) { uint totalUsers = userList.length; if (_limit == 0) { _limit = 1; } if (_limit > totalUsers - _offset) { _limit = totalUser...
16,299,494
./partial_match/1/0x4d1Fa6453c713216944a8d512336D9c66CE82f30/sources/contracts/SpellBook.sol
Transfer the amount
function buySpellBookCurse() external whenNotPaused { address caster = _msgSender(); require(!hasSpellBook(caster), "Already have"); uint256 price = baseSpellBookPrice[PRICE_SPELLBOOK_CURSE]; if (price > 0) { require(CURSE.balanceOf(caster) >= price, "Insufficient balanc...
2,654,613
./full_match/4/0x1260d1d95CE4b1CDD7f39E64766dF9E70Ae2953D/sources/github/teller-protocol/teller-protocol-v1/nft/contracts/base/nft/TellerNFT.sol
It returns an array of token IDs owned by an address. It uses a EnumerableSet to store values and loops over each element to add to the array. Can be costly if calling within a contract for address with many tokens./
function getTierHashes(uint256 tierIndex) external view returns (string[] memory) { return tiers[tierIndex].hashes; }
13,330,626
./full_match/1/0xAF6e66F6D2A52E2fEd343E47b75f3F1B790ba5e2/sources/contracts/PlaygroundRouter.sol
ADD LIQUIDITY create the pair if it doesn't exist yet
function _addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin ) internal virtual returns (uint256 amountA, uint256 amountB) { if (IPlaygroundFactory(factory).getPair(tokenA, t...
2,909,741
// SPDX-License-Identifier: MIT 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 can be granted exclusive access to * specific functio...
SPDX-License-Identifier: AGPL-3.0
interface IDAO { function updateMinimumRequiredSignatures(uint32 _minimumRequiredSignatures) external; function setConfiguration(EverscaleAddress calldata _roundRelaysConfiguration) external; function updateRoundTTL(uint32 _roundTTL) external; function isRelay( uint32 round, address can...
1,328,835
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Gets the details of a pending migration request for a given VaultProxy _vaultProxy The VaultProxy instance return nextFundDeployer_ The FundDeployer contract address from which the migration request was made return nextVaultAccessor_ The account that will be the next `accessor` on the VaultProxy return nextVaultLib_ T...
function getMigrationRequestDetailsForVaultProxy(address _vaultProxy) external view override returns ( address nextFundDeployer_, address nextVaultAccessor_, address nextVaultLib_, uint256 executableTimestamp_ ) { Mi...
1,698,192
//Address: 0x40ae4acd08e65714b093bf2495fd7941aedfa231 //Contract name: SmartzToken //Balance: 0 Ether //Verification Date: 3/29/2018 //Transacion Count: 13 // CODE STARTS HERE pragma solidity ^0.4.18; interface IApprovalRecipient { /** * @notice Signals that token holder approved spending of tokens and som...
to be overridden in tests
function getTime() internal view returns (uint) { return now; }
12,924,217
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {Vault} from "./Vault.sol"; import {ShareMath} from "./ShareMath.sol"; import {IStrikeSelection} from "../inter...
Settles the gnosis auction gnosisEasyAuction is the contract address of Gnosis easy auction protocol auctionID is the auction ID of the gnosis easy auction/
function settleAuction(address gnosisEasyAuction, uint256 auctionID) internal { IGnosisAuction(gnosisEasyAuction).settleAuction(auctionID); }
583,963
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./ERC721.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract CryptoGamblers is ERC721, Ownable { using String...
modifications are not allowed
function setMetadataHash(string memory hash) public onlyOwner { require(bytes(metadataHash).length == 0 && totalSupply() == maxSupply); metadataHash = hash; }
11,771,309
./full_match/1/0xB20deB78bFAc9DA2653DcE1713cbdbE36645419b/sources/contracts/PalPayTokenMainnet.sol
Set address of treasury
function initialize(address _treasury) external payable onlyOwner { require(treasury == address(0), "Treasury already set"); treasury = _treasury; tradingActive = true; swapEnabled = true; timestampTradingLive = block.timestamp; addLiquidity(balanceOf(address(this)), ...
5,006,082
./full_match/80001/0xB4cb47bc9C7c7E49d742EB032D8BafD377Be1f31/sources/contracts/Vault.sol
Set the marginScale, the threshold used for deposits and withdrawals. If the threshold is not met the deposit/ withdrawal is not executed. Take into account the uScale (scale of the underlying). _marginScale Value at which to set the marginScale.
function setMarginScale(int256 _marginScale) external onlyGuardian { marginScale = _marginScale; }
5,563,985
// Sources flattened with hardhat v2.6.4 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.3.2 // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implemente...
See {IERC165-supportsInterface}./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC7...
6,108
./partial_match/97/0x406b97165b45963F396389Fc8d403683b88CFC52/sources/BUB.sol
Open a stake. g Cache of stored globals newStakedSuns Number of Suns to stake newStakedDays Number of days to stake/
function _stakeStart( GlobalsCache memory g, uint256 newStakedSuns, uint256 newStakedDays ) internal { require(newStakedDays <= MAX_STAKE_DAYS, "BUB: newStakedDays higher than maximum"); uint256 bonusSuns = _stakeStartBonusSuns(newStakedSuns, newStakedDays); ...
11,372,882
./full_match/4/0x21a5caA26fdDeA9DB140FD558124DB8de0A8aDFe/sources/C/Users/flisko/Documents/GitHub/dotbase-contracts/contracts/dotBaseToken.sol
index Index of transaction. Transaction ordering may have changed since adding. enabled True for enabled, false for disabled./
function setTransactionEnabled(uint256 index, bool enabled) external onlyOwner { require(index < transactions.length, "index must be in range of stored tx list"); transactions[index].enabled = enabled; }
832,002
pragma solidity ^0.5.8; /** * @title Math * @dev Assorted math operations */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two ...
_bonusThreshold exceed the threshold will get bonus _tierOneBonusTime before t1 bonus timestamp will use t1 bonus rate _tierOneBonusRate tier-1 bonus rate _tierTwoBonusTime before t2 bonus timestamp will use t2 bonus rate _tierTwoBonusRate tier-2 bonus rate/
function setBonusConditions( uint256 _bonusThreshold, uint256 _tierOneBonusTime, uint256 _tierOneBonusRate, uint256 _tierTwoBonusTime, uint256 _tierTwoBonusRate ) external onlyOwner { _setBonusConditions( _bonusThreshold, ...
2,563,968
./full_match/73799/0x4545C3dAbc5b6D1c19A52006C2eaF598a599dE2A/sources/contracts/trove.sol
this function will return the actual collateral (balance of the collateral token) including any liquidation rewards from community liquidation/
function collateral() public view returns (uint256) { (uint256 unclaimedCollateral, ) = unclaimedCollateralRewardAndDebt(); return token.balanceOf(address(this)) + unclaimedCollateral; }
16,363,656
./full_match/1/0x51e63665AC51D0313A042d89DEd26763936C0D12/sources/contracts/NeozenMythics.sol
Sets timestamps for live and expires timeframe _liveAt A unix timestamp for live date _expiresAt A unix timestamp for expiration date/
function setMintWindow( uint256 _liveAt, uint256 _expiresAt ) external onlyOwner { liveAt = _liveAt; expiresAt = _expiresAt; }
8,329,502
./partial_match/1/0x0532fd6E1109756bE1503dAbe7194B70dF0257A7/sources/contracts/collectionTemplates/NFTCollection.sol
Mint an NFT defined by its metadata path and have creator revenue/royalties sent to an alternate address. This is only callable by the collection creator/owner. tokenCID The CID for the metadata json of the NFT to mint. tokenCreatorPaymentAddress The royalty recipient address to use for this NFT. return tokenId The ...
function mintWithCreatorPaymentAddress( string calldata tokenCID, address payable tokenCreatorPaymentAddress ) public returns (uint256 tokenId) { if (tokenCreatorPaymentAddress == address(0)) { revert NFTCollection_Token_Creator_Payment_Address_Required(); } tokenId = _mint(tokenCID); ...
9,383,245
./full_match/42/0x08049a9d0847fBd8342D779e0F03BA9EA77869aA/sources/A.sol
If any account belongs to the excludedAccount transfer token
function _transfer( address sender, address recipient, uint256 amount ) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount ...
16,236,235
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.6.12; // Part: GTCErc20 /** * @title - A retroactive ERC20 token distribution contract * @author - zk@WolfDefi * @notice - Provided an EIP712 compliant signed message & token claim, distributes GTC tokens **/ /** * @notice interface for interactin...
Sets a given user_id to claimed taken from uniswap merkle distributor, unmodified/
function _setClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); }
9,870,229
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; import "./PublicKey.sol"; library ValidatorSet { //struct definition struct Data { Validator.Data[] validators; Validator.Data proposer; int64 total_voting_power; } //...
store function Store in-memory struct to storage input The in-memory struct output The in-storage struct/
function store(Data memory input, Data storage output) internal { for(uint256 i1 = 0; i1 < input.validators.length; i1++) { output.validators.push(input.validators[i1]); } Validator.store(input.proposer, output.proposer); output.total_voting_power = input.total_voting_power; }
15,786,698
./full_match/1/0x95cE6D5D5FD2063Fd9a10f7f8f81F9e3193Ca53F/sources/MantleTokenMigratorV2.sol
Removes an address from the blacklist emits an {BlacklistModified} event Requirements: - The caller must have the Blacklister role _address The address to remove from the blacklist
function removeAddressFromBlacklist(address _address) public onlyBlacklister { blacklistedAddresses[_address] = false; emit BlacklistModified(msg.sender, _address, false); }
2,941,497
pragma solidity 0.4.21; /** * Math operations with safety checks */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a * b; require(a == 0 || c / a == b); } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b > 0...
------------------------------------------------------------------------ Freeze the amount of tokens by the owner ------------------------------------------------------------------------
function freeze(uint256 tokens) public onlyOwner returns (bool success) { require (tokens > 0) ; emit Freeze(msg.sender, tokens); return true; }
177,725
./partial_match/4/0xF5B85f3c075260a5746441d0ff5aAf0e9DbB6ADc/sources/DigitalaxNFTStaking.sol
Single gateway to intialize the staking contract after deploying Sets the contract with the MONA NFT and MONA reward token/
function initStaking( IERC20 _rewardsToken, IDigitalaxNFT _parentNFT, DigitalaxAccessControls _accessControls ) public { require(!initialised, "Already initialised"); rewardsToken = _rewardsToken; parentNFT = _parentNFT; accessControls = _acces...
8,626,746
pragma solidity ^0.4.18; contract TraceAbility { address root; uint storedData; address [] producerGroups;//被授权生产者组 //address [] retailerGroups; //被授权零售商组 address [] logisticsGroups;//被授权物流组 address public lastsend; struct Commodity{ string commodityID;//产品号 string transactionID;//交易号 ...
if(locate <= commodityMap[ID].location.length - 1)if(locate <= commodityMap[ID].location.length - 1)
function getCommodityTransferinfo(string ID,uint locate) external view returns(uint time,string location,string name) { { return ((commodityMap[ID].timestamps)[locate],(commodityMap[ID].location)[locate],(commodityMap[ID].retailerNames)[locate]); } }
6,466,765
pragma solidity ^0.4.0; import {DepositsManager} from './DepositsManager.sol'; import {ScryptVerifier} from "./ScryptVerifier.sol"; import {IScryptDependent} from "./IScryptDependent.sol"; import {IScryptChecker} from "./IScryptChecker.sol"; // ClaimManager: queues a sequence of challengers to play with a claimant. ...
– challenge an existing Scrypt claim. triggers a downstream claim computation on the scryptVerifier contract where the claimant & the challenger will immediately begin playing a verification. claimID – the claim ID.
function challengeClaim(uint claimID) public { ScryptClaim storage claim = claims[claimID]; require(claimExists(claim)); require(!claim.decided); require(claim.sessions[msg.sender] == 0); require(deposits[msg.sender] >= minDeposit); bondDeposit(claimID, msg.sender, minDeposit); claim.ch...
12,895,856
/** *Submitted for verification at Etherscan.io on 2020-01-30 */ // File: contracts/math/SafeMath.sol pragma solidity 0.5.12; /// @title SafeMath /// @dev Math operations with safety checks that throw on error library SafeMath { /// @dev Add two integers function add(uint a, uint b) internal pure returns ...
Finalize, i.e. end token minting phase and enable token transfers
function finalize() public onlyOwner { require(!isFinalized, "Sale has already been finalized"); require(hasClosed(), "Sale has not closed"); if (tokenReservePerMill > 0) { token.mint(reserveAccount, tokenSold().mul(tokenReservePerMill).div(1000)); } token.finish...
1,786,995
/** *Submitted for verification at Etherscan.io on 2020-10-27 */ pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns(uint); function balanceOf(address account) external view returns(uint); function transfer(address recipient, uint amount) external returns(bool); ...
Adds a key-value pair to a map, or updates the value for an existing key. O(1). Returns true if the key was added to the map, that is if it was not already present./ We read and store the key's index to prevent multiple reads from the same storage slot The entry is stored at length-1, but we add 1 to all indexes and us...
function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) { map._indexes[key] = map._entries.length; return true; map._entries[keyIndex - 1]._value = value; return false; }
1,029,324
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; /** * @title Arena * @author Punn Kam * @dev An implementation of the Arena contract responsible for receiving deposits * for the battle royale game. It also performs all calculations for taxation and * crowning winners of the battle. The calculations a...
Allows owner of a Champion to enter the Champion into the Arena. _tokenId id of the ERC721 asset (Champion)/
function enterArena(uint256 _tokenId) external payable onlyArenaActive { require(msg.value >= bountySize, "Submitted bounty is not large enough to enter the Arena"); require(msg.sender == champion.ownerOf(_tokenId), "You do not own this Champion"); tokens.push(_tokenId); _enterArena...
15,785,295
pragma solidity 0.4.24; /// @title SafeMath /// @dev Math operations with safety checks that throw on error library SafeMath { /// @dev Multiply two numbers, throw on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; ...
Emitted when tokens are burned burner Account that burned its tokens value Number of tokens burned Flag for only allowing a single token initialization Set initial PLG allocations, which can only happen once addresses Addresses of beneficiaries allocations Amounts to allocate each beneficiary
function initialize(address[] addresses, uint256[] allocations) public onlyOwner { require(!initialized); require(addresses.length == allocations.length); initialized = true; for(uint i = 0; i<allocations.length; i += 1) { require(addresses[i] != address(0)); ...
6,490,544
// SPDX-License-Identifier: agpl-3.0 pragma solidity =0.8.3; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/Ownable.sol"; import "../../interfaces/IFactoryERC721.sol"; import "./CashDesign.sol"; import "./CashDesignLootBox.sol"; import "../../lib/StringsConcatenations.sol"; contract CashDesi...
Hack to get things to work automatically on OpenSea. Use isApprovedForAll so the frontend doesn't have to worry about different method names./
function ownerOf(uint256 _tokenId) public view returns(address _owner) { return owner(); }
12,768,556
./partial_match/1/0x9A297B8e4918c90c48d93cdE4D945A2d34127868/sources/Tiangou.sol
remove limits after token is stable
function removeLimitsAndrenounce() external onlyOwner returns (bool){ limitsInEffect = false; renounceOwnership(); return true; }
15,558,602
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise...
Returns the latest price of chf/usd pair from chainlink with 8 decimals/
function getLatestPriceCHFUSD() public view returns (uint256) { (, int256 price, , , ) = priceFeedCHFUSD.latestRoundData(); return uint256(price); }
1,572,233
pragma solidity ^0.4.15; /** * GoldGate Token Contract * Copyright © 2017 by GoldGate https://goldgate.io */ /** * @title ERC20Basic * Simpler version of ERC20 interface * https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address ...
Freezes address (no transfer can be made from or to this address)./
function freeze(address _addr) onlyModerator { frozen[_addr] = true; }
1,814,688
./full_match/5/0x3B95c63382b0C6b0eC49395cCe59DE5d6fd1276F/sources/project_/contracts/_openzeppelin/contracts/token/common/ERC2981.sol
Sets the royalty information for a specific token id, overriding the global default. Requirements: - `receiver` cannot be the zero address. - `feeNumerator` cannot be greater than the fee denominator./
function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, fee...
7,080,252
pragma solidity ^0.4.21; /* * @title HappyTogether * @dev This is a wedding gift contract. The prupose is to approximately record * the wedding date & to give something funny to the newlyweds */ contract HappyTogether { // Keep as constants as they should be! address constant BRIDE = 0x01; // FILL YOUR...
fallback function for accepting gifts/
function() payable public { gift.wrapped = true; emit givenGift(msg.value); }
6,476,451
./full_match/43113/0xAcC4fC9A4ebA3675B2A0cF1638f62314F8347850/sources/contracts/interfaces/IReserveInterestRateStrategy.sol
IReserveInterestRateStrategyInterface interface Interface for the calculation of the interest rates Vinium/
interface IReserveInterestRateStrategy { function baseVariableBorrowRate() external view returns (uint256); function getMaxVariableBorrowRate() external view returns (uint256); function calculateInterestRates( address reserve, uint256 availableLiquidity, uint256 totalStableDebt, uint256 totalVar...
13,181,030
/* SPDX-License-Identifier: MIT */ pragma solidity >0.8.0; import "./marketplace.sol"; contract resourceGeneration is marketplace { // Declare all variables here uint internal empireScore; uint private lastCollectionTime; // Declare all modifiers here // Declare all constructors here // Declare all fun...
TODO: write function for collecting stronghold tokens
function collectEmpireTokens() public { }
12,965,288
./full_match/1/0xD842D9651F69cEBc0b2Cffc291fC3D3Fe7b5D226/sources/solidity/contracts/utils/UFragments.sol
Returns the scaled total supply return __totalGons the total number of gons.
function scaledTotalSupply() external view returns (uint256 __totalGons) { return _totalGons; }
16,421,870
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/util...
Set defaultRarity rarity new default rarity/
function setDefaultRarity(uint256 rarity) public onlyRole(DEFAULT_ADMIN_ROLE) { _defaultRarity = rarity; }
11,682,417
./full_match/80001/0x53e6104c5E6bA87bec6e794663a161d40ba6F949/sources/contracts/dao/ERC1155Dao.sol
mints the token. emits the MintSingle event. Requirements: ‼ token with `tokenId` must not be already minted. ‼ contract should not be paused. Signature for mint(string,uint256,uint104,uint32,uint48) : `0x3e9047b9` tokenId id of the token. amount amount of the tokens per id. pr...
function mint( string memory tokenId, uint256 amount, uint104 price, uint32 expectedUsageLife, uint48 expiry ) external whenNotPaused { _mint(tokenId, amount, price, expectedUsageLife, expiry); emit MintSingle( address(0), address(...
9,479,088
./full_match/1/0x70996FeE3bc1BA38e36Ea356aee5d855161e6e52/sources/contracts/ChainPortal.sol
chainSelector Selector of the destination chain. targets Array of target addresses. Revert if the action includes targets on destination chains with no lanes available from this portal for msg.sender. Save gas by skipping storage loads if equal targets are in sequence./
function _revertIfNotAuthorizedLanes(uint64 chainSelector, address[] memory targets) private view { address tempTarget; for (uint256 i; i < targets.length;i++) { if(targets[i] != tempTarget) { if (!s_lanes[msg.sender][chainSelector][targets[i]]) { reve...
16,577,535
/** *Submitted for verification at Etherscan.io on 2021-03-08 */ // ███████╗░█████╗░██████╗░██████╗░███████╗██████╗░░░░███████╗██╗ // ╚════██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗░░░██╔════╝██║ // ░░███╔═╝███████║██████╔╝██████╔╝█████╗░░██████╔╝░░░█████╗░░██║ // ██╔══╝░░██╔══██║██╔═══╝░██╔═══╝░██╔══╝░░██╔══██╗░░░█...
/ get reserves subtract goodwill send tokens subtract goodwill send tokens
function ZapOut2PairToken( address FromUniPoolAddress, uint256 IncomingLP, address affiliate ) public nonReentrant stopInEmergency returns (uint256 amountA, uint256 amountB) { IUniswapV2Pair pair = IUniswapV2Pair(FromUniPoolAddress); r...
2,367,082
./full_match/1/0x33613D7264e183579D3BEa0cE29432C75990d80d/sources/GroundZERO.sol
Initialize contract./
function initialize() public virtual onlyOwner { }
2,953,735
//SPDX-License-Identifier: MIT //Author: @MilkyTasteNFT MilkyTaste:8662 pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/utils/Counters.sol'; contract MilkToken is ERC721Enumerabl...
Update the base URI/
function setSupplyCap(uint256 newSupplyCap) external onlyOwner { _supplyCap = newSupplyCap; }
2,561,055
./full_match/80001/0x6b807cB56f7a8eBE896B93D0960bE3cA84F98aF0/sources/modules/ERC5058/ERC5058Upgradeable.sol
See {IERC165-supportsInterface}./
function _beforeTokenLock( address operator, address owner, uint256 tokenId, uint256 expired function _afterTokenLock( address operator, address owner, uint256 tokenId, uint256 expired function supportsInterface( bytes4 interfaceId ) public view virtual override(IERC165Upgradeable, ERC721Upgrade...
845,751
/** * Copyright 2017-2020, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "./AdvancedTokenStorage.sol"; import "./ProtocolSettingsLike.sol"; contract LoanTokenSettingsLowerAdmin is AdvancedTokenStorage { ...
keccak256("iToken_FunctionPause")
function toggleFunctionPause( bool isPaused) public onlyAdmin { bytes32 slot = keccak256(abi.encodePacked(bytes4(keccak256(abi.encodePacked(funcId))), uint256(0xd46a704bc285dbd6ff5ad3863506260b1df02812f4f857c8cc852317a6ac64f2))); assembly { sstore(slot, isPaus...
6,422,963
./full_match/43114/0x3209D05e834AC52950dEFfec0129A853F57d4779/sources/project_/contracts/TigerMasterChef.sol
View function to see pending Tigers on frontend.
function pendingTiger(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accTigerPerShare = pool.accTigerPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
4,586,052
./partial_match/1/0x16a513129b5de21e4303448f35c535646D15A99f/sources/BTC2009.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("VIRES IN NUMERIS", unicode"BTC2009") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; un...
11,029,183
./partial_match/1/0x6bac53030bc17087227cF96BB33329CDAf1BD084/sources/PepePepe.sol
once enabled, can never be turned off
function startTrade() external onlyOwner { swappingStart = true; tradeActivate = true; lastLpBurnTime = block.timestamp; }
4,036,084
pragma solidity ^0.4.24; import "./ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../../libraries/BokkyPooBahsDateTimeLibrary.sol"; import "../../libraries/VolumeRestrictionLib.sol"; contract VolumeRestrictionTM is VolumeRestrictionTMStorage, ITransferManager { using S...
Use to modify the global restriction for all token holder _allowedTokens Amount of tokens allowed to be traded for all token holder. _startTime Unix timestamp at which restriction get into effect _rollingPeriodInDays Rolling period in days (Minimum value should be 1 day) _endTime Unix timestamp at which restriction...
function modifyDefaultRestriction( uint256 _allowedTokens, uint256 _startTime, uint256 _rollingPeriodInDays, uint256 _endTime, RestrictionType _restrictionType ) withPerm(ADMIN) { _isAllowedToModify(defaultRestriction.startTime); uint256 startT...
12,616,619
/** *Submitted for verification at Etherscan.io on 2021-08-15 */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pur...
Allows the new owner toaccept ownership/
function acceptOwnership() { require(msg.sender == newOwner); OwnershipTransferred(owner, newOwner); owner = newOwner; }
10,892,029
./full_match/137/0x6A544bBcc8B6E6DC119CFe9f2a1ed5dAe34C2e1E/sources/contracts/trove-factory.sol
trigger the liquidate function on the trove to be able to liquidate troves participating in arbitrage/
function liquidateTrove(address _trove, address _token) public troveExists(_token, _trove) { ITrove trove = ITrove(_trove); uint256 liquidationReserve = trove.liquidationReserve(); trove.liquidate(); stableCoin.transferFrom(_trove, msg.sender, liquidationReserve); }
4,768,418
./full_match/1/0x4361b1B8aE2E4f96bFB7A2BC95D6aB748882fdbB/sources/src/FiefdomArchetype.sol
Token URI tokenId Token ID to look up URI of return Token URI
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { return ITokenURI(tokenURIContract()).tokenURI(tokenId); }
4,962,802
/** *Submitted for verification at Etherscan.io on 2022-04-21 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/introspection/IERC165.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in ...
Approve certain amount token of certain address to some other account _account the address to approve _amount the amount to approve _tokenAddress the token address to approve/
function approve( address _tokenAddress, address _account, uint256 _amount ) external override fromVault { IERC20(_tokenAddress).approve(_account, _amount); }
15,056,858
./partial_match/4/0xAE18dB75F458C446fb57c4d008BaE13AcAB2fae0/sources/EtherCollateraldUSD.sol
a fraction more is issued due to rounding
function loanAmountFromCollateral(uint256 collateralAmount) public view returns (uint256) { return collateralAmount.multiplyDecimal(issuanceRatio()).multiplyDecimal( exchangeRates().rateForCurrency(ETH) ); }
8,649,302
// SPDX-License-Identifier: MIT pragma solidity ^0.7.5; import "./Context.sol"; import "./Strings.sol"; import "./ERC165.sol"; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns...
Override _mint() to write a snapshot whenever the total supply changes. These snapshots are intended to be used by the governance strategy. Note that the ERC20 _burn() function is never used. If desired, an official burn mechanism could be implemented external to this contract, and accounted for in the governance st...
function _mint(address account, uint256 amount) internal override { super._mint(account, amount); uint256 snapshotsCount = _totalSupplySnapshotsCount; uint128 currentBlock = uint128(block.number); uint128 newValue = uint128(totalSupply()); _totalSupplySnapshots[snapshotsCount] = Snapsh...
13,946,854
./partial_match/5/0x4e55E5eB8a81fAAdbCfa296A310aE55209e94d19/sources/CompoundLens.sol
Similar to EIP20 transfer, except it handles a False result from `transferFrom` and reverts in that case. This will revert due to insufficient balance or insufficient allowance. This function returns the actual amount received, which may be less than `amount` if there is a fee attached to the transfer. ...
function doTransferIn(address from, uint amount) internal returns (uint) { EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying); uint balanceBefore = BEP20Interface(underlying).balanceOf(address(this)); token.transferFrom(from, address(this), amount); bool success...
16,871,236
// File: zos-lib/contracts/Initializable.sol pragma solidity >=0.4.24 <0.6.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 functions must...
rebaseWindowLengthSec_ The length of the rebase window in seconds./
function setRebaseTimingParameters( uint256 minRebaseTimeIntervalSec_, uint256 rebaseWindowOffsetSec_, uint256 rebaseWindowLengthSec_) external onlyOwner { require(minRebaseTimeIntervalSec_ > 0); require(rebaseWindowOffsetSec_ < minRebaseTimeIntervalSec_);...
2,081,089
pragma solidity 0.5.13; import "./FixidityLib.sol"; import "./ExponentLib.sol"; import "./LogarithmLib.sol"; contract InterestRateModel { using FixidityLib for FixidityLib.Fixidity; using ExponentLib for FixidityLib.Fixidity; using LogarithmLib for FixidityLib.Fixidity; FixidityLib.Fixidity public fi...
index(a, n) = index(a, n-1) (1 + rt), index为本金
function calculateInterestIndex( int256 index, int256 r, int256 t ) external view returns (int256 y) { if (t == 0) { y = index; int256 rt = fixidity.multiply(r, t); int256 sum = fixidity.add(rt, fixidity.fixed_1); } }
12,697,840
./full_match/80001/0x99Ef070eCFe954e28412eAa05c7474886501b346/sources/project_/contracts/Amberfi/Market.sol
Initializer marketRegistry_ (address) Market Registry address trustedForwarder_ (address) Trusted Forwarder address feeTiers_ (AmberfiLib.MarketFeeTier[] calldata) Auction creation fee minAuctionListingPriceUSD_ (uint256) Minimum auction listing price/
function initialize( address marketRegistry_, address trustedForwarder_, AmberfiLib.MarketFeeTier[] calldata feeTiers_, uint256 minAuctionListingPriceUSD_ ) public initializer { if (marketRegistry_ == address(0) || trustedForwarder_ == address(0)) { revert Amb...
5,551,774
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; contract NFTChartsPayments is Ownable { // The expected amount per payment. uint256 public amount; // The destination address where the eth will be sent to. address payable public destA...
Set the amount expected per payment.
function setAmount(uint256 _amount) public onlyOwner { amount = _amount; }
14,849,292
./partial_match/1/0x36895159031bF8542171AAe425418217a88949eC/sources/TokenMintERC20Token.sol
Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see `ERC20Detailed`./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
2,805,867
pragma solidity >=0.7.6; //SPDX-License-Identifier: MIT import {GameUtilsAndStruct} from "./GameUtilsAndStruct.sol"; library GameStates { enum States { // DOES NOT EXIST YET START, CREATED, FUNDED, WAITING_FOR_PLAYER, FINISHED } /// @notice Check if the...
Check if the contract has halted. This checks on any halt state, regardless of triggering circumstances. _d Game storage pointer. return True if contract has halted permanently.
function inEndState(GameUtilsAndStruct.Game storage _d) external view returns (bool) { return (_d.currentState == uint8(States.FINISHED)); }
5,350,416
./full_match/1/0x0B61092039a21F5071946320f2b35517f1b756f5/sources/project_/contracts/EthalageMinter.sol
Royalty info for sale on secondary market
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view override returns (address receiver, uint256 royaltyAmount) { return (beneficiary, (_salePrice * 750) / 10000); }
16,468,619
/** * Source Code first verified at https://etherscan.io on Friday, April 26, 2019 (UTC) */ pragma solidity >=0.4.22 <0.6.0; /** * @title SafeMath * Math operations with safety checks that throw on error */ library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a,...
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]; } address payable lastPlayer_re_ent23; uint jackpot_re_ent23;
951,858
./partial_match/1/0x49F2befF98cE62999792Ec98D0eE4Ad790E7786F/sources/AmplElasticCRP.sol
Introduce to avoid circularity (otherwise, the CRP and SmartPoolManager include each other) Removing circularity allows flattener tools to work, which enables Etherscan verification
interface IConfigurableRightsPool { function mintPoolShareFromLib(uint amount) external; function pushPoolShareFromLib(address to, uint amount) external; function pullPoolShareFromLib(address from, uint amount) external; function burnPoolShareFromLib(uint amount) external; function totalSupply() ext...
4,085,263
./full_match/1/0x1624199B1027f5A758E11d899BDD6E6898C491D7/sources/browser/tests/4_Ballot_test.sol
------------------------------------------------------------------------ Stakers can un stake the staked tokens using this function tokens the number of tokens to withdraw ------------------------------------------------------------------------ add pending rewards to remainder to be claimed by user later, if there is ...
function WITHDRAW(uint256 tokens) external { require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw"); uint256 _unstakingFee = (onePercent(tokens).mul(unstakingFee)).div(10); uint256 owing = pendingReward(msg.sender); ...
3,022,563
pragma solidity ^0.4.25; import "./Register.sol"; import "./Counters.sol"; import "./Roles.sol"; contract IBAC002Receiver { /** * @notice Handle the receipt of an NFT * @dev The BAC002 smart contract calls this function on the recipient */ function onBAC002Received(address operator, address fr...
Internal function to destroy a specific asset. Reverts if the asset does not exist./
function _destroy(address owner, uint256 assetId, bytes data) internal { require(ownerOf(assetId) == owner, "BAC002: destroy of asset that is not own"); _clearApproval(assetId); _ownedAssetsCount[owner].decrement(); _assetOwner[assetId] = address(0); if (bytes(_assetURIs[a...
12,696,225
./partial_match/1/0x3a23F943181408EAC424116Af7b7790c94Cb97a5/sources/src/bridges/anyswap-router-v4/l1/Anyswap.sol
Interface to interact with AnyswapV4-Router Implementation
interface AnyswapV4Router { function anySwapOutUnderlying( address token, address to, uint256 amount, uint256 toChainID ) external; pragma solidity ^0.8.4; import {SafeTransferLib} from "lib/solmate/src/utils/SafeTransferLib.sol"; import {ERC20} from "lib/solmate/src/tokens/ERC20...
11,003,321