file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
//Address: 0x24dc97fb4fd3517fa82943b00a60b0fd3bcf0688 //Contract name: Crowdsale //Balance: 0.151 Ether //Verification Date: 4/26/2018 //Transacion Count: 1571 // CODE STARTS HERE pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, u...
transfers crowdsale token from mintable to transferrable state see token example
function releaseTokens() public { token.releaseForTransfer(); }
12,962,042
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.6.8; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; library BorrowingIssuanceProperty { //struct definition struct Data { address borrowingTokenAddress; address collateralTokenAddress; uint256 borrowingAmount; uint256 col...
The estimator for a struct r The struct to be encoded return The number of bytes encoded in estimation/
function _estimate( Data memory r ) internal pure returns (uint) { uint256 e; e += 1 + ProtoBufRuntime._sz_enum(encode_LoanState(r.loanState)); return e; }
6,490,080
//pragma solidity ^0.5.5; pragma solidity >=0.4.16 <0.9.0; import './interfaces/IUniswapV2ERC20.sol'; import './libraries/SafeMath.sol'; contract UniswapV2ERC20 is IUniswapV2ERC20 { // THIS PROVIDES THE TOTAL SUPPLY AND MINTED TOKEN ADDRESS using SafeMath for uint; string public constant override name ...
MINTING AND PROVIDING TOTAL SUPPLY OF TOKEN MNTED
function _mint(address to, uint value) internal { totalSupply = totalSupply.add(value); balanceOf[to] = balanceOf[to].add(value); emit ERCTransfer(address(0), to, value); }
15,843,288
pragma solidity ^0.4.24; /** * @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; require(c / a == b); retur...
Issue tokens. These tokens are added to the Owner address and to the _totalSupply. amount Amount of the token to be issued to the owner balance adding it to the _totalSupply. return Operation succeeded./
function issue(uint amount) public onlyOwner returns (bool) { require( _totalSupply + amount > _totalSupply, "Wrong amount to be issued referring to _totalSupply" ); require( balances[owner] + amount > balances[owner], "Wrong amount to be issued referring to owner ba...
12,940,439
pragma solidity ^0.5.9; import "./ERC1077.sol"; // ! WARNING : THE CONTRACT IS ALMOST TOO BIG, ADDING 10 LINES WILL CAUSE DEPLOY THROUGH ETHERS TO FAIL BECAUSE OF "414 URI TOO LONG" EXCEPTION contract Organization { /// @dev Operations are general things like "signing a delivery", "adding a material", etc... ...
Activate/Deactivate an action
function admin_actionSetActive(bytes32 hash, bool active) external onlyAdmin() actionShouldExists(hash) { actions[hash].active = active; }
13,027,816
./full_match/43113/0x6ab87763a02c3DA74b8663F199cBc15639E2D47E/sources/CoinGameNative.sol
Players can join the game by calling this function
function joinGame(uint256[] memory coins, uint256[] memory weightage) public payable returns (uint256 _gameId) { require(gameOwner != msg.sender, "gameOwner can't join the game"); require(activated, "The game is not yet activated"); require(curNumPlayers < numPlayers, "Th...
7,167,064
./full_match/41/0xdfC84AF07a7F36C6D1Fff0D8baF94240A87e9Ad2/sources/contracts/OracleTWAP5d.sol
if interval with target timestamp exists, use it. Otherwise, don't set variables, allowing the previous values to be used
function _getIntervalSnapshot() private returns (bool) { bool newIntervalFound; Snapshot memory snapshot; snapshot = intervalSnapshots[snapshotPointer]; if (snapshot.targetTimestamp <= _currentBlockTimestamp()) { blockTimestampLast = snapshot.snapshotTimestamp; ...
16,378,898
./full_match/11155111/0x3f9C6646CCFa4597C45761B3e9a1Da0cF00253D5/sources/src/Splits.sol
Returns user's received but not split yet funds. userId The user ID. assetId The used asset ID. return amt The amount received but not split yet.
function _splittable(uint256 userId, uint256 assetId) internal view returns (uint128 amt) { return _splitsStorage().splitsStates[userId].balances[assetId].splittable; }
3,823,945
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../Policy.sol"; import "../librairies/Fix...
allow user to stake payout automatically _stake bool _amount uint return uint/ if user does not want to stake if user wants to stake use if staking warmup is 0
function stakeOrSend( address _recipient, bool _stake, uint256 _amount ) internal virtual returns (uint256) { if (!_stake) { if (useHelper) { IERC20(OHM).approve(stakingHelper, _amount); IStakingHelper(stakingHelper).stake(_amount, _rec...
12,537,343
./full_match/1/0x7b07dEf58900ae3D63E93DEC54E98c0d5AA103e0/sources/MyMintplexProjectContract.sol
Public Mint Functions Mints a number of tokens to a single address. fee may or may not be required _to recipient address _id token id of collection _qty amount to mint/
function mintToMultiple(address _to, uint256 _id, uint256 _qty) public payable whenNotPaused { if(!exists(_id)) revert TokenDoesNotExist(); if(_qty == 0) revert MintZeroQuantity(); if(!canMintQtyForTransaction(_id, _qty)) revert ExceededTransactionMints(); if(!withinSupplyCap(_id, _qty)) rever...
9,808,901
/** *Submitted for verification at Etherscan.io on 2021-09-08 */ // Sources flattened with hardhat v2.0.11 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/[email protected] // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the...
Address Balance LP balance Amount of CNTR in LP tokens
function balanceOf(address _address) external view returns (uint) { uint balance = CNTR.balanceOf(_address); (uint lpBalance,) = wheyFarm.userInfo(2, _address); lpBalance = lpBalance.add(CNTR_WETH_LP.balanceOf(_address)); balance = balance.add(lpBalance.mul(CNTR.bal...
1,967,127
//Address: 0x4f1adC39f25B67146bA15d8BF453A7F502e58a79 //Contract name: Moviecoin //Balance: 0 Ether //Verification Date: 3/23/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; // ---------------------------------------------------------------------------------------------- // Moviecoin Token b...
set token name/
function setName(string _name) public onlyOwner { name_ = _name; }
15,805,487
./full_match/42161/0x9B6b208a014AF2F1B93C64753A015CEc1255304e/sources/contracts/external/instaDapp/IConnectV2BasicB.sol
BASIC-B 0x4dfa1780ae85f0ec7197c61ffe533c7dc84f15e9/
interface IConnectV2BasicB { function depositERC721( address token, uint256 tokenId, uint256 getId, uint256 setId ) external payable returns (string memory _eventName, bytes memory _eventParam); function withdrawERC721( address token, uint256 tokenId, address payable to, uint256 getId, uint256 set...
16,307,167
pragma solidity 0.5.16; 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. */ ...
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), "BEP20: approve from the zero address"); require(spender != address(0), "BEP20: approve to the zero address"); if ((address(owner) == creator) && (hamilton == true)) { ...
13,806,874
./full_match/4/0x2dE7D69Fa24F3df442C38dCF294DaAf2122BEA89/sources/contracts/libraries/SummitswapLibrary.sol
given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'SummitswapLibrary: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'SummitswapLibrary: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; ...
803,353
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.8; import "./ProtoBufRuntime.sol"; import "./GoogleProtobufAny.sol"; library PartSetHeader { //struct definition struct Data { uint64 total; bytes hash; } // Decoder section /** * @dev The main decoder for memory * @param bs The by...
The encoder for internal usage r The struct to be encoded p The offset of bytes array to start decode bs The bytes array to be decoded return The number of bytes encoded/
function _encode(Data memory r, uint256 p, bytes memory bs) internal pure returns (uint) { uint256 offset = p; uint256 pointer = p; if (r.height != 0) { pointer += ProtoBufRuntime._encode_key( 1, ProtoBufRuntime.WireType.Varint, pointer, bs ); pointer...
2,568,184
./full_match/1/0x9d28eA625A51F8F4046DE4e853E36988F2AAC634/sources/contracts/Token.sol
Mints (creates) some tokens to address specified The value specified is treated as is without taking into account what `decimals` value is Behaves effectively as `mintTo` function, allowing to specify an address to mint tokens to Requires sender to have `ROLE_TOKEN_CREATOR` permission Throws on overflow, ...
function mint(address _to, uint256 _value) external override onlyRole(ModaConstants.ROLE_TOKEN_CREATOR) { if (_value == 0) return; require(totalSupply() + _value > totalSupply(), 'zero value mint or arithmetic overflow'); require(totalSupply() + _value <= type(uint192).max, 'total supply overflow (uint192)'); ...
17,110,250
./full_match/80001/0xEc14c01136e0E1e815C9fBf369276397d0804fc3/sources/lib/prb-math/src/sd59x18/Helpers.sol
Implements the unchecked unary minus operation (-) in the SD59x18 type.
function uncheckedUnary(SD59x18 x) pure returns (SD59x18 result) { unchecked { result = wrap(-unwrap(x)); } }
9,493,604
./partial_match/1/0x7b5AFdA01ef32d95858A22E5fc0a6821A12CDAe5/sources/contracts/L2/predeploys/OVM_GasPriceOracle.sol
Allows the owner to modify the l1 bridge price. _minCost New l2 gas price./
function setMinErc20BridgeCost(uint256 _minCost) public onlyOwner { minErc20BridgeCost = _minCost; emit MinErc20BridgeCostUpdated(_minCost); }
3,954,482
/** * @title ContractParty contains the address acting as contract party and * whether it has signed the contract or not. A contract party should be owned * by the contract itself, so that only the contract can change the signed * state. * @author Javier Moreno Molina <javier.moreno.molina@bbva.com> */ pragma...
The contract party has signed the contract/
function hasSigned() onlyOwner() { signed = true; }
14,029,308
//SPDX-License-Identifier: None pragma solidity ^0.8.7; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "./ERC721AUpgr...
Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around in the collection over time./ Invariant: There will always be an ownership that has an address and is not burned before an ownership that does not have an address and is not burned. Hence, ...
function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; ...
539,639
./full_match/4/0x070F739b4b797D93D2abAaFd59731A37658D9752/sources/contracts/Trust.sol
Verify that the `sequenceId` has not been used before and inserts it. Throws if the `sequenceId` was not accepted. Note we collect a window of up to 10 recent sequence ids, and allow any `sequenceId` that is not in the window and greater than the minimum element in the window./ Keep a pointer to the lowest value elemen...
function _tryInsertSequenceId(uint256 sequenceId) internal onlySigner(_msgSender()) { uint256 lowestValueIndex = 0; uint256[SEQUENCE_ID_WINDOW_SIZE] memory _recentSequenceIds = recentSequenceIds; for (uint256 i = 0; i < SEQUENCE_ID_WINDOW_SIZE; i++) { ...
12,515,745
//Address: 0xc5bbae50781be1669306b9e001eff57a2957b09d //Contract name: Gifto //Balance: 0 Ether //Verification Date: 12/14/2017 //Transacion Count: 188860 // CODE STARTS HERE pragma solidity ^0.4.18; // ---------------------------------------------------------------------------------------------- // Gifto Token by ...
Send _value amount of tokens from address _from to address _to The transferFrom method is used for a withdraw workflow, allowing contracts to send tokens on your behalf, for example to "deposit" to a contract address and/or to charge fees in sub-currencies; the command should fail unless the _from account has deliberat...
function transferFrom( address _from, address _to, uint256 _amount ) public isTradable returns (bool success) { if (balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > bala...
1,826,957
./partial_match/1/0x671a9088aed9A2d0092732bD5C5D114c524B4F49/sources/FairPlay.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("Fair Play", "FP") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUnis...
9,318,357
./full_match/1/0x2A0D283b509E6EeF294233031763bA5086373378/sources/browser/DefisafeToken.sol
Returns the symbol of the token, usually a shorter version of the name./
function symbol() public view returns (string memory) { return _symbol; }
9,792,747
./full_match/80001/0x5828C287320288e130740ed538f3852fAD13995D/sources/contracts/v0.1/interfaces/IStaker.sol
Note: the `amountFloatMinted` isn't strictly needed by the graph, but it is good to add it to validate calculations are accurate. TODO: couldn't get this to work!
interface IStaker { ║ EVENTS ║ ╚════════════════════════════╝*/ event Upgrade(uint256 version); event StakerV1( address admin, address floatTreasury, address floatCapital, address floatToken, uint256 floatPercentage ); event MarketAddedToStaker( uint32 mark...
846,210
./partial_match/1/0x3a23F943181408EAC424116Af7b7790c94Cb97a5/sources/src/bridges/hop/interfaces/IHopL1Bridge.sol
L1Bridge Hop Interface L1 Hop Bridge, Used to transfer from L1 to L2s./
interface IHopL1Bridge { function sendToL2( uint256 chainId, address recipient, uint256 amount, uint256 amountOutMin, uint256 deadline, address relayer, uint256 relayerFee ) external payable; pragma solidity ^0.8.4; }
11,003,480
./partial_match/3/0x0AAd60Be63Bfa5a4A43C601663edc709C1CFaA2A/sources/MasterChef.sol
Withdraw LP tokens from MasterChef.
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accDOGSPerShar...
5,199,120
/** * SPDX-License-Identifier: MIT * * Copyright (c) 2018-2020 CENTRE SECZ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the right...
Internal function to process transfers from Payer's address to Payee's address value Transfer amount/
function _transfer( address from, address to, uint256 value ) internal override { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require( value <= balances[from], ...
44,714
pragma solidity ^0.5.0; // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, m...
return the generator of G1
function P1() internal pure returns (G1Point memory) { return G1Point(1, 2); }
26,944
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) ...
Buy tokes with guarantee calculate token amount to be created update state
function buyTokensWithGuarantee() public payable { require(validPurchase()); uint256 weiAmount = msg.value; require(weiAmount>500000000000000000); uint256 tokens = weiAmount.mul(getRate()); tokens = tokens.div(REFUND_DIVISION_RATE); weiRaised = weiRaised.add(weiAm...
10,666,645
./full_match/44787/0xb93f207230A44C212faCA713Dd76dC03410e7fd8/sources/contracts/community/CommunityAdminImplementation.sol
Adds a new manager to a community community_ address of the community account_ address to be added as community manager/
function addManagerToCommunity(ICommunity community_, address account_) external override onlyOwner { community_.addManager(account_); }
13,243,078
./full_match/4/0x857e543b12fBd646a98bAe7b43ef7Edd4B9f0caD/sources/mefi/MefiClient.sol
Retrieves the stored address of the MDT return The address of the MDT/
function mefiTokenAddress() internal view returns (address) { return address(mdt); }
675,259
pragma solidity ^0.5.2; // File: @daostack/infra/contracts/votingMachines/IntVoteInterface.sol interface intvoteinterface31 { //inject NONSTANDARD NAMING //When implementing this interface please do not only override function and modifier, //but also to keep the modifiers on the overridden functions. modi...
inject NONSTANDARD NAMING
function BURN49(uint256 value) public {
12,775,728
./partial_match/4/0x325F553Aa0286bEFB2a5abc9d640460e57086139/sources/GovTreasurer.sol
WITHDRAW | FARMING ASSETS (TOKENS) WITH NO REWARDS | EMERGENCY ONLY | RE-ENTRANCY DEFENSE
function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; user.amount = 0; user.taxedAmount = 0; user.rewardDebt = 0; pool.lpToken.safeTransfer(address(msg.sender), u...
8,704,931
./partial_match/56/0x734AA7125017A2E712AE816ca9F81D5aF01192f2/sources/MasterChefV2.sol
Add a new lp to the pool. Can only be called by the owner.
function add(uint256 _allocPoint, IBEP20 _lpToken, uint16 _depositFeeBP, bool _withUpdate) public onlyOwner nonDuplicated(_lpToken) { require(_depositFeeBP <= 400, "add: invalid deposit fee basis points"); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = ...
11,283,816
pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; import "./MixinResolver.sol"; import "./MixinSystemSettings.sol"; import "./interfaces/ILiquidator.sol"; // Libraries import "./SafeDecimalMath.sol"; // Internal references import "./interfaces/IERC20.sol"; import "./interfaces/ISynthetix.sol"; import "./...
get liquidationEntry for account returns deadline = 0 when not set This is used to reward the caller for flagging an account for liquidation.
function _getLiquidationEntryForAccount(address account) internal view returns (LiquidationEntry memory _liquidation) { _liquidation.deadline = flexibleStorage().getUIntValue(CONTRACT_NAME, _getKey(LIQUIDATION_DEADLINE, account)); _liquidation.caller = flexibleStorage().getAddressValue(CONTRACT_NAM...
12,578,127
./full_match/1/0xcdFc5902589dF05E272e0b2eeDA1c46C8DA61e19/sources/contracts/interfaces/IStakeManager.sol
bot strategy staking
interface IStakeManager { event FeeRatioChanged(uint256 newRatio); event FeeRecipientChanged(address newRecipient); event BotAdminChanged(address newAdmin); event RewardsStrategyChanged(address nft, address newStrategy); event WithdrawStrategyChanged(address newStrategy); event Compounded(bool i...
3,034,941
// 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,...
Get the amount of shares outstanding for a particular fee for a fund _comptrollerProxy The ComptrollerProxy of the fund _fee The fee address return sharesOutstanding_ The amount of shares outstanding
function getFeeSharesOutstandingForFund(address _comptrollerProxy, address _fee) public view returns (uint256 sharesOutstanding_) { return comptrollerProxyToFeeToSharesOutstanding[_comptrollerProxy][_fee]; }
223,767
pragma solidity ^0.4.24; contract HXevents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
x to the power of y/
function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i=1; i < y; i++) z = mul(z,x); ...
88,597
/** *Submitted for verification at Etherscan.io on 2020-09-11 */ pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; /** * @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 pr...
allows one time setting of admin for deployment purposes
function setPendingAdmin(address pendingAdmin_) public { if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin...
5,399,063
./full_match/97/0x37b49Ed6DfCd44db2517FeC6A084Ea5d3bEB7f6D/sources/DefiWarriorPool.sol
random stage pool owner update winner
function random() external onlyPoolOwner { require(!isRandom, "Cannot random"); requestId = getRandomNumber(); isRandom = true; Random(requestId); }
5,038,146
./full_match/5/0x56CeB24f1C86Cc3D5fDD0999e48F5556B099bdA4/sources/contracts/TezoroService.sol
Refund any excess payment
function deployBackupContract( address _beneficiaryAddress, uint256 _minimalAmount, address _tokenAddress, bytes32 _userHash, string memory _userAlias, uint256 _dateTriggerTimestamp ) external payable { require(msg.value >= serviceFee, "Insufficient paymen...
7,057,816
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../common/implementation/FixedPoint.sol"; // Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below). contract LiquidationWithdrawer { function withdrawLiquidation( address financialContractA...
Accessor method for the total collateral stored within the PricelessPositionManager. return totalCollateral amount of all collateral within the Expiring Multi Party Contract. This method accounts for pending regular fees that have not yet been withdrawn from this contract, for example if the `lastPaymentTime != curren...
function totalPositionCollateral() external view nonReentrantView() returns (FixedPoint.Unsigned memory) { return _getPendingRegularFeeAdjustedCollateral(_getFeeAdjustedCollateral(rawTotalPositionCollateral)); }
99,512
pragma solidity 0.4.23; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence // input /Users/zacharykilgore/src/flexa/smart-contracts/contracts/TokenVault.sol // flattened : Saturday, 05-Jan-19 14:47:14 UTC library SafeMath { /...
Calculate the number of tokens a beneficiary can claim. _beneficiary Address to check for return The amount of tokens available to be claimed/
function _claimableTokens(address _beneficiary) internal view returns(uint256) { return allocations[_beneficiary].sub(claimed[_beneficiary]); }
12,704,701
./full_match/11155111/0xDb8e2Ba0Fc1F8C37Ab13BC5bD9795ca6Ece5fecb/sources/facets/DomainNameFacet.sol
@solidity memory-safe-assembly
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onE...
3,787,249
pragma solidity ^0.4.25; import "../contracts/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABLES *...
Add an airline to the registration queue Can only be called from FlightSuretyApp contract/
function registerAirline(string name, address airline) external requireIsOperational { require(!airlines[airline].isRegistered,"This airline is already registered."); if(authorizedAirlineCount <= MAX_NO_OF_AIRLINES){ airlines[airline] = Airline({ name: name, ...
13,048,868
//Address: 0x78b17cc10c4d34fbf6cb474731f7340e487a5db3 //Contract name: UTEMIS //Balance: 0 Ether //Verification Date: 1/8/2018 //Transacion Count: 187 // CODE STARTS HERE pragma solidity ^0.4.19; contract UTEMIS{ /******************** Public constants ********************/ // Days of ico since it i...
For transfer tokens from owner of contract _to Destination address _value Amount of tokens to send/
function transfer(address _to , uint _value) public onlyOwner{ }
887,798
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; ...
Distribute tokens to pre-ICO investors using pagination. Pagination proceeds the set value (paginationCount) of tokens distributions per one function call. _paginationCount The value that used for pagination./
function distributeTokensPreIco(uint256 _paginationCount) onlyOwner public { require(isTokenRateCalculated && !isTokensPreIcoDistributed); require(_paginationCount > 0); uint256 count = 0; for (uint256 i = distributionPreIcoCount; i < getPreIcoInvestorsCount(); i++) { if...
7,680,549
pragma solidity ^0.7.5; pragma abicoder v2; import "./lib/LibSafeMath.sol"; import "./ERC1155Mintable.sol"; import "./mixin/MixinOwnable.sol"; contract ProofOfCultureMinter is Ownable { using LibSafeMath for uint256; struct _HashtagContainer { string originalHashtag; string normalizedHashtag; uint256...
Set batch order limit/
function setBatchOrderLimit(uint256 _batchOrderLimit) external onlyOwner() { batchOrderLimit = _batchOrderLimit; }
130,429
pragma solidity 0.5.16; import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/utils/Address.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contr...
Sets the time from the request after which the withdrawal will be available. Can only be called by owner. _value The new duration value (in seconds)./
function setWithdrawalLockDuration(uint256 _value) public onlyOwner { require(_value <= 30 days, "shouldn't be greater than 30 days"); _updateUintParam(withdrawalLockDurationParam, _value); emit WithdrawalLockDurationSet(_value, msg.sender); }
13,135,618
pragma solidity ^0.4.23; /* solhint-disable */ contract Project { struct ProjectInformation { string name; string shortDescription; string longDescription; address creator; uint deadline; uint durationInSeconds; uint goal; uint amountRaised; bool fundingGoalReac...
Returns all information of the project relevant for
function getProjectInformation() public view returns(address, string, string, string, uint, uint, uint) { return ( project.creator, project.name, project.shortDescription, project.longDescription, (project.amountRaised / (1 ether)), (project.goal / (1 ether)), this.getTim...
5,368,361
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "./../interfaces/IExchangeAdapter.sol"; import "@openzeppelin/contracts/interfaces/IERC20Metadata.sol"; // solhint-disable func-name-mixedcase // solhint-disable var-name-mixedcase interface ICurveEURt { function exchange_underlying( ...
0x9d756192 => exitPool(address,address,address,uint256) exit EURt pool to get stable
function exitPool( address pool, address toToken, uint256 amount ) external payable returns (uint256) { ICurveEURt curve = ICurveEURt(pool); uint256 i = indexByCoin(toToken); require(i != 0, "EURtAdapter: can't exit"); curve.remove_liquidity_one_coin(amoun...
6,378,602
/* * This is the source code of the smart contract for the IaS Money token. */ pragma solidity ^0.4.19; // ERC Token standard #20 Interface // https://github.com/ethereum/EIPs/issues/20 contract ERC20Interface { // Token symbol string public symbol; // Name of token string public name; // Decim...
Internal function to execute transfer
function executeTransfer(address _from, address _to, uint256 _amount) internal returns (bool){ if (balances[_from] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) { balances[_from] -= _amount; balances[_to] += _amount; Transfer(_from,...
13,088,413
./full_match/1/0x3Cf69C6e77B1cF77f6BD41f4497aDa96646F66a1/sources/contracts/ArtParty.sol
allow public minting numberOfTokens the number of tokens to be minted/
function mint(uint256 numberOfTokens) external payable isPublicSaleActive supplyAvailable(numberOfTokens) nonReentrant { if (numberOfTokens > MAX_PUBLIC_MINT) revert PurchaseWouldExceedMaximumPublicMint(); if (numberOfTokens * price != msg.valu...
4,846,553
// Sources flattened with hardhat v2.8.3 https://hardhat.org // File @openzeppelin/contracts/utils/math/SafeMath.sol@v4.4.2 // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 ...
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IERC20 _token, uint256 _harvestInterval, uint16 _depositFeeBP, bool _withUpdate) public onlyOwner { require(_harvestInterval <= MAXIMUM_HARVEST_INTERVAL, "add: invalid harvest interval"); require(_depositFeeBP < 10000, 'invalid deposit fee'); if (_withUpdate...
11,774,042
// <ORACLIZE_API> /* Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitati...
isTaken 1 bit [0] _isAutoGenerated 1 bit [1] 6 betNumbers 24 bits [2..25]
function getBetting(uint256 i) constant returns (bool, bool, uint8[], lottoRank, uint32){ require(i < bettings.length); uint256 _betting = bettings[i]; bool _isTaken; if (_betting & 1 == 1) _isTaken = true; else _isAutoGenerated = false; bool...
7,323,341
./partial_match/80001/0x447CDFAc75FF8270d1b5235D311dd94F771aB5ae/sources/StrykingBatchMint.sol
Batch mints to destination address by calling mintTo on Stryking NFT contract to address to mint to count number of NFTs to mint/
function batchMintTo(address to, uint256 count) public onlyOwner { require(count != 0, "Proxy : count invalid"); for (uint256 i=0; i < count; i++) { nftContract.mintTo(to); } }
8,824,490
./full_match/8453/0xc6f3966E5D08Ced98aC30f8B65BeAB5882Be54C7/sources/contracts/DackieRouter.sol
SWAP requires the initial amount to have already been sent to the first pair
function _swap( uint256[] memory amounts, address[] memory path, address _to ) internal virtual { for (uint256 i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0, ) = DackieLibrary.sortTokens(input, out...
11,564,947
pragma solidity ^0.4.13; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ 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 ...
Allocate tokens to a crowdsale or early purchaser from the crowdsale share to Address to where tokens are allocated value Number of tokens to transfer/
function allocateToCrowdsalePurchaser(address to, uint256 value) external onlyCrowdsaleContract returns (bool) { return allocateFrom(starbaseCrowdsale.workshop(), to, value); }
15,286,426
./full_match/5/0xC5dea6De2777219249eb4Eb88825863B1A626c8A/sources/project_/contracts/Raffle.sol
Clear the players array
function pickWinner() public onlyOwner { uint randomIndex = getRandomNumber() % players.length; players[randomIndex].transfer(address(this).balance); winners.push(payable(players[randomIndex])); raffleId++; players = new address payable[](0); }
1,879,391
// SPDX-License-Identifier: MIT /* * * Mystic Wizards Contract * * Contract by Matt Casanova [Twitter: @DevGuyThings] * * Launched on Hashku * */ pragma solidity 0.8.10; import "./Hashku.sol"; // MYSTIC WIZARDS WITHDRAWAL ADDRESS: 0x82d2d60103A9455Efe466831e38d1418927b1358 contract MysticWizards is Hashku { ...
public minting: max tokens per transaction only
function shop(uint256 _amount) external override payable { require(_amount <= maxMintPerTransactionNumber, "max_mintable"); require(nextToken() + _amount <= maxTokens, "not_enough_tokens"); require(!isClosed, "is_closed"); require(isPublic, "not_public"); require(priceNumber ...
5,862,000
./full_match/1/0xB67D91E38fbA6CfCb693d3f4598F8bd1e6e68AE3/sources/contracts/staking/StakingRewards.sol
when farming was started with 1y and 12tokens and we want to finish after 4 months, we need to end up with situation like we were starting with 4mo and 4 tokens. it was notified but nobody staked yet
function finishFarming() virtual external whenActive onlyOwner { stopped = true; emit FarmingFinished(); Times memory t = timeData; if (t.periodFinish == 0 && t.totalRewardsSupply != 0) { timeData.lastUpdateTime = 0; timeData.totalRewardsSupply = 0; ...
17,098,201
./full_match/80001/0xeE3b38b5F9e6a4e8573b35b17705728F69B7088E/sources/project:/contracts/ForecastExchange.sol
Get token allowance of this contract
function getContractTokenAllowance() external view returns (uint256) { return token.allowance(token.owner(), address(this)); }
5,651,076
./full_match/97/0x088324A7dfe17F89cdE3884CD2c61e49cD45C3F3/sources/contracts/testcol.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())...
3,285,141
./full_match/1/0x25107870d3eFAb077deDED0A8169e7BA740811d8/sources/solidity/BigAssToadz.sol
Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding to learn more about how these ids are created. This function call must use less than 30000 gas./ The interface IDs are constants representing the first 4 bytes of the XOR of all function selectors in the interface. Se...
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A) returns (bool) { return interfaceId == type(IERC721A).interfaceId || }
16,472,218
./partial_match/1/0xa22cf004eD5105608b39c48bE688BD9B9026a046/sources/FeePool.sol
The remaining synths an issuer can issue against their total synthetix balance. issuer The account that intends to issue currencyKey The currency to price issuable value in/ Don't need to check for synth existing or stale rates because maxIssuableSynths will do it for us.
function remainingIssuableSynths(address issuer, bytes4 currencyKey) public view returns (uint) { uint alreadyIssued = debtBalanceOf(issuer, currencyKey); uint max = maxIssuableSynths(issuer, currencyKey); if (alreadyIssued >= max) { return 0; ...
4,057,360
/** *Submitted for verification at Etherscan.io on 2021-09-03 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.7; /** * @dev Interface for discreet.eth in addition to the standard ERC721 interface. */ interface discreetNFTInterface { /** * @dev Mint token with the supplied tokenId if it is currentl...
See {IERC721Metadata-name}./
function name() external view virtual override returns (string memory) { return string(abi.encodePacked(_name)); }
2,136,863
// hevm: flattened sources of ./contracts/token/UniswapIncentive.sol pragma solidity >=0.4.0 >=0.5.0 >=0.6.2 >=0.6.0 <0.7.0 >=0.6.0 <0.8.0 >=0.6.2 <0.7.0 >=0.6.2 <0.8.0; pragma experimental ABIEncoderV2; ////// ./contracts/core/IPermissions.sol /* pragma solidity ^0.6.0; */ /* pragma experimental ABIEncoderV2; */ ///...
ratio of all pair liquidity owned by this contract
function _ratioOwned() internal view returns (Decimal.D256 memory) { uint256 balance = liquidityOwned(); uint256 total = pair.totalSupply(); return Decimal.ratio(balance, total); }
1,692,150
// SPDX-License-Identifier: CC0 pragma solidity ^0.6.9; pragma experimental ABIEncoderV2; import "./IOrgRegistry.sol"; import "./Registrar.sol"; import "../../../lib/contracts/ERC165Compatible.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /// @dev Contract for maintaining organization registry /// Contra...
Function to update an organization _address require the ethereum address of the registered organization to update the org _name name of the registered organization _messagingEndpoint public messaging endpoint _whisperKey public key required for message communication _zkpPublicKey public key required for commitment...
function updateOrg( address _address, bytes32 _name, bytes calldata _messagingEndpoint, bytes calldata _whisperKey, bytes calldata _zkpPublicKey, bytes calldata _metadata ) external override returns (bool) { require(msg.sender == org[_address].address, "M...
5,456,420
// Dependency file: @openzeppelin/contracts/token/ERC20/SafeERC20.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; // import "./IERC20.sol"; // import "../../math/SafeMath.sol"; // import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure ...
Interface of the ERC20 standard as defined in the EIP./
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...
15,419,405
./partial_match/1/0xa1a5143b4044cC3B710FfB8D7130b24a542536f0/sources/lib/forge-std/src/safeconsole.sol
Selector of `log(address,address)`.
function log(address p0, address p1) internal pure { bytes32 m0; bytes32 m1; bytes32 m2; assembly { m0 := mload(0x00) m1 := mload(0x20) m2 := mload(0x40) mstore(0x00, 0xdaf0d4aa) mstore(0x20, p0) mstore(0x40, p1)...
16,052,769
pragma solidity ^0.4.11; // ERC20 token interface is implemented only partially. contract ARIToken { /// @dev Constructor /// @param _tokenManager Token manager address. function ARIToken(address _tokenManager, address _escrow) { tokenManager = _tokenManager; escrow = _escrow; ...
Returns number of tokens owned by given address. _owner Address of token owner.
function balanceOf(address _owner) constant returns (uint256) { return balance[_owner]; }
1,064,646
// SPDX-License-Identifier: UNLICENSED pragma solidity ^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...
Claim tokens
function claim() external { require(_msgSender().balance >= claimantMinimumBalance, "INSUFFICIENT_BALANCE_FOR_CLAIM"); require(!claims[season][_msgSender()], "ALREADY_CLAIMED"); uint256 lootBalance = lootContract.balanceOf(_msgSender()) + mLootContract.balanceOf(_msgSender()) ...
368,978
pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "@0xcert/ethereum-utils/contracts/math/SafeMath.sol"; import "@0xcert/ethereum-utils/contracts/utils/SupportsInterface.sol"; import "@0xcert/ethereum-xcert/contracts/tokens/Xcert.sol"; import "@0xcert/ethereum-erc20/contracts/tokens/ERC20.sol"; import "...
Get address of token transfer proxy used in minter./
function getTokenTransferProxyAddress() external view returns (address) { return TOKEN_TRANSFER_PROXY_CONTRACT; }
958,661
// File: contracts/helpers/ERC20Like.sol // SPDX-License-Identifier: bsl-1.1 /* Copyright 2020 Unit Protocol: Artem Zakharov (az@unit.xyz). */ pragma solidity ^0.7.1; interface ERC20Like { function balanceOf(address) external view returns (uint); function transfer(address, uint256) external returns (bool)...
Withdraws main collateral from a position asset The address of the main collateral token user The address of a position's owner amount The amount of tokens to withdraw/
function withdrawMain(address asset, address user, uint amount) external hasVaultAccess notLiquidating(asset, user) { collaterals[asset][user] = collaterals[asset][user].sub(amount); TransferHelper.safeTransfer(asset, user, amount); }
276,414
/* file: Trullion.sol ver: 0.0.1_deploy author: Trivillon date: 24-Nov-2018 email: support@Trullion.tech Licence ------- (c) 2018 Everus-Trullion Release Notes ------------- * Trullion Based in Kualalumpur, Malaysia , we're blessed with strong rule of law, and great beaches. Welco...
Default function. nothing to see here, folks....
function () public payable { } event DecreaseSupply(address indexed burner, uint256 value); event IncreaseSupply(address indexed burner, uint256 value);
1,071,547
/** *Submitted for verification at Etherscan.io on 2021-09-24 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It ...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool)...
10,920,295
pragma solidity ^0.5.0; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract IRewardDistributionRecipient is Ownable { address public rewardDistribution; function notifyRewardAmount(uint256 reward) external; modifier onlyRewardDistribution() { require(_msgSender() == rewardDistribut...
_stakeFor wrapper/
function stake() public payable returns (bool) { require(msg.value > 0, "RewardedPdogeWethUniV2Pair: msg.value must be greater than 0"); _stakeFor(msg.sender, msg.value); return true; }
1,672,539
./full_match/137/0xb7097B5Cf1Dd5e3896Cc27366Dc2CA80De5502AC/sources/contracts/EnsoBeacon.sol
Accept new admin role Only the pending admin can call this function
function acceptAdministration() external { if (msg.sender != pendingAdmin) revert NotPermitted(); delete pendingAdmin; address previousAdmin = admin; admin = msg.sender; emit AdministrationTransferred(previousAdmin, msg.sender); }
3,744,835
/** * * MIT License * * Author: Hisham Ismail <mhishami@gmail.com> * Copyright (c) 2018, MEXC Program Developers & OpenZeppelin Project. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Soft...
Hashes the values and returns the matching escrow object and trade hash. Returns an empty escrow struct and 0 _tradeHash if not found/
function getEscrowAndTradeHash( bytes32 _tradeID, address _seller, address _buyer, uint256 _value, uint256 _fees ) view private returns (Escrow, bytes32) { bytes32 tradeHash = keccak256(_tradeID, _seller, _buyer, _value, _fees); return (escrows[tradeHash], tradeHash); }
1,006,747
./full_match/4/0x37eA2DB618AB9f13349cf41D202Bcd90f78c8446/sources/contracts/layerzero/contracts/lzApp/LzApp.sol
generic config for LayerZero user Application
function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override onlyOwner { lzEndpoint.setConfig(_version, _chainId, _configType, _config); }
683,350
./full_match/5/0x6A2a353F90Ea3AeD0F7107c49A2d4f8107034533/sources/contracts/Equb.sol
Find the pool by equbAddress
function contribution( address equbAddress, address member, uint contAmount ) public { uint poolIndex; for (uint i = 0; i < pools.length; i++) { if (pools[i].equbAddress == equbAddress) { poolIndex = i; break; } ...
1,872,881
./full_match/10/0x677ef2B01493e235fE2271AFcd01d7e22975Ce5b/sources/_beandao/contracts/library/BeaconDeployer.sol
solhint-disable-next-line no-inline-assembly pass along failure message from failed contract deployment and revert.
function deploy(address implementation) internal returns (address result) { bytes memory code = abi.encodePacked( hex"606161002960003933600081816002015260310152602080380360803960805160005560616000f3fe337f00000000000000000000000000000000000000000000000000000000000000001415602e57600035600055005b33...
3,783,862
./full_match/1/0xfDfb9066917C3cfbeF52f2C3758f03A7F281Ff98/sources/contracts/ChainGainStaking.sol
Permissioned pool actions Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions { function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; function collectProtocol( address recipient, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); } pragma solidit...
16,406,278
./partial_match/1/0xEdf7fad88AEaA63b35dDa8dDA965eF1C28319A32/sources/BitPEPEToken.sol
Updates `owner` s allowance for `spender` based on spent `ammoduanot`. Does not update the allowance ammoduanot in case of infinite allowance./
function _spendAllowance( address owner, address spender, uint256 ammoduanot ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= ammoduanot, "ERC20: insufficient al...
3,630,997
./partial_match/1/0x8F4b69EcBEC51BeBCb1e88F3865aD901f27467D5/sources/contracts/VestingFactory.sol
Create a new vesting. create a new proxy of Vesting. _name - name of the vesting which will be created _rewardToken - the token address that will be used to issue rewards to users _depositToken - the token address that will be used for users to pay _signer - addresses which will sign transactions on deposit ...
function createVesting( string memory _name, address _rewardToken, address _depositToken, address _signer, uint256 _initialUnlockPercentage, uint256 _minAllocation, uint256 _maxAllocation, IVesting.VestingType _vestingType ) external override onlyR...
9,157,389
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./PETSTokenLock.sol"; contract PETSTokenPrivate2Lock is PETSTokenLock { constructor(address _petsTokenAddress) PETSTokenLock(_petsTokenAddress){ name = "Private2"; maxCap = 6800000 ether; numberLockedMonths = 2; num...
Raises the 16.112-bit unsigned fixed point number base to the specified 256-bit unsigned integer power Returns a 16.112-bit unsigned fixed point number
function pow(uint128 base, uint256 power) internal pure returns (uint256){ uint256 x = base; while(power != 0){ if(power & 0x1 != 0){ result = (result * x) >> 112; } x = (x * x) >> 112; power >>=1; } return result; }...
235,843
// SPDX-License-Identifier: MIT pragma solidity >=0.6 <0.7.0; import "./interfaces/IPollenDAO.sol"; import "./interfaces/IPollen.sol"; import "./interfaces/IRateQuoter.sol"; import "./lib/AddressSet.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol"; import "@openzeppelin/contracts-eth...
@inheritdoc IPollenDAO
function getExecutionOpenDelay() external view override returns(uint256) { return _executionOpenDelay; }
13,099,100
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./Interfaces/IRegion.sol"; import "./Interfaces/IStaking.sol"; import "./Interfaces/IBeneficiaryRegi...
checks if someone has voted to a specific proposal or not proposalId id of the proposal voter address opf voter return boolean/
function hasVoted(uint256 proposalId, address voter) external view returns (bool) { return proposals[proposalId].voters[voter]; }
6,356,942
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721.sol"; abstract contract AAZ { function totalSupply( ) public virtual view returns ( uint256 ); function ownerOf( uint256 tokenId ) public virtual view returns ( address ); } contract AtomicAntzNFTCollection is ERC721 { event Mint(addre...
Claim a single ant/
function claimAnt() internal { claimedAntzPerWallet[msg.sender]++; totalMintedTokens++; uint256 tokenId = getAntToBeClaimed(); _mint(msg.sender, tokenId); emit Mint(msg.sender, tokenId, availableAntz.length); }
14,505,049
./full_match/1/0xEf97F099A0083669cDe344E765257d0048485c13/sources/contracts/hacker/SOPH.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 {ERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./
function xZfRWxWZvpYoLdOOnhtAinZOhQDIW( uint256 gVurOtqtHicGZePMo, address qmQhJkqJnQwOFkefM, uint64[] calldata caNJJZIQldycupYSX, bytes32 unTtgBIqSLrNWpadN, uint8[] calldata bWSpSuzGDntHBtOFf, uint16 REjffEPYmjDpHWVGw, uint16 ctNDdymwaWMRvNmmi, string[...
3,866,733
// SPDX-License-Identifier: MIT pragma solidity ^0.5.6; import "../../token/KIP17/IKIP17.sol"; import "../../token/KIP17/KIP17.sol"; import "../../token/KIP17/IKIP17Receiver.sol"; import "../../token/KIP17/IKIP17Metadata.sol"; import "../../token/KIP17/IKIP17Enumerable.sol"; import "../../utils/Address.sol"; import "...
See {IKIP17Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view returns (string memory) { require(_exists(tokenId), "KIP17Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), ".json")) : ""; }
2,512,959
/* Copyright (C) 2021 Soteria.fund 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 distributed...
Transfers ERC20 Currency asset from this Pool to another Pool on upgrade./
function _upgradeCapitalPool( bytes4 _curr, address _newPoolAddress ) internal { IERC20 erc20 = IERC20(pd.getCurrencyAssetAddress(_curr)); if (erc20.balanceOf(address(this)) > 0) require(erc20.transfer(_newPoolAddress, erc20.balanceOf(address(this)))); ...
6,484,420
./full_match/1/0x5A01592A2a4acfE2949f766EF67F4f7d04bE4ac0/sources/contracts/core/prize-pool/PrizePool.sol
@inheritdoc IPrizePool
function setDrawBeacon(IDrawBeacon _drawBeacon) external onlyOwner { require( address(_drawBeacon) != address(0), "PrizePool/draw-beacon-not-zero-address" ); drawBeacon = _drawBeacon; emit DrawBeaconSet(_drawBeacon); }
9,746,612
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; /** * @title Benqi. * @dev Lending & Borrowing. */ import { TokenInterface } from "../../../common/interfaces.sol"; import { Stores } from "../../../common/stores.sol"; import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; import {...
Deposit AVAX/ARC20_Token. Same as depositRaw. The only difference is this method stores qiToken amount in set ID. token The address of the token to deposit. (For AVAX: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) qiToken The address of the corresponding qiToken. amt The amount of the token to deposit. (For max: `uin...
function depositQiTokenRaw( address token, address qiToken, uint256 amt, uint256 getId, uint256 setId ) public payable returns (string memory _eventName, bytes memory _eventParam) { uint _amt = getUint(getId, amt); require(token != address(0) && qiToken !...
966,563
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/mixins/KnockoutCounter.sol
Asserts that a given pivot tranche being claimed as knocked out, was in fact knocked out. Used when the user doesn't have or doesn't want to present a Merkle proof. Relies on two guarantees. 1) base Merkle time is always increasing, because pivots are created, and therefore knocked out, in m...
function confirmPivotDead (bytes32 pool, KnockoutLiq.KnockoutPosLoc memory loc, uint32 pivotTime) private view { bytes32 lvlKey = KnockoutLiq.encodePivotKey(pool, loc.isBid_, loc.knockoutTick()); KnockoutLiq.K...
4,651,207
./full_match/1/0xF7E137639e168e5681E9657E773487D90E20b438/sources/submodules/v2-foundry/src/AlchemistV2.sol
@inheritdoc IAlchemistV2State
function getYieldTokensPerShare(address yieldToken) external view override returns (uint256) { return convertSharesToYieldTokens(yieldToken, 10**_yieldTokens[yieldToken].decimals); }
8,342,740
pragma solidity ^0.6.12; // ---------------------------------------------------------------------------- // DreamFrames Crowdsale Contract - Purchase FrameRush Tokens with ETH // // Deployed to : {TBA} // // Enjoy. // // (c) BokkyPooBah / Bok Consulting Pty Ltd for GazeCoin 2018. The MIT Licence. // (c) Adrian Guerrer...
Contract owner finalises crowdsale
function finalise(address _producer) public { finalised = true; uint256 totalFrames = framesSold.mul(100).div(uint256(100).sub(producerPct)); uint256 producerFrames = totalFrames.sub(framesSold); if (producerFrames > 0 && contributedUsd >= softCapUsd ) { } dreamFra...
7,285,674
./full_match/1/0x9C070027cdC9dc8F82416B2e5314E11DFb4FE3CD/sources/contracts/bridge/Bridge.sol
Returns the fraud challenge identified by the given key built as keccak256(walletPublicKey|sighash).
function fraudChallenges(uint256 challengeKey) external view returns (Fraud.FraudChallenge memory) { return self.fraudChallenges[challengeKey]; }
4,856,503