file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: MIT /** * @authors: [@unknownunknown1] * @reviewers: [] * @auditors: [] * @bounties: [] * @deployments: [] */ pragma solidity ^0.8; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./IArbitrator.sol"; import "./IDisputeKit.sol"; import {SortitionSumTreeFactory} ...
Executes the next delayed stakes. _iterations The number of delayed stakes to execute./
function executeDelayedStakes(uint256 _iterations) external { require(phase == Phase.staking, "Should be in Staking phase."); uint256 actualIterations = (delayedStakeReadIndex + _iterations) - 1 > delayedStakeWriteIndex ? (delayedStakeWriteIndex - delayedStakeReadIndex) + 1 ...
12,944,274
pragma solidity 0.5.7; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; // mock class using BasicToken contract InvalidReturnTokenMock { using SafeMath for uint; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 public decimals; st...
Function to check the amount of tokens that an owner allowed to a spender. _owner address The address which owns the funds. _spender address The address which will spend the funds. return A uint256 specifying the amount of tokens still available for the spender./
function allowance( address _owner, address _spender ) external view returns (uint256) { return allowed[_owner][_spender]; }
14,029,609
./full_match/137/0x125466A4bE990a52403A8C2E6c890f7fC9898C94/sources/contracts/upgradeable_contracts/modules/fee_manager/OmnibridgeFeeManager.sol
Tells if a given address is part of the reward address list. _addr address to check if it is part of the list. return true if the given address is in the list/
function isRewardAddress(address _addr) public view returns (bool) { for (uint256 i = 0; i < rewardAddresses.length; i++) { if (rewardAddresses[i] == _addr) { return true; } } return false; }
3,736,837
// SPDX-License-Identifier: MIT // Latest stable version of solidity pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "../FarmV2.sol"; import "../MoneyHandler.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openz...
Get amount per person
function getAmountPer(uint256 totalAmount, uint256 sharePerc) private pure returns (uint256) { uint256 sharesmul_ = SafeMath.mul(totalAmount, sharePerc); uint256 shares_ = SafeMath.div(sharesmul_, 10**18); return shares_; }
893,584
./full_match/1/0x21C78Ae6018eCDfecD295ee3793aeD020428a3D0/sources/contracts/Minter.sol
require whitelisted for genesis token validate whitelisted
function mint( address to, bytes32[] calldata merkleProof, uint256 tokenId, uint256 amount ) public { uint256 maxSully = tokenMaxSupply[tokenId]; require(maxSully != 0, 'Invalid token id'); require(mintedAddess[to] != true, 'Max per wallet reached'); require(amount <= MAX_PER_BATCH, ...
4,847,163
// File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Helper function to create stakes for a given address _address address The address the stake is being created for _amount uint256 The number of tokens being staked _lockInDuration uint256 The duration to lock the tokens for _data bytes optional data to include in the Stake event/
function createStake( address _address, uint256 _amount, uint256 _lockInDuration, bytes memory _data) internal canStake(_msgSender(), _amount) { if (!stakeHolders[_msgSender()].exists) { stakeHolders[_msgSender()].exists = true; } stakeHolders[_address].totalStakedFor = st...
2,361,574
./full_match/100/0xF5079415ABd644dA07BaBa5C65f564Af99A49d97/sources/browser/SashimiToken.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( getChainId(), address(this) ...
14,274,767
pragma solidity ^0.5.13; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "./UsingRegistry.sol"; /** * @title Holds a whitelist of addresses for which transfers should not be * frozen so that network initialization can take place. */...
Gets the number of registered contracts return The length of whitelistedContractIdentifiers/
function getNumberOfWhitelistedContractIdentifiers() external view returns (uint256 length) { return whitelistedContractIdentifiers.length; }
14,048,667
pragma solidity ^0.4.24; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABL...
returns(uint8)return 0;
function registerAirline ( address airlineaddress ) external requireIsOpe...
6,367,258
./partial_match/1/0xF6CA4bdE4f6dF4d733090476e5052F26da37D8fF/sources/IAO.sol
Kyber Network interface
interface KyberNetworkProxyInterface { function maxGasPrice() public view returns(uint); function getUserCapInWei(address user) public view returns(uint); function getUserCapInTokenWei(address user, DetailedERC20 token) public view returns(uint); function enabled() public view returns(bool); functio...
4,033,635
pragma solidity >=0.4.22 <0.6.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./Utils.sol"; /// @title Broken BTC Relay contract. FIX ME!!! /// @notice For simplicity, this example assumes: /// (i) constant difficulty /// (ii) no forks occur contract BrokenRelay { using SafeMath for uint256...
Verifies that a transaction is included in a block at a given blockheight txid transaction identifier txBlockHeight block height at which transacton is supposedly included txIndex index of transaction in the block's tx merkle tree merkleProof merkle tree path (concatenated LE sha256 hashes) return True if txid is ...
function verifyTx( bytes32 txid, uint256 txBlockHeight, uint256 txIndex, bytes32[] memory merkleProof, uint256 confirmations) public returns(bool) { bytes32 blockHeaderHash = _mainChain[txBlockHeight]; bytes32 merkleRoot = _headers[b...
7,224,693
//SPDX-License-Identifier: MIT pragma solidity =0.7.6; pragma abicoder v2; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {Address} from "@openzeppe...
remove eth collateral from the vault this function will update the vault memory in-place _vault the Vault memory to update _account where to send collateral to _vaultId id of the vault _amount amount of eth to withdraw/
function _withdrawCollateral( VaultLib.Vault memory _vault, address _account, uint256 _vaultId, uint256 _amount ) internal { _checkCanModifyVault(_vaultId, _account); _vault.removeEthCollateral(_amount); emit WithdrawCollateral(msg.sender, _vaultId, _amo...
13,123,592
pragma solidity 0.8.10; /*** *@title Gauge Controller *@author InsureDAO * SPDX-License-Identifier: MIT *@notice Controls liquidity gauges and the issuance of INSURE token through the gauges */ //dao-contracts import "./interfaces/dao/IInsureToken.sol"; import "./interfaces/dao/IVotingEscrow.sol"; import "./inte...
Fill historic total weights week-over-week for missed checkins and return the total for the future weekreturn Total weight/ If we have already checkpointed - still need to change the value Scales as n_types n_unchecked_weeks (hopefully 1 at most)
function _get_total() internal returns (uint256) { uint256 _t = time_total; uint256 _n_gauge_types = n_gauge_types; if (_t > block.timestamp) { _t -= WEEK; } uint256 _pt = points_total[_t]; for (uint256 _gauge_type = 1; _gauge_type < 100;) { i...
7,234,534
./full_match/97/0xC8f6Ed7C1d1865e5d82bB37b1B6B005447421BCF/sources/tttttttt/GeckoDividendTracker.sol
If not initial set, then it can only be updated every 24h, and only increasing by 25% if over 1 day
function updateVestingDuration(uint256 newVestingDuration) public onlyOwner { require(newVestingDuration <= 2592000, "GeckoDividendTracker: max vesting duration is 30 days"); if(vestingDurationUpdateTime > 0) { require(block.timestamp >= vestingDurationUpdateTime + 1 days, "too soon"); ...
5,024,364
./full_match/43114/0x88f8CCC064bA2D39cF08D57B6e7504a7B6bE8E4e/sources/contracts/handlers/traderjoe/JoeRouter02Handler.sol
Check whether can handle an order execution _inToken - Address of the input token _outToken - Address of the output token _amountIn - uint256 of the input token amount _minReturn - uint256 of the min return amount of output token _data - (module, relayer, fee, intermediatePath) return bool - Whether the execution ...
function canHandle( IERC20 _inToken, IERC20 _outToken, uint256 _amountIn, uint256 _minReturn, bytes calldata _data ) external view override returns (bool) { ( address inToken, address outToken, , address[] memory pat...
4,623,156
./partial_match/42/0x84D37f143C1849D15581e94C95D83d353e48613a/sources/Timelock.sol
timelock not enforced prior to updating the admin. This should occur on deployment.
function executeTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 eta ) public payable returns (bytes memory) { require( msg.sender == admin, "Timelock::executeTransaction: Call must come from a...
3,407,046
pragma solidity ^0.4.18; import "../base/Owned.sol"; import "../base/AddressChecker.sol"; contract MetaBOLInterface { function controller() public constant returns(address); function getMoveInfo(uint8) public constant returns(uint, uint, uint8, uint8, uint, uint, uint8, bool); function getIntermediariesC...
Can implement custom functionality on inheritance, if needed.
function _reserveCallback( address _shipment, uint256 _price, address _seller, address _buyer, address _escrow, address[] _intermediaries, uint256[] _payments ) onlyStatus(Status.NOT_SET) internal returns(bool) { return true; ...
13,076,652
./partial_match/1/0x59BC239cAb00CADd9b14f299835ae39E8B4B569c/sources/contracts/protocol/libraries/logic/GenericLogic.sol
Calculates the health factor from the corresponding balances totalCollateralInETH The total collateral in ETH totalDebtInETH The total debt in ETH liquidationThreshold The avg liquidation threshold return The health factor calculated from the balances provided/
function calculateHealthFactorFromBalances( uint256 totalCollateralInETH, uint256 totalDebtInETH, uint256 liquidationThreshold ) internal pure returns (uint256) { if (totalDebtInETH == 0) return uint256(-1); return (totalCollateralInETH.percentMul(liquidation...
15,931,843
pragma solidity >=0.4.21 <0.8.0; contract Adopcion { address[16] public adopters; //Adoptando una mascota function adopt(uint petId) public returns (uint) { require(petId >= 0 && petId <= 15, "La mascota no tiene un identificador valido"); adopters[petId] = msg.sender; return pet...
Retrieving the adopters
function getAdopters() public view returns (address[16] memory){ return adopters; }
12,561,247
pragma solidity ^0.5.0; /** * @title Remittance contract. * Consensys Dev Academy exercise - Small projects - Module 4 * */ contract Remittance { //states address payable public owner; uint public deadlineLIMITInSeconds; //remittance max period of time. after that, owner can claim funds ...
if it is after deadline, remittance owner can claim back its Etheronly owner of the remittance can call this functionit should exist and it should have funds and it should have been beyond deadline
function claimUnchallengedEther(bytes32 passwordHash) public returns(bool success) { require(RemittanceMapping[passwordHash].deadline < now); require(RemittanceMapping[passwordHash].remittanceBallance > 0); require(RemittanceMapping[passwordHash].remittanceOwner...
15,881,775
pragma solidity ^0.6.0; // import files from common directory interface TokenInterface { function allowance(address, address) external view returns (uint); function balanceOf(address) external view returns (uint); function approve(address, uint) external; function transfer(address, uint) external retur...
Deposit ETH/ERC20_Token. token token address to deposit.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) amt token amount to deposit./
function deposit(address token, uint amt) external payable { uint _amt = amt; AaveInterface aave = AaveInterface(getAaveProvider().getLendingPool()); uint ethAmt; if (isETH(token)) { _amt = _amt == uint(-1) ? address(this).balance : _amt; ethAmt = _amt; ...
7,647,142
pragma solidity ^0.4.24; import "../math/SafeMath.sol"; import "../token/ERC20MultiRecipient.sol"; import "./IChannelManager.sol"; /** * @title Channel manager contract with support for one-to-many payments. */ contract ChannelManager is IChannelManager { using SafeMath for uint256; // Structs benefit fro...
Settles the channel provided the caller has a valid signature from channel's node./
function settleChannel(address node, address[] recipients, uint256[] values, bytes nodesig) public returns (bool) { require(node != address(0)); require(recipients.length > 0); require(recipients.length == values.length); bytes32 key = _channelKey(msg.sender, node); require...
2,545,457
pragma solidity ^0.4.19; contract SafeMath { function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a && c >= b); return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } func...
only the admin is allowed to lock accounts. _owner the address of the account to be locked
function lockAccount(address _owner) public is_not_locked(_owner) validate_address(_owner) onlyAdmin { lockedAccounts[_owner] = true; }
12,774,183
/** *Submitted for verification at BscScan.com on 2021-05-27 */ // SPDX-License-Identifier: MIT // pragma experimental ABIEncoderV2; // pragma solidity 0.6.12; pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. Whil...
Return reward multiplier over the given _from to _to block. _from: block to start _to: block to finish/
function _getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) { if (_to <= bonusEndBlock) { return _to.sub(_from); return 0; return bonusEndBlock.sub(_from); } }
6,450,478
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, ...
if player is winner if player is not the winner
function registerNameXID(string _nameString, uint256 _affCode, bool _all) isHuman() public payable } function registerNameXaddr(string _nameString, address _affCode, bool _all) isHuman() public payable } function registerNameXname(string _nam...
11,990,474
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; // 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...
Change the closing time which gives you the possibility to either shorten or enlarge the presale period/
function setClosingTime(uint256 newClosingTime) external { require(msg.sender == _wallet, 'restricted to wallet'); require(newClosingTime > openingTime, 'close < open'); closingTime = newClosingTime; }
10,372,002
./full_match/1/0x5C1Dbcb680f19b66907effD9F291880a4776d592/sources/contracts/diamond/facets/ERC721AFacet.sol
============================================================= Getters =============================================================
function airdrop() public view returns (bool) { return s.airdrop; }
4,973,934
./full_match/4/0xbbd7E45Bbe47cA665CBFbf2dc8fa086Da26A4be3/sources/contracts/KHHN.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(!frozenAccount[sender], "ERC20: sender is frozenAc...
701,317
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** ____ _ __ / __ )(_) /_ / __ / / __/ / /_/ / / /_ /_____/_/\__/ __ __ _ ...
Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./
interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); pragma solidity ^0.8.0; ____ _ __ }
404,892
./full_match/5/0xACD8f27EAF5B160d460b60E4f45F9FFafb70516a/sources/project_/contracts/Implementation/SimpleAccountFactory.sol
calculate the counterfactual address of this account as it would be returned by createAccount()/
function getAddress(bytes32 salt) external view returns (address) { address simpleAccountAddress = Clones.predictDeterministicAddress( SimpleAccountAddress, salt ); return simpleAccountAddress; }
1,868,350
./full_match/11155111/0x922647b0a7Aa1E8a9052c87Cf66F6099055132f9/sources/contracts/Raffle.sol
@inheritdoc IRaffle/
function togglePaused() external onlyOwner { paused() ? _unpause() : _pause(); }
3,796,924
./full_match/8453/0x94E69ef94BE77b98BF22F54784F2151a5084A3AB/sources/contracts/CamelotRouter.sol
SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair permute values to force reserve0 == inputReserve
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to, address referrer) internal { for (uint i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = UniswapV2Library.sortTokens(input, output); ICamelotPair pair = ICam...
11,558,886
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import { LibDiamondCut } from "./diamond/LibDiamondCut.sol"; import { DiamondFacet } from "./diamond/DiamondFacet.sol"; import { OwnershipFacet } from "./diamond/OwnershipFacet.sol"; import { LibDiamondStorage } from "./diamond/...
DIFundToken DerivaDEX (Borrowed/inspired from Compound) This is the token contract for tokenized DerivaDEX insurance fund positions. It implements the ERC-20 standard, with additional functionality around snapshotting user and global balances. The contract makes use of some nonstandard types ...
interface IDIFundTokenFactory { function createNewDIFundToken( string calldata _name, string calldata _symbol, uint8 _decimals ) external returns (address); function diFundTokens(uint256 index) external returns (DIFundToken); function issuer() external view returns (address); ...
1,813,655
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol"; import "@openzeppelin/contracts/token/ERC777/IERC777Sender.sol"; import "@openzeppelin/contracts/token/ERC777/ERC777.sol"; import "@openzeppel...
this can be called by anyone. but should be called AFTER the ILO on xDai chain ETH would be xDai, on BSC it would be BNB step 6arequire(address(0) == i._fundingToken, "xStarterPair: FundingTokenError"); approve project token to be sent to dex. Spender is dex IUniswapRouter address (honeyswap, uniswap etc)bool approved_...
function _createLiquidityPairETH() internal returns(uint liquidityTokens_) { uint amountETH = _fundingTokenAvail; uint amountProjectToken = _tokensForLiquidity; _projectToken, amountProjectToken, amountProjectToken, ...
15,816,794
./full_match/80001/0x2d3B52Ab8233f29c7F189B6AAbD4AF8de3036cC4/sources/contracts/mixins/MixinKeys.sol
Checks if the user has at least one non-expired key. _keyOwner the/ check hook directly with address if user has no valid keys
function getHasValidKey( address _keyOwner ) public view returns (bool isValid) { if (balanceOf(_keyOwner) == 0) { if (address(onValidKeyHook) != address(0)) { return onValidKeyHook.isValidKey( address(this), msg.sender, _keyOwner, fals...
9,435,260
pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "./assign.sol"; contract demo is assign{ mapping(uint => uint) backrecord; /**************用户定义空间***************/ /**************创建评估单功能类***************/ /** * guobin * 创建评估单基本信息 */ function addvaluation( string...
仲裁定义空间/ guobin 返回当前仲裁者的所有评估单编号/
function backappnumber() view public returns (uint[]) { return _backappnumber(); }
895,600
/** *Submitted for verification at Etherscan.io on 2020-02-11 */ // File: @aragon/os/contracts/common/EtherTokenConstant.sol /* * SPDX-License-Identitifer: MIT */ pragma solidity ^0.4.24; // aragonOS and aragon-apps rely on address(0) to denote native ETH, in // contracts where both tokens and ETH are accept...
Burn non-existent `_role` in `_app`, so no modification can be made to it (grant, revoke, permission manager) _app Address of the app in which the permission is being burned _role Identifier for the group of actions being burned/
function createBurnedPermission(address _app, bytes32 _role) external auth(CREATE_PERMISSIONS_ROLE) noPermissionManager(_app, _role) { _setPermissionManager(BURN_ENTITY, _app, _role); }
451,321
pragma solidity >=0.5.0 <0.6.0; contract Proxiable { // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7" event Upgraded(address indexed implementation); function updateCodeAddress(address newAddress) internal { require( ...
Evaluates if the sender conditions are valid for relaying a escrow transaction from Sender gasPrice Gas Price functionSignature Function Signature dataValue Represents the escrowId or offerId depending on the function being called/
function _evaluateConditionsToRelay(address from, uint gasPrice, bytes4 functionSignature, uint dataValue) internal view returns (uint256) { address token; if(functionSignature == RATE_SIGNATURE && gasPrice < 20000000000){ return OK; } if(from.balance > 600000 * gasPrice) return ERROR_ENOUGH_B...
2,496,013
pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transaction...
Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Note that unlike {grantRole}, this function doesn't perform any checks on the calling account. Requirements: - this function can only be called from a constructor./
function _setupRole(bytes32 role, address account) internal virtual { require(!address(this).isContract(), "AccessControl: roles cannot be setup after construction"); _grantRole(role, account); }
6,026,188
pragma solidity ^0.5.0; import "./libraries/SafeMath.sol"; import "./TellorData.sol"; import "./Ownable.sol"; /** * @title TokenAndStaking * @dev This contracts contains the ERC20 token functions and staking functions for * Tellor Tributes */ contract TokenAndStaking is TellorData,Ownable{ using SafeMath for uin...
This function allows stakers to request to withdraw their stake (no longer stake)/
function requestWithdraw() external { StakeInfo storage stakes = staker[msg.sender]; require(stakes.current_state == 1); stakes.current_state = 2; stakes.startDate = now -(now % 86400); stakers -= 1; emit StakeWithdrawRequested(msg.sender); }
6,393,770
./partial_match/1/0x2Ccc01b6F6230FB6C59218ec4bEbAe273cE0E517/sources/contracts/libraries/DarwinSwapLibrary.sol
given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, "DarwinSwapLibrary: INSUFFICIENT_OUTPUT_AMOUNT"); require(reserveIn > 0 && reserveOut > 0, "DarwinSwapLibrary: INSUFFICIENT_LIQUIDITY"); uint numerator = reser...
3,619,822
./full_match/1/0x7FeEe1c7AF002bCfc12720539Bf8360A2f1724DF/sources/bozy.sol
Returns information about the value of the transaction.
function _msgValue() internal view virtual returns (uint256) { return msg.value; }
3,099,129
./partial_match/1/0x014C84740E60d4DBcBd48c2bf9E9404321b41390/sources/contracts/sealSquad.sol
change the whitelist price(amount need to be in wei)
function setWlCost(uint256 _newWlCost) public onlyOwner { wlcost = _newWlCost; }
4,404,171
pragma solidity ^0.5.2; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ import...
Register a future flight for insuring.
function registerFlight ( string calldata flightName, uint256 departure, uint256[] calldata ticketNumbers ) external requireIsOperational requireIsAirlineFunded(msg.sender) { bytes32 flightKey = getFlightKey(msg.sender, flightName, departure); ...
2,544,082
./partial_match/80001/0x636C4701Fdd1C46e47177cef7032b26402Bf7251/sources/minter1.sol
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } }
8,818,719
./full_match/80001/0x4eAA7acf7245d51AeDc78Ef2A9A97B5068602139/sources/contracts/BattleResolutionLibrary.sol
Player 1 attacks, player 2 defends
function handleAttackDefend( StructsLibrary.BattleData storage battle, StructsLibrary.CharacterProxy storage proxyA, StructsLibrary.CharacterProxy storage proxyB ) internal returns ( uint256[2] memory damageDealt, address[2] memory damagedPlayers ...
9,479,694
pragma solidity ^0.5.0; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function tran...
adminDoDestructContract/
function adminDoDestructContract() external onlyOwner { selfdestruct(msg.sender); }
7,212,900
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Mintable { /** * @dev Returns the amount of tokens in existence. */ function mint(address account, uint256 amount) external returns (bool); /** ...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20Mintable { function mint(address account, uint256 amount) external returns (bool); function burn(uint256 amount) external; pragma solidity >=0.4.22 <0.9.0; }
5,354,964
./partial_match/1/0x86Ae2Fbb51a87752E300077B4FDF18A4917279e6/sources/lib/mellow-vaults/contracts/vaults/ERC20RootVault.sol
------------------- EXTERNAL, MUTATING ------------------- @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external { _requireAtLeastStrategy(); for (uint256 i = 0; i < depositors.length; i++) { _depositorsAllowlist.add(depositors[i]); } }
16,146,044
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; contract Proxy { // IMPLEMENTATION_SLOT is an arbitrary random hex bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3; fallback() external payable { _fallback(); } ...
solhint-disable-next-line func-name-mixedcase
function __initialize__(address implementation) external { require(_implementation() == address(0), "Proxy: already initialized"); require(implementation != address(0), "Proxy: zero address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, implementation) ...
12,833,375
./full_match/137/0xE1bA63A04E612B370a394545979C6926c63C1585/sources/maticBridge/paybswapToken.sol
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_balances[sender] >= amount, "ERC20: transfer amo...
3,776,027
./full_match/80001/0x3dCBAF778A2642a1a827FE07ab905DdA8f6F63CB/sources/contracts/CryptoHomiesGenesis.sol
total eth to mint 0.101 Calculate the platform fee Calculate the total amount to be paid by the user Transfer the platform fee to the specified address Increment the number of tokens minted by the buyer's wallet Refund any excess amount sent by the user
function _mint(address _buyer) internal { uint16 _tokenId = tokenIdCount + 1; require( mintedPerWallet[_buyer] + 1 <= maxMintPerWallet, "Exceeded maximum mint per wallet" ); require(saleActive, "Sale not active"); require(_tokenId <= MAX_SUPPLY, "No mo...
5,571,353
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import './interfaces/IArchRouterImmutableState.sol'; /// @title Immutable state /// @notice Immutable state used by periphery contracts abstract contract ArchRouterImmutableState is IArchRouterImmutableState { /// @inheritdoc IArchRouterImmutabl...
Deterministically computes the pool address given the factory and PoolKey factory The Uniswap V3 factory contract address key The PoolKey return pool The contract address of the V3 pool
function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) { require(key.token0 < key.token1); pool = address( uint160( uint256( keccak256( abi.encodePacked( hex'ff', ...
11,683,175
./partial_match/42/0xcF2EfAf4921d28DC587D05004235c34961Bd4d82/sources/CFD.sol
keep the record in order to retain the last updated block number
function clearPosition(IExchange _exchange, address _trader) internal { exchangeMap[address(_exchange)].positionMap[_trader] = Position({ size: SignedDecimal.zero(), margin: Decimal.zero(), openNotional: Decimal.zero(), lastUpdatedCumulativePremiumFraction: Si...
8,844,628
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/callpaths/ColdPath.sol
Sets the treasury address to receive protocol fees. Once set, the treasury cannot receive fees until 7 days after. /
function setTreasury (bytes calldata cmd) private { (, address treasury) = abi.decode(cmd, (uint8, address)); require(treasury != address(0) && treasury.code.length != 0, "Treasury invalid"); treasury_ = treasury; treasuryStartTime_ = uint64(block.timestamp + 7 days); emit C...
4,651,034
./full_match/421613/0x18c15FeCa4b1B71D95c93322f7B4C38DD6875b9e/sources/project_/contracts/IntellScan.sol
ICreatorNFT.ModelInfo memory modelInfo = creatorNFT().modelInfo( _tokenId );
function singleCreatorNFTDetail(uint256 _tokenId) external view returns (MyCreatorNFTCollection memory) { if (factory().getShareNFTAddr(_tokenId) != address(0)) { address _shareNFTAddr = factory().getShareNFTAddr(_tokenId); IShareERC721InDetail _shareNFT ...
11,579,422
./full_match/5/0xA4c703308B5e2e0488DE704010287Cd42A2823d0/sources/contracts/DailyRaffle.sol
this is the method that will be called to create a raffle _maxEntriesPerUser maximum number of entries allowed per user _minimumFunds minimum funds required to start the raffle _prices array of prices for the raffle tickets _prizes array of prizes for the raffle given to winner
function createRaffle( uint256 _maxEntriesPerUser, uint256 _minimumFunds, uint256 _startDate, uint256 _endDate, PriceStructure[] calldata _prices, Prize[] calldata _prizes ) external onlyRole(OPERATOR_ROLE) returns (uint256) { require(_maxEntriesPerUser > ...
1,942,729
./partial_match/1/0xad108A81e22FAA725Ea3c58788D0ff8245204A7f/sources/VolumeRestrictionTM.sol
Use to get the bucket details for a given address _user Address of the token holder for whom the bucket details has queried return uint256 lastTradedDayTime return uint256 sumOfLastPeriod return uint256 days covered return uint256 24h lastTradedDayTime return uint256 Timestamp at which last transaction get executed/
function getDefaultBucketDetailsToUser(address _user) public view returns(uint256, uint256, uint256, uint256, uint256) { return _getBucketDetails(bucketData.defaultUserToBucket[_user]); }
4,389,438
./full_match/3/0x8e6FB067e612662613694489cC5A14a6f19Bd1a7/sources/browser/contracts/myCustome.sol
for (int i = 0; i < 10; i++) { coinHandler.deposit{value: 0.1 ether}(); }
function runDeposit() payable public { coinHandler.depositA(); }
8,254,449
./partial_match/3/0x7D876aC4E5E6eE05E55D0d4D619aC871cE4B8239/sources/UniswapV2Pair.sol
this low-level function should be called from a contract which performs important safety checks
function mint(address to) external lock returns (uint liquidity) { uint balance0 = IERC20Uniswap(token0).balanceOf(address(this)); uint balance1 = IERC20Uniswap(token1).balanceOf(address(this)); uint amount0 = balance0.sub(_reserve0); uint amount1 = balance1.sub(_reserve1); ...
5,178,540
/** *Submitted for verification at Etherscan.io on 2022-04-26 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS ...
Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but also transferring `value` wei to `target`. Requirements: - the calling contract must have an ETH balance of at least `value`. - the called Solidity function must be `payable`. _Available since v3.1._/
function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); }
10,913,243
// SPDX-License-Identifier: AGPL // File: contracts/interfaces/IITR.sol pragma solidity ^0.8.0; interface IITR { function claim(address to) external; } // File: contracts/interfaces/ISRC20.sol pragma solidity ^0.8.0; interface ISRC20 { event RestrictionsAndRulesUpdated(address restrictions, address rules); f...
Add a value to a set. O(1). Returns true if the value was added to the set, that is if it was not already present./
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); }
6,152,343
./full_match/1/0xA309c1E54d91b9f45845c4899A7e35999540406B/sources/contracts/staking/StakingPool.sol
Update the given pool's AMDX allocation point and `IRewarder` contract. Can only be called by the owner. _pid The index of the pool. _allocPoint New AP of the pool. _rewarder Address of the rewarder delegate. _overwrite True if _rewarder should be `set`. Otherwise `_rewarder` is ignored.
function set(uint256 _pid, uint256 _allocPoint, IRewarder _rewarder, bool _overwrite) external validatePoolByPid(_pid) onlyOwner { totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint.to64(); emit LogSetPool(_pid, _allocPo...
17,053,089
// Copyright 2019-2020 The Energi Core Authors // This file is part of Energi Core. // // Energi Core 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) a...
migrate masternode statuses from the current masternode registry We migrate the available masternodes till gas left is less than or equal to 10000, so this function will use the gas limit to determine how many masternodes that will be migrated at a ago. address(uint160()) cast converts from non-payable address to al...
function migrateStatusPartial() external noReentry { require(!migration_complete, "migration already done"); IGovernedContract current_mnreg_impl = IGovernedProxy(address(uint160(proxy))).impl(); require(address(current_mnreg_impl) != address(this), "cannot migrate from self"); Mas...
13,011,040
pragma solidity 0.5.6; /** * @title Metamorphic Contract Factory * @author 0age * @notice This contract creates metamorphic contracts, or contracts that can be * redeployed with new code to the same address. It does so by deploying a * contract with fixed, non-deterministic initialization code via the CREATE2 *...
View function for retrieving the address of the implementation contract to clone. Called by the constructor of each metamorphic contract./
} /* solhint-enable function-max-lines */ function getImplementation() external view returns (address implementation) { return _implementations[msg.sender]; }
12,604,735
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; // import "hardhat/console.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol...
Keep previous dna - or modify it
function _setDna(uint256 tokenId, uint256 baseDna) internal virtual { _dnaMapping[tokenId] = baseDna; }
10,427,955
pragma solidity ^0.4.24; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./interfaces/IOwnable.sol"; import "./interfaces/ISTFactory.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/ISecurityTokenRegistry.sol"; import "./storage/EternalStorage.sol"; import "./libraries/Util.sol"; import...
Returns the security token address by ticker symbol _ticker is the ticker of the security token return address/
function getSecurityTokenAddress(string _ticker) external view returns (address) { string memory ticker = Util.upper(_ticker); return getAddress(Encoder.getKey("tickerToSecurityToken", ticker)); }
12,831,573
./full_match/43114/0x86F06353353E311dc21982DDB6a22De68E987468/sources/fij.sol
First check most recent balance Next check implicit zero balance
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "Fiji::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return ...
4,516,428
pragma solidity 0.4.24; import "./CryptoArt.sol"; /** * @dev Contract with utility methods for testing. * * **NEVER DEPLOY THIS CONTRACT!!!** */ contract TestableArt is CryptoArt { uint public mockTime; /** * @dev Overrides default behaviour. Allows to mock time. */ function getTime() public...
Overrides default behaviour. Allows to mock time./
function getTime() public view returns (uint) { return mockTime; }
12,552,175
// 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 minDebtPerHarvest; uint256 maxDebtPerHarvest; uint256 lastReport; uin...
Override this to add all tokens/tokenized positions this contract manages on a persistent basis (e.g. not just for swapping back to want ephemerally). NOTE: Do not include `want`, already included in `sweep` below. Example: ``` function protectedTokens() internal override view returns (address[] memory) { addre...
function protectedTokens() internal view virtual returns (address[] memory); function sweep(address _token) external onlyGovernance { require(_token != address(want), "!want"); require(_token != address(vault), "!shares"); address[] memory _protectedTokens = protectedTokens(); ...
26,889
./full_match/44787/0x842370DCa5E8d5c1CC16e811508D303549197b2a/sources/contracts/StarFarm.sol
Withdraw LP tokens from MasterChef.require (_pid != 0, 'withdraw STAR by unstaking');if (_pid == 0) require(userNFTs[_msgSender()].length == 0, "nft user");uint256 _useramount = user.amount.sub(user.nftAmount);uint256 _amountGain = _useramount.add(_useramount.mul(_selfGain).div(100));uint256 _nftAmountGain = user.nftAm...
function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_msgSender()]; require(user.amount >= _amount, "withdraw: amount error"); updatePool(_pid); (uint256 _selfGain, uint256 _parentGain) = sta...
13,256,299
./full_match/5/0xdF3190874906C85425623c7DeeECE9555D7f1A36/sources/contracts/CrowdFunding.sol
if(sent) { campaign.amountCollected = campaign.amountCollected + amount; } } emit TokenDonate( msg.sender, campaign.owner, tokens ); (bool sent, ) = payable(campaign.owner).call{value: amount}("");
function donateToCampaign(uint256 _id) public payable { uint256 bal = _getBalance(msg.sender); _preValidatePurchase(msg.sender, 0); Campaign storage campaign = campaigns[_id]; campaign.donators.push(msg.sender); campaign.donations.push(bal); uint256 tokens ...
1,940,767
// Sources flattened with hardhat v2.2.1 https://hardhat.org // File @uniswap/v3-core/contracts/libraries/TickMath.sol@v1.0.0 pragma solidity >=0.5.0; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed ...
Pool state that never changes These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables { function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function fee() external view returns (uint24); function tickSpacing() external view returns (int24); ...
1,811,250
./full_match/137/0xb8cece5AE3E408149EcD3037FF8F6939C0E77B2F/sources/contracts/PoolPartyAaveMinion.sol
Checks there's an existing aToken for this token
function depositCollateral( address token, uint256 paymentRequested, string calldata details ) external memberOnly returns (uint256) { (address aToken,,) = getAaveTokenAddresses(token); require(aToken != address(0), "AP::No aToken"); uint256 prop...
3,746,809
pragma solidity 0.4.15; /// @dev `Owned` is a base level contract that assigns an `owner` that can be /// later changed contract Owned { /// @dev `owner` is the only address that can call a function with this /// modifier modifier onlyOwner() { require(msg.sender == owner); _; ...
Constructs the contract with the following arguments _etherEscrowAddress the address that will hold the crowd funded Ether _bountyAddress the address that will hold the bounty SHP _trusteeAddress the address that will hold the vesting SHP _affiliateUtilityAddress address of the deployed AffiliateUtility contract. ...
function SharpeCrowdsale( address _etherEscrowAddress, address _bountyAddress, address _trusteeAddress, address _affiliateUtilityAddress, uint256 _minContributionInWei) TokenSale ( _etherEscrowAddress, _bountyAddress, _trusteeAddress, ...
5,546,203
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "../libraries/LibAppStorage.sol"; import "../facets/AavegotchiFacet.sol"; import "../facets/CollateralFacet.sol"; interface IAavegotchiDiamond { /////////////////////////////////////////////////////////////////////////...
Calculates the base rarity score, including collateral modifier
function getNumericTraits(uint256 _tokenId) external view returns (uint256 numericTraits_); function getAavegotchi(uint256 _tokenId) external view returns (AavegotchiInfo memory aavegotchiInfo_); function availableSkillPoints(uint256 _tokenId) external view returns (uint256); function aavegotchiLevel...
12,855,981
./full_match/97/0xe75d306558b6F072Ad64323EACD0D2133e51aafD/sources/project:/contracts/TokenFactory/tokens/ERC721.sol
Burn multiple nft tokenIds - array of token ids/
function burnBatch(uint256[] memory tokenIds) external onlyRole(MINTER_ROLE) nonReentrant { for (uint256 i; i < tokenIds.length; ++i) { _burn(tokenIds[i]); } }
3,283,662
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./zeppelin/token/ERC20/ERC20BurnableUpgradeable.sol"; import "./zeppelin/token/ERC20/ERC20PausableUpgradeable.sol"; import "./zeppelin/token/ERC20/ERC20Upgradeable.sol"; import "./zeppelin/proxy/Initializable.sol"; import "./zeppelin/access/Acces...
set admin rol -- Emit RoleAdminChangedset minter, pauser and fee rol -- Emit RoleGranted
function __ERC20Decrypto_init_unchained(address owner) internal initializer { _setupRole(DEFAULT_ADMIN_ROLE, owner); _setupRole(MINTER_ROLE, owner); _setupRole(PAUSER_ROLE, owner); }
13,016,095
./full_match/1/0xb552deAEB776bF76C9E94c87bF2759Cd90468cE7/sources/contracts/topbridge.sol
IERC20(stableTokenAddress).approve(routerAddress, amount);
function _payToAddress(address _user, uint256 amount, address[] calldata pairs) internal returns (uint256){ uint256 last = pairs.length - 1; if (pairs[last] != stableTokenAddress) { if (pairs[last] != weth) { return IUniswapV2Router(routerAddress).swapExactTokensForTokens...
4,844,883
./full_match/4/0x6Aeaf50973CcAA98F151a43cC85db75A9e238D9E/sources/AMM/MasterCheft.sol
Stake CS98 tokens to Coin98Chef
function enterStaking(uint256 _amount) public { PoolInfo storage pool = poolInfo[0]; UserInfo storage user = userInfo[0][msg.sender]; updatePool(0); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accCS98PerShare).div(1e12).sub(user.rewardDebt); ...
13,343,685
// Sources flattened with hardhat v2.7.0 https://hardhat.org // File contracts/forwarder/IRelayRecipient.sol // SPDX-License-Identifier:MIT pragma solidity ^0.7.6; /** * a contract must implement this interface in order to support relayed transaction. * It is better to inherit the BaseRelayRecipient as its impleme...
Unstake and claim rewards stakeId Stake ID of the user/ lockableDays check optional lock check Checks State updation Balance check Transfer staked token back to user Emit state changes
function unStake(address userAddress, uint256 stakeId) external whenNotPaused returns (bool) { require( _msgSender() == userAddress || _msgSender() == _owner, "UNSTAKE: Invalid User Entry" ); address stakedToken = stakingDetails[userAddress].tokenAddress[stakeId]; require( ...
10,178,628
./full_match/5/0x5B050507373815D825Ba812f92FF31073eab6d4c/sources/contracts/ApeCoinStaking.sol
Claim rewards for array of BAYC NFTs _nfts Array of NFTs owned and committed by the msg.sender/
function claimSelfBAYC(uint256[] calldata _nfts) external { _claimNft(BAYC_POOL_ID, _nfts, msg.sender); }
1,895,063
pragma solidity 0.4.19; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.send...
called by the owner to pause, triggers stopped state/
function pause() onlyOwner whenNotPaused public { paused = true; Pause(); }
6,416,029
./full_match/1/0x7af62458e41E2F490D2Df54A8FeDc56fFedB8c17/sources/lib/solady/src/tokens/ERC721.sol
Transfers token `id` from `from` to `to`. Requirements: - Token `id` must exist. - `from` must be the owner of the token. - `to` cannot be the zero address. - The caller must be the owner of the token, or be approved to manage the token. Emits a {Transfer} event. @solidity memory-safe-assembly Clear the upper 96 bits. ...
function transferFrom(address from, address to, uint256 id) public payable virtual { _beforeTokenTransfer(from, to, id); assembly { let bitmaskAddress := shr(96, not(0)) from := and(bitmaskAddress, from) to := and(bitmaskAddress, to) mstore(0x00, id) ...
3,202,247
./full_match/1/0x7D24D647Fd58383a136D2D159C04CA3661CaC9E7/sources/browser/RHAsset.sol
get number of token issuance return uint256 total issuance number/
function getIssuanceNumber() external override view returns (uint256) { return _issuanceNumber; }
17,048,379
./full_match/1/0xE1Ef01C19751540778b73c122B4fc9a5EF543ECf/sources/TestNet_ReLaunch.sol
It's a sell It's a buy
function transferFrom(address sender, address recipient, uint256 amount) public override nonReentrant returns (bool) { uint256 tax = 0; if (recipient == uniswapV2Pair) { tax = (amount * sellTaxRate) / 100; tax = (amount * buyTaxRate) / 100; } uint256 amountAf...
8,462,615
// SPDX-License-Identifier: LicenseRef-StarterLabs-Business-Source /* ----------------------------------------------------------------------------- The Licensed Work is (c) 2022 Starter Labs, LLC Licensor: Starter Labs, LLC Licensed Work: OpenStarter v1 Effective Date: 2022 March 1 Full License...
PendingOwner can accept ownership./
function claimOwnership() public onlyPendingOwner { owner = pendingOwner; pendingOwner = address(0); emit LogOwnerShipTransferred(owner, pendingOwner); }
206,460
./partial_match/4/0xf45D37854595CC4fa1F935f4646658aCCA34E8d6/sources/ERC20CustomStaking.sol
Get claimable NDR amount/
function earned(address account) public view returns (uint256) { return strengthWeight[account] .mul(rewardPerToken().sub(userRewardPerTokenPaid[account])) .div(tokenDecimals) .add(rewards[account]); }
16,983,910
./full_match/4/0x6799FefBC0b40954720624107c9D0E75b1a0b7De/sources/contracts/DexTrackerPass.sol
configure royalties for Rariable
function setRoyalties( uint256 _tokenId, address payable _royaltiesRecipientAddress, uint96 _percentageBasisPoints ) public onlyOwner { _setRoyaltiesInternal( _tokenId, _royaltiesRecipientAddress, _percentageBasisPoints ); }
763,064
./full_match/3/0xcd8A8f90D402A845f3Ac90631f963570Dabbe87F/sources/browser/MainContract__1_.sol
transferReceivedFund() is function to transfer received_fund to another user. _recipient is address of recipient. _amount is amount to be transferred./
function transferReceivedFund(address _recipient, uint256 _amount) public hasUpline(msg.sender){ require(!hasActiveCycle(msg.sender), "Active Cycle"); require(accounts[msg.sender].received_fund >= _amount, "Insufficient Amount to transfer"); accounts[msg.sender].received_fund -= _am...
8,206,505
./partial_match/1/0x0D7aAD1310D6b8c2af31dEB861CFa6Da224F96C0/sources/ERC20.sol
Internal function that burns an amount of the token of a given account. account The account whose tokens will be burnt. amount The amount that will be burnt./
function _burn(address account, uint256 amount) internal { require(account != 0); require(amount <= _balances[account]); totalSupply = totalSupply.sub(amount); _balances[account] = _balances[account].sub(amount); emit Transfer(account, address(0), amount); }
4,074,418
pragma solidity ^0.4.21; /** * Issued by * _ __ _ _ * | | / _| | (_) * __| | __ _ _ __ _ __ ___ ___ | |_| |_ _ ___ * / _` |/ _` | '_ \| '_ \/ __|/ _ \| _| __| | |/ _ \ * | (_| | (_| | |_) | |_) \__ \ (_) | | | |_ _| | (_) | * \__,_...
2.5 lottery get random number in [0, maxNumber)
function getRandomNumber(uint maxNumber) private returns(uint) { require(maxNumber>0); randNonce += 1; return uint(keccak256(now, randNonce, block.blockhash(block.number - 1), block.coinbase)) % maxNumber; }
1,330,834
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC20/u...
calculate current bond price and remove floor if above return price_ uint/
function _bondPrice() internal returns ( uint price_ ) { price_ = terms.controlVariable * debtRatio() / 1e5; if (price_ < terms.minimumPrice) { price_ = terms.minimumPrice; terms.minimumPrice = 0; } } else if (terms.minimumPrice != 0) { }
1,016,619
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul interface DharmaTradeReserveV14Interface { event TRADE504( //inject NONSTANDARD NAMING address account, address suppliedAsset, address receivedAsset, address re...
inject NONSTANDARD NAMING
function _SETROLE96(Role role, address account) internal {
7,223,521
./partial_match/1/0x9e376F30D4e47Cc4f792BfC682caeb5dc76155f7/sources/MarketCreationRewards.sol
function to get integer parameters/
function getUintParameters(bytes8 code) external view returns(bytes8 codeVal, uint256 value) { codeVal = code; value = maxGasPrice; value = maxRewardPoolPercForMC; value = minRewardPoolPercForMC; value = plotStakeForRewardPoolShare; value = rewardPoolShareThreshold; ...
15,474,621
./partial_match/3/0xEe7a5DA1AC411052447a79a51a1E61Fc3920717C/sources/compounderFarmer.sol
Safe WETH transfer function, just in case if rounding error causes pool to not have enough ETH.
function safeWETHTransfer(address _to, uint256 _amount) public { uint256 wethBal = weth.balanceOf(address(this)); if (_amount > wethBal) { weth.transfer(_to, wethBal); weth.transfer(_to, _amount); } }
5,207,978
./full_match/5/0x4204c35dED93A6537A30310E50432134430aDC1e/sources/contracts/Contract.sol
This interface is designed to be compatible with the Vyper version. This is the Ethereum 2.0 deposit contract interface. For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs
interface IDepositContract { event DepositEvent( bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index ); function deposit( bytes calldata pubkey, bytes calldata withdrawal_credentials, bytes calldata signature...
1,942,959
pragma solidity ^0.5.2; import "../ERC20/IERC20.sol"; import "../crowdsale/ICrowdsale.sol"; import "./IAirdrop.sol"; import "../access/roles/ManagerRole.sol"; import "../access/roles/RecoverRole.sol"; import "../access/roles/FundkeeperRole.sol"; import "../math/SafeMath.sol"; /** * @title Airdrop module contract - f...
Called to end Airdrop Stage. Can only be called by the Manager Role. Ends all Manger functionality for record manipulation and ends user claim functionality. Recoverer can recvoer TBN after this./
function airdropEnd() external onlyManager atStage(Stages.Airdrop) returns (bool) { stages = Stages.AirdropEnded; emit AirdropEnded(); return true; }
12,643,964
./full_match/1/0xf0AfA19305473eDe1b033148FfaABa91B89f90b6/sources/src/ethereum/HourglassCustodianV2.sol
Clones a contract, pulled from Convex Booster. Not specific to Convex vaults. implementation The address of the implementation to clone return result The address of the newly cloned contract
function _clone(address implementation) internal returns (address result) { bytes20 implementationBytes = bytes20(implementation); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clo...
8,374,482
pragma solidity ^0.4.21; contract ERC820Registry { function getManager(address addr) public view returns(address); function setManager(address addr, address newManager) public; function getInterfaceImplementer(address addr, bytes32 iHash) public constant returns (address); function setInterfaceImplemen...
Helper function that checks for ERC777TokensSender on the sender and calls it. May throw according to `_preventLocking` _from The address holding the tokens being sent _to The address of the recipient _amount The amount of tokens to be sent _userData Data generated by the user to be passed to the recipient _opera...
function callSender( address _operator, address _from, address _to, uint256 _amount, bytes _userData, bytes _operatorData ) internal { address senderImplementation = interfaceAddr(_from, "ERC777TokensSender"); ERC777TokensSender(senderI...
2,445,230