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/0xC62b8c58984a7f9E15933bC9E20159D240Ab0D8D/sources/contracts/protocol/tokenization/base/MintableIncentivizedERC721.sol
See {IERC721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) external virtual override nonReentrant { _safeTransferFrom(from, to, tokenId, _data); }
2,783,966
/** *Submitted for verification at Etherscan.io on 2022-01-21 */ pragma solidity ^0.5.16; contract ESG { /// @notice EIP-20 token name for this token string public constant name = "ESG"; /// @notice EIP-20 token symbol for this token string public constant symbol = "ESG"; /// @notice EIP-20 tok...
Transfer `amount` tokens from `src` to `dst` src The address of the source account dst The address of the destination account rawAmount The number of tokens to transfer return Whether or not the transfer succeeded/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "ESG::transferFrom: amount exceeds 96 bits"); if (spender != src && spenderAl...
15,082,049
./full_match/4/0x139651987B3a38B4a9adb60Ad81209f601721Cc8/sources/contracts/FundMe.sol
uint256 minimumUSD = 1 10 18;require(getConvertionRate(msg.value) >= minimumUSD, "you need to spend more ETH!");
function fund() public payable{ addressToAmountFunded[msg.sender] += msg.value; }
13,358,351
./partial_match/1/0xcfDE5CF330a76fa69DFeb9B0f5feBa2dF803B7D3/sources/PPPP01PP.sol
exclude from paying fees
constructor() ERC20("PeppaPaulyPotterPunk01PP", "POLYGON") { uint256 _buyMarketingFee = 15; uint256 _buyLiquidityFee = 0; uint256 _sellMarketingFee = 40; uint256 _sellLiquidityFee = 0; uint256 totalSupply = 100000000 * 1e9; maxTransactionAmount = (totalSupply) / 50...
9,306,446
./full_match/5/0xeDeE35dA2492c30024BC6Ca5718B84c5fA8b9037/sources/project_/contracts/SweetToken.sol
Locks a certain amount of tokens for an account account address of the account to lock tokens for amount amount of tokens to lock/ Calculate the new total amount for the "whale" condition (considering only the amount of the current transaction)
function _lockTokens(address account, uint256 amount) internal { uint256 newPurchaseLocked = amount * LOCKED_TOKEN_PERCENTAGE / 100; uint256 previouslyLocked = _locked[account].amount; uint256 randomBlocksPerPeriod = blocksPerUnlockPeriodPool[uint256(keccak256(abi.encodePacked(block.timesta...
1,859,923
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; /// @title Periphery Payments /// @notice Functions to ease deposits and withdrawals of ETH interface IPeripheryPayments { /// ...
Periphery Payments Functions to ease deposits and withdrawals of ETH
interface IPeripheryPayments { function unwrapWETH9(uint256 amountMinimum, address recipient) external payable; function refundETH() external payable; function sweepToken( address token, uint256 amountMinimum, address recipient ) external payable; pragma solidity ^0.6.0; }
15,808,598
pragma solidity 0.5.17; import "@keep-network/sortition-pools/contracts/AbstractSortitionPool.sol"; contract CandidatesPools { // Notification that a new sortition pool has been created. event SortitionPoolCreated( address indexed application, address sortitionPool ); // Mapping of po...
Creates new sortition pool for the application. Have to be implemented by keep factory to call desired sortition pool factory. _application Address of the application. return Address of the created sortition pool contract. Gets bonded sortition pool of specific application for the operator. Reverts if the operator ...
function newSortitionPool(address _application) internal returns (address); function getSortitionPoolForOperator( address _operator, address _application ) internal view returns (AbstractSortitionPool) { require( isOperatorRegistered(_operator, _application), ...
12,902,625
// SPDX-License-Identifier: MIT // // Copyright (c) 2021 Kentaro Hara // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php pragma solidity ^0.8.11; import "../JohnLawCoin.sol"; //------------------------------------------------------------------------------ // [Joh...
Pay ETH and purchase JLC from the open market operation. Parameters ---------------- The sender needs to pay |requested_eth_amount| ETH. Returns ---------------- A tuple of two values: - The amount of ETH the sender paid. This value can be smaller than |requested_eth_amount| when the open market operation does not have...
function purchaseCoins() public whenNotPaused payable returns (uint, uint) { uint requested_eth_amount = msg.value; uint elapsed_time = getTimestamp() - current_epoch_start_v2_; (uint eth_amount, uint coin_amount) = open_market_operation_v2_.increaseCoinSupply( requested_eth...
13,078,088
pragma solidity ^0.6.0; import "../SortitionSumTreeFactory.sol"; /** * @title ExposedSortitionSumTreeFactory * @author Enrique Piqueras - <epiquerass@gmail.com> * @dev Exposed version of SortitionSumTreeFactory for testing. */ contract ExposedSortitionSumTreeFactory { /* Storage */ using SortitionSumT...
Draw an ID from a tree using a number. _key The key of the tree. _drawnNumber The drawn number. return ID The drawn ID./
function _draw(bytes32 _key, uint _drawnNumber) public view returns(bytes32 ID) { return sortitionSumTrees.draw(_key, _drawnNumber); }
14,108,866
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./Token.sol"; import { Pausable } from "./utils/Ownable.sol"; import "./IERC20.sol"; import "./utils/SafeMath.sol"; import "./utils/SafeCast.sol"; import "./utils/SafeBEP20.sol"; // SOULLIB ...90% /\/\ // IN...
View: Returns current block Unix time stamp
function _now() internal view returns (uint256) { return block.timestamp; }
12,722,085
pragma solidity 0.4.18; // File: contracts/ERC20Interface.sol // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value)...
/ Fees in ETH Fees in ETH
function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { require(tradeEnabled); require(msg.sender == kyberNetwork); ...
5,454,566
//Address: 0x76645F7C6F98caD248474e9a38D4A38c4173F2a4 //Contract name: POTENTIAM //Balance: 0 Ether //Verification Date: 2/9/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * fu...
Burns a specific amount of tokens. _value The amount of token to be burned./ no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure
function burn(uint256 _value) public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply= totalSupply.sub(_value); Burn(burner, _value); }
12,872,365
pragma solidity ^0.6.0; /** * @title Primitive's Pool Contract * @notice The pool contract. * @author Primitive */ /** * @title Primitive's Instruments * @author Primitive Finance */ library Instruments { /** * @dev A Prime has these properties. * @param ace `msg.sender` of the createPri...
CHECKS / This function should only be called by Prime / EFFECTS / Clear liability of Prime / INTERACTIONS / COMPOUND / Check if enough cTokens can be redeemed to meet collateral / Swap cEther to Ether / Sent to trusted address - Prime Contract / Withdraw strike assets from prime / buy debt, withdraw capital user must...
function closePosition(uint256 _amount) external payable returns (bool) { uint256 userEthBal = balanceOf(msg.sender); require(userEthBal >= _amount, 'Close: Eth Bal < amt'); uint256 poolBalance = getPoolBalance(); uint256 debt = _amount.mul(_liability).div(poolBalance); requ...
14,077,692
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract JFToken is ERC20, Ownable { uint256 private constant preMineSupply = 20000000 * 1e...
mint with max supply
function mint(address _to, uint256 _amount) public onlyMinter returns (bool) { _mint(_to, _amount); return true; }
2,549,598
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./IERC20.sol"; import "./IERC20Sec.sol"; import "./IFreezable.sol"; import "./IBurnable.sol"; import "./IMintable.sol"; import "./AccessControl.sol"; import "./Pausable.sol"; import "./Wallet.sol"; /** * @dev Implementation of the {IERC20, IERC20Sec} in...
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./
function transfer(address recipient, uint256 amount) public override whenNotPaused whenNotAccountsPausedOf(msg.sender, recipient) validateSenderAccount validateAddress(recipient) returns (bool) { _transfer(msg.sender, recipient, amount); re...
6,363,247
./full_match/1/0xBCF9F4c6FC589c89d4aAdE063010D0f5B3733680/sources/contracts/staking/Staking.sol
Slash the indexer stake. Delegated tokens are not subject to slashing. Can only be called by the slasher role. _indexer Address of indexer to slash _tokens Amount of tokens to slash from the indexer stake _reward Amount of reward tokens to send to a beneficiary _beneficiary Address of a beneficiary to receive a rew...
function slash( address _indexer, uint256 _tokens, uint256 _reward, address _beneficiary ) external override onlySlasher notPartialPaused { Stakes.Indexer storage indexerStake = stakes[_indexer]; require(_tokens > 0, "!tokens"); require(_tokens >= _rewar...
4,905,278
./full_match/1313161554/0x56dD69B679611FCC5dE0FEbd8e65e10A0046d537/sources/contracts/interfaces/IDiamondLoupe.sol
A loupe is a small magnifying glass used to look at diamonds. These functions look at diamonds
interface IDiamondLoupe { pragma solidity 0.8.16; struct Facet { address facetAddress; bytes4[] functionSelectors; } }
13,233,522
/* || THE LEXDAO REGISTRY (TLDR) || version 0.2 DEAR MSG.SENDER(S): / TLDR is a project in beta. // Please audit and use at your own risk. /// Entry into TLDR shall not create an attorney/client relationship. //// Likewise, TLDR should not be construed as legal advice or replacement for professional counsel. ///// S...
reputable lexScribe can resolve rddr dispute with division of remaining payCap amount in wei accounting for 5% fee / receive fee + LEX mint, "1"
function resolveDDR(uint256 ddrNumber, uint256 clientAward, uint256 providerAward) public { emit Resolved(ddrNumber); }
2,555,234
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import './Context.sol'; import './Strings.sol'; import './ERC165.sol'; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { function hasRole(bytes32 role, address account) external view ...
Split into two functions to avoid error 'call stack too deep'.
function _forcedTradeRequestPremiumCostFalse( uint256[12] calldata args, bytes calldata signature ) private { STARK_PERPETUAL.forcedTradeRequest( signature, ); }
221,924
./full_match/4/0xf281aB231B0B2C43336075e6546fd642359Ac4e0/sources/browser/SellToken.sol
withDraw token by milestone 30/25/25/20 % sent transfer to sender sent fee to dev
function withDrawToken(uint256 _orderId, uint256 _milestone) public { Order storage order = orders[_orderId]; uint256 rewardPending = 0; uint256 feePending = 0; bool isWithDraw = false; uint256 milestone = 0; if (_milestone == 30 && order.timestampLastWithDraw==0) { ...
645,518
./partial_match/1/0xC58212BD2cC5D60Cb89E980713461Be027389b2C/sources/RPDFoundersPass.sol
Set Total Tokens Supply/
function setTotalTokens(uint256 qty) public onlyOwner { TOTAL_TOKENS = qty; }
3,988,639
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ abstract contract ERC20MetadataStorage is ERC20 { string private _name; string private _symbol; constructor(string memory name_, string memory s...
Returns the name of the token./
function name() public virtual view returns(string memory) { return _name; }
6,475,536
pragma solidity 0.5.17; import "../utils/ModUtils.sol"; /** * @title Operations on alt_bn128 * @dev Implementations of common elliptic curve operations on Ethereum's * (poorly named) alt_bn128 curve. Whenever possible, use post-Byzantium * pre-compiled contracts to offset gas costs. Note that these pre-compiles ...
Return multiplication of two gfP2 field elements./
function gfP2Multiply(gfP2 memory a, gfP2 memory b) internal pure returns (gfP2 memory) { return gfP2( addmod(mulmod(a.x, b.y, p), mulmod(b.x, a.y, p), p), addmod(mulmod(a.y, b.y, p), p - mulmod(a.x, b.x, p), p) ); }
1,763,182
// Beta Job on the Keep4r.Network 🚀 // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function ...
Allows pendingGovernance to accept their role as governance (protection pattern)/
function acceptGovernance() external { require(msg.sender == pendingGovernance, "acceptGovernance: !pendingGov"); governance = pendingGovernance; } IKeep4rV1 public constant KP4R = IKeep4rV1(0x6921B6A7bD3f39dEE1f883f3C4FCb35B2dFabbbA); address public constant factory = 0x5C69bEe701ef81...
2,338,971
./partial_match/1/0x01cF6B5684C7D9d0BbBd57a385e5F2B06D42771f/sources/Frame.sol
this is used on the dashboard to calculate the pending shards
function calculateTotalPendingShards(uint256[] memory tokens) public view returns(uint256) { uint256 possibleShards = 0; for (uint256 x = 0;x < tokens.length;x++) { uint256 _token = tokens[x]; possibleShards += shards.determineYield(tokenYield[_token]); delete _t...
16,050,524
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "@openzeppelin/contracts/tok...
Calculate Fee & Reward Distribute the TrippyToken
function stake(uint256 _nftId) public override updateRewardPool whenNotPaused { require(_nftId > 0, "Staking: Nft id must be greater than 0"); UserInfo storage user = userInfo[_msgSender()]; ( uint256 feeToOwner, uint256 feeToDAO,...
10,172,145
// Sources flattened with hardhat v2.8.4 https://hardhat.org // File @rari-capital/solmate/src/auth/Auth.sol@v6.2.0 // SPDX-License-Identifier: GNU AGPLv3 pragma solidity >=0.8.0; /// @notice Provides a flexible and updatable auth pattern which is completely separate from application logic. /// @author Solmate (https...
Calculates the total amount of underlying tokens the Vault holds. return totalUnderlyingHeld The total amount of underlying tokens the Vault holds. Cannot underflow as locked profit can't exceed total strategy holdings.
function totalHoldings() public view returns (uint256 totalUnderlyingHeld) { unchecked { totalUnderlyingHeld = totalStrategyHoldings - lockedProfit(); } }
314,904
// SPDX-License-Identifier: GPL-3.0-or-later // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is dis...
Update cached total supply and invariant using the results after the join that will be used for future oracle updates. Note that this function relies on the base class to perform any safety checks on joins./
function onJoinPool( bytes32 poolId, address sender, address recipient, uint256[] memory balances, uint256 lastChangeBlock, uint256 protocolSwapFeePercentage, bytes memory userData ) public virtual override returns (uint256[] memory amountsIn, uint256[] me...
928,954
./full_match/42220/0x5bd084845f8Ce18384d361BF8F4742EAd18eeD3d/sources/contracts/DefaultStrategy.sol
Distributes votes by computing the number of votes each active group should receive. celoAmount The amount of votes to distribute. depositGroupToIgnore The group that will not be used for deposit. return finalGroups The groups that were chosen for distribution. return finalVotes The votes of chosen finalGroups./
function generateDepositVoteDistribution(uint256 celoAmount, address depositGroupToIgnore) external managerOrStrategy returns (address[] memory finalGroups, uint256[] memory finalVotes) { return _generateDepositVoteDistribution(celoAmount, depositGroupToIgnore); }
16,332,567
./full_match/62320/0xbe9ff483BF4bEE31661340b26b0fD2e021C7CEd0/sources/lib/mento-core/contracts/BreakerBox.sol
Sets the trading mode for the specified rateFeedID. rateFeedID The address of the rateFeedID. tradingMode The trading mode that should be set./
function setRateFeedTradingMode(address rateFeedID, uint64 tradingMode) public onlyOwner { require( tradingMode == 0 || tradingModeBreaker[tradingMode] != address(0), "Trading mode must be default or have a breaker set" ); TradingModeInfo memory info = rateFeedTradingModes[rateFeedID]; re...
3,225,090
./partial_match/1/0xa94310AeeD50687f7c39ACdAA5FCd311AEDB25f8/sources/contracts/erc721/ERC721EditionsDFS.sol
Conforms to ERC-2981. _tokenId Token id _salePrice Sale price of token/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address receiver, uint256 royaltyAmount) { return ERC721Base.royaltyInfo(_getEditionId(_tokenId), _salePrice); }
3,645,419
./full_match/137/0x7e6Ec23e6858743b575734F0F013BeABEfff2615/sources/contracts/CaesiumBondStakeDepository.sol
determine maximum bond size return uint/
function maxPayout() public view returns (uint256) { return IERC20(CAES).totalSupply().mul(terms.maxPayout).div(100000); }
4,719,165
./full_match/1/0xFDdbc45f4cE5893962d2DEAAa03acfC6813d9C21/sources/src/FishfoodFunder.sol
Don't allow the last admin to be removed if there are funds in the contract.
function removeAdmin(address newAdmin) external { if ( !fishFoodFundingStatus[msg.sender].isAdmin || (adminCount == 1 && address(this).balance > 0) ) { revert TooBad(); } fishFoodFundingStatus[newAdmin].isAdmin = false; --adminCount; }...
17,156,385
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function DESIGNATEDREPORTERNOSHOWBONDTOTAL703() external view returns (uint256);
2,553,892
pragma solidity ^0.4.20; // Solidity compiler version supported by Azure Blockchain Workbench //--------------------------------------------- //Generated automatically for application 'RefrigeratedTransportation' by AppCodeGen utility //--------------------------------------------- import "./RefrigeratedTransportat...
Transition preconditions Call overridden function TransferResponsibility in this contract Transition postconditions
function Transition_InTransit_Number_0_TransferResponsibility (address newCounterparty) public { require(State == StateType.InTransit); require(msg.sender == Counterparty); TransferResponsibility(newCounterparty); assert(State == StateType.InTransit); }
5,533,606
pragma solidity >=0.4.21 <0.7.0; import "./Account.sol"; contract Spy { using SafeMath for uint; Account accountInstance; constructor(address _account_address) public { accountInstance = Account(_account_address); } mapping (address => uint) public numOfSpy; mapping (address => uin...
return 0 if failed (maybe already creating or not enough resource) otherwise return createtime
function startCreateSpy(uint number) public returns(uint) { address _owner = msg.sender; bool enoughResource; uint lvOfSpy; enoughResource = _createSpy(_owner, number); lvOfSpy = levelOfSpy[_owner]; if(enoughResource == false) return uint(0); setStartCreateTi...
13,118,916
pragma solidity 0.5.16; /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { ...
Function to mint tokens to The address that will receive the minted tokens. value The amount of tokens to mint. return A boolean that indicates if the operation was successful./
function mint(address to, uint256 value) public returns (bool) { require(CHNInterface(MINT_BASE_TOKEN).balanceOf(msg.sender) >= value, "Mint Base Token Insufficient"); require(totalSupply().add(value.mul(1000)) < MAX_SUPPLY_AMOUNT, "Mint limited max supply"); IERC20(MINT_BASE_TOKEN).transfer...
12,035,635
./full_match/43113/0xFFD36482CFf7a98a3A16b9852aD8594da42b14c2/sources/contracts/hola.sol
public/Private - el view es para que se aloje localmente y no se vaya al resto de los nodos
function consultarFrase() public view returns(string memory){ return frase; }
7,149,038
./full_match/111000/0x42104e0985aE238ba603D30b52c36c666759700C/sources/contracts/CHARITY_WALLET.sol
Sends coins to the specified recipient address recipientAddress The address to send coins to amount The amount of coins to send/
function sendCoins(address payable recipientAddress, uint256 amount) external whenNotPaused onlyRole(MANAGER_ROLE) { bool success; require(amount > 0,"Can not send zero amount"); require(address(this).balance >= amount, "Balance is too low"); require(success, "Transf...
16,365,911
pragma solidity 0.4.21; // File: contracts/ExchangeHandler.sol /// @title Interface for all exchange handler contracts interface ExchangeHandler { /// @dev Get the available amount left to fill for an order /// @param orderAddresses Array of address values needed for this DEX order /// @param orderValues...
Perform a buy order at the exchange orderAddresses Array of address values needed for each DEX order orderValues Array of uint values needed for each DEX order amountToFill Amount to fill in this order v ECDSA signature parameter v r ECDSA signature parameter r s ECDSA signature parameter s return Amount filled i...
function performBuy( address[8] orderAddresses, uint256[6] orderValues, uint256, uint256 amountToFill, uint8 v, bytes32 r, bytes32 s ) external onlyTotle payable returns (uint256) { return fillBuy(orderAddresses, orderValues, v, r, ...
6,532,134
./partial_match/1/0x4d74c068129C1DB1216FaB1b28b9C050908C577B/sources/contracts/AvoForwarder.sol
Retrieves the current avoNonce of AvocadoMultisig for `owner_` address. Needed for signatures. owner_ Avocado owner to retrieve the nonce for. index_ index number of Avocado for `owner_` EOA return returns the avoNonce for the `owner_` necessary to sign a meta transaction
function avoNonce(address owner_, uint32 index_) external view returns (uint256) { address avoAddress_ = _computeAvocado(owner_, index_); if (Address.isContract(avoAddress_)) { return IAvocadoMultisigV1(avoAddress_).avoNonce(); } return 0; }
15,730,471
./full_match/3/0xe8476FB89c76CE2Ad16877FD7e746Bc2db6FE627/sources/broker.sol
convert the account argument from address to bytes. create an in-memory fixed-size bytes array. declare variable types. get the capitalized characters in the actual checksum. iterate over bytes, processing left and right nibble in each iteration. locate the byte and extract each nibble. locate and extract each capitali...
function addressToString( address account ) public pure returns (string memory asciiString) { bytes20 data = bytes20(account); bytes memory asciiBytes = new bytes(40); uint8 b; uint8 leftNibble; uint8 rightNibble; bool leftCaps; bool rightCaps; ...
8,269,832
pragma solidity ^0.4.17; import "zeppelin-solidity/contracts/ECRecovery.sol"; import "zeppelin-solidity/contracts/MerkleProof.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; library JobLib { using SafeMath for uint256; // Prefix hashed with message hash when a signature is produced by the eth_s...
Computes the amount of fees given total segments, total number of profiles and price per segment _totalSegments of segments _transcodingOptions String containing video profiles for a job _pricePerSegment Price in LPT base units per segment/ Calculate total profiles defined in the transcoding options string
function calcFees(uint256 _totalSegments, string _transcodingOptions, uint256 _pricePerSegment) public pure returns (uint256) { uint256 totalProfiles = bytes(_transcodingOptions).length.div(VIDEO_PROFILE_SIZE); return _totalSegments.mul(totalProfiles).mul(_pricePerSegment); }
5,463,672
pragma solidity ^0.4.15; import "zeppelin-solidity/contracts/crowdsale/Crowdsale.sol"; import "zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol"; import "zeppelin-solidity/contracts/token/MintableToken.sol"; import "zeppelin-solidity/contracts/token/StandardToken.sol"; // import "./InitialDistribution.sol"; i...
Overrides Crowdsale function
function buyTokens(address beneficiary) public payable { require(beneficiary != 0x0); require(validPurchase()); uint256 weiAmount = msg.value; uint256 currentRate = rate; if (block.timestamp < presaleEndTime) { currentRate = presaleRate; } else if (hardCap > 0 && weiRaised > hard...
6,439,278
./full_match/97/0xA2bE9B9637A2E235f28552FC168f4e65cD0Ca1dc/sources/project_/contracts/diamond/libraries/LibAlpManager.sol
It is not allowed for the value of any token in the LP to become negative after burning. ∵ alpPrice_ > 0 ∴ (LibVault.getTotalValueUsd() + lpUnPnlUsd) > 0
function _calculateTokenAmount(LibVault.AvailableToken memory at, uint256 alpAmount) private view returns (uint256 amountOut) { require(at.tokenAddress != address(0), "LibAlpManager: Token does not exist"); (int256 lpUnPnlUsd, int256 lpTokenUnPnlUsd) = ITradingCore(address(this)).lpUnrealizedPnlUsd(...
5,026,521
./full_match/44787/0xB39A777c6E3AE43e630621bC144Ce9bd6DcC344e/sources/src/SwayAdmin.sol
access control pausable
function __SwayAdmin_init(address governor) internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); __AccessControlEnumerable_init_unchained(); __Pausable_init_unchained(); __SwayAdmin_init_unchained(governor)...
13,242,760
/** *Submitted for verification at Etherscan.io on 2021-05-24 */ /** *Submitted for verification at Bscscan.com on 2020-09-09 */ pragma solidity 0.5.16; interface IHRC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Ret...
See {HRC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {HRC20}; Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ...
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "HRC20: transfer amount exceeds allowance")); return true; }
10,772,887
pragma solidity ^0.4.22; // File: contracts/ERC223/ERC223_receiving_contract.sol /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. ...
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 uint the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint _value) public returns (bool) { bytes memory empty; return transferFrom(_from, _to, _value, empty); }
393,671
/** * Created on 2018-06-05 16:37 * @summary: Our NFT Minting Contract which inherits ERC721 capability from LSNFT * @author: Fazri Zubair & Farhan Khwaja */ pragma solidity ^0.4.23; pragma solidity ^0.4.23; /* NFT Metadata Schema { "title": "Asset Metadata", "type": "object", "properties": { ...
Helper function to get the attirbute of the collectible.To avoid using getCollectibleDetails Returns the ability of an asset/collectible/token from attributes. _tokenId The token identifier return ability ability of the asset/
function getAbilitiesForCollectibleId(uint256 _tokenId) external view returns (uint256 ability) { NFT memory obj = _getAttributesOfToken(_tokenId); uint256 _attributes = uint256(obj.attributes); ability = (_attributes % 1000); }
7,722,496
/** *Submitted for verification at Etherscan.io on 2021-10-29 */ // File openzeppelin-solidity/contracts/utils/introspection/[email protected] pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support...
add factory addrss/
function addFactoryAddress(address factoryAddr) external onlyOwner { factoryAddresses[factoryAddr] = true; }
2,451,058
// SPDX-License-Identifier: MIT AND GPL-3.0 // File: OpenZeppelin/openzeppelin-contracts@4.3.2/contracts/access/IAccessControl.sol pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRol...
Returns motion with given id if it exists
function _getMotion(uint256 _motionId) private view returns (Motion storage) { uint256 _motionIndex = motionIndicesByMotionId[_motionId]; require(_motionIndex > 0, ERROR_MOTION_NOT_FOUND); return motions[_motionIndex - 1]; }
1,144,492
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/lib/ConsiderationErrors.sol
Reverts execution with an "UnresolvedOfferCriteria" error message./
) pure { function _revertUnresolvedOfferCriteria( uint256 orderIndex, uint256 offerIndex assembly { mstore(0, UnresolvedOfferCriteria_error_selector) mstore(UnresolvedOfferCriteria_error_orderIndex_ptr, orderIndex) mstore(UnresolvedOfferCriteria_error_offerIndex_ptr, offerIndex) ...
4,301,469
./full_match/1/0x5E57C528EF9126200D76620e7b843600635E74Ca/sources/sir-token.sol
returns data of Total struct
function getTotals() external view returns(Totals memory) { return Total; }
17,066,148
./full_match/97/0xF7FCC686158A97f82DE82437d4553E3Da017157d/sources/project_/contracts/core/erc721_upgradeable/LivNFTUpgradeable.sol
An exterval method that allow CLevel to set readyToBreedPeriod _readyToBreedPeriod - New Ready to breed period
function setReadyToBreedPeriod(uint256 _readyToBreedPeriod) external onlyCLevel{ readyToBreedPeriod = _readyToBreedPeriod; }
3,263,687
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move con...
return The slippage numerator
function getSlippageNumerator() public view returns (uint24) { return slippageNumerator; }
9,947,467
pragma solidity ^0.4.13; interface FundInterface { // EVENTS event PortfolioContent(address[] assets, uint[] holdings, uint[] prices); event RequestUpdated(uint id); event Redeemed(address indexed ofParticipant, uint atTimestamp, uint shareQuantity); event FeesConverted(uint atTimestamp, uint sha...
Register an exchange information entry Pre: Only registrar owner should be able to register Post: Address ofExchange is registered ofExchange Address of the exchange ofExchangeAdapter Address of exchange adapter for this exchange inputTakesCustody Whether this exchange takes custody of tokens before trading input...
function registerExchange( address ofExchange, address ofExchangeAdapter, bool inputTakesCustody, bytes4[] inputFunctionSignatures ) auth pre_cond(!exchangeInformation[ofExchange].exists) { exchangeInformation[ofExchange].exists = true; registe...
196,288
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.7.0; import "@openzeppelin/contracts/token/ERC777/ERC777.sol"; import "./interfaces/IArbToken.sol"; contract L2Land is ERC777, IArbToken { address public l2Gateway; address public override l1Address; modifier onlyGateway { require(msg.se...
Burn tokens on L2. only the token bridge can call this account owner of tokens amount amount of tokens burnt/
function bridgeBurn(address account, uint256 amount) external virtual override onlyGateway { bytes calldata data; _burn(account, amount, data, ''); }
15,868,759
./partial_match/3/0xc5caAcB9F860d72201318F8519A8770713651927/sources/YZYVault.sol
Update Staker's Treasury Available Rewards/ For All Stakers Get Staker Update Staker's Treasury available reward Update Staker's Treasury pending reward
function _updateTreasuryAvailableRewards() internal { for (uint256 i = 0; i < _stakerList.length; i++) { address staker = _stakerList[i]; _stakers[staker].treasuryAvailableReward.add( _stakers[staker].treasuryPendingReward ); _stakers[staker]....
5,290,273
./full_match/5/0x7cCa8f6fE3757f67764635F30EfD4711F83220a8/sources/contracts/Equb.sol
get the equb balance Call the investInCampaign function on the instance of the contract
function investInStartup( address payable _startup, address payable equbAddress ) public { uint poolIndex = getPoolIndex(equbAddress); uint amount = pools[poolIndex].equbBalance; _startup.transfer(amount); pools[poolIndex].equbBalance = 0; }
1,937,748
./full_match/1/0x517a197ad807703D99d919afcd720B5F4a2AA9fC/sources/contracts/uniswapv2/libraries/UniswapV2Library.sol
fetches and sorts the reserves for a pair
function getReserves( address factory, address tokenA, address tokenB ) internal view returns (uint256 reserveA, uint256 reserveB) { (address token0, ) = sortTokens(tokenA, tokenB); (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(IUniswapV2Factory(factory).getPair(tokenA, tokenB)).getRes...
16,394,010
./full_match/1/0x0C58579eCeDa5bFb87448da1F8bD6c99175640eb/sources/contracts/AdapterHelper.sol
Tells TokenProfit contract to deposit funds into LiquidNFTs pool/
function _depositLiquidNFTsWrapper( ILiquidNFTsPool _pool, uint256 _amount ) internal { tokenProfit.executeAdapterRequest( LIQUID_NFT_ROUTER_ADDRESS, abi.encodeWithSelector( ILiquidNFTsRouter.depositFunds.selector, _amou...
9,701,634
./full_match/80001/0xf446930D66E7a32b013A602295a919772B20AB41/sources/contracts/PrizeSavingToken.sol
token Id token Id => time result jackpost Token Id => index result consolation Token Id => index
{ using SafeERC20 for IERC20; using TWStrings for uint256; uint256 private nextTokenIdToMint_; mapping(address => bool) public isAdminListed; mapping(uint256 => uint256) public statusDrawed; mapping(uint256 => uint256) public timeDrawed; mapping(uint256 => uint256) public resultJackpot; ...
5,643,755
/** * @title OnboardRouter * @author Team 3301 <team3301@sygnum.com> * @dev OnboardRouter contract, that allows one individual transaction to onboard a particular subset of users onto * the Sygnum platform, instead of having to initiate X amount of transactions. */ pragma solidity 0.5.12; import "../helpers...
Admin can give '_account' address blocker privileges, whitelist them on the shared whitelist contract, and the passed in whitelist address i.e. Equity Token, or the default whitelist. _account address that should be given blocker privileges. _whitelist Whitelist contract address./
function onboardBlocker(address _account, address _whitelist) public onlyAdmin { _toggleWhitelist(_account, _whitelist, true); blockerOperatorsInst.addBlocker(_account); }
5,353,042
// File: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/utils/math/SafeMathUpgradeable.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's bu...
complete setup once all obligations are met, to remove the ability to reclaim tokens until vesting is complete, and allow claims to start
function endSetup() external onlyAdmin setupOnly { uint256 tokenBalance = token.balanceOf(address(this)); require(tokenBalance >= totalObligations, "obligations not yet met"); setupComplete = true; setupAdmin = address(0); emit SetupCompleted(); }
12,940,923
./full_match/1/0xE5fED113E1969D76c3268f2244EE7b5F3e94a12a/sources/contracts/SwaposToken.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
16,391,877
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import './openzeppelin-solidity/contracts/SafeMath.sol'; //Interfaces import './interfaces/IExternalStorage.sol'; //Inheritance import './interfaces/IUsers.sol'; import './openzeppelin-solidity/contracts/Ownable.sol'; import './openzeppelin-solidity/contracts/...
Given the address of a user, returns the user's profile NFT ID. If the user hasn't minted an NFT profile, the function returns 0. userAddress Address of the user. return uint The user's NFT ID./
function getUser(address userAddress) external view returns (uint) { require(userAddress != address(0), "Users: invalid user address."); return profileIDs[userAddress]; }
13,053,439
pragma solidity ^0.4.24; contract F3Devents { // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, ...
logic runs whenever a reload order is executed. determines how to handle incoming eth depending on if we are in an active round or not/ setup local rID grab time if round is active get earnings from all vaults and return unused to gen vault because we use a custom safemath library. this will throw if player tried to ...
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, F3Ddatasets.EventReturns memory _eventData_) private { uint256 _rID = rID_; uint256 _now = now; if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && roun...
27,604
pragma solidity ^0.4.24; import './IBancorNetwork.sol'; import './ContractIds.sol'; import './FeatureIds.sol'; import './converter/interfaces/IBancorConverter.sol'; import './converter/interfaces/IBancorFormula.sol'; import './converter/interfaces/IBancorGasPriceLimit.sol'; import './utility/TokenHolder.sol'; import '....
/ iterate over the conversion path check if the current smart token supply was changed in the previous iteration validate input calculate the amount & the conversion fee update the smart token supply for the next iteration
function getReturnByPath(IERC20Token[] _path, uint256 _amount) public view returns (uint256, uint256) { IERC20Token fromToken; ISmartToken smartToken; IERC20Token toToken; IBancorConverter converter; uint256 amount; uint256 fee; uint256 supply; uint25...
7,322,291
./full_match/83/0x518d0bD24C3d9705608f229BbfBAA4519d324628/sources/contracts/UnderWriterAdmin.sol
require(markets[address(cToken)].isListed, "cannot pause a market that is not listed");
function _setBorrowPaused(CToken cToken, bool state) public returns (bool) { require(msg.sender == pauseGuardian || msg.sender == admin, 'only pause guardian and admin can pause'); require(msg.sender == admin || state, 'only admin can unpause'); borrowGuardianPaused[address(cToken)] = state; emit Act...
9,563,678
./full_match/1/0x3c53bd8809C220412BCac552CE09a7B2B786dD6A/sources/localhost/contracts/JT9.sol
msg sender should be DF9T clone contract mint DF9 and transfer prize to accout
function redeem(address account, uint256 level, uint256 id, uint256 dividend, bool mintable) external { require(factory.isVerifiedMarket(address(msg.sender))); if (mintable) { _mint(account, id, 1, ""); userInfo[account].redeemedBets.push( RedeemedBet({ ...
8,317,257
pragma solidity ^0.4.23; // import 'zeppelin-solidity/contracts/ownership/DelayedClaimable.sol'; import './MultiOwnerContract.sol'; interface itoken { function freezeAccount(address _target, bool _freeze) external; function freezeAccountPartialy(address _target, uint256 _value) external; function balance...
change the owner of the contract from this contract address to another one. _congress the contract address that will be next Owner of the original Contract/
function initCongress(address _congress) onlyMultiOwners public { require(hasAuth(AUTH_INITCONGRESS)); require(!congressInit); itoken tk = itoken(address(ownedContract)); tk.initialCongress(_congress); clearAuth(AUTH_INITCONGRESS); congressInit = true; }...
5,386,564
pragma solidity 0.8.3; import "./CurrencyNetworkInterface.sol"; contract TLSwap { CurrencyNetworkInterface _currency; struct Commitment { address payable initiator; address payable recipient; address TLNetwork; uint64 TLMoneyAmount; uint64 endTimeStamp; addres...
We currently just remove the commitment. In the future we could make sure that if a transfer didn't succeed we could add a dept in the currency network/
function removeCommitment(bytes32 _hash) external { require(CommitmentsMap[_hash].initiator != address(0x0), "No entry found"); require(CommitmentsMap[_hash].endTimeStamp < block.timestamp, "TimeStamp violation"); delete CommitmentsMap[_hash]; emit ExpireCommitment(_hash); }
12,643,901
// 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. ...
Get market total borrows from the AlkemiEarnVerified contract market The address of the market isVerified Verified / Public protocol return Market total borrows for the given market/
function getMarketTotalBorrows(address market, bool isVerified) public view returns (uint256) { uint256 totalBorrows; (, , , , , , totalBorrows, , ) = getMarketStats(market, isVerified); return totalBorrows; }
81,710
pragma solidity ^0.4.23; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "Overflow - Multiplication"); return c; } /** *...
Checks that a call pushing a storage value to the buffer is expected and valid Ensure that the next function expected pushes a storage value - Ensure that the current buffer is pushing STORES actions -
function validStoreVal() private pure { if ( expected() != NextFunction.VAL_SET && expected() != NextFunction.VAL_INC && expected() != NextFunction.VAL_DEC ) revert('Unexpected function order - expected storage value to be pushed'); isStoring(); }
1,484,855
./partial_match/1/0xFB41B505b83D3fF7FdbeE5527C744C7fdb975026/sources/COOL.sol
remove limits after token is stable
function removeLimits() external onlyOwner { limitsInEffect = false; buyFee = 1; sellFee = 1; }
2,721,102
./partial_match/42220/0xe6F77e6c1Df6Aea40923659C0415d82119F34882/sources/home/eruiz/Projects/celo/celo-monorepo/packages/protocol/contracts/governance/Proposals.sol
Constructs a proposal. proposal The proposal struct to be constructed. values The values of CELO to be sent in the proposed transactions. destinations The destination addresses of the proposed transactions. data The concatenated data to be included in the proposed transactions. dataLengths The lengths of each tran...
function make( Proposal storage proposal, uint256[] memory values, address[] memory destinations, bytes memory data, uint256[] memory dataLengths, address proposer, uint256 deposit ) public { require( values.length == destinations.length && destinations.length == dataLengths.le...
3,498,754
./full_match/3/0xf6b62Ef67fc2A7d122e08cbde38BDE08Ad5aAE50/sources/releasable__1__mod.sol
Transfers manager permissions to a new account (`newManager`). Internal function without access restriction./
function _setManager(address newManager) internal { address oldManager = _manager; _manager = newManager; emit ManagementTransferred(oldManager, newManager); }
8,148,305
pragma solidity ^0.4.10; /// @title A group expenses smart contract allowing you to settle up your debts and credits /// @author Adrien Arcuri /// @notice You can use this contract to record your group expenses, Payment participants, /// check the debts and credits of the groups and settle up. /// @dev No comments fo...
Constructor of our smart contract. The creator of the smart contract will be the first participant. name the name of the first participant return
function WeExpenses(string name) public { createParticipant(name, msg.sender); deployed = true; }
14,106,474
./partial_match/97/0x7F5267Ac54dFFB7577139CfB118C867b567060DA/sources/HRPToken.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "HRP::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0...
11,411,504
./full_match/1/0x9f48313C86249A8A369c830cE0379cb634B94935/sources/browser/Farming/FarmManager.sol
fund a farm with amount. must give allowance to created farm first.
function fund(uint _fid, uint256 _amount) public { require(funders[msg.sender] == true, "fund: sender is not funder"); farms[_fid].fund(_amount); }
2,916,494
pragma ton-solidity ^0.37.0; pragma AbiHeader expire; pragma AbiHeader time; pragma AbiHeader pubkey; import "./interfaces/IRootAuction.sol"; import "./interfaces/IAuction.sol"; /** * Error codes * 100 - Method for the root only * 101 - Invalid number of periods * 102 - Bid period is over * 103 -...
PUBLIC // Participants confirm the bid with money. If make it possible not to confirm the bid with money, then the trolls will be able to do this: 1. Bet on 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 2. Win the auction. ...
function submit(uint256 salt) public canSubmit notZeroValue { address sender = msg.sender; uint128 value = msg.value; TvmBuilder builder; builder.store(value); builder.store(salt); TvmCell cell = builder.toCell(); uint256 bidHash = tvm.hash(cell); _s...
13,031,120
./full_match/44787/0x33F8d23a573544a9D80B74c029a3aB392aEDB40A/sources/contracts/StarFarm.sol
Deposit LP tokens to MasterChef for STAR allocation.
function deposit(uint256 _pid, uint256 _amount) public { if (_pid == 0) require(userNFTs[_msgSender()].length == 0, "nft user"); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_msgSender()]; updatePool(_pid); (uint256 _selfGain, uint256 _paren...
13,250,115
pragma solidity 0.5.17; import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; import {TBTCDepositToken} from "./TBTCDepositToken.sol"; import {FeeRebateToken} from "./FeeRebateToken.sol"; import {TBTCToken} from "./TBTCToken.sol"; import {TBTCConstants} from "./TBTCConstants.sol"; import "../dep...
Extracts the target from a block header Target is a 256-bit number encoded as a 3-byte mantissa and 1-byte exponent _header The header return The target threshold
function extractTarget(bytes memory _header) internal pure returns (uint256) { bytes memory _m = _header.slice(72, 3); uint8 _e = uint8(_header[75]); uint256 _mantissa = bytesToUint(reverseEndianness(_m)); uint _exponent = _e - 3; return _mantissa * (256 ** _exponent); }...
7,283,279
/* Copyright 2018 RigoBlock, Rigo Investment Sagl. 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...
Provides whether a token wrapper is whitelisted _wrapper Address of the target exchange return Bool is whitelisted
function isWhitelistedWrapper(address _wrapper) external view returns (bool) { return accounts[_wrapper].groups[true].wrapper; }
980,967
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import './BitMath.sol'; /// @title Packed tick initialized state library /// @notice Stores a packed mapping of tick index to its initialized state /// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per w...
Computes the position in the mapping where the initialized bit for a tick lives tick The tick for which to compute the position return wordPos The key in the mapping containing the word in which the bit is stored return bitPos The bit position in the word where the flag is stored
function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) { wordPos = int16(tick >> 8); bitPos = uint8(uint24(tick % 256)); }
897,388
pragma solidity ^0.6.0; /** Powered by Paul Bolhar t.me/bolpol Smart solutions and code audit. http://pironmind.com */ /** @title ERC20 interface (short version) */ interface ERC20 { function balanceOf(address tokenOwner) external returns (uint balance); function transfer(address to, uint tokens) extern...
Destroy this contract and recover any ether to the owner./
function destroy() public onlyOwner { if(returnTokens()) { emit Destroyed(now); selfdestruct(msg.sender); } }
6,411,689
// SPDX-License-Identifier: Unlicensed pragma solidity 0.8.7; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity...
vest function from now
function vestTokensFromNowInt(address _beneficiary, uint256 _tokensAmountInt, uint256 _afterDay, uint256 _cliffDay, uint256 _durationDay ) public onlyOwner { vestTokensStartAtInt(_beneficiary, _tokensAmountInt, block.timestamp, _afterDay, _cliffDay, _durationDay); }
1,016,400
./partial_match/1/0xCF0aC4329820A2C3BBdFA7C1e3B4819662A85DcC/sources/contracts/RefToken.sol
has the pot been reached
function hasPotBeenReached() public view returns (bool) { return _potEthBalance >= _potWinningAmount; }
9,358,585
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol
Reads the int56 at `cdPtr` in calldata.
function readInt56( CalldataPointer cdPtr ) internal pure returns (int56 value) { assembly { value := calldataload(cdPtr) } }
3,218,330
pragma solidity 0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./eTac...
_from: block number from which the reward is calculated _to: block number before which the reward is calculated return Return reward multiplier over the given _from to _to block/
function getReward(uint256 _from, uint256 _to) public view returns (uint256) { return rewardPerBlock.mul(_to.sub(_from)); }
14,913,590
// SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppe...
Mint and increase the tokenID Set the tokenURI to the URI specified by the App
function mint(uint256 _appId) public payable { require(apps[_appId].id != 0, "App ID must exist"); uint256 totalSupply = totalSupply(); uint256 _tokenId = totalSupply + 1; _safeMint(msg.sender, _tokenId); require(_exists(_tokenId)); nftsToAppIds[_tokenId] = ...
13,686,733
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol...
xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_mint}. Requirements: - `ids` and `amounts` must have the same length. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value./
function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"...
1,159,126
./partial_match/137/0x18ec0A6E18E5bc3784fDd3a3634b31245ab704F6/sources/contracts/IPolygonPosChildToken.sol
IPolygonPosChildToken This interface define the mandatory method enabling polygon bridging mechanism. This interface should be inherited to deploy on polygon POS network./
interface IPolygonPosChildToken { function deposit(address user, bytes calldata depositData) external; function withdraw(uint256 amount) external; pragma solidity ^0.8.0; }
3,531,860
// File: contracts/lib/ERC20.sol pragma solidity ^0.4.24; /** * @title ERC20 * @dev A standard interface for tokens. * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md */ contract ERC20 { /// @dev Returns the total token supply function totalSupply() public view returns (u...
In this 1st option for ownership transfer `proposeOwnership()` must be called first by the current `owner` then `acceptOwnership()` must be called by the `newOwnerCandidate` `onlyOwner` Proposes to transfer control of the contract to a new owner _newOwnerCandidate The address being proposed as the new owner
function proposeOwnership(address _newOwnerCandidate) public onlyOwner { newOwnerCandidate = _newOwnerCandidate; emit OwnershipRequested(msg.sender, newOwnerCandidate); }
2,572,906
// File: contracts/SafeMath.sol pragma solidity ^0.5.0; /** * @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 c) { ...
Creates a new token type and assings _initialSupply to minter Transfer event with mint semantic
function create(uint256 _initialSupply, address _to, string calldata _name) external onlyOwner returns (uint256 _id) { _id = ++nonce; balances[_id][_to] = _initialSupply; _totalSupplies[_id] = _initialSupply; emit TransferSingle(msg.sender, address(0x0), _to, _id, _initialSupply); ...
14,742,392
./partial_match/3/0x62e5849229F78689CC992a5631eC23ad8862dd5a/sources/TokenERC20.sol
确保目标地址不为0x0,因为0x0地址代表销毁 检查发送者余额 确保转移为正数个 以下用来检查交易, Subtract from the sender Add the same to the recipient 用assert来检查代码逻辑。
function _transfer(address _from, address _to, uint _value) internal { require(_to != address(0x0)); require(balanceOf[_from] >= _value); require(balanceOf[_to] + _value > balanceOf[_to]); uint previousBalances = balanceOf[_from] + balanceOf[_to]; ...
5,065,973
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (stri...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a delegate call. _Available since v3.4._/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); }
351,925
/** * Because the use of ABIEncoderV2 , the pragma should be locked above 0.5.10 , * as there is a known bug in array storage: * https://blog.ethereum.org/2019/06/25/solidity-storage-array-bugs/ */ pragma solidity >=0.5.10 <0.6.0; pragma experimental ABIEncoderV2; import {Proxiable} from "./Proxiable.sol"; import ...
Distribute the incoming tokens to the recipients as loans. The tokens are immediately invested into the saving strategy and add to the sAmount of the recipient account. Recipient also inherits the owner's hat if it does already have one. owner Owner account address rAmount rToken amount being loaned to...
function distributeLoans( address owner, uint256 rAmount, uint256 sInternalAmount ) internal { Account storage account = accounts[owner]; Hat storage hat = hats[account.hatID == SELF_HAT_ID ? 0 : account.hatID]; uint256 i; if (hat.r...
5,495,273
//Address: 0xfd95392e1ce28a6debff90feb0a28a1392df738b //Contract name: CryptoABS //Balance: 0 Ether //Verification Date: 7/13/2017 //Transacion Count: 19 // CODE STARTS HERE pragma solidity ^0.4.11; /** * Math operations with safety checks */ library SafeMath { function mul(uint256 a, uint256 b) internal return...
put all capital in this contract/
function ownerPutCapital() payable isInitialized isPaused onlyOwner { require(msg.value > 0); finalizedCapital = msg.value; }
7,279,054
pragma solidity 0.5.8; import "./ERC777ERC20Compat.sol"; import "./SafeGuard.sol"; import { CStore } from "./CStore.sol"; //TODO: Convert all imports like this contract CALL is ERC777ERC20Compat, SafeGuard { constructor( string memory _name, string memory _symbol, uint256 _granularity, ...
Revoke a third party `_operator`'s rights to manage (send) `msg.sender`'s tokens at remote database. _operator The operator that wants to be Revoked/
function revokeOperator(address _operator) external { require(_operator != msg.sender, "Cannot revoke yourself as an operator"); if (balancesDB.getDefaultOperator(_operator)) { require(balancesDB.setRevokedDefaultOperator(_operator, msg.sender, true)); require(balancesDB.setA...
13,062,953