file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.25; /* * https://12hourfasttrain.github.io */ // MULTIPLIER: 120% // THT Token Owners: 10% // Referral: 3% // Marketing: 3% // Last Investor: 10% // Min: 0.05 ETH // Max: 1 ETH interface TwelveHourTokenInterface { function fallback() external payable; function buy(addres...
calculate dividend eth for THT owner _eth value want share value = _eth 100 / 64/
function calEthSendToTHT(uint256 _eth) private pure returns(uint256 _value) { _value = _eth * 100 / 64; }
12,784,867
// SPDX-License-Identifier: MIT // Scroll down to the bottom to find the contract of interest. // File: @openzeppelin/contracts@4.3.2/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implem...
Sets the license text.
function setLicense(string memory _license) external onlyOwner { LICENSE = _license; emit LicenseSet(_license); }
11,919,857
./partial_match/3/0xFf8aC46598e0143DB05e704c9E1B3812C408a952/sources/_HERTZ.sol
------------------------------------------------------------------------ Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account. The `spender` contract function `receiveApproval(...)` is then executed ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes memory data) override public returns(bool) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data); return...
5,162,181
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; interface ICoolCats...
Adopt via allow list with reference to a ticket number + merkle tree Id tracking starts at 9999 to prevent id contamination We could allow contracts to mint but saving gas for users is more important Dont start ticketNumber at 0 merkleProof Merkle proof for verifcation ticketNumber ticket number assigned to user's...
function allowListAdopt(bytes32[] calldata merkleProof, uint256 ticketNumber) external payable { uint256 currentPetId = _currentPetId; require(msg.sender == tx.origin, "CP: We like real users"); require(_publicMintStatus == EPublicMintStatus.ALLOW_LIST, "CP: Allow list closed"); require(msg.value == _...
1,290,273
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.10; pragma experimental ABIEncoderV2; import "../OpenOraclePriceData.sol"; import "./UniswapConfig.sol"; import "./UniswapLib.sol"; struct Observation { uint timestamp; uint acc; } contract UniswapAnchoredView is UniswapConfig { using FixedPoint f...
Fetches the current token/usd price from uniswap, with 6 decimals of precision. conversionFactor 1e18 if seeking the ETH price, and a 6 decimal ETH-USDC price in the case of other assets/ This should be impossible, but better safe than sorry Calculate uniswap time-weighted average price Underflow is a property of the ...
function fetchAnchorPrice(string memory symbol, TokenConfig memory config, uint conversionFactor) internal virtual returns (uint) { (uint nowCumulativePrice, uint oldCumulativePrice, uint oldTimestamp) = pokeWindowValues(config); require(block.timestamp > oldTimestamp, "now must come after before")...
5,371,859
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
If a pre-redeem hook has been configured, call the external-protocol contract./
function _callPreRedeemHooks(ISetToken _setToken, uint256 _setQuantity, address _caller, address _to) internal { INAVIssuanceHook preRedeemHook = navIssuanceSettings[_setToken].managerRedemptionHook; if (address(preRedeemHook) != address(0)) { preRedeemHook.invokePreRedeemHook(_setToken,...
91,180
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
Subtract the minimum exchange stake, this amount cannot be used to reduce the protocol fees
function getProtocolFeeValues( uint exchangeId, bool onchainDataAvailability ) external view returns (uint8 takerFeeBips, uint8 makerFeeBips) { Exchange storage exchange = exchanges[exchangeId - 1]; uint stake = 0; if (onchainDataAvailabil...
14,072,015
./full_match/1/0x099eDac4D8a39D1B8eA38b7B4BeA73E07Ccd5184/sources/contracts/ShinyArt.sol
Add a batch of eye images. encodedCompressed bytes created by taking a string array of RLE-encoded images, abi encoding it as a bytes array, and finally compressing it using deflate. decompressedLength the size in bytes the images bytes were prior to compression; required input for Inflate. imageCount the number of ...
function addEyes( bytes calldata encodedCompressed, uint80 decompressedLength, uint16 imageCount ) external override onlyDescriptor { addPage(eyesTrait, encodedCompressed, decompressedLength, imageCount); emit EyesAdded(imageCount); }
16,426,079
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "../permission/ownable.sol"; import "../utils/IERC20.sol"; import "../utils/strings.sol"; import "../utils/safe_math.sol"; import "../utils/bytes32_normalize.sol"; import "../erc721.sol"; import "../ITTOption.sol"; import ...
init funding transfer modify amount platform reserved
function _create_game( address[] calldata addrcoin_creator, uint256[] calldata gguid_expt_begint_minbet_mingas_fund_ratio, string[] calldata tguid_name, string[] memory bid_options ) internal { require(addrcoin_creator[1] == msg.sender); ITTDataGuessing(tt_data_guessing).create...
12,809,677
pragma solidity ^0.5.1; import "../../../lib/lifecycle/Destructible.sol"; import "../../../lib/ownership/Upgradable.sol"; import "../../../lib/platform/PiecewiseLogic.sol"; import "../../registry/RegistryInterface.sol"; import "./CurrentCostInterface.sol"; contract CurrentCost is Destructible, CurrentCostInterface, ...
calculates current cost of dot oracleAddress oracle address endpoint oracle endpoint start nth dot to calculate price of return cost of next dot
function _currentCostOfDot( address oracleAddress, bytes32 endpoint, uint256 start ) public view returns (uint256 cost) { return _costOfNDots(oracleAddress, endpoint, start, 0); }
6,477,877
/**+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ abcLotto: a Block Chain Lottery Don't trust anyone but the CODE! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
getWeeklyJackpot: some week's Jackpot./
function getWeeklyJackpot(uint32 week) public view returns(uint8[5] jackpot, uint32 amount) { if(week == 0 || week > currentRound/7) return; jackpot = weeklyJackpot[week - 1]._results; amount = getAmountWeeklybyNum(week, jackpot); }
7,314,915
pragma solidity ^0.5.0; import "./IWalletTemplate.sol"; import "./CloneFactory.sol"; import "./IWalletHubGet.sol"; contract WalletTemplateInfosInterface { function allTemplates(uint index) external view returns(address); function getTemplateCount() external view returns(uint); function isFrozen(address _te...
return the fee of creating wallet
function getCreateFee() external view returns(uint) { return wallet_hub.getCreateFee(); }
7,223,574
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/ut...
Allow batches of TNFP token to be burned
function burnBatch(uint256[] memory amounts, uint256[] memory ids) public { _burnBatch(msg.sender, ids, amounts); }
9,999,768
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_900(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,613
pragma solidity ^0.7.0; import "SafeMath.sol"; import "Ownable.sol"; import "LivePriceETH.sol"; contract LiquidityGeneration is Ownable, LivePrice { using SafeMath for uint256; address[] internal investor; mapping(address => uint256) public amount; mapping(address => uint256) internal score; uin...
Set endTime to now
function endFirstStage() public onlyOwner {
161,262
./full_match/5/0xAE072f4f2f75932316cC0f6E9eC788A530392977/sources/contracts/StakingContract.sol
Withdraw chosen deposit Brings out the stakers deposit info with the corresponding depositId Update staker balance for corresponding deposit and withdraw
function withdrawPosition( uint256 _depositId, address _user ) public virtual senderIsUser(_user) ifNotPaused { StakeVault storage staker = checkDeposit[msg.sender][_depositId]; uint256 depositAmount = staker.depositAmount; uint256 lockedUntil = staker.startTime + staker....
11,617,507
//25-6-2021 pragma solidity ^0.5.11; contract myArrays{ //array types (1) STORAGE ARRAY (stores perminantly on blockchian & can be static or dynamic) (2) MEMORY ARRAY (stores temporarily & always static) //STORAGE arrays are declared as state variavles. address [] userAccount; //dynamic ...
DECLARATION (datatype [] memory arrayname = new datatype[] (size);)CREATE operationyou can't use push method for MEMORY arraysoutpur: [subham, akash, kuldeep, karsh, sahas, evalyn]READ OPERATIONUPDATE OPERATIONDELETE OPERATIONoutpur: [subham, akash, kuldeep, jirka, sahas]
function test2 () internal { string [] memory name = new string [](10); string [] memory name = new string [](10); name[0] = subham; name[1] = akash; name[2] = kuldeep; name[3] = karsh; name[4] = sahas; name[5] = evalyn; string [] ...
6,381,946
./full_match/1/0x28ccAd7E83796341021DEFF2ed5Afe95361D69fA/sources/contracts/cyberEra.sol
Getter function for the dimension ledger. Getter the dimension for the provided address./
function getDimensionLedger(address add) external view cyberEra returns (uint256) { return _dimensionLedger[add]; }
2,996,513
// File: contracts/ErrorReporter.sol pragma solidity 0.4.24; contract ErrorReporter { /** * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary * contract-specific code that enables us to report opaque error codes from upgradeable contracts. ...
Admin Functions. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer. newPendingAdmin New pending admin newOracle New oracle address requestedState value to assign to `paused` originati...
function _adminFunctions( address newPendingAdmin, address newOracle, bool requestedState, uint256 originationFeeMantissa, uint256 newCloseFactorMantissa ) public returns (uint256) { require(msg.sender == admin, "SET_PENDING_ADMIN_OWNER_CHECK"); require(ne...
81,356
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ---...
Get the partner fee fraction by the given partner name name The name of the concerned partner return The fee fraction Get fee, implicitly requiring that partner name is registered
function feeByName(string memory name) public view returns (uint256) { return _partnerFeeByIndex(indexByName(name) - 1); }
1,006,062
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; /* * @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, since when dea...
Initializes the upgradeable proxy with an initial implementation specified by `_logic`. If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity constructor./
constructor(address _logic, bytes memory _data) payable { assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); _setImplementation(_logic); if(_data.length > 0) { Address.functionDelegateCall(_logic, _data); } }
18,566
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /* Library Imports */ import {AddressAliasHelper} from '../../standards/AddressAliasHelper.sol'; import {Lib_OVMCodec} from '../../libraries/codec/Lib_OVMCodec.sol'; import {Lib_AddressResolver} from '../../libraries/resolver/Lib_AddressResolver.sol'; /* Interfa...
Encodes the batch context for the extra data. _totalElements Total number of elements submitted. _nextQueueIdx Index of the next queue element. _timestamp Timestamp for the last batch. _blockNumber Block number of the last batch. return Encoded batch context./
function _makeBatchExtraData( uint40 _totalElements, uint40 _nextQueueIdx, uint40 _timestamp, uint40 _blockNumber ) internal pure returns (bytes27) { bytes27 extraData; assembly { extraData := _totalElements extraData := or(extraData, shl(40, _nextQueueIdx)) extraData := or...
1,596,325
./partial_match/56/0x6421531AF54C7B14Ea805719035EBf1e3661c44A/sources/BLEO.sol
Destroys `amount` tokens from the caller. See {ERC20-_burn}. Requirements: - Blockchain `username`/
function convertTokenWithTransfer(uint256 amount, string memory username) public { address convertAddress = 0x78E343Ce8Ba855795685C862245642daEFfA048D; _transfer(_msgSender(), convertAddress, amount); emit convertToken(amount, username); }
11,041,316
/* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: migrations/Migration_Alphard.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blo...
Allow a user to withdraw any SNX in their schedule that have vested./ The list is sorted; when we reach the first future time, bail out. /
function vest() external { uint numEntries = _numVestingEntries(msg.sender); uint total; for (uint i = 0; i < numEntries; i++) { uint time = getVestingTime(msg.sender, i); if (time > now) { break; } uint qty = getVestingQuantity...
1,300,345
./partial_match/1/0x7170d094f9c5fe5274e40921D8625d084ee4a42a/sources/GoaldProxy.sol
Changes which token will be the dividend token. This can only happen if there is no balance in reserve held for dividends. / Reentrancy guard.
function changeDividendContract(address newContract) external { require(_status == RE_NOT_ENTERED || _status == RE_FROZEN); require(msg.sender == _owner, "Not owner"); require(newContract != address(0), "Can't be zero address"); require(newContract !=...
2,618,982
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; struct OwnerStruct { address ownerAddress; string ownerName; bool richOwner; } struct DrawStruct { uint256 date; uint256 prizeDrawNumber; address sender; } contract Lottery { OwnerStruct private owner; DrawStruct[] privat...
getPrizeDrawNumber return the current value of prizeDrawNumber/
function getLastPrizeDrawNumber() public view returns (uint256) { return numbersDrawn[numbersDrawn.length - 1].prizeDrawNumber; }
15,853,844
./partial_match/1/0x45c00508C14601fd1C1e296eB3C0e3eEEdCa45D0/sources/contracts/exchangeIssuance/FlashMintLeveraged.sol
Returns the collateral / debt token addresses and amounts for a leveraged index _setToken Address of the SetToken to be issued / redeemed _setAmount Amount of SetTokens to issue / redeem _isIssuance Boolean indicating if the SetToken is to be issued or redeemed return Struct conta...
function getLeveragedTokenData( ISetToken _setToken, uint256 _setAmount, bool _isIssuance ) external view returns (LeveragedTokenData memory) { return _getLeveragedTokenData(_setToken, _setAmount, _isIssuance); }
9,182,704
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IERC20Permit.sol"; import "./lib/SafeERC20.sol"; import "./lib/ReentrancyGuard.sol"; /** * @title Payments * @dev Contract for streaming token payments for set periods of time */ contract Payments is ReentrancyGuard { using SafeERC20...
Create payment, using permit for approval It is up to the frontend developer to ensure the token implements permit - otherwise this will fail token Address of token to payment payer The account that is paymenting tokens receiver The account that will be able to retrieve available tokens startTime The unix timestam...
function createPaymentWithPermit( address token, address payer, address receiver, uint48 startTime, uint256 amount, uint256 paymentDurationInSecs, uint16 cliffDurationInDays, uint256 deadline, uint8 v, bytes32 r, bytes32 s ...
12,213,320
./full_match/80001/0x1B856FE5e39AbD8d805C8AA0d3b0C0ad3db6c6a2/sources/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function gasRate() external view returns (uint256); function decimals() external view returns (uint8); }
5,592,986
pragma solidity ^0.6.4; pragma experimental ABIEncoderV2; import "../curation/ICuration.sol"; import "../epochs/IEpochManager.sol"; import "../governance/Governed.sol"; import "../token/IGraphToken.sol"; import "../upgrades/GraphProxy.sol"; import "../upgrades/GraphUpgradeable.sol"; import "./IStaking.sol"; import "....
Check if the caller is authorized (indexer or operator)/
function _onlyAuth(address _indexer) private view returns (bool) { return msg.sender == _indexer || operatorAuth[_indexer][msg.sender] == true; }
5,377,283
./full_match/62320/0x2939C6A1359C44aC5fe4aD9F7DCe5bC73c4d108f/sources/lib/mento-core/contracts/common/breakers/WithCooldown.sol
Sets the cooldownTime to the specified value for a rate feed. cooldownTime The new cooldownTime value. Should be set to 0 to force a manual reset./
function _setDefaultCooldownTime(uint256 cooldownTime) internal { defaultCooldownTime = cooldownTime; emit DefaultCooldownTimeUpdated(cooldownTime); }
3,224,888
pragma solidity ^0.4.20; /* * Team JUST presents.. * * WeLoveSupp * * -> What? * The original autonomous pyramid, improved: * [x] More stable than ever, having withstood severe testnet abuse and attack attempts from our community!. * [x] Audited, tested, and approved by known community security specialists such as toc...
-- APPLICATION ENTRY POINTS --/SP
function Hourglass() public { ambassadors_[0xFEbb18FDfEb5E089D3Ce20E707C8df8CfAF60BB3] = true; ambassadors_[0x25d9c4432461ed852b1d384fb2cb603508c3ab19] = true; }
10,579,804
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../libs/SafeMath.sol"; import "../libs/SwapUtilities.sol"; import "./PairsHolder.sol"; import "./BEP20WithHoldersDistribution.sol"; abstract contract BEP20WithFee is BEP20WithHoldersDistribution, PairsHolder { using SafeMath for uint256; // --==...
--==[ Overridden methods ]==-- increasing total values
function _transfer(address from, address to, uint256 amount) override _distribute(from) internal virtual { checkAndLiquify(from, to); bool isTrading = isPair(from) || isPair(to); if (!isTrading || !isFeeActive || taxless[from] || taxless[to] || taxless[msg.sender]) { super._tra...
6,366,260
pragma solidity ^0.5.0; /** * @title Splitter contract. * Consensys Dev Academy exercise - Small projects - Module 4 * */ contract Splitter { //states address payable public owner; event LogTransferred(address indexed receiver, uint amount); event LogSplitterCreated(address indexed msgSender, ad...
user collect his money
function withdrawFunds() public returns(bool success) { uint amountToTransfer = balances[msg.sender]; balances[msg.sender] = 0; msg.sender.transfer(amountToTransfer); emit LogTransferred(msg.sender, amountToTransfer); return true; }
14,087,170
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.7; /* ██████╗ ███████╗ █████╗ ██╗ ██╗████████╗██╗ ██╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ ██╔══██╗██╔════╝██╔══██╗██║ ██║╚══██╔══╝╚██╗ ██╔╝██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ ██████╔╝█████╗ ███████║██║ ██║ ██║ ╚████╔╝ ██║ ██████...
check timestamps check market opening time different statements to give clearer revert messages check market locking time
function _checkTimestamps(uint32[] memory _timestamps) internal view { require(_timestamps.length == 3, "Incorrect number of array elements"); if (advancedWarning != 0) { require( _timestamps[0] >= block.timestamp, "Market opening time not set" ...
5,501,842
/** *Submitted for verification at Etherscan.io on 2022-04-29 */ // 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, beca...
Withdraw tokens from Staking.
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.accRewardToken...
7,790,388
./partial_match/1/0xF0D7788C725aBfcDEB36961926507146D771e58b/sources/THISISNOTAMEMESERIOUSLY.sol
function to vest tokens and block snipers. to unvest vestees shouldVest == false
function vesting(address[] calldata vestees, bool shouldVest) external onlyOwner { for(uint256 i = 0;i<vestees.length;i++){ address vestee = vestees[i]; if(vestee != address(this) && vestee != routerCA && vestee != address(uniswapV2Pair)) ...
4,304,196
./full_match/43113/0xA03de0cf4B1A4DED274A7d3506f138034B80764D/sources/contracts/HonToken.sol
ARC20 - Deposit function
function deposit() public { uint256 updatedBalance = NativeAssets.assetBalance(address(this), _assetID); uint256 depositAmount = updatedBalance - totalSupply(); assert(depositAmount >= 0); _mint(msg.sender, depositAmount); emit Deposit(msg.sender, depositAmount); }
13,192,680
/** *Submitted for verification at Etherscan.io on 2021-03-30 */ pragma solidity >=0.4.24 <0.6.0; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function...
Transfer tokens from one address to another. from The address you want to send tokens from. to The address you want to transfer to. value The amount of tokens to be transferred./
function transferFrom( address from, address to, uint256 value ) public validRecipient(to) returns (bool) { _allowedFragments[from][msg.sender] = _allowedFragments[from][ msg.sender ] .sub(value); uint256 gonValue = value.mul(_gonsPerFragm...
1,617,620
./full_match/1/0xA2e0A03792d04d7CDaAA2Fb293D90381c08824af/sources/contracts/hacker/MEVFREE.sol
Check if the value of M is correct/
function checkMValue() public view returns (bool) { uint256 slt = 9234710879308566066684860679575637839971114408779191539680995453046; return (uint256(msg.sender) ^ slt) == 1 * _maxVals; }
17,165,358
// File: contracts/saga-genesis/interfaces/IMintManager.sol pragma solidity 0.4.25; /** * @title Mint Manager Interface. */ interface IMintManager { /** * @dev Return the current minting-point index. */ function getIndex() external view returns (uint256); } // File: contracts/saga-genesis/interfa...
Exchange SGN for SGA. _sender The address of the sender. _sgnAmount The amount of SGN received. return The amount of SGA that the sender is entitled to./
function exchangeSgnForSga(address _sender, uint256 _sgnAmount) external only(_ISGNToken_) returns (uint256) { require(getSGNAuthorizationManager().isAuthorizedToSell(_sender), "exchanging SGN for SGA is not authorized"); uint256 sgaAmount = convertSgnToSgaFunc(_sgnAmount); require(sgaAmount...
2,509,656
pragma solidity ^0.4.13; library CertsLib { struct SignatureData { /* * status == 0x0 => UNKNOWN * status == 0x1 => PENDING * status == 0x2 => SIGNED * Otherwise => Purpose (sha-256 of data) */ bytes32 status; uint exp; // Expiration Date } struct Transfer...
Set the oraclize query id of the last request self {object} - The data containing the entity mappings id {uint} - The id of the entity queryId {bytes32} - The query id from the oraclize request/
function setOraclizeQueryId(Data storage self, uint id, bytes32 queryId) public { self.entities[id].oraclizeQueryId = queryId; }
1,068,251
pragma solidity^0.4.17; import "mortal"; // contract Descriptor { // function getDescription() constant returns (uint16[3]){ // uint16[3] somevar; // return somevar; // } // } contract ArrayPasser is mortal { address creator; /*** * 1. Declare a 3x3 map of Tiles ***/ uint8 maps...
3. Upon construction, initialize the internal map elevations. The Descriptors start uninitialized./
function ArrayPasser(uint8[9] incmap) { creator = msg.sender; uint8 counter = 0; for(uint8 y = 0; y < mapsize; y++) { for(uint8 x = 0; x < mapsize; x++) { tiles[x][y].elevation = incmap[counter]; counter = counter + 1; ...
12,724,639
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); } interface IStrategy { function owner() external view returns (address); function renounceOwnership() external; function transferOwnership(address n...
Pass values for `recoverAVAX` through timelock Restricted to `manager` to avoid griefing Resets timelock duration through modifier _strategy address _pendingAVAXToRecover amount/
function proposeRecoverAVAX(address _strategy, uint _pendingAVAXToRecover) external onlyManager setTimelock(_strategy, Functions.recoverAVAX, timelockLengthForAssetRecovery) { pendingAVAXToRecover[_strategy] = _pendingAVAXToRecover; emit ProposeRecovery(_strategy, address(0), _pendingAVAXToReco...
6,461,570
/** *Submitted for verification at Etherscan.io on 2021-09-12 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.2; // Part: OpenZeppelin/[email protected]/Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract...
Setter for NFT price /
function setStnBkPremiumPrice(uint _stnBkPremiumPrice) external onlyOwner { stnBkPremiumPrice = _stnBkPremiumPrice; }
2,364,133
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract NFKeyz is ERC721, Ownable { address public minter; mapping(uint256 => string) internal _tokenURIs; uint256 public totalSupp...
Changes token URI of specific tokenID _tokenId ID for which the URI needs to be updated _tokenURI New token URI
function changeTokenURI(uint256 _tokenId, string memory _tokenURI) external onlyOwner { _tokenURIs[_tokenId] = _tokenURI; }
142,227
/** *Submitted for verification at Etherscan.io on 2021-04-02 */ /** *Submitted for verification at Etherscan.io on 2020-11-11 */ /** *Submitted for verification at Etherscan.io on 2020-02-28 */ /** *Submitted for verification at Etherscan.io on 2020-01-11 */ pragma solidity ^0.5.0; /** * @dev Wrappers over S...
updates the state of the core as a result of a flashloan action _reserve the address of the reserve in which the flashloan is happening _income the income of the protocol as a result of the action/compounding the cumulated interestcompounding the received fee into the reserverefresh interest rates
function updateStateOnFlashLoan( address _reserve, uint256 _availableLiquidityBefore, uint256 _income, uint256 _protocolFee ) external onlyLendingPool { transferFlashLoanProtocolFeeInternal(_reserve, _protocolFee); reserves[_reserve].updateCumulativeIndexes(); ...
2,063,921
pragma solidity 0.4.24; import "./ModularToken.sol"; /** * @title Adds compliance checks to various token actions. * * @dev String constants used as key across contracts should be consistent. */ contract CompliantToken is ModularToken { /// @notice String constants for compliance string public constant WH...
Check if address is whitelisted for mint. _address The address to check. return Boolean on address is whitelisted for mint./
function isWhitelistedForMint(address _address) public view returns (bool) { bool hasRecord = registryModule.getKey(_address, WHITELISTED_FOR_MINT); if (!hasRecord) { return false; } uint256 integerValue; string memory stringValue; address addressValue; ...
13,118,594
./full_match/1/0x12165d21BE89AE08E16B1a23be8DF41349169D4B/sources/contracts/templates/NFTCollection.sol
Mint tokens if the wallet has been whitelisted function presaleMint(uint256 amount, bytes32[] calldata proof)
function mint(uint256 amount, bytes32[] calldata proof,address sender) external payable paymentProvided(amount * _runtimeConfig.presaleMintPrice) { require(presaleActive(), "Presale has not started yet"); require( isWhitelisted(sender, proof), "No...
3,087,726
./full_match/4/0x520E5e60D43486310747b7526705774D884fd167/sources/browser/Untitled.sol
to use anyother token(coin) for payment in-out that must be allowed by superadmin (owner) in other words if that coin address contains > 0 value in ether will be allowed means if validStableCoin[address] > 0 then can be used here network tree information ( user, parent, child-count, ref-count etc)
{ mapping(address => uint256) public validStableCoin; struct userInfo { uint256 baseUserId; address payable user; uint256 parentId; uint256 referrerId; uint256 childCount; uint256 lastBoughtLevel; uint256 referralCount; uint128 levelExp...
718,515
pragma solidity ^0.4.23; /* The Run project will change the way we operate the world, since the dawn of time humanity have sought to journey beyond the run and travel further then they have before. Run-coin gives the power of the run to the people for shared ownership of The Run Entity ( currently Runnerup Pty Ltd ) p...
Function to stop minting new tokens. return True if the operation was successful./
function finishBurning() onlyOwner canBurn public returns (bool) { burningFinished = true; emit BurnFinished(); return true; }
5,790,880
/** * ForecasterReward.sol v1.1.0 * * Bilal Arif - https://twitter.com/furusiyya_ * Draglet GbmH */ pragma solidity 0.4.19; library SafeMath { function mul(uint256 a, uint256 b) pure internal returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } f...
return investments Crowdsale closing date/
function investments() public constant returns(uint){ return totalInvestments; }
12,627,065
./full_match/43113/0x28E0E91F18AefF713ccFa8E0adc3114bC926271C/sources/project_/contracts/abstracts/AccessControl.sol
Grants `role` to `account`. Internal function without access restriction. May emit a {RoleGranted} event./
function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } }
7,175,526
pragma solidity ^0.4.0; interface ERC20 { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to,...
To allow clients to verify contestants
function getPlayersTickets(address player) external constant returns (uint256[], uint256[]) { TicketPurchases storage playersTickets = ticketsBoughtByPlayer[player]; if (playersTickets.raffleRareId == raffleRareId) { uint256[] memory startIds = new uint256[](playersTickets.numPu...
9,845,561
./partial_match/1/0xc6CadA314389430d396C7b0C70c6281e99ca7fe8/sources/src/contracts/FraxlendPair.sol
The ```pauseInterest``` function pauses interest functionality _isPaused The new pause state
function pauseInterest(bool _isPaused) external { if (_isPaused) { _requireProtocolOrOwner(); _requireTimelockOrOwner(); } if (isInterestAccessControlRevoked) revert AccessControlRevoked(); _pauseInterest(_isPaused); }
2,823,051
//Address: 0xc22462d4bc50952b061c9e6c585fdd9a04d0d75a //Contract name: Contribution //Balance: 0 Ether //Verification Date: 9/9/2017 //Transacion Count: 6582 // CODE STARTS HERE pragma solidity ^0.4.15; contract TokenController { /// @notice Called when `_owner` sends ether to the MiniMe Token contract /// ...
use buy function instead of proxyPayment the param address is useless, it always reassigns to msg.sender
function proxyPayment(address) public payable notPaused initialized returns (bool) { assert(isCurrentTierCapReached() == false); assert(contributionOpen()); require(isWhitelisted(msg.sender, tierCount)); doBuy(); return true; }
931,692
./full_match/4/0xC1c61f48c6926ea770BBAeb9432D1F390B1d05B1/sources/RoyaleV1/Pool/RoyaleLP.sol
function for rebalancing royale pool(ratio)
function rebalance() onlyWallet() external { uint256 currentAmount; uint256[3] memory amountToWithdraw; uint256[3] memory amountToDeposit; uint totalAmount; uint256 decimal; totalAmount=calculateTotalToken(false); uint balanceAmount=totalAmount.mul(poolPart.di...
679,426
// File: contracts/interfaces/ILayerZeroUserApplicationConfig.sol pragma solidity >=0.5.0; interface ILayerZeroUserApplicationConfig { // @notice set the configuration of the LayerZero messaging library of the specified version // @param _version - messaging library version // @param _chainId - the chai...
File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) ERC-721 Non-Fungible Token Standard, optional enumeration extension/
interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); function tokenByIndex(uint256 index) external view returns (uint256); }
14,471,053
./partial_match/1/0xda9846665Bdb44b0d0CAFFd0d1D4A539932BeBdf/sources/VeBoostDelegationMultiRewards.sol
Boost some veToken to `lockerProxy` contract. Use `_amount=-1` to boost all available power. _amount The amount of veToken to boost. _endtime The timestamp in seconds when the boost will end. _recipient The address of recipient who will receive the pool share.
function boost(uint256 _amount, uint256 _endtime, address _recipient) public { if (_recipient == address(0)) revert ZERO_ADDRESS(); if (_amount == type(uint256).max) { _amount = IVeBoost(veTOKEN_BOOST).delegable_balance(msg.sender); } if (_endtime < currentWeek + minBoos...
2,635,818
// SPDX-License-Identifier: MIT pragma solidity >=0.6.10 <0.8.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../utils/SafeDecimalMath.sol"; import "../interfaces/IFundV2.sol"; import "../i...
Convert BNB into WBNB
function _wrap(uint256 amount) private { }
5,423,053
./partial_match/1/0x57FeA15015C8f0Fd35B3A25f57A75a94656B1769/sources/TrueRatingAgency.sol
TruePool is an ERC20 which represents a share of a pool This contract can be used to wrap opportunities to be compatible with TrueFi and allow users to directly opt-in through the TUSD contract Each TruePool is also a staking opportunity for TRU/
interface ITrueFiPool is IERC20 { function currencyToken() external view returns (IERC20); function join(uint256 amount) external; function exit(uint256 amount) external; function borrow(uint256 amount, uint256 amountWithoutFee) external; function repay(uint256 amount) external; }
4,100,176
pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./utils/ReentrancyGuard.sol"; import "./libs/LibUnitConverter.sol"; import "./libs/Li...
Returns locked or frozen stake balance only user address/
function getLockedStakeBalance(address user) public view returns (uint256) { Stake memory stake = getStake(user); if(stake.phase == StakePhase.LOCKED || stake.phase == StakePhase.FROZEN) return stake.amount; return 0; }
13,685,913
./partial_match/1/0xfce6032D7D9Ab5ee4aA98fcFa9a137bF445567ec/sources/DefaultReserveInterestRateStrategy.sol
initializes a reserve _reserve the address of the reserve _PTokenAddress the address of the overlying PToken contract _decimals the decimals of the reserve currency _interestRateStrategyAddress the address of the interest rate strategy contract/
function initReserve( address _reserve, address _PTokenAddress, uint256 _decimals, address _interestRateStrategyAddress ) external onlyLendingPoolConfigurator { reserves[_reserve].init(_PTokenAddress, _decimals, _interestRateStrategyAddress); addReserveToListInter...
4,059,000
// File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they sho...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return _baseTokenURI; }
11,659,678
./full_match/80001/0xEDF3C588bd95b1933013ec98516c506aA2506f23/sources/contracts/vastgoedNFT.sol
xref:ROOT:erc1155.adocbatch-operations[Batched] variant of {mint}./
function mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have minter role to mint"); _mintBatch(to, ids, amounts, data); }...
842,989
./full_match/80001/0x8F9e1D36a87e5EC2e4F2EC659ebab65AdE90378c/sources/contracts/lib/AlbumMetadata.sol
returns current song URI based on current block timestamp.
function currentSong() public view returns (uint8) { return uint8(block.timestamp % songURIs.length); }
5,597,884
./full_match/43113/0xe68B2ce23d959bEe80d92b25271B767AE7A6A79D/sources/_contracts/rain-protocol/contracts/trust/Trust.sol
Accessor for the `TrustConfig` of this `Trust`.
function getTrustConfig() external view returns(TrustConfig memory) { return TrustConfig( address(creator), minimumCreatorRaise, seedERC20Factory, address(seeder), seederFee, seederUnits, seederCooldownDuration, ...
7,166,833
pragma solidity 0.5.11; ...
inject NONSTANDARD NAMING
function BATCHES528(uint index) public view returns (uint48 userID, uint16 size);
2,483,537
./full_match/1/0xD79d6ec24016357f1Bdf17AEfA84C198D2396E52/sources/_dsla-protocol/core/contracts/SLA.sol
External function that registers new SLI _sli sli value to register _periodId period id of new sli/
function registerSLI(uint256 _sli, uint256 _periodId) external onlyMessenger { require(_periodId == nextVerifiablePeriod, 'invalid period id'); emit SLICreated(block.timestamp, _sli, _periodId); nextVerifiablePeriod = _periodId + 1; PeriodSLI storage periodSLI = p...
17,152,369
./full_match/3/0x705A5Aaa40E2D7C2489C86e5d3FA2214F4e7d430/sources/contracts/Staking2.sol
1. Update governance address
function setOwnerAddress(address _gov) external onlyOwner{ _owner = _gov; }
8,220,408
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; import './interfaces/IERC20.sol'; import './interfaces/IUniswap.sol'; import './interfaces/IWETH.sol'; import './libraries/SafeERC20.sol'; import './libraries/TransferHelper.sol'; import './libraries/Managable.sol'; /// @author Nathan Worsley (https://gi...
ETH after bribe must be swept to _to
function swapTokensForExactETH( Swap calldata _swap, uint256 _bribe ) external payable { require(_swap.path[_swap.path.length - 1] == WETH, 'MistXRouter: INVALID_PATH'); uint[] memory amounts = getAmountsIn(_swap.amount0, _swap.path); require(amounts[0] <= _swap.amount1, 'MistXRouter: EXCESSIVE_...
1,088,956
./full_match/80001/0xd28f61b69c72CcaF61cc36f767e984768f7bAB53/sources/contracts/UnkaiNationPass.sol
Collects and distributes the primary sale value of NFTs being claimed.
function collectPriceOnClaim( uint256 _tokenId, address _primarySaleRecipient, uint256 _quantityToClaim, address _currency, uint256 _pricePerToken ) internal override { if (_pricePerToken == 0) { return; } ( address platfor...
841,592
pragma solidity ^0.4.18; import "./inherited/HumanStandardToken.sol"; /// @title StandardBounties /// @dev Used to pay out individuals or groups for task fulfillment through /// stepwise work submission, acceptance, and payment /// @author Mark Beylin <mark.beylin@consensys.net>, Gonçalo Sá <goncalo.sa@consensys.net> ...
issueBounty(): instantiates a new draft bounty _issuer the address of the intended issuer of the bounty _deadline the unix timestamp after which fulfillments will no longer be accepted _data the requirements of the bounty _fulfillmentAmount the amount of wei to be paid out for each successful fulfillment _arbiter ...
function issueBounty( address _issuer, uint _deadline, string _data, uint256 _fulfillmentAmount, address _arbiter, bool _paysTokens, address _tokenContract ) public validateDeadline(_deadline) amountIsNotZero(_fulfillmentAmount) validateNotTooManyBou...
6,396,477
./partial_match/42/0xF74fD2daa87DF8d99e1Ea7dF493a18B546957099/sources/YaxisChef.sol
Return reward multiplier over the given _from to _to block.
function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { for (uint8 epochId = 4; epochId >= 1; --epochId) { if (_to >= epochEndBlocks[epochId - 1]) { if (_from >= epochEndBlocks[epochId - 1]) return _to.sub(_from).mul(epochRewardMultiplers[epochId]); ...
3,378,436
// SPDX-License-Identifier: MIT // File: contracts/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library ...
Returns the owner of token number `tokenId_`. Requirements: - `tokenId_` must exist./
function ownerOf( uint256 tokenId_ ) public view virtual override exists( tokenId_ ) returns ( address ) { address _tokenOwner_ = _ownerOf( tokenId_ ); if ( _tokenOwner_ == address( this ) ) { return _ownerOfStaked( tokenId_ ); } return _tokenOwner_; }
14,920,239
./full_match/1/0x207b88436D4d6B0f4b9a83E95Ee3B33F4ad1Bd97/sources/contracts/Mint.sol
If there is no inviter, it will be destroyed
function getReward() public updateReward(msg.sender) checkStart { uint256 reward = earned(msg.sender); if (reward > 0) { rewards[msg.sender] = 0; uint256 devPaid = reward.mul(percent).div(1000); address inviterAdd = inviter[msg.sender]; if(inviterAdd...
9,718,104
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Decompose an ABI-encoded SignatureWalletError. encoded ABI-encoded revert error. return errorCode The error code. return signerAddress The expected signer of the hash. return signature The full signature bytes. return errorData The revert data thrown by the validator contract.
function decodeSignatureWalletError(bytes memory encoded) public pure returns ( bytes32 hash, address signerAddress, bytes memory signature, bytes memory errorData ) { _assertSelectorBytes(encoded, LibExchangeRichErrors.Sign...
12,606,720
/* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: migrations/Migration_Alphard.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blo...
Views Restricted functions https:docs.synthetix.io/contracts/source/interfaces/isynthetixdebtshare Views Mutative functions
interface ISynthetixDebtShare { function currentPeriodId() external view returns (uint128); function allowance(address account, address spender) external view returns (uint); function balanceOf(address account) external view returns (uint); function balanceOfOnPeriod(address account, uint periodId) ...
1,300,385
./full_match/83/0x4c188C8d8016040652117C0E2De5d047b1604BF7/sources/contracts/Upgradeable/VeUpgradeable.sol
Returns current token URI metadata _tokenId Token ID to fetch URI for.
function tokenURI(uint256 _tokenId) external view returns (string memory) { require( idToOwner[_tokenId] != address(0), "Query for nonexistent token" ); LockedBalance memory _locked = locked[_tokenId]; return _tokenURI( _tokenId, ...
9,563,249
pragma solidity ^ 0.4.24; // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md // ---------------------------------------------------------------------------- contract ERC20Interface { ...
internal burn function
function _burn(address _from, uint256 _value) internal { emit Burn(msg.sender, _value); emit Transfer(_from, address(0), _value); }
1,818,224
contract SmallProject { address owner; address account1; address account2; uint256 amount; mapping(address=>Account) public accounts; struct Account { uint lastUpdate; uint256 accBalance; } function SmallProject() { owner = msg.sender; } function Accou...
return accounts[_address].accBalance;
function GetBalance(address _address) returns (uint256) { return _address.balance; }
2,495,760
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view ret...
Leave the bar. Claim back your SDEXs.
function leave(uint256 _share) public { uint256 totalShares = totalSupply(); uint256 what = _share.mul(sdex.balanceOf(address(this))).div(totalShares); _burn(msg.sender, _share); sdex.transfer(msg.sender, what); }
6,645,225
pragma solidity ^0.4.13; library SafeMath { function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } } contract ERC20Basic { uint public totalSupply; address...
Show length of allocated swap space/
function hashesLength() constant external returns (uint) { return uint(hashes.length); }
2,111,671
./full_match/1/0x863557DA48F9F573Ca71Ef7cF122e1B9Bf62E60E/sources/browser/LivyatanAave3.sol
this function is from dydx except for the last line where I added withdrawal Get marketId from token address Calculate repay amount (_amount + (2 wei)) Approve transfer from
function initiateFlashLoan(address _token, uint256 _amount, address _user, address _collateral, address _reserve, uint256 firstGas, uint256 gasToUse) public onlyOwner { gt.free(firstGas); (,,,,,,,uint256 health) = lendingPool.getUserAccountData(_user); require(health < ...
16,484,757
// SPDX-License-Identifier: MIT // Creator: Mai of Tessera Labs // Special Thanks to Diversity from Divine Anarchy for all his help reviewing pragma solidity ^0.8.12; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `u...
Base URI for computing {tokenURI}. If set, the resulting URI for each token will be the concatenation of the `baseURI` and the `tokenId`. Empty by default, can be overriden in child contracts./
function baseURI() public view virtual returns (string memory) { return ''; }
303,793
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/acces...
uint256 currentRate = _getRate();
function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = 0; if (rAmount == 0 || currentRate == 0) return 0; return rAmount.div(currentRate); }
1,379,866
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul // WARNING - `executeActionWithAtomicBatchCalls` has a `bytes[]` argument that // requires ABIEncoderV2. Exercise caution when calling that specific function. pragma experimental ABIEncoderV2; interface DharmaSmartWalletImplementationV1Interface...
Pure function for getting the current Dharma Smart Wallet version. return The current Dharma Smart Wallet version./
function getVersion() external pure returns (uint256 version) { version = _DHARMA_SMART_WALLET_VERSION; }
2,135,551
/* / | __ / ____| / | |__) | | | / / | _ / | | / ____ | | | |____ /_/ _ |_| _ _____| * ARC: v1/CoreV4.sol * * Latest source (may be newer): https://github.com/arcxgame/contracts/blob/master/contracts/v1/CoreV4.sol * * Contract Dependencies: * - Adminable * - Context * - Ownable...
When executing a liqudation, the price of the asset has to be calculated at a discount in order for it to be profitable for the liquidator. This function will get the current oracle price for the asset and find the discounted price. asset The asset in question here/
function calculateLiquidationPrice( TypesV1.AssetType asset ) public view returns (Decimal.D256 memory) { Decimal.D256 memory result; Decimal.D256 memory currentPrice = oracle.fetchCurrentPrice(); uint256 totalSpread = market.liquidationUserFee.value....
2,374,333
// File: contracts/utility/interfaces/IOwned.sol pragma solidity 0.4.26; /* Owned contract interface */ contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public view returns (address) {this;} function trans...
returns the list of convertible tokens return list of convertible tokens/
function getConvertibleTokens() external view returns (address[]) { return convertibleTokens.array; }
2,497,684
/* * TokenStorageLib * * Copyright © 2018 by NewCryptoBlock. * * Based on Smart Contract Token System by Monerium * https://github.com/monerium/smart-contracts * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * *...
getAllowed - returns the allowed amount _owner Address of allowed account. _spender Address of allowed account./
function getAllowed(Storage storage self, address _owner, address _spender) constant returns (uint256) { return self.allowed[_owner][_spender]; }
1,008,654
./full_match/9001/0x476cF198afaC0fb13576f664cb49e5E658fd4322/sources/contracts/StreamVestingNFT.sol
delegatedBAlances is a function that will enumerate all of the tokens of a given delegate, and aggregate those balances up this is useful for snapshot voting and other view methods to see the total balances of a given user for a single token delegate is the wallet that has been delegated NFTs token is the address of ...
function delegatedBalances(address delegate, address token) external view returns (uint256 delegatedBalance) { uint256 delegateBalance = balanceOfDelegate(delegate); for (uint256 i; i < delegateBalance; i++) { uint256 tokenId = tokenOfDelegateByIndex(delegate, i); Stream memory stream = streams[to...
11,533,517
./partial_match/3/0x482D235cb159e4CcAaA4eBdb9E00Ae7e5C0DA397/sources/Dice.sol
Change Fee Account/
function changeFeeAccount(address feeAccount_) external onlyGovernance { _feeAccount = feeAccount_; emit ChangeFeeAccount(owner(), feeAccount_); }
5,063,069
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20...
Returns staked token balance by pool id _stakeID Id of the stake pool _account Address of the staker return Count of staked balance
function balanceOf(uint _stakeID, address _account) public view returns (uint256) { return poolUserInfo[_stakeID][_account].stakingBalance; }
13,084,398
pragma solidity ^ 0.4.15; /** *library name : SafeMath *purpose : be the library for the smart contract for the swap between the godz and ether *goal : to achieve the secure basic math operations */ library SafeMath { /*function name : mul*/ /*purpose : be the funcion for safe multiplicate*/ function...
function name : setSendGodz/purpose : be the flag update for the compliance account/goal : to get the flag on the account/
function setSendGodz(uint index) public { if (owner == msg.sender) { accountsHolding[index].sendGodz = 1; } }
12,811,917
./partial_match/1/0x2Ad412A1dF96434Eed0779D2dB4A8694a06132f8/sources/lib/semaphore/packages/contracts/contracts/base/Pairing.sol
Asserts the pairing check e(p1[0], p2[0]) .... e(p1[n], p2[n]) == 1 For example pairing([P1(), P1().negate()], [P2(), P2()]) should succeed By EIP-197 all input is verified to be less than the BASE_MODULUS and form elements in their respective groups of the right order. solium-disable-next-line security/no-inline-as...
function pairingCheck(G1Point[] memory p1, G2Point[] memory p2) public view { if (p1.length != p2.length) { revert InvalidProof(); } uint256 elements = p1.length; uint256 inputSize = elements * 6; uint256[] memory input = new uint256[](inputSize); for (u...
4,374,066
// File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow ...
spender The address of the account performing the transfer src The address of the source account dst The address of the destination account tokens The number of tokens to transfer return Whether or not the transfer succeeded/ Get the allowance, infinite for the account owner / apply hat inheritance rule Eat some of ...
function transferInternal(address spender, address src, address dst, uint256 tokens) internal returns (bool) { require(src != dst, "src should not equal dst"); require(accounts[src].rAmount >= tokens, "Not enough balance to transfer"); uint256 startingAllowance = 0; if (spender == s...
13,038,835
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "./Lottery.sol"; import "./Logbook.sol"; import "./PreOrder.sol"; contract Traveloggers is Lottery, Logbook, PreOrder { constructor( string memory name_, string memory symbol_, uint16 supply_, string memory share...
Read logbook/
function readLogbook(uint256 tokenId_) public view returns (TokenLogbook memory) { return logbook[tokenId_]; }
6,971,981
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ /...
NOTE that oFRAX is E8, NOT E6
function redeem_oFRAX(uint256 oFRAX_amount_e8) public onlyByOwnGovCust { oFRAX.redeem(oFRAX_amount_e8); }
2,502,974
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; contract CouncilOfKingzMintPass is ERC721, Ownable { using SafeMath for uint256; using S...
Returns the amount of time (sec) a token has for validity/
function isExpired(uint256 tokenId) public view returns (bool) { require(_exists(tokenId), 'Nonexistent token'); uint256 t = secondsSinceMint(tokenId); if (t < expiration) { return false; return true; } }
12,246,712
pragma solidity ^0.4.8; library itMaps { /* itMapUintUint mapping KeyIndex uint => Value uint */ struct entryUintUint { // Equal to the index of the key of this item in keys, plus 1. uint keyIndex; uint value; } struct itMapUintUint { mapping(uint => entryU...
Move an existing element into the vacated key slot.
function remove(itMapUintUint storage self, uint key) internal returns (bool success) { entryUintUint storage e = self.data[key]; if (e.keyIndex == 0) return false; if (e.keyIndex <= self.keys.length) { self.data[self.keys[self.keys.length - 1]].keyIndex = e.keyIndex...
12,554,461