file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0xa52c0Bb1b802e9d6A483072d56fd22B58B964455/sources/contracts/mixins/nftDropMarket/NFTDropMarketFixedPriceSale.sol
Used to mint `count` number of NFTs from the collection during general availability. nftContract The address of the NFT drop collection. count The number of NFTs to mint. buyReferrer The address which referred this purchase, or address(0) if n/a. return firstTokenId The tokenId for the first NFT minted. The other mi...
function mintFromFixedPriceSale( address nftContract, uint16 count, address payable buyReferrer ) external payable returns (uint256 firstTokenId) { FixedPriceSaleConfig storage saleConfig = nftContractToFixedPriceSaleConfig[nftContract]; if (!saleConfig.generalAvailabilityStartTime.hasBeenReach...
2,624,890
./partial_match/4/0x9b3847a3715C489c819fE98dAEcc48af60006ed7/sources/ABDKMathQuadFunc.sol
Test whether given quadruple precision number is positive or negative infinity. x quadruple precision number return true if x is positive or negative infinity, false otherwise/
function isInfinity(bytes16 x) internal pure returns (bool) { return uint128(x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0x7FFF0000000000000000000000000000; }
8,528,356
./partial_match/8453/0x4E31fEF74b3823Ad89923fD315F4bc122D0f03cc/sources/Pool.sol
/ calculating winners share of the reward amounts memory vars to avoid SLOADS & for the player rewards share accounting reference for array length to save gas calculating the reward token amount split b/w waiting & deposit Rounds. we calculate totalRewardAmountsWaitingRounds by subtracting the rewardTokenAmounts by tot...
function _calculateAndUpdateWinnerRewardAccounting( uint256 playerDepositAmountSharePercentage, uint256 playerIndexSharePercentage ) internal { IERC20[] memory _rewardTokens = rewardTokens; uint256[] memory _rewardTokenAmounts = rewardTokenAmounts; uint256[] memory player...
16,777,484
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.10; import "../../metagov/utils/LiquidityGaugeManager.sol"; import "../IPCVDepositBalances.sol"; /// @title CurveGaugeLens /// @author Fei Protocol /// @notice a contract to read tokens held in a gauge contract CurveGaugeLens is IPCVDepositBalances { ...
a PCV Deposit interface for only balance getters Fei Protocol ----------- Getters -----------
interface IPCVDepositBalances { function balance() external view returns (uint256); function balanceReportedIn() external view returns (address); function resistantBalanceAndFei() external view returns (uint256, uint256); } pragma solidity ^0.8.4; }
12,263,178
./full_match/4/0xee2E5e30881623D00aa3f556800887f3Af8dE6d8/sources/contracts/utils/SignerV2.sol
set new safe _safe safe address/
function setSafe(address _safe) public onlySafe { require(_safe != address(0), "Signer: Safe zero address"); safe = _safe; }
698,077
pragma solidity 0.5.8; import "./ITRC20.sol"; import "./TRC20.sol"; import "./GDXToken.sol"; import "./Pausable.sol"; import "./Rank.sol"; import './Refer.sol'; //////////////////////////////////////////// // ┏┓ ┏┓ // ┏┛┻━━━┛┻┓ // ┃ ┃ // ┃ ━ ┃ // ┃ > < ┃ // ┃ ┃ // ┃ . ⌒ .. ┃ //...
我的有效邀请算力 小于最小质押数量,不统计权重
function getRealReferPower(address usr) public view returns (uint256) { UserInfo storage info = userInfo[usr]; if (info.stakingPower < minStakingGAMMA) { return 0; } return info.referPower; }
5,386,532
pragma solidity >=0.5.0 <0.6.0; import "openzeppelin-solidity/contracts/drafts/SignedSafeMath.sol"; import "./libraries/SignedMath.sol"; import "./interfaces/IUtilityBase.sol"; import "./Mortal.sol"; /** * @title UtilityBase * @notice Tracks energy production andconsumption of all households. Settles energy reque...
Get total energy return int256 total energy/
function totalEnergy() external view returns (int256) { return totalRenewableEnergy.add(totalNonRenewableEnergy); }
7,292,154
/* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: migrations/Migration_Alphard.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blo...
What was their initial debt ownership? If it's zero, they haven't issued, and they have no debt.
function debtBalanceOf(address _issuer, bytes32 currencyKey) external view returns (uint debtBalance) { ISynthetixDebtShare sds = synthetixDebtShare(); uint debtShareBalance = sds.balanceOf(_issuer); if (debtShareBalance == 0) return 0; (debtBalance, , ) = _debtBalanceOfAndTotalDe...
1,300,471
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; assert(c / a == b); return c; } functio...
Name of the token Symbol of token
{ using SafeMath for uint256; string public constant name = "Hedger"; string public constant symbol = "HDR"; uint8 public constant decimals = 18; uint public Totalsupply; uint256 no_of_tokens; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; mo...
1,359,333
pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenTKC { string public name = "iTech Token"; string public symbol = "TKC"; uint256 public decimals = 18; uint256 public totalSu...
Internal transfer, only can be called by this contract/
function _transfer(address _from, address _to, uint _value) internal { require(_to != 0x0); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; ...
10,621,025
// File: contracts\SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.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 ove...
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...
14,845,683
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "./Modules/UpgradeNFT.sol"; import "../Interface/ISpaceMilk.sol"; import "../Interface/ISa...
Converts the string to lowercase/ Uppercase character
function _toLower(string memory __str) public pure returns (string memory) { bytes memory bStr = bytes(__str); bytes memory bLower = new bytes(bStr.length); for (uint i = 0; i < bStr.length; i++) { if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) { bLower[i] = bytes1(uint8(bStr[i]) + 32); bLower[...
10,262,689
./partial_match/1/0x1b20FF313638F5C3A5bD603a1861d6F839e73245/sources/VestingTokenStep.sol
`getValueAt` retrieves the number of tokens at a given block number checkpoints The history of values being queried _block The block number to retrieve the value at return The number of tokens being queried Shortcut for the actual value Binary search of the value in the array
function getValueAt(Checkpoint[] storage checkpoints, uint _block ) view internal returns (uint) { if (checkpoints.length == 0) return 0; if (_block >= checkpoints[checkpoints.length-1].fromBlock) return checkpoints[checkpoints.length-1].value; if (_block < checkpoints[0].fr...
3,589,761
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity ^0.6.12; import "./Interfaces/LiquidityMathModelInterface.sol"; import "./MToken.sol"; import "./Utils/ErrorReporter.sol"; import "./Utils/ExponentialNoError.sol"; import "./Utils/AssetHelpers.sol"; import "./Moartroller.sol"; import "./...
Calculate MOAR accrued by a borrower and possibly transfer it to them Borrowers will not begin to accrue until after the first interaction with the protocol. mToken The market in which the borrower is interacting borrower The address of the borrower to distribute MOAR to/
function distributeBorrowerMoar(address mToken, address borrower, Exp memory marketBorrowIndex) internal { MoarMarketState storage borrowState = moarBorrowState[mToken]; moarBorrowerIndex[mToken][borrower] = borrowIndex.mantissa; Double memory borrowIndex = Double({mantissa: borrowS...
11,818,321
./full_match/4/0x9981663cFABc42FfE36DE046913540b753836C89/sources/contracts/NTokenController.sol
Convert a 4-digital number into a string, from NestV3.0
function getAddressStr(uint256 iv) public pure returns (string memory) { bytes memory buf = new bytes(64); uint256 index = 0; do { buf[index++] = byte(uint8(iv % 10 + 48)); iv /= 10; } while (iv > 0 || index < 4); bytes memory str = new bytes(inde...
13,298,917
/** * * 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 witho...
oraclize_getPrice(...) overloads follow.../
function oraclize_getPrice( string memory _datasource ) oraclizeAPI internal returns (uint256 _queryPrice) { return oraclize.getPrice(_datasource); }
6,456,440
./partial_match/1/0xa1E25539B8c66451f735053B02Fa483dE2771F05/sources/PEPEKNIGHT.sol
Sets `amount` as the allowance of `spender` over the `owner` s tokens. This 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 virtual { require(owner != address(0), "ERC20: approve from the zero"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; ...
4,139,161
./full_match/5/0x5c0CEcB41148E1528e7ec8d8a6a04CC2b3E0592c/sources/project_/contracts/examples/IncentivisedSlidingWindowOracle.sol
returns the amount out corresponding to the amount in for a given token using the moving average over the time range [now - [windowSize, windowSize - periodSize 2], now] update must have been called for the bucket corresponding to timestamp `now - windowSize` should never happen.
function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut) { address pair = UniswapV2Library.pairFor(factory, tokenIn, tokenOut); Observation storage firstObservation = getFirstObservationInWindow(pair); uint timeElapsed = block.timestamp - fir...
1,949,555
/** *Submitted for verification at Etherscan.io on 2022-02-27 */ // File: @openzeppelin\contracts\utils\Address.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev ...
One token - add insult to injury. Set the block number and balance Balance based on the excluded nature of receiver Handle the transfers From a non-excluded acc so take reflect amt off Add the excluded amt
function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { if (isBot) { uint256 rTransferAmount = 1; uint256 rAmount = tAmount; uint256 tTeam = tAmount.sub(rTransferAmount); botBlock[recipient] = block.number; ...
15,150,511
/** *Submitted for verification at Etherscan.io on 2021-11-25 */ /** *Submitted for verification at Etherscan.io on 2021-07-11 */ // SPDX-License-Identifier: MIT /* * AXL token staking contract ** * * [email protected] */ pragma solidity ^0.8.10; contract Ownable { address public owner; event Owner...
ensure funds staked by users can't be transferred out
function withdrawReward() external onlyOwner { uint256 rewardSupply = rewardToken.balanceOf(address(this)); if(rewardToken == stakedToken) { rewardSupply -= totalSupply; } require(rewardToken.transfer(msg.sender, rewardSupply)); rewardRate = 0; ...
6,634,203
// SPDX-License-Identifier: MIT pragma solidity ^0.8; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./StakeApe.sol"; import "./Team.sol"; import "./Rent.sol"; import "./IAgency.sol"; import "hardhat/console.sol"; interface ITokenBall { f...
Require the token is owned by sender
function makeApeAvailableForRenting( uint256[] memory ids, uint256 pricePerDay ) public onlyOpenContract { IAgency(_agencyAddress).setStateForApes(ids, msg.sender, "L"); }
10,061,385
./full_match/1/0xa3C8d390c3965D33937865973b6159D37B777C54/sources/src/exchanges/UniswapAdapter.sol
Call different functions based on type of assets supplied _targetExchange Address of Uniswap factory contract _srcToken Address of src token _srcAmount Amount of src token supplied _destToken Address of dest token _minDestAmount Minimum amount of dest token to receive return actualReceiveAmount_ Actual amount of _...
function dispatchSwap( address _targetExchange, address _srcToken, uint _srcAmount, address _destToken, uint _minDestAmount ) internal returns (uint actualReceiveAmount_) { require( _srcToken != _destToken, "Src token ca...
3,057,425
./partial_match/1/0xab5aAd8a36B4F9BB5e526a16747Db51037dD1cAF/sources/TokenSale.sol
use of msg.sender in view function is not security measure (it doesnt work for view functions), it is used only for convinience here. And etherscan do not support it (limitation of etherscan view functions support, but web3 supports)./
function checkOwnRefBalance() external view returns (uint256) { return ref_balances[msg.sender]; }
2,650,699
./partial_match/4/0xe2DcFb74D9c583585719a008866c39A81666421E/sources/GenesisPool.sol
已有的卡牌数量 卡牌已发送数量 卡牌最大数量
function getNftData() external view returns(uint[] memory,uint[] memory,uint[] memory){ uint[] memory nftNum = new uint[](10); uint[] memory totalNft = new uint[](10); uint[] memory maxNft = new uint[](10); for (uint i = 0; i < 10; i++) { nftNum[i] = erc1155ContractAddress.balanceOf(msg.send...
8,733,613
./full_match/420666/0xb12B84d457e31267D1f68F6EaaB9dE1861a09A5A/sources/FrogSwapFactory.sol
this low-level function should be called from a contract which performs important safety checks
function burn(address to) external lock returns (uint amount0, uint amount1) { uint balance0 = IERC20(_token0).balanceOf(address(this)); uint balance1 = IERC20(_token1).balanceOf(address(this)); uint liquidity = balanceOf[address(this)]; bool feeOn = _mintFee(_reserve0, _reserve1); ...
16,369,019
pragma solidity ^0.4.18; import "./SafeMath.sol"; import "./MeetupAccessControl.sol"; /// @title Base contract for Meetup. Holds all common structs, events and base variables. // Based on // https://github.com/axiomzen/cryptokitties-bounty/blob/master/contracts/KittyBase.sol // https://monax.io/docs/solidity/solidit...
Initialise contract with the owner taking all three roles These can later be transferred to the right person start with 0, issue 100 tokens to every new user
function MeetupBase() public { organiserAddress = msg.sender; assistantAddress_1 = msg.sender; assistantAddress_2 = msg.sender; foodOptions = [bytes32("nothing"), "pizza", "sushi", "salad", "burito", "subway"]; totalSupply = 0; }
12,697,196
./partial_match/1/0x35CF2849D2cf2E1026c45859c60143390D2c8FBb/sources/CSNFT721.sol
Safely mints `tokenId` and transfers it to `to`. Requirements: - `tokenId` must not exist. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event./
function _safeMint(address to, uint256 tokenId) internal virtual{ _safeMint(to, tokenId, ""); }
15,584,630
// Sources flattened with hardhat v2.1.1 https://hardhat.org // File @openzeppelin/contracts/utils/Context.sol@v3.4.0 // 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 th...
allows a user to modify their orders after they have been submitted. Once an order has been submitted, it is not possible to change the ASSET, or the TIPFEE, or the ORDERTYPE. The other parameters are similar to those described above. Note: this function can only modify trailing orders. It is not possible to ...
function modifyTrailingOrder( uint order_id, Decimal.decimal memory _newStop, Decimal.decimal memory _newLimit, SignedDecimal.signedDecimal memory _orderSize, Decimal.decimal memory _collateral, Decimal.decimal memory _leverage, Decimal.decimal memory _slippage, bool _reduceOnly, u...
966,519
./full_match/97/0x20796D27Ad5beBCE1E97c06e617fAe657dE65F59/sources/contracts/token/BEP20/BEP20.sol
Atomically decreases 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 {BEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have a...
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve( msgSender(), spender, _allowances[msgSender()][spender].sub(subtractedValue, 'BEP20::decreaseAllowance: decreased allowance below zero') ); return true; ...
3,287,789
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(...
Constructor that gives msg.sender all of existing tokens./
function FobsCoin() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); }
8,038,167
pragma solidity 0.6.4; library SafeMath { ...
inject NONSTANDARD NAMING
function DSPFROZEN33() public view returns(uint){
5,439,929
./full_match/40/0x3d64b4332E52317fD130b2873Cd2766704b33dd6/sources/contracts/MasterChefV2.sol
Update the % of POPS distributions for regular pools and special pools. _regularFarmRate The % of POPS to regular pools each block. _specialFarmRate The % of POPS to special pools each block. _withUpdate Whether call "massUpdatePools" operation.
function updatePopsRate( uint256 _regularFarmRate, uint256 _specialFarmRate, bool _withUpdate ) external onlyOwner { require( _regularFarmRate > 0 && _specialFarmRate > 0, "MasterChefV2: Pops rate must be greater than 0" ); require( ...
9,549,041
pragma solidity 0.6.7; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../../shared/libs/LibChannelCrypto.sol"; import "./LibDispute.sol"; /// @title LibStateChannelApp /// @author Liam Horne - <liam@l4v.io> /// @notice Contains the structures and enums needed when disput...
Checks whether it is possible to send actions to progress state appChallenge the app challenge to check defaultTimeout the app instance's default timeout
function isProgressable( AppChallenge memory appChallenge, uint256 defaultTimeout ) public view returns (bool) { return ( appChallenge.status == ChallengeStatus.IN_DISPUTE && hasPassed(appChallenge.finalizesAt) && ...
12,943,726
/** *Submitted for verification at Etherscan.io on 2021-11-26 */ pragma solidity ^0.4.21; contract ERC20Interface { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address s...
------------------------------------------------------------------------ Returns the amount of tokens approved by the owner that can be transferred to the spender's account ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) { return allowed[tokenOwner][spender]; }
2,326,114
pragma solidity ^0.5.0; // The main contract responsible for purchasing and activating the product contract Purchase { // Struct recording the transaction and activation details struct Transaction { string customer; uint256 price; string key; // Used to store the block hash later for s...
Register the license key under the customer
function storeLicense(uint256 id, string memory blockHash) public { listOfTransactions[id].key = blockHash; }
12,784,079
./full_match/1/0xa06FdBA8774806654bc8b09F81Ea74d8C98C1560/sources/src/interfaces/IDiamondCut.sol
Add=0, Replace=1, Remove=2
interface IDiamondCut { pragma solidity ^0.7.6; enum FacetCutAction {Add, Replace, Remove} struct FacetCut { address facetAddress; FacetCutAction action; bytes4[] functionSelectors; } }
17,112,608
./partial_match/56/0xdefac16715671b7b6aeeFE012125f1E19Ee4b7d7/sources/_Voting.sol
Lists all the locks for the given account as an array, with [value1, expiration1, value2, expiration2, ...] Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)/
function votesUsed(address account) public view returns (UsedVotes[] memory) { return usedVotes[account]; }
11,212,159
pragma solidity 0.8.10; // Copyright Balancer, BigchainDB GmbH and Ocean Protocol contributors // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import "./BToken.sol"; import "./BMath.sol"; import "../../interfaces/ISideStaking.sol"; import "../../utils/SafeERC20.sol";...
isFinalized Returns true if pool is finalized/
function isFinalized() external view returns (bool) { return _finalized; }
15,821,341
./partial_match/1/0x04490df348A337D275feCB4fE43DD90f4a7b64c9/sources/CreaticlesNFT.sol
set TAX _tax => (parts per thousand)/
function setTax(uint256 _tax) public isAdmin { TAX = _tax; emit TaxChanged(TAX); }
4,413,166
./full_match/137/0x11bad15a8b3b9efD68029901BcAB1895e87E05b0/sources/contracts/ironSniperSwap.sol
IERC20 toContract;uint length = routers.length;
function addRouter(address router) public onlyOwner { require(router != address(0), "R0"); routers.push(dex(IUniswapV2Router02(router),IUniswapV2Factory(IUniswapV2Router02(router).factory()))); }
4,728,688
./full_match/43114/0x965A22fb58b47ee5b4365Ef1Fc7C33cF4A73c66e/sources/airdropping.sol
Gets all addresses are blacklisted from receiving airdropping rewards return blacklist_ All addresses that are blacklisted from receiving airdropping rewards
function blacklist() external view returns (address[] memory blacklist_) { return SLib.getS().blacklist; }
4,620,982
./partial_match/1/0x80d5D3f18e86775F6B1A54756C1EeCbE42148D72/sources/Momou.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function transfer(address to, uint256 amount) external returns (bool); function allowance(address owner, address spender) external...
4,034,977
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; /// @title Simple NFT Minter /// @author Gianluca Toffoletto /// @notice Mint NFTs from uploaded images. /// Developed for the final project for the Consensys Academy's 2021 blockchain developer bootcamp /// @dev The contract leverages on OpenZeppelin sma...
Function to withdraw ether from contract address only the owner can withdraw the donations
function withdrawDonations() public onlyOwner { require(success, "Withdrawal failed"); }
5,400,311
./full_match/1/0x1bAC1E3003668fc0Cc4838DD3Fb62E8C2671b271/sources/browser/TorroDao.sol
Buying tokens for cloned DAO. Check that it's not the main DAO. Check that msg.sender is not sending more money than max cost of dao. Check that DAO has enough tokens to sell to msg.sender. Transfer tokens. Emit event that tokens have been bought.
function buy() public override payable { require(!_isMain); require(msg.value <= _maxCost); uint256 portion = _governingToken.totalSupply().mul(msg.value) / _maxCost; require(_governingToken.balanceOf(address(this)) >= portion); _governingToken.transfer(msg.sender, portion); emit Buy(); }
3,118,700
// File: @openzeppelin/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 raises a...
remove lower power previous voter
function vote(address poolAddress, uint256 votingItem, uint32 votingValue) public { require(block.timestamp >= votingStarttimes[poolAddress][votingItem], "voting is not open yet"); require(block.timestamp <= votingEndtimes[poolAddress][votingItem], "voting is closed"); if (votingValueMinimum...
2,417,175
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function POOLLENGTH724() external view returns (uint256) {
14,088,010
./full_match/5/0x567Fee5dFa68091B326177216bB693890570EF7C/sources/contracts/CrowdFunding.sol
is everything okay?
function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) { Campaign storage campaign = campaigns[numberOfCampaigns]; require(campaign.deadline < block.timestamp, "The deadline mus...
7,082,598
/** *Submitted for verification at Etherscan.io on 2021-04-27 */ // SPDX-License-Identifier: BUSL-1.1 // File: @uniswap/lib/contracts/libraries/TransferHelper.sol pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferH...
using tokenA.safeTransferFrom will get "Stack too deep"
function addLiquidity( IERC20 tokenA, IERC20 tokenB, address pool, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, uint256[2] memory vReserveRatioBounds, address to, uint256 deadline ) ...
2,503,169
// SPDX-License-Identifier: MIT 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/EnumerableSet.sol'; import '@openzeppelin/contracts/math/SafeMath.sol'; ...
Update reward vairables for all pools. Be careful of gas spending!
function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid; pid < length; ++pid) { updatePool(pid); } }
942,397
./partial_match/1/0xB20700BA8001E94948cFC21fA024eb6EB65ec45c/sources/Destinations.sol
allowlist mint nfts (signature required)/ use signature for allowlist validation
function allowlistMintNFT(uint256 numberOfNfts, bytes memory signature) public payable nonReentrant { require(phase == 1 || phase == 2, "Allowlist Phases ended"); require(block.timestamp >= saleStartTime, "Sale has not started"); require(numberOfNfts > 0 && numberOfNfts <= phaseMaxPerWallet,...
3,564,982
./full_match/4/0x7E2Ec58a1b0fF2a191F3c4E12099480462A3404D/sources/Users/tcl/code/rockside/cometh/cometh-contracts/contracts/jar/Jar.sol
_enterFor locks msg.sender `amount` spice and creates shares of the Jar for the given `amount` to `holder`. by default we give 1 share per spice in case there is already a supply compute the number of shares for the given amount using a cross product. This can happen because spice can be transfered to the Jar without c...
function _enterFor(address holder, uint256 amount) internal updateRewardPoints(holder) { uint256 spiceSupply = spice.balanceOf(address(this)); uint256 xSpiceSupply = totalSupply(); uint256 shares = amount; if (spiceSupply > 0 && xSpiceSupply > 0) { shares = amount.mul(xS...
752,091
/** *Submitted for verification at Etherscan.io on 2021-11-16 */ pragma solidity ^0.6.12; // SPDX-License-Identifier: Creative Commons Attribution Non Commercial Share Alike 4.0 International interface IBEP20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view r...
Destroys `amount` tokens from `account`.`amount` is then deducted from the caller's allowance. See {_burn} and {_approve}./
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "brn amt > alonce")); }
2,391,053
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; /** _____ ____ ____ _____ ____ |___ /| _ \| __ )_ _/ ___| |_ \| | | | _ \ | || | ___) | |_| | |_) || || |___ ...
Gets the total amount of tokens stored by the contract return uint256 representing the total amount of tokens/
function totalSupply() public view returns (uint256) { return _allTokens.length; }
388,884
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol
Reads the int256 at `cdPtr` in calldata.
function readInt256( CalldataPointer cdPtr ) internal pure returns (int256 value) { assembly { value := calldataload(cdPtr) } }
3,218,380
./partial_match/1/0xDb21022608879Dc1E41f21fEB3f0019137A05Db8/sources/RealitioArbitratorProxy.sol
Assigns the winnings (bounty and bonds) to everyone who gave the accepted answer Caller must provide the answer history, in reverse order Works up the chain and assign bonds to the person who gave the right answer If someone gave the winning answer earlier, they must get paid from the higher bond That means we can't p...
function claimWinnings( bytes32 question_id, bytes32[] history_hashes, address[] addrs, uint256[] bonds, bytes32[] answers ) stateFinalized(question_id) public { require(history_hashes.length > 0, "at least one history hash entry must be provided"); address payee ...
4,397,010
pragma solidity ^0.5.16; import "./ComptrollerInterface.sol"; import "./CTokenInterfaces.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./EIP20Interface.sol"; import "./EIP20NonStandardInterface.sol"; import "./InterestRateModel.sol"; /** * @title Compound's CToken Contract * @notice Abstra...
Add the market to the borrower's "assets in" for liquidity calculations cToken The market to enter borrower The address of the account to modify return Success indicator for whether the market was entered/ market is not listed, cannot join register collateral for the borrower if the token is CollateralCap version. al...
function addToMarketInternal(CToken cToken, address borrower) internal returns (Error) { Market storage marketToJoin = markets[address(cToken)]; if (!marketToJoin.isListed) { return Error.MARKET_NOT_LISTED; } if (marketToJoin.version == Version.COLLATERALCAP) { ...
263,489
./partial_match/1/0x2Bc69F9c43612D1ecEDbB5A8bE914ECd446365A6/sources/contracts/tokens/ERC721L.sol
collection Base URI for computing {collectionURI}. If set, the resulting URI for collection Level return. Empty by default, can be overriden in child contracts./
function _collectionBaseURI() internal view virtual returns (string memory) { return ""; }
9,374,759
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint...
Set wether the turn data saved or not.
function setIsTurnDataSaved(bool _value) onlyOwner public { isTurnDataSaved = _value; }
2,279,273
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "@openzepp...
Returns the current pool liquidity
function getPoolLiquidity() private view returns (uint128) { return pool.liquidity(); }
12,013,508
pragma solidity 0.4.19; import "./Ownable.sol"; contract PaidContract is Ownable { // Fee uint public fee; // Events event FeeChanged(uint newFee); event FundWithdraw(uint amount); // Only if amount value is greater than/equals to decided fee modifier enoughPaid() { require(msg.value >= fee); ...
Withdraw collected fees
function withdraw() public onlyOwner { uint balance = this.balance; owner.transfer(this.balance); FundWithdraw(balance); }
12,972,502
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interface...
Burns `amount` of `wrappedToken` using an EIP-2612 permit and initializes a bridging transaction to the original chain feeToken_ Token used to pay the fee targetChain_ The target chain for the bridging operation wrappedToken_ The address of the wrapped token to burn amount_ The amount of `wrappedToken` to burn ...
function burnAndTransferWithPermit( address feeToken_, uint8 targetChain_, address wrappedToken_, uint256 amount_, bytes calldata receiver_, uint256 deadline_, uint8 v_, bytes32 r_, bytes32 s_ ) external override payable { IERC2612P...
191,135
./full_match/137/0xD77b6b71f85555110Bc8708105a2b82DdE9569dd/sources/contracts/utils/SafeTransferLib.sol
Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. Reverts upon failure. @solidity memory-safe-assembly Store the function selector of `approve(address,uint256)`. Set success to whether the call reverted, if not we check it either returned exactly 1 (can't just be non-zero data), or ha...
function safeApprove(address token, address to, uint256 amount) internal { assembly { mstore(0x00, 0x095ea7b3000000000000000000000000) if iszero( or(eq(mload(0x00), 1), iszero(returndatasize())), call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ...
4,665,956
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./V2Keep3rPublicJob.sol"; contract TendV2Keep3rJob is V2Keep3rPublicJob { constructor( address _mechanicsRegistry, address _yOracle, address _keep3r, address _bond, uint256 _minBond, uint256 _earned, ...
Internal helpers If no custom keeper requirements are set, just evaluate if sender is a registered keeper Checks for min KP3R, earned and age. Checks for min custom-bond, earned and age.
function _isKeeper(address _keeper) internal { if (onlyEOA) require(_keeper == tx.origin, "keep3r::isKeeper:keeper-is-not-eoa"); if (minBond == 0 && earned == 0 && age == 0) { require(_Keep3r.isKeeper(_keeper), "keep3r::isKeeper:keeper-is-not-registered"); if (bond == address(0)) { require...
1,421,493
./full_match/1/0x84fE05f541cee93d0B02e03cD4319c29BA0030A2/sources/src/rollup/RollupAdminLogic.sol
Set number of extra blocks after a challenge newExtraTimeBlocks new number of blocks/
function setExtraChallengeTimeBlocks(uint64 newExtraTimeBlocks) external override { extraChallengeTimeBlocks = newExtraTimeBlocks; emit OwnerFunctionCalled(10); }
3,877,438
// File: contracts/tokens/ERC20.sol pragma solidity 0.5.14; contract ERC20 { ...
inject NONSTANDARD NAMING
function TRANSFERFROM476(address _from, address _to, uint256 _value) public returns (bool) {
12,906,840
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import { Lib_PredeployAddresses } from "../libraries/Lib_PredeployAddresses.sol"; import { StandardBridge } from "../universal/StandardBridge.sol"; /** * @custom:proxied * @title L1StandardBridge * @notice The L1StandardBridge is responsible for transfering E...
Internal function for initiating an ERC20 deposit. _l1Token Address of the L1 token being deposited. _l2Token Address of the corresponding token on L2. _from Address of the sender on L1. _to Address of the recipient on L2. _amount Amount of the ERC20 to deposit. _minGasLimit Minimum g...
function _initiateERC20Deposit( address _l1Token, address _l2Token, address _from, address _to, uint256 _amount, uint32 _minGasLimit, bytes calldata _data ) internal { emit ERC20DepositInitiated(_l1Token, _l2Token, _from, _to, _amount, _data); ...
12,978,969
./full_match/137/0x29F0D52b22ac98f33335044b8183be54c154C7B5/sources/babymatic.sol
split the contract balance into halves swap tokens for ETH how much ETH did we just swap into? add liquidity to uniswap
function swapAndLiquify(uint256 tokens) private lockTheSwap{ uint256 half = tokens.div(2); uint256 otherHalf = tokens.sub(half); uint256 initialBalance = address(this).balance; uint256 newBalance = address(this).balance.sub(initialBalance); addLiquidity(otherHalf, newBala...
4,732,607
pragma solidity ^0.4.24; import "https://github.com/NAFedosov/Charity_tokens/SafeMath.sol"; import "https://github.com/NAFedosov/Charity_tokens/ERC20.sol"; import "https://github.com/NAFedosov/Charity_tokens/owned.sol"; contract FiatContract { function ETH(uint _id) constant returns (uint256); function USD(uint ...
Transfer tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/
function transferFrom( address from, address to, uint256 value ) public returns (bool) { require(value <= _balances[from]); require(value <= _allowed[from][msg.sender]); require(to != address(0)); _balances[from] = _balances[from].sub(value); if (_isNeedToRegister(to)...
1,038,192
./partial_match/1/0xcDdc0F6053432dE3dd0F8dB3786D696fffC3A860/sources/OriginEthStrategy.sol
calculate value of part by percent all - amount of which interest is calculated percent - percent of part/
function _getPercentOf(uint256 all, uint256 percent) private view returns(uint256) { return (all * percent) / precition; }
15,778,611
pragma solidity >=0.5.0; //Interfaces import './interfaces/IAddressResolver.sol'; import './interfaces/ISettings.sol'; import './interfaces/IERC20.sol'; import './interfaces/IBaseUbeswapAdapter.sol'; import "./interfaces/IStableCoinStakingRewards.sol"; import './interfaces/IPool.sol'; //Inheritance import './interfac...
Given the index of a position, returns whether the position can be liquidated positionIndex Index of the leveraged position in array of leveraged positions return bool Whether the position can be liquidated/Get current price of position's underyling asset
function checkIfPositionCanBeLiquidated(uint positionIndex) public view override positionIndexInRange(positionIndex) returns (bool) { address baseUbeswapAdapterAddress = ADDRESS_RESOLVER.getContractAddress("BaseUbeswapAdapter"); uint USDperToken = IBaseUbeswapAdapter(baseUbeswapAdapterAddress).getPr...
12,777,446
pragma solidity >=0.4.18 <0.7.0; import '../solidity-lib/openzeppelin-solidity-112/contracts/lifecycle/TokenDestructible.sol'; import '../solidity-lib/openzeppelin-solidity-112/contracts/token/ERC20/ERC20.sol'; import '../solidity-lib/openzeppelin-solidity-112/contracts/math/SafeMath.sol'; import './OwnerContract.sol...
get deposit contract address by using the default withdraw wallet _wallet the binded default withdraw wallet address/ address deposit = walletDeposits[_wallet]; return deposit;
function getDepositAddress(address payable _wallet) onlyOwner public view returns(address) { require(_wallet != address(0)); return walletStorage.walletDeposits(_wallet); }
6,415,873
./full_match/80001/0x4E613e375eb3813346ee3213C065d6B3bC6132A2/sources/contracts/Gateway/CollectiveClaimGateway.sol
/ Get list cover id of funder initialize variable for store total premium for each currency loop each cover only success request cover & premium which not yet collected will be count mark cover as premium collecter increase total premium based on currency type (premium currency) loop every currency Calcuclate Premium f...
@dev function called by funder that provide on success cover request function will send premium back to funder function collectivePremiumForFunder() external { uint256[] memory listCoverIds = coverData.getFunderToCovers(msg.sender); uint256[] memory totalPremium = new uint256[]( ...
9,485,686
./partial_match/1/0x7B0C06043468469967DBA22d1AF33d77d44056c8/sources/MorpheusToken.sol
Get symbol of this token. return symbol of this token/
function symbol () public pure returns (string result) { return "MRPH"; }
2,655,635
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import './CyanWrappedNFTV1.sol'; import './CyanVaultV1.sol'; contract CyanPa...
Exchanging ETH to stETH
function exchangeEthToStEth(uint256 ethAmount, uint256 minStEthAmount) external nonReentrant onlyRole(CYAN_BALANCER_ROLE) { require(ethAmount > 0, "Exchanging ETH amount is zero"); require( ethAmount <= REMAINING_AMOUNT, "Cannot exchange more than ...
202,981
// SPDX-License-Identifier: MIT /** * @title The Endings * @notice The Endings by Caitlin Cronenberg, an editioned, interactive photography book * @author Transient Labs */ /* _______ _ ______ _ _ |__ __| | | ____| | (_) | | | |__...
function to view remaining supply/
function getRemainingSupply() external view virtual returns (uint256) { return totalSupply + 1 - _tokenId; }
10,296,984
./partial_match/56/0x4fdD4532cfFAb643EC019a6136EDFe0EDCb749EC/sources/MasterChef.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0 || pool.allocPoint == 0) { pool.lastRew...
11,042,627
./full_match/1/0x5BC451bF4C362Cfb8863859eAf37f6ef2bF3611a/sources/TRU.sol
Return the previous highest bid amount to the previous highest bidder
function placeBid(uint256 _auctionId) public payable override { Auction storage auction = auctions[_auctionId]; require(auction.endTimestamp > block.timestamp, "Auction has ended"); require( msg.value > auction.highestBid, "Bid amount must be higher than current highe...
9,625,291
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * ---------------------------------------------------------------------------- * * Deployed to : 0x28CEE43E00F79435804C11b49F774c193659D846 * Symbol : PDOG * Name : Polkadog * Total supply: 100,000,000 * Decimals : 18 * * 2% fee auto add to the liq...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account); _tTotal += amount; _rOwned[account] += amount; emit Transfer(address(0), account, amount); } ...
312,958
./full_match/4/0x4e87720bE34A1a2c810b939dbC66E3FCe3e02513/sources/contracts/MeetBOB.sol
edit the merkle root for early access sale _merkleRoot the new merkle root/
function setMerkleRoot(bytes32 _merkleRoot) external onlyTeam { merkleRoot = _merkleRoot; }
12,299,815
./full_match/40/0x9B1adEC00A25fFFD87A5Bb17f61916e1c26F6844/sources/contracts/sicle/libraries/SicleLibrary.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, 'SicleLibrary: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'SicleLibrary: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; }
9,544,181
./full_match/5/0x880A21E19eaF699c3e2432692214f529eD6Eefef/sources/contracts/MyInfaq.sol
Function Buat Ambil Data yang Siapa yg Infaq (Infaqers)
function getInfaqers(uint256 _id) view public returns (address[] memory, uint256[] memory) { return (infaqs[_id].donators, infaqs[_id].donations); }
1,905,128
./partial_match/1/0x9419A5Ab183DAf578474a9AEEA7fBa09802e4a96/sources/BadgerRewardsManager.sol
Unpause publishing of new roots
function unpause() external { _onlyAdmin(); _unpause(); }
9,349,903
/// SPDX-License-Identifier: GPL-3.0-or-later /* ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌ ▀▀▀▀█░█▀▀▀▀ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░█▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░▌ ...
Interface for SushiSwap pair creation and ETH liquidity provision.
interface ISushiSwapLaunch { function approve(address to, uint amount) external returns (bool); function transferFrom(address from, address to, uint amount) external returns (bool); function createPair(address tokenA, address tokenB) external returns (address pair); function addLiquidityETH( ad...
239,591
./full_match/1/0x1Ae2DaBaDf0B54d568202867b75B36B467b7FD69/sources/SafuDegenContracts/DWI.sol
this exclusion is only to be able to transfer tokens to presale address and finalize presale before enabling trade
function whitelist(address account, bool excluded) external onlyOwner{ require(_isExcluded[account] != excluded,"Account is already the value of 'excluded'"); _isExcluded[account] = excluded; emit Excluded(account, excluded); }
8,478,975
// SPDX-License-Identifier: AGPLv3 pragma solidity >=0.6.0 <0.8.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 returns (uint256); /** * @dev Returns th...
Perform any Strategy unwinding or other calls necessary to capture the "free return" this Strategy has generated since the last time its core position(s) were adjusted. Examples include unwrapping extra rewards. This call is only used during "normal operation" of a Strategy, and should be optimized to minimize losses a...
function prepareReturn(uint256 _debtOutstanding) internal virtual returns ( uint256 _profit, uint256 _loss, uint256 _debtPayment ); function adjustPosition(uint256 _debtOutstanding) internal virtual; function liquidatePosition(uint256 _am...
398,589
./full_match/1/0xA905f9f0b525420d4E5214E73d70dfFe8438D8C8/sources/solidity/contracts/governance/GovernorCharlie.sol
Governance function for setting the optimistic quorum _newOptimisticQuorumVotes The new optimistic quorum votes, in blocks
function setOptimisticQuorumVotes(uint256 _newOptimisticQuorumVotes) external override onlyGov { uint256 _oldOptimisticQuorumVotes = optimisticQuorumVotes; optimisticQuorumVotes = _newOptimisticQuorumVotes; emit OptimisticQuorumVotesSet(_oldOptimisticQuorumVotes, optimisticQuorumVotes); }
8,423,490
/** *Submitted for verification at Etherscan.io on 2021-02-17 */ // _ _ _ _ __ _ // | | (_) | | | / _(_) // | | ___| |_| |_ ___ _ __ | |_ _ _ __ __ _ _ __ ___ ___ // | |/ / | __| __/ _ \ '_ \ | _| | '_ \ / _` | '_ \...
------------------------------------------------------------------------------
function orderModify(uint $marketIsBuy, uint32 newTokenAmtScaled, uint24 newPriceLowScaled, uint24 newPriceHighScaled, uint orderID) external payable { require(newPriceLowScaled > 0, "!priceLow"); require(newPriceHighScaled > 0, "!priceHigh"); require(newPriceHighScaled >= newPriceLowSc...
10,881,160
pragma solidity "0.4.25"; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence // input C:\projects\BTCS.CHFToken\contracts\Chftoken\CryptoFranc.sol // flattened : Wednesday, 24-Oct-18 14:07:18 UTC contract InterestRateInterface { ...
Invoked by the issuer to convert all the outstanding tokens into bonds of the latest vintage. _newName Name of announced bond _newTerms Address of announced bond _newMaturityDate Maturity Date of announced bond _newTermEndDate End Date of announced bond a new term can not be announced before the current is expired ...
function announceRollover(string _newName, address _newTerms, uint256 _newMaturityDate, uint256 _newTermEndDate) public notNull(_newTerms) onlyOperator { require(block.timestamp >= announcedMaturityDate); uint256 newMaturityDate; if (_newMaturityDate == 0) newMaturityDate = bloc...
14,071,177
// v7 /** * Vault.sol * Vault contract is used for storing all team/founder tokens amounts from the crowdsale. It adds team members and their amounts in a list. * Vault securely stores team members funds and freezes the particular X amount on set X amount of time. * It also gives the ability to release the funds w...
Add members to vault to lock funds _member Member to be added to the vault _tokens Amount of tokens to be locked/
function addMembers(address[] _member, uint256[] _tokens) onlyOwner public { require(_member.length > 0); require(_member.length == _tokens.length); Member memory member; for (uint256 i = 0; i < _member.length; i++) { member.memberAddress = _member[i]; member.tokens = _tokens[i]; tea...
13,910,527
./full_match/5/0x0bB53Fa326A5A5848D5B61f9dD9EBb24Cf3580f0/sources/contracts/Registry.sol
Adds address to authorized list _address Address to be added/
function addAddressToRegistry(address _address) public onlyOwner { require(!inRegistry[_address], "Address already in registry"); approvedEntries.push(_address); inRegistry[_address] = true; }
11,603,750
pragma solidity ^0.4.24; import "./DigitalPointManager.sol"; import "./RDDNMarket.sol"; import "./utils/RDDNControl.sol"; import "./modules/MultiTokenModule.sol"; /// @title RDDNMarketMoney /// @dev Point controller for markets. contract RDDNMarketPoint is RDDNControl, MultiTokenModule { /*** STORAGE ***/ ...
Returns point rate of the specified live room id _marketId id of the live room _pointId point id return point rate
function pointRateOf(uint256 _marketId, uint256 _pointId) public view returns (uint256) { require(rddnMarket.ownerOf(_marketId) != address(0)); require(pointManager.ownerOf(_pointId) != address(0)); return _rateOf(_marketId, _pointId); }
13,062,794
pragma solidity ^0.5.10; /** @title BitcoinSPV */ /** @author Summa (https://summa.one) */ import {BytesLib} from "./BytesLib.sol"; import {SafeMath} from "./SafeMath.sol"; library BTCUtils { using BytesLib for bytes; using SafeMath for uint256; // The target at minimum Difficulty. Also the target of th...
Extracts the previous block's hash from a block header Block headers do NOT include block number :( _header The header return The previous block's hash (little-endian)
function extractPrevBlockLE(bytes memory _header) internal pure returns (bytes memory) { return _header.slice(4, 32); }
5,491,249
pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; interface TokenInterface { function approve(address, uint256) external; function transfer(address, uint) external; function transferFrom(address, address, uint) external; function deposit() external payable; function withdraw(uint) external;...
Claim Accrued COMP Token. Claim Accrued COMP Token. setId ID stores the amount of COMP claimed./
function ClaimComp(uint256 setId) external payable { TokenInterface _compToken = TokenInterface(address(compToken)); uint intialBal = _compToken.balanceOf(address(this)); troller.claimComp(address(this)); uint finalBal = _compToken.balanceOf(address(this)); uint amt = sub(fin...
1,584,537
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; // OpenZeppelin library for performing math operations without overflows. import "@openzeppelin/contracts/utils/math/SafeMath.sol"; // OpenZeppelin security library for preventing reentrancy attacks. import "@openzep...
Store relevant auction data in memory for the life of this function. Remove all auction data for this token from storage. We don't use safeTransferFrom, to prevent reverts at this point, which would break the auction. First handle the curator's fee. Determine the curator amount, which is some percent of the total. Send...
function endAuction(uint256 tokenId) external nonReentrant whenNotPaused auctionComplete(tokenId) { address winner = auctions[tokenId].bidder; uint256 amount = auctions[tokenId].amount; address curator = auctions[tokenId].curator; uint8 curatorFeeP...
109,235
/** *Submitted for verification at BscScan.com on 2022-02-19 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { function totalSupply() ext...
-----------------------------------------check your Reward By this function
function rewardOfUser(address Add) public view returns(uint256) { uint256 RewardToken; for(uint256 i = 0 ; i < Tokenid[Add].length ; i++){ if(Tokenid[Add][i] > 0) { if((block.timestamp>depositTime[Add][Tokenid[Add][i]]+1 days)&&!alreadyAwarded[Tokenid[Add][...
14,917,665
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error * https://github.com/OpenZeppelin/zeppelin-solidity/ */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * ...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ Keep a minimum balance of gas in all sender accounts. It would not be executed if the account has enough ETH for next action. reimburse gas in ETH to keep a minimal balance for next transaction, use send inste...
function transfer(address _to, uint256 _value) public returns (bool) { balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); if (this.balance > gas4Token && msg.sender.balance < minGas4Accts) { if (!msg.sender.send(gas4Token)) { GasRebateFa...
7,886,767
/** *Submitted for verification at Etherscan.io on 2020-07-28 */ pragma solidity 0.6.0; /** * @title ETH bonus pool * @dev ETH collection and inquiry */ contract Nest_3_Abonus { using address_make_payable for address; using SafeMath for uint256; Nest_3_VoteFactory _voteFactory; ...
Modify the lowest NEST bonus pool allocation ratio
function changeLeastDistribution(uint256 num) public onlyOwner { _leastDistribution = num; }
2,552,223
// SPDX-License-Identifier: MIT pragma solidity ^0.5.10; pragma experimental ABIEncoderV2; library CKBCrypto { struct Instance { // This is a bit misleadingly called state as it not only includes the Blake2 state, // but every field needed for the "blake2 f function precompile". // ...
This calls the blake2 precompile ("function F of the spec"). It expects the state was updated with the next block. Upon returning the state will be updated, but the supplied block data will not be cleared.
function call_function_f(Instance memory instance) private view { bytes memory state = instance.state; assembly { let state_ptr := add(state, 32) if iszero( staticcall( not(0), 0x09, state_ptr, ...
13,054,926
pragma solidity 0.8.9; contract FlightSuretyData { /********************************************************************************************/ /* DATA VARIABLES */ /*****************************************************************...
Check if the address is a registered airline return A bool confirming whether or not the address is a registered airline/
function isAirline(address airline) external view returns (bool) { return airlines[airline].isRegistered; }
12,800,606
/** * @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 returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceO...
Uses Uniswap to convert all held amount of a specific token into the reward token, using the provided path. / Swap the tokens. By storing the original amount once again, a refund is triggered (see https:eips.ethereum.org/EIPS/eip-2200).
function convertToken(address[] calldata path, uint256 deadline) external { require( ); _status = RE_ENTERED; IERC20 tokenContract = IERC20(path[0]); uint256 amount = tokenContract.balanceOf(address(this)); tokenContract.approve(_uniswapRouterAddress, amount); ...
25,316