file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/1/0x21605E15A0bf722C3BbC0e13fEA743022e7ccb87/sources/browser/v2.sol
allows governance to start or stop grassland
function govAllow() public onlyOwner { require( isAllow == false, "Already allowed"); isAllow = true; }
9,745,326
./full_match/5/0x191ceFa4a57F833988842636edcc34c68ea14ab3/sources/contracts/PepeSystems.sol
Set pepe status _saleStatus sale ON or OFF
function setSaleStatus(bool _saleStatus) external onlyOwner { saleStatus = _saleStatus; }
1,857,765
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@kyber.network/utils-sc/contracts/IERC20Ext.sol"; import "./interfaces/ISmartWalletImplementation.sol"; import "....
swapContract swap contract lendingContract lending contract srcAmount amount of src token minDestAmount minimal accepted dest amount tradePath path of the trade on Uniswap feeMode fee mode feeBps fee bps platformWallet wallet to receive fee extraArgs extra data needed for swap on particular platforms
function swap(SwapParams calldata params) external payable returns (uint256 destAmount); struct SwapAndDepositParams { address payable swapContract; address payable lendingContract; uint256 srcAmount; uint256 minDestAmount; address[] tradePath; FeeMode feeMode; ...
1,653,133
// Sources flattened with hardhat v2.4.3 https://hardhat.org // -------------------------------- // ----. Moonshot Collective .----- // -------------------------------- // File @openzeppelin/contracts/math/SafeMath.sol@v3.4.1 // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over...
user balance management functions share ETH from amount payed by user
function _sharePayedETH(address[] memory users, uint256[] memory shares) internal accurateUserSharesRatio(users, shares) hasEnoughBalance(shares, msg.value) { _distribute(users, shares, address(0), address(0)); }
14,598,728
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `...
IERC20(_eonAddress).transferFrom(msg.sender, address(this), NAME_CHANGE_PRICE);
function nameColonist(uint256 tokenId, string memory newName) public { require(namingActive == true, "naming not yet available"); require(ownerOf[tokenId] == msg.sender, "Not your colonist to name"); require(hasBeenNamed(tokenId) == false, "Colonist already named"); require(validateN...
6,195,496
./full_match/1/0xc1BB6B6ae3b161AB145758D34D1FbfE91a3823ae/sources/contracts/Sale.sol
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but performing a static call. _Available since v3.3._/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); }
3,114,311
./full_match/1/0x8b4fd02326Db6EbE095E0707E2973C9e045da3dC/sources/browser/BlackScholesEstimate.sol
fromReturnsBSestimate first calculates the stddev of an array of price returns then uses that as the volatility param for the blackScholesEstimate _numbers uint256[] array of price returns for volatility calculation _underlying uint256 price of the underlying asset _time uint256 days to expiration in years multipli...
function retBasedBlackScholesEstimate( uint256[] memory _numbers, uint256 _underlying, uint256 _time ) public pure { uint _vol = stddev(_numbers); blackScholesEstimate(_vol, _underlying, _time); }
8,287,634
./full_match/44787/0x8eba7df80534924b85e822f3671d3FE533286Eb7/sources/contracts/StarFarm.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)).add(pool.extraAmount); if (lpSupply == 0) { pool.lastRewar...
13,264,525
/* * Copyright 2019 ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wr...
TODO skip if isLocked.
function getRoomInformation(uint256 _date, uint256 _uniqueId) external view returns (uint256 amountPaid, uint256 roomId) { for (uint i=0; i<rooms.length; i++) { (uint256 uniqueId, address whoBooked) = rooms[i].getBookingInfo(_date); if (_uniqueId == uniqueId && whoBooked == tx.origin...
5,426,319
pragma solidity ^0.5.2; import "./Host.sol"; /// the patent hub will be hosted by one of the innovators contract PatentHub is Host { // ***** STRUCTS ***** // contribution phase struct Share { address shareholder; uint percentage; // denoted in values between 0 and 100 bool accepted; // true ...
functions - helper functions specific to patent hub use case
function isContractedPatentAgent(address addr) internal view returns(bool) { return patentAgentInventorsContract.signed && addr == patentAgentInventorsContract.patentAgent; }
12,802,345
// Contracts/SupplyChain.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../emeraldaccesscontrol/MinerRole.sol"; import "../emeraldaccesscontrol/LaboratoryRole.sol"; import "../em...
Define a function 'receiveFromStorage' that allows the manufacturer mark an item 'ManufacturerReceived' Call modifier to check if upc has passed previous supply chain stage Access Control List enforced by calling Smart Contract / DApp Update the appropriate fields - ownerID, retailerID, itemState Emit the appropriate e...
function receiveFromStorage(uint _upc) public shiptoManufacture(_upc) onlyManufacturer { emeralds[_upc].SetEmeraldState(EmeraldStates.State.ManufacturerReceived); emit ManufacturerReceived(_upc); }
5,454,284
pragma solidity ^0.4.24; import "./CacaoLibrary.sol"; import "./StandardToken.sol"; import "./CacaoKeyRing.sol"; import "./CacaoCreation.sol"; import "./CacaoDistribution.sol"; import "./CacaoDestruction.sol"; import "./CacaoRescue.sol"; import "./Freezable.sol"; import "./IVerifySignature.sol"; /// @title Moneda Caca...
Enable withdrawal of other tokens (by airdrop, forks maybe?) _tokenContract The token contract address to withdraw tokens from. _to The address of the recipient
function withdrawExternalTokens(address _tokenContract, address _to) public onlyCreator returns (bool) { ERC20Basic token = ERC20Basic(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(_to, amount); }
12,772,478
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "./Ownable.sol"; contract OwnableDelegateProxy {} /** * Used to delegate ownership of a c...
increments the value of _currentTokenID/
function _incrementTokenTypeId() private { _currentTokenID++; }
9,957,740
pragma solidity 0.4.25; import "./SafeMath.sol"; import "./IToken.sol"; import "./ISettings.sol"; import "./ITBoxManager.sol"; import "./IOracle.sol"; /// @title BondService contract BondService { using SafeMath for uint256; /// @notice The address of the admin account. address public admin; // The...
IOracle Interface for getting the data from the oracle contract.
interface IOracle { function ethUsdPrice() external view returns(uint256); }
1,820,757
./full_match/5/0xDd075Ee118E993A9C18806561635a5a74974F556/sources/project_/contracts/base/ERC721Extensions/ERC721Vault.sol
Toggle the staking status of the input tokens./
function vault_toggleStaking(uint256[] calldata tokenIds) external { uint256 n = tokenIds.length; for (uint256 i; i < n;) { vault_toggleStaking(tokenIds[i]); } unchecked{++i;} }
1,879,339
/* * Crypto stamp On-Chain Shop * Selling NFTs directly and handling shipping of connected physical assets * * Developed by capacity.at * for post.at */ // File: openzeppelin-solidity\contracts\token\ERC721\IERC721Receiver.sol pragma solidity ^0.5.0; /** * @title ERC721 token receiver interface ...
number of EUR cent per ETH (rounded down!)
function ETH_EURCENT() public view returns (uint256);
2,542,952
// 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...
Computes how many tokens must be sent to a pool if `tokenAmountOut` are sent given the current balances, using the Newton-Raphson approximation. The amplification parameter equals: A n^(n-1) The invariant should be rounded up. inGivenOut token x for y - polynomial equation to solve ...
function _calcInGivenOut( uint256 amplificationParameter, uint256[] memory balances, uint256 tokenIndexIn, uint256 tokenIndexOut, uint256 tokenAmountOut, uint256 invariant ) internal pure returns (uint256) { balances[tokenIndexOut] = balances[tokenIndexOu...
277,647
/* * This code has not been reviewed. * Do not use or deploy this code before reviewing it personally first. */ pragma solidity ^0.8.0; import "../../openzeppelin/contracts/utils/math/SafeMath.sol"; import "../../openzeppelin/contracts/access/Ownable.sol"; import "../../openzeppelin/contracts/token/ERC20/IERC20.sol...
Extract function signature from payload. payload Payload of the initial transaction. return Function signature./
function _getFunctionSig(bytes memory payload) internal pure returns(bytes4) { return (bytes4(payload[0]) | bytes4(payload[1]) >> 8 | bytes4(payload[2]) >> 16 | bytes4(payload[3]) >> 24); }
15,790,840
./full_match/4/0x9d12aeBb3671A1f53e80fE2B3da029B29fF36B4c/sources/RRR.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, (tokenId + 1).toStr...
687,197
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/token/ERC20/IERC20.sol pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view retu...
We need to now calculate the percent of accessory tokens going to this depositor It is based on how long the depositor is in the contract and their share This shouldn't happen under normal circumstances This user has been in the contract longer than the average, allow up to 100% of tokens based on share User has been i...
function transferAccessoryTokens(address payable _depositor, uint256 _share, uint256 _total) internal { bool _takeAll = false; if(_share == _total){ _takeAll = true; } if(_takeAll == false){ uint256 exitTime = now; uint256 enterTime = ...
15,090,223
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract Z_ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint2...
Token sale sumilation for current sale stage ( public view function ) _ether_or_wei_value input ethereum value (in wei or ether unit) return _num_of_tokens number of tokens that can be bought with the input value return _exch_rate current sale stage exchange rate (wei per now) return _current_sale_stage_index ...
function simulate_token_sale(uint _ether_or_wei_value) public view returns (uint256 _num_of_tokens, uint256 _exch_rate, uint256 _current_sale_stage_index) { if(sale_stage_index >=5 ) return (0,0,0); _exch_rate= sale_price_per_stage_wei_per_now[sale_stage_index]; _current_sale_stage_index= sale_stage_ind...
13,028,599
//SPDX-License-Identifier: MIT // File: contracts/interfaces/IPancakeV2Router01.sol pragma solidity ^0.8.0; interface IPancakeV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address t...
Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amo...
12,747,488
pragma solidity ^0.4.24; // File: openzeppelin-solidity/contracts/introspection/ERC165.sol /** * @title ERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface ERC165 { /** * @notice Query if a contract implements an interface * @param _interfaceId The interface identifier,...
Set prices for specific blocks _x X coordinate of the desired block _y Y coordinate of the desired block _price New price of the pixel block/
function setPixelBlockPrice(uint256 _x, uint256 _y, uint256 _price) public payable { require(_price > 0); _setPixelBlockPrice(_x, _y, _price); }
6,608,990
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./NectarToken.sol"; contract OfferMultiSig is Pausable { using SafeMath for uint256; stri...
solium-disable-next-line security/no-inline-assembly
function getPartyA(bytes memory _state) public pure returns (address _ambassador) { assembly { _ambassador := mload(add(_state, 96)) } }
2,509,406
pragma solidity 0.6.12; import "./base/IACL.sol"; import "./base/IACLConstants.sol"; import "./base/IAccessControl.sol"; import "./base/SafeMath.sol"; /** * @dev Library for managing addresses assigned to a Role within a context. */ library Assignments { using SafeMath for *; struct RoleUsers { mapping (ad...
assign a role to an address/ record new context if necessary only admin should be able to assign somebody in the system context
function _assignRole(bytes32 _context, address _assignee, bytes32 _role) private { if (!isContext[_context]) { contexts[numContexts] = _context; isContext[_context] = true; numContexts++; } assignments[_context].addRoleForUser(_role, _assignee); if (_context == systemContext) { ...
14,092,363
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract AMM { using SafeMath for uint256; uint totalShares; // Stores the total amount of share issued for the pool uint totalToken1; // Stores the amount of Token1 locked in the poo...
Returns the estimate of Token1 & Token2 that will be released on burning given _share
function getWithdrawEstimate(uint256 _share) public view activePool returns(uint256 amountToken1, uint256 amountToken2){ require(_share <= totalShares, "Share should be less than totalShare"); amountToken1 = _share.mul(totalToken1).div(totalShares); amountToken2 = _share.mul(totalToken2).div...
5,372,377
pragma solidity ^0.5.0; /* @title CredentialsConstrained */ contract CredentialsConstrained { // State mapping(address => bool) public authorizedUsers; address public contractOwner; bool public isOpenToEveryUser; // Events event AuthorizedUserAdded(address user); event Credentia...
Remove credentials Remove credentials of an authorized user user - the authorized address to be removed/
function removeCredentials(address user) public onlyContractOwner { delete authorizedUsers[user]; emit CredentialsRemoved(user); }
5,506,583
./full_match/1/0x57a1c411bc39EFA256CCb8Dc49Ea56DFe2aAe3b5/sources/contracts/AvoForwarder.sol
computes the deterministic contract address for a AvoSafe deployment for owner_ owner_ AvoSafe owner return the computed contract address cast last 20 bytes of hash to address
function _computeAvoSafeAddress(address owner_) internal view returns (address) { bytes32 hash = keccak256( abi.encodePacked(bytes1(0xff), address(avoFactory), _getSalt(owner_), avoSafeBytecode) ); return address(uint160(uint256(hash))); }
8,341,652
pragma solidity 0.5.9; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; /** * @title MultiSig * @dev Simple MultiSig using off-chain signing. * @author Julien Niset - <julien@argent.im> */ contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 10; // Incrementing counter to pre...
Removes an owner from the multisig. This method can only be called by the multisig itself (i.e. it must go through the execute method and be confirmed by the owners). _owner The address of the removed owner./
function removeOwner(address _owner) public onlyWallet { require(ownersCount > threshold, "MSW: Too few owners left"); require(isOwner[_owner] == true, "MSW: Not an owner"); ownersCount -= 1; delete isOwner[_owner]; emit OwnerRemoved(_owner); }
13,057,099
./full_match/43114/0xE487a3780D56F2ECD142201907dF16350bb09946/sources/DssProxyActions.sol
Joins DAI amount into the vat Paybacks debt to the CDP and unlocks WETH amount from it Moves the amount from the CDP urn to proxy's address Exits WETH amount to proxy address as a token Converts WETH to ETH Sends ETH back to the user's wallet
function wipeAndFreeETH( address manager, address ethJoin, address daiJoin, uint cdp, uint wadC, uint wadD ) public { address urn = DssCdpManager(manager).urns(cdp); daiJoin_join(daiJoin, urn, wadD); frob( manager, c...
4,579,870
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "../interface/IERC721.sol"; import "../interface/IERC721Receiver.sol"; import "../utils/Address.sol"; import "./ERC165.sol"; /** * @dev ERC721 Non-Fungible Token Implementation * * Exert uniqueness of owner: one owner can only have one token ...
See {IERC721}.{transferFrom}/
function transferFrom(address from, address to, uint256 tokenId) public override { _validateTransfer(msg.sender, from, to, tokenId); _transfer(from, to, tokenId); }
880,026
./full_match/43113/0x2Ad8a117CAA5574f34CF28312E5715c153a3a147/sources/contracts/SmartAlpha.sol
Return the price of the junior token for the current epoch If there's no supply, it returns 1 (scaled by scaleFactor). It does not take into account the current profits and losses. return The price of a junior token in pool tokens
function getEpochJuniorTokenPrice() public view returns (uint256) { uint256 supply = juniorToken.totalSupply(); if (supply == 0) { return scaleFactor; } return epochJuniorLiquidity * scaleFactor / supply; }
7,165,498
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of...
Returns the number of shares for a given `assetAmount`. Used by the frontend to calculate withdraw amounts. assetAmount is the asset amount to be withdrawn return share amount/
function assetAmountToShares(uint256 assetAmount) external view returns (uint256) { uint256 total = wmul( lockedAmount, collateralToken.pricePerShare().mul(_decimalShift()) ) .add(assetBalance()); ret...
2,187,489
./full_match/3/0x0651b43922721aA5452aCE716c47676e435Ab410/sources/NewDebitDollar-v1.sol
Change safeguard status on or off When safeguard is true, then all the non-owner functions will stop working. When safeguard is false, then all the functions will resume working back again!/
function changeSafeguardStatus() onlyOwner external{ if (safeguard == false){ safeguard = true; } else{ safeguard = false; } }
8,111,999
./full_match/4/0x6174F4B94fF021dA028e0356Bd60F177Ffe5e72F/sources/ShitNFTS.sol
Add to free mint list
function addToFreeList(address[] memory _addresses) external onlyOwner { for(uint256 i; i < _addresses.length; i++){ _freeMintsReserved[_addresses[i]] = true; } }
13,350,440
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned i...
Get the current balance of the tokens/
function balanceToMaintain() external view returns(uint256) { uint256 currentBalance = IERC20(stakeToken).balanceOf(address(this)); uint256 totalUnClaimed = totalUnClaimedTokens(); if(totalUnClaimed > currentBalance) { return totalUnClaimed.sub(currentBalance); return...
85,886
./full_match/80001/0x3cE80d5EA6Adc1e378D2e74f298bCcc062377d7F/sources/contracts/BourbonNBlockchainRewards.sol
inject rewards here
function injectRewards(uint256 amount) onlyOwner public view returns(uint256) { return 50; }
5,621,045
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; // ============ Internal Imports ============ import {IBridgeToken} from "../../interfaces/bridge/IBridgeToken.sol"; import {ERC20} from "./vendored/OZERC20.sol"; // ============ External Imports ============ import {Version0} from "@celo-org/opti...
Destroys `_amount` tokens from `_account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `_account` cannot be the zero address. - `_account` must have at least `_amount` tokens./
function _burn(address _account, uint256 _amount) internal virtual { require(_account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(_account, address(0), _amount); balances[_account] = balances[_account].sub( _amount, "ERC20: burn amount ...
1,230,212
/** *Submitted for verification at Etherscan.io on 2020-12-29 */ pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; abstract contract IUniswapV2Factory { function getPair(address tokenA, address tokenB) external virtual view returns (address pair); function allPairs(uint) external virtual view ret...
@inheritdoc ActionBase
function executeActionDirect(bytes[] memory _callData) public payable override burnGas { UniWithdrawData memory uniData = parseInputs(_callData); _uniWithdraw(uniData); }
10,806,169
//SPDX-License-Identifier: Unlicense // *****+=:. .=*****+-. -#@@#-. .+*****=:. .****+: :*****+=:. -***: -+**= =***. // ...:=*#%%#*=:.. .+%@*. @@@@%@@@@* .#@@@%%@@@*. [emailΒ protected]@@@%@@@- :%@@@%%@@@- [emailΒ p...
Allows owner to pause use of the swap function Simply calling this function is enough to pause swapping/
function pauseSwap() external onlyOwner { swapActive = false; }
10,107,147
./full_match/80001/0x065D6D98928272aeBa71b98846008f5667ed08fe/sources/project_/interfaces/IFACTORYSELLER.sol
PUBLIC FUNCTIONS View functions Set functions
interface IFACTORYSELLER { function setManager(address p_manager) external; function create(address p_stableCoin, address p_beneficiary, address p_aggregatorStableCoinDollar) external returns(address); pragma solidity ^0.8.4; }
9,447,636
pragma solidity ^0.6.9; //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::: @#::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //:::::...
Total amount of tokens remaining
function tokensRemaining() public view returns (uint256) { uint256 totalCommitted = totalTokensCommitted(); if (totalCommitted >= totalTokens ) { return 0; return totalTokens.sub(totalCommitted); } }
79,561
./full_match/1/0xa4Bad5d040d4464EC5CE130987731F2f428c9307/sources/contracts/EthVesting.sol
return the period after the duration in completed before the backup beneficiary can withdraw./
function backupReleaseGracePeriod() public view returns (uint256) { return _backupReleaseGracePeriod; }
8,357,459
pragma solidity ^0.4.22; import "./IDaoBase.sol"; import "./DaoStorage.sol"; import "./DaoBaseLib.sol"; /** * @title DaoBase * @dev Main Thetta DAO Framework contract. * Usage scenarios: * 1) Preferred: become its client (derive your contract from DaoClient contract!) * 2) Optional: derive a contract directly...
_groupName name of the group in storage return array of addresses which in group name with name _groupName/
function getGroupMembers(string _groupName) public view returns(address[]) { return daoStorage.getGroupMembers(stringHash(_groupName)); }
12,852,784
./full_match/4/0xB26Fac8092a2FA52b3Db3CA415051637C3A15FA4/sources/contracts/EOC_Beta.sol
Mints a token to an address with a tokenURI for allowlist. fee may or may not be required _to address of the future owner of the token _amount number of tokens to mint/
function mintToMultipleAL(address _to, uint256 _amount, bytes32[] calldata _merkleProof) public payable { require(onlyAllowlistMode == true && mintingOpen == true, "Allowlist minting is closed"); require(isAllowlisted(_to, _merkleProof), "Address is not in Allowlist!"); require(_amount >= 1,...
811,740
pragma solidity 0.4.25; /** * @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...
helper method to get token details, name, symbol and totalSupply in one go/
function getTokenDetail() public view returns (string, string, uint256) { return (name, symbol, totalSupply); }
353,298
./full_match/6119/0x86FF54A7C36f668Ee60Cd356E09ca7F94f28B49B/sources/subnet/contracts/MultiAllowList.sol
Set [addresses] to be enabled on the precompile contract.
function setEnabled(address precompileContract, address[] calldata addresses) external onlyOwner { validate(addresses); uint index = 0; for (index = 0; index < addresses.length; index++) { IAllowList(precompileContract).setEnabled(addresses[index]); } }
16,295,916
// Copyright (C) 2020 Zerion Inc. <https://zerion.io> // // 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...
inject NONSTANDARD NAMING
function GETBALANCE609(address token, address account) external view override returns (uint256) {
12,865,794
./partial_match/1/0xa202D5B0892f2981bA86C981884cebA49B8AE096/sources/DigitalaxGenesisStaking.sol
Single gateway to intialize the staking contract after deploying Sets the contract with the MONA genesis NFT and MONA reward token/
function initGenesisStaking( address payable _fundsMultisig, IERC20 _rewardsToken, IDigitalaxGenesisNFT _genesisNFT, DigitalaxAccessControls _accessControls ) public { require(!initialised, "Already initialised"); fundsMultisig = _fundsMultisig; ...
2,671,383
//Address: 0x8c7d36631768c83feae33ec42a843cc2a2fa1897 //Contract name: GoldRaffle //Balance: 0.705 Ether //Verification Date: 2/6/2018 //Transacion Count: 30 // CODE STARTS HERE pragma solidity ^0.4.18; contract OraclizeAddrResolverI { function getAddress() public returns (address _addr); } library OraclizeLib...
Gets the cascade total for the given percentage percentage the percentage of the total pot as a uint totalJackpot the total jackpot amount return the total amount the percentage represents
function getCascadeTotal(uint percentage, uint totalJackpot) internal pure returns(uint) { return totalJackpot.mul(percentage).div(100); }
12,742,275
pragma solidity ^0.4.25; import "./BrightCoinTokenOwner_ICO.sol"; import "./BrightCoinERC20Contract_ICO.sol"; //Rules for Accredited Investors /* This is special BrightCoinToken that will allow User to invest to Token Only after Proper Checks and Validation as provide by US Regulatories Authorities */ /* import ...
If regulated transfer is true then only reduce allowed map
function transferFrom(address _from, address _to, uint256 _tokens) public returns (bool success) { require(_tokens > 0); require(allowed[_from][msg.sender] >= _tokens); require(internaltransfer(_from ,_to,_tokens) == true); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(...
13,741,409
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./IChokchanaTicket.sol"; contract ChokchanaLottery is Ownable { using SafeMa...
Draw reward set up for next round
function summarizedRewards() public { distributeReward(); curRound = curRound.add(1); ticket.nextRound(); curReward = 0; }
12,656,478
./partial_match/5/0x3db345e1bE53DBb10Faa7E059b29042a2F8D6506/sources/CYCLEToken.sol
solium-disable-next-line /
interface ICycleToken is IERC20 { function mint(uint256 amount) external; function burn(uint256 amount) external; function isBlacklisted(address account) view external returns (bool); function setAuction(address account) external; function setCYCLEWETHAddress(address CYCLEWETH) external; pragma sol...
16,890,639
./full_match/1/0x1a0120eAB44157ba10D767e0F4A38a0A6452BCf9/sources/contracts/Fraud.sol
Mints new tokens, increasing totalSupply, initSupply, and a users balance./
function mint(address to, uint256 amount) external returns (bool) { require(hasRole(MINTER_ROLE, _msgSender()), "Must have minter role"); _mint(to, amount); return true; }
3,080,464
/** *Submitted for verification at Etherscan.io on 2019-09-24 */ pragma solidity >=0.4.21 <0.6.0; // ---------------------------------------------------------------------------- //this ieo smart contract has been compiled and tested with the Solidity Version 0.5.2 //There are some minor changes comparing to ieo contr...
transfer tokens from the owner account to the account that calls the function
function transferFrom(address from, address to, uint tokens) public returns(bool){ require(allowed[from][to] >= tokens); require(balances[from] >= tokens); balances[from] -= tokens; balances[to] += tokens; allowed[from][to] -= tokens; ...
6,475,030
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Gets the `VALUE_INTERPRETER` variable value return valueInterpreter_ The `VALUE_INTERPRETER` variable value
function getValueInterpreter() external view returns (address valueInterpreter_) { return VALUE_INTERPRETER; }
10,290,166
// Dependency file: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) // pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * ...
grant minter role to account _account user address only admin can do it
function grantMinterRoleTo(address _account) external onlyRole(DEFAULT_ADMIN_ROLE) { grantRole(MINTER_ROLE, _account); }
11,876,828
./full_match/1/0x23E8233CdcC3556F65B2e13d935fa1A5eAbAA9e6/sources/contracts/MunchiesNFT.sol
nextToken for Randomly Assigning NFT Get the next token ID Randomly gets a new token ID and keeps track of the ones that are still available. return the next token ID If this matrix position is empty, set the value to the generated random number. Otherwise, use the previously stored number from the matrix. If the last...
function nextToken() internal ensureAvailability returns (uint256) { uint256 maxIndex = maxSupply - totalSupply(); uint256 random = uint256(keccak256( abi.encodePacked( msg.sender, block.coinbase, block.difficulty, ...
5,009,963
/** *Submitted for verification at Etherscan.io on 2022-02-03 */ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 minDebtPerHarv...
migrate our want token to a new strategy if needed, make sure to check claimRewards first also send over any CRV or CVX that is claimed; for migrations we definitely want to claim
function prepareMigration(address _newStrategy) internal override { uint256 _stakedBal = stakedBalance(); if (_stakedBal > 0) { IConvexRewards(rewardsContract).withdrawAndUnwrap( _stakedBal, claimRewards ); } crv.safeTransfer(_n...
7,998,395
pragma solidity ^0.5.3; /** * Copyright Β© 2017-2019 Ramp Network sp. z o.o. All rights reserved (MIT License). * * 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 restrictio...
Ensure the described asset is sent to the given address. Should revert if the transfer failed, but callers must also handle `false` being returned, much like ERC20's `transfer`./ Ensure the described asset is sent to the contract (check `msg.value` for ether, do a `transferFrom` for tokens, etc). Should revert if the t...
function sendAssetTo(bytes memory assetData, address payable _to) internal returns (bool success); function lockAssetFrom(bytes memory assetData, address _from) internal returns (bool success); function getAssetTypedHash(bytes memory data) internal view returns (bytes32); modifier checkAssetType(byte...
12,958,461
./partial_match/1/0xEdE1b094e460E444f6DfF1f440D741F7d029F917/sources/LiquidityVault.sol
Moves liquidity to new location, assuming the 14 days lockup has passed -preventing abuse. /
function processMigration() external { require(msg.sender == blobby); require(migrationRecipient != address(0)); require(now > migrationLock); uint256 liquidityBalance = liquidityToken.balanceOf(address(this)); liquidityToken.transfer(migrationRecipient, liquidityBal...
16,180,942
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import './interfaces/IForceMove.sol'; import './interfaces/IForceMoveApp.sol'; /** * @dev An implementation of ForceMove protocol, which allows state channels to be adjudicated and finalized. */ contract ForceMove is IForceMove...
Checks that a given ChannelData struct matches the challenge stored on chain, and that the channel is in Challenge mode. Checks that a given ChannelData struct matches the challenge stored on chain, and that the channel is in Challenge mode. data A given ChannelData data structure. channelId Unique identifier for a ...
function _requireSpecificChallenge(ChannelData memory data, bytes32 channelId) internal view { _requireMatchingStorage(data, channelId); _requireOngoingChallenge(channelId); }
993,168
/** * @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; } function div(uint2...
Release time-locked tokens for any vested address/
function releaseLock(address participant) public { require(vestedTokens[participant] != 0x0); TokenTimelock timelock = TokenTimelock(vestedTokens[participant]); timelock.release(); }
931,514
pragma solidity ^0.6.6; ...
inject NONSTANDARD NAMING
function _FUNCTIONCALLWITHVALUE2(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
12,732,298
./full_match/1/0xf83c53c080E48e78A6B114eAB682d528562d33B5/sources/contracts/v2/Editions/Fairxyz1155Editions.sol
See {FairxyzEditionsUpgradeable-_emitMetadataUpdateEvent}./
function _emitMetadataUpdateEvent( uint256 editionId, string memory editionURI ) internal override { emit URI(editionURI, editionId); }
3,850,652
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "hardhat/console.sol"; /* TODO: 1. Create a pool that people can put money in -> Complete 2. Transfer money in and out of pool -> Complete 3. Randomize distribution of funds -> WIP -- need to wait for Chainlink 4. Unlock pool afte...
Get the amount owed to the user after the pool distribution
function getOwedAmount() external view returns (uint256) { return owedAmount[msg.sender]; }
2,553,508
// SPDX-License-Identifier: MIT // File: contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by oth...
The last person to purchase might pay too much. This way however they can't get sniped. If this happens, we'll refund the Eth for the unavailable tokens./ Since they can get here while exceeding the TwentyFiveFF_MAX, we have to make sure to not mint any additional tokens./
function purchase(uint256 numberOfTokens) external payable override { require(isActive, 'Contract is not active'); require(!isAllowListActive, 'Only allowing from Allow List'); require(totalSupply() < TwentyFiveFF_MAX, 'All tokens have been minted'); require(numberOfTokens <= PURCHASE_LIMIT, 'Would ex...
228,794
./full_match/80001/0x0aCca12ade732F5Dc6afbad42ad1Eb5F0163e663/sources/contracts/dev/functions/FunctionsOracle.sol
@inheritdoc FunctionsOracleInterface/
function getRegistry() external view override returns (address) { return address(s_registry); }
5,561,738
./full_match/1/0xefaCa6Fc316B3B2Aa6c55FF5E02a62A85d4391e8/sources/contracts/modules/core/RewardsManagerModule.sol
@inheritdoc IRewardsManagerModule/
function claimRewards( uint128 accountId, uint128 poolId, address collateralType, address distributor ) external override returns (uint256) { FeatureFlag.ensureAccessToFeature(_CLAIM_FEATURE_FLAG); Account.loadAccountAndValidatePermission(accountId, AccountRBAC._R...
16,516,957
./full_match/40/0x6D1F230f479f14e717204f2053E8e7c0397B0937/sources/contracts/Omnidex-incentives/incentives/TempIncentivesVault.sol
Internal functions/ Returns if amount is within daily limit and resets spentToday after one day. amount Amount to withdraw. return Returns if amount is under daily limit.
function isUnderLimit(uint amount) internal returns (bool) { if (block.timestamp > lastDay + 24 hours) { lastDay = block.timestamp; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false...
9,548,286
./full_match/80001/0x93606Db8e1340eBa115633Cc8a031D379D7638C6/sources/contracts/dev/vendor/openzeppelin-solidity/v.4.8.0/contracts/utils/SafeCast.sol
Returns the downcasted int152 from int256, reverting on overflow (when the input is less than smallest int152 or greater than largest int152). Counterpart to Solidity's `int152` operator. Requirements: - input must fit into 152 bits _Available since v4.7._/
function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); require(downcasted == value, "SafeCast: value doesn't fit in 152 bits"); }
5,640,083
./full_match/1/0x95AaDD5092F5b3a4Bbbefdf4187962b811bF9e79/sources/contracts/Briber/Briber.sol
fixed plans can only have insufficient tokens if: 1. an unsafe plan was added and/or 2. an unsafe withdrawal was requested
function _getBribeAmount( Plan storage plan ) internal view returns (uint256) { if (plan.isFixed) return plan.amount <= plan.token.balanceOf(address(this)) ? plan.amount : 0; uint256 available = _getAvailable(plan.token...
9,763,256
//Address: 0x31eb0d694eb2071e45e818d7c1beb627b938c25f //Contract name: GooCrowdsale //Balance: 0 Ether //Verification Date: 4/8/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.19; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/is...
InitialDistribution
function GooToken(uint256 _vestingTime) public { vestingTime = _vestingTime; totalSupply_ = INITIAL_SUPPLY; }
12,810,300
./full_match/8453/0xB4Ca85D61f7fcCe0d176Fdb743860daBF3FC03f9/sources/src/token/metadata/MetadataRenderer.sol
Ensures the caller is authorized to upgrade the contract to a valid implementation This function is called in UUPS `upgradeTo` & `upgradeToAndCall` _impl The address of the new implementation
function _authorizeUpgrade(address _impl) internal view override onlyOwner { if (!manager.isRegisteredUpgrade(_getImplementation(), _impl)) revert INVALID_UPGRADE(_impl); }
11,555,962
./full_match/56/0x5B99e0893225178dBf4Ffe9FfD2142a21E8d1087/sources/src/strategies/BaseStrategy.sol
need check nonReentrant to avoid cyclic call
function shutdown() external nonReentrant onlyOwner {
3,226,506
pragma solidity ^0.4.23; /** * @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); funct...
Buy token with Wei. The Wei will be deposited until crowdsale is finalized. If crowdsale is success, raised Wei will be transfered to the token. If crowdsale is fail, buyer can refund the Wei. Note The minimum investment is 1 ETH. Note the big finger issue is expected to be handled by frontends. _token Deployed ERC20 ...
function buyToken( address _token ) inState(_token, States.Active) nonZeroAddress(_token) external payable { require( msg.value >= crowdsales[_token].minInvest, "Failed to buy token due to less than minimum investment." ); ...
14,072,543
./full_match/4/0x3556F3eAe60bA3849aa251B072A60A3bA1e63A26/sources/browser/_TestDemo.sol
uint256[] memory _luckAttrs = [0];
function _create( string memory _name, string memory _placeOfOrigin, uint256 _kind, uint256 _varieties, uint256 _teaTime, uint256 _teaTreeTime, string memory _image, uint256 _basePrice ) internal returns (uint256) { TeaCake memor...
13,318,064
./full_match/137/0x85afa00f38aD5F353C2B80985407b8E8A27eA38f/sources/src/zkbob/ZkBobPool.sol
Updates pool usage limits. Callable only by the contract owner / proxy admin. _tier pool limits tier (0-254). _tvlCap new upper cap on the entire pool tvl, 18 decimals. _dailyDepositCap new daily limit on the sum of all deposits, 18 decimals. _dailyWithdrawalCap new daily limit on the sum of all withdrawals, 18 dec...
function setLimits( uint8 _tier, uint256 _tvlCap, uint256 _dailyDepositCap, uint256 _dailyWithdrawalCap, uint256 _dailyUserDepositCap, uint256 _depositCap ) external onlyOwner { _setLimits( _tier, _tvlCap / TOKEN...
3,739,149
pragma solidity ^0.4.18; // <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...
only owner address can set owner address /
function ownerChangeOwner(address newOwner) public onlyOwner { owner = newOwner; }
6,861,582
pragma solidity 0.4.24; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "openzeppelin-solidity/contracts/lifecycle/Destructible.sol"; import "./Activatable.sol"; /** * @title Room * @dev The Room contract can be deposited in escrow. * The room owner can send the reward to selected questions...
Deposit Eth for the prize to the Room contract./
function deposit() external payable whenNotPaused { require(msg.value > 0, "Deposited value must be larger than 0"); emit Deposited(msg.sender, msg.value); }
2,559,766
./partial_match/1/0x67f354aBf33783b4bf09154aA92F7a96774fC005/sources/contracts/loans/direct/loanTypes/DirectLoanBase.sol
that nonce. _expiry - The date when the renegotiation offer expires _lenderSignature - The ECDSA signature of the lender, obtained off-chain ahead of time, signing the following combination of parameters: - _loanId - _newLoanDuration - _newMaximumRepaymentAmount - _lender - _expiry - address of this contract - chainI...
function _renegotiateLoan( uint256 _loanId, uint32 _newLoanDuration, uint256 _newMaximumRepaymentAmount, uint256 _renegotiationFee, uint256 _lenderNonce, uint256 _expiry, bytes memory _lenderSignature ) internal { LoanTerms storage loan = loanIdToL...
2,844,834
./full_match/1/0x8CC23A8CFE803f8E9Ee978bD7F9D343eeA0Cf82F/sources/src/LockRewards.sol
Owner is the deployer _lockToken: token address which users can deposit to receive rewards _rewards: token address used to pay users rewards (Governance token) _defaultEpochDurationInDays: epoch duration in days _lockDuration: deposit duration in epochs/
function initialize( address _lockToken, address[] memory _rewards, uint256 _defaultEpochDurationInDays, uint256 _lockDuration, address _admin, address _epochSetter, address _pauseSetter ) public initializer { __ReentrancyGuard_init(); __Pa...
9,625,173
//β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— //β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ //β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ //β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ //β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ //β•šβ•β• β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•...
Internal - Accrues rewards token to the user claimable balance, depending on the Pool SupplyRewards state palPool address of the PalPool the user interracted with user address of the user to accrue rewards to/ Get the Pool current SupplyRewards state Get the current reward index for the Pool And the user last reward ...
function accrueSupplyRewards(address palPool, address user) internal { PoolRewardsState storage state = supplyRewardState[palPool]; uint currentSupplyIndex = state.index; uint userSupplyIndex = supplierRewardIndex[palPool][user]; supplierRewardIndex[palPool][user] = currentSupplyIn...
13,912,988
pragma solidity ^0.4.0; import "./Token.sol"; import "./NettingChannelContract.sol"; library ChannelManagerLibrary { struct Data { mapping(bytes32 => address) channel_addresses; Token token; } /// @notice Get the address of the unique channel of two parties. /// @param caller_address ...
Remove a channel after it's been settled caller_address address of the caller partner of the partner remove channel from channel_addresses.
function deleteChannel( Data storage self, address caller_address, address partner) internal { self.channel_addresses[partyHash(caller_address, partner)] = 0x0; }
1,845,121
./full_match/97/0x70Cf08CBeE91B9ca1760Eb170201f8781a344Fe1/sources/src/land/SinCityLand.sol
Get Token ID by Coordinates x - x coordinate of property y - y coordinate of property/
function getIdFromCoordinates(uint256 x, uint256 y) external view returns (uint256) { uint256 coords = formatCoordinates(x, y); uint256 tokenId = _coordsToId[coords]; require(_exists(tokenId), "NFT does not exist"); return tokenId; }
5,034,112
./full_match/288/0x6E7D74FA7d5c90FEF9F0512987605a6d546181Bb/sources/project:/contracts/pyth/Pyth.sol
This method is deprecated, please use the `getUpdateFee(bytes[])` instead. In the accumulator update data a single update can contain up to 255 messages and we charge a singleUpdateFee per each message
function getUpdateFee( uint updateDataSize ) public view returns (uint feeAmount) { return 255 * singleUpdateFeeInWei() * updateDataSize; }
7,103,702
./full_match/1/0xEAFB3Ee25B5a9a1b35F193A4662E3bDba7A95BEb/sources/contracts/Strategy.sol
highestInterestIndex finds the best pair to invest the given deposit A pair is highest (really best) if either - It's utilization is higher, and either - It is above the max target util - The existing choice is below the min util target - Compare APR directly only if both are between the min and max
function highestInterestPair(uint256 sharesToDeposit) internal view returns (IKashiPair _highestPair, uint256 _highestPid) { uint256 highestInterest = 0; uint256 highestUtilization = 0; for (uint256 i = 0; i < kashiPairs.length; i++) { KashiPairInfo m...
3,173,597
./full_match/80001/0x9a18822EA5a607Ba999Fb1064AFD11e7C72AD451/sources/project_/contracts/src/s-token/STokensManager.sol
See {IERC721Enumerable-tokenByIndex}./ solhint-disable-next-line reason-string
function tokenByIndex( uint256 index ) public view virtual override returns (uint256) { require( index < tokenIdCounter.current(), "ERC721Enumerable: global index out of bounds" ); return index + 1; }
846,843
./partial_match/1/0x0E508D9E2A1D3B23a4d4791d7604F042D0705Ed9/sources/NoTax.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("NoTax", "NT") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV...
3,548,184
./partial_match/42/0xd332E12c5404C57A42817E5Ff13C23844196D85d/sources/BUSDImplementation.sol
This is not a function used in actual production Only for getting free token to test
function allocateTo(address _usr, uint _value) public { totalSupply_ = totalSupply_.add(_value); balances[_usr] = balances[_usr].add(_value); emit SupplyIncreased(_usr, _value); emit Transfer(address(0), _usr, _value); }
8,952,022
./full_match/80001/0xa017e81dA5986485A1cc564A5fBfb2B36A84B28b/sources/project:/contracts/MobiusBand.sol
ζ€»η›ˆεˆ©ζ²‘εˆ°50%,保本+δ»£εΈζ€»η›ˆεˆ©θΆ…θΏ‡50%,δΊζŸιƒ¨εˆ†θ‘₯充代币
function getLedgerRoundToUserRoundIndex( uint256 ledgerType, uint256 epoch, address user } } } function _safeClosePosition( uint256 ledgerType, uint256 epoch, uint256 positionIndex, PositionInfo storage positionInfo, RoundInfo storag...
841,711
// SPDX-License-Identifier: Unlicense pragma solidity >=0.7.0 <0.9.0; import "./Ownable.sol"; /// @title Connection /// @author Youssef Chiguer /// @notice This is an ownable contract for connections to the Commun Room /// Connections can be sold and traded and they are fungible contract Connection is Ownable { ...
Getter for the credit return value of the credit
function credit() public view returns (uint256) { return _credit; }
5,399,026
// SPDX-License-Identifier: None pragma solidity 0.6.12; import "../BoilerplateStrategy.sol"; import "./CompoundInteractor.sol"; import "../../interfaces/compound/ComptrollerInterface.sol"; import "../../interfaces/compound/CTokenInterfaces.sol"; import "../../interfaces/uniswap/IUniswapV2Router02.sol"; contract Com...
Returns the current balance. Ignores COMP/CREAM that was not liquidated and invested./The current exchange rate as an unsigned integer, scaled by 1e18.
function balanceOf() external override view returns (uint256) { uint256 currentCbal = IERC20(ctoken).balanceOf(address(this)); uint256 suppliedInUnderlying = currentCbal.mul(CTokenInterface(ctoken).exchangeRateStored()).div(1e18); return IERC20(underlying).balanceOf(address(this)).add(suppl...
10,389,049
./full_match/2222/0xE88b19885935B4Be8dCF38e2C96b8c73CfC9b6e2/sources/contracts/base/Dispatcher.sol
Executes encoded commands along with provided inputs. commands A set of concatenated commands, each 1 byte in length inputs An array of byte strings containing abi encoded inputs for each command Performs a call to purchase an ERC721, then transfers the ERC721 to a specified recipient inputs The inputs for the prot...
function execute(bytes calldata commands, bytes[] calldata inputs) external payable virtual; function callAndTransfer721(bytes calldata inputs, address protocol) internal returns (bool success, bytes memory output) { uint256 value; address recipient; address token; ...
7,102,178
pragma solidity ^0.4.25; /** Hi this is an hyip contract Golden Ratio Percent it is based on 200percent project code Official site -> call meth.site_url() How to use: 1. Send from ETH wallet to the smart contract address any amount ETH. 2. Claim your profit by sending 0 ether t...
1.618 - max profite
function _reward() private isUser isTime { if ((balance[msg.sender].mul(1618).div(1000)) <= allPercentWithdraw[msg.sender]) { balance[msg.sender] = 0; time[msg.sender] = 0; percentWithdraw[msg.sender] = 0; uint256 pay = payout(); if(allPercentWith...
5,462,002
pragma experimental ABIEncoderV2; pragma solidity ^0.5.0; import { DomainObjs } from './DomainObjs.sol'; import { IncrementalMerkleTree } from "./IncrementalMerkleTree.sol"; import { SignUpGatekeeper } from "./gatekeepers/SignUpGatekeeper.sol"; import { BatchUpdateStateTreeVerifier } from "./BatchUpdateStateTreeVerifi...
Update the postSignupStateRoot if the batch update state root proof is valid. _newStateRoot The new state root after all messages are processed _stateTreeRoots The intermediate state roots _ecdhPubKeys The public key used to generated the ECDH shared key to decrypt the message _proof The zk-SNAR...
function batchProcessMessage( uint256 _newStateRoot, uint256[] memory _stateTreeRoots, PubKey[] memory _ecdhPubKeys, uint256[8] memory _proof ) isAfterVotingDeadline public { require( _stateTreeRoots.length == messageBatchSize, "M...
15,808,898
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.6.12; import "./lib/InstantWithdrawManager.sol"; import "./interfaces/VerifierRollupInterface.sol"; import "./interfaces/VerifierWithdrawInterface.sol"; import "../interfaces/IHermezAuctionProtocol.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; c...
Withdraw to retrieve the tokens from the exit tree to the owner account Before this call an exit transaction must be done tokenID Token identifier amount Amount to retrieve babyPubKey Public key babyjubjub represented as point: sign + (Ay) numExitRoot Batch number where the exit transaction has been done siblings ...
function withdrawMerkleProof( uint32 tokenID, uint192 amount, uint256 babyPubKey, uint32 numExitRoot, uint256[] memory siblings, uint48 idx, bool instantWithdraw ) external { if (instantWithdraw) { require( _processInsta...
14,721,940
pragma solidity ^0.5.8; //Practice safe math import "./SafeMath.sol"; import "./SafeMath8.sol"; //TODO - Implement Proxy contract once all functionality is implemented contract LeaveTool { using SafeMath8 for uint8; using SafeMath for uint256; address public owner; uint8 private power; uint private employeeCoun...
Do some validation so it's not public
function getEmployeeAddress(uint _id) public view returns (address) { return employees[_id].accountAddress; }
12,680,324
./partial_match/42/0xE76eF865B41de41FD7F5125e1e62D5c69Cf4e9A4/sources/AssetsSnapshot.sol
Allow to modify parameters,Only 5 super accounts can vote for approval
function allowModifyParameters() public returns(bool success) { require(addrInOwners(msg.sender)); for(uint8 i=0;i<5;i++){ if(msg.sender == owners[i].owner){ owners[i].voteState = 1; } } success = true; }
3,411,941
./full_match/1/0x5B6cFfc4B7911f8fEF0f5A4aB8639Ea203a1b634/sources/contracts/BrewlabsFarm.sol
Add a new lp to the pool. Can only be called by the owner.
function add(uint256 _allocPoint, IERC20 _lpToken, uint16 _depositFee, uint16 _withdrawFee, uint256 _duration, bool _withUpdate) external onlyOwner nonDuplicated(_lpToken) { require(_depositFee <= 10000, "add: invalid deposit fee basis points"); require(_withdrawFee <= 10000, "add: invalid withdraw ...
16,491,374