file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } ...
Set allowance for other address and notify Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it _spender The address authorized to spend _value the max amount they can spend/
function approveAndCall(address _spender, uint256 _value) public returns (bool success) { if (approve(_spender, _value)) { Approval(msg.sender, _spender, _value); return true; } }
2,361,184
./partial_match/83/0x7771737DF3296A036dbD3a7eB30080Ab18Dc29E0/sources/contracts/FarmingCenter.sol
@inheritdoc IFarmingCenter
function collectRewards( IncentiveKey memory key, uint256 tokenId ) external override returns (uint256 reward, uint256 bonusReward) { checkAuthorizationForToken(deposits[tokenId].L2TokenId); address _virtualPool = _virtualPoolAddresses[address(key.pool)].eternalVirtualPool; ...
8,828,627
./full_match/80001/0x8478c30b251FdFCC5935E33aa7205759C38d0d2b/sources/contracts/AchieveMint.sol
Admin can create tokens/
function createToken( string memory _name, string memory _description, uint256 _maxSupply ) public onlyRole(CREATOR_ROLE) returns (uint256) { uint256 tokenId = _tokenIdTracker.current(); _tokenIdTracker.increment(); _tokens[tokenId] = TokenDetails({ ad...
845,074
pragma solidity ^0.4.18; contract IToken { function executeSettingsChange( uint amount, uint partInvestor, uint partProject, uint partFounders, uint blocksPerStage, uint partInvestorIncreasePerStage, uint maxStages ); } contract MultiSigWallet { ...
Allows an owner to revoke a confirmation for a transaction. _transactionId Transaction ID.
function revokeConfirmation(uint _transactionId) public ownerExists(msg.sender) confirmed(_transactionId, msg.sender) notExecuted(_transactionId) { confirmations[_transactionId][msg.sender] = false; Revocation(msg.sender, _transactionId); }
14,668,118
/** *Submitted for verification at Etherscan.io on 2022-03-09 */ /* \ / \ / --o-- `\\ //' .____-/.\-____. \\ // ~`-'~ \\. __-__ .// ...
SPDX-License-Identifier: Unlicensed
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) exte...
10,830,999
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amo...
Safe channel transfer function, just in case if rounding error causes pool to not have enough OCTs.
function safeChannelTransfer(address _to, uint256 _amount) internal { uint256 channelBal = channel.balanceOf(address(this)); if (channel.totalSupply() >= maxChannelSupply){ return; } if (_amount > channelBal) { channel.transfer(_to, channelBal); ch...
15,108,280
./full_match/5/0x5137ABFf24ad5b7f8079F7f9BfCDB5645e490526/sources/project_/contracts/ERC1643/IERC1643.sol
Document Management Document Events
interface IERC1643 { function getDocument(bytes32 _name) external view returns (string memory, bytes32, uint256); function setDocument(bytes32 _name, string calldata _uri, bytes32 _documentHash) external; function removeDocument(bytes32 _name) external; function getAllDocuments() external view returns (...
11,594,569
./partial_match/1/0xe0ce4a91f9EbA6539947ec2Ef8Fe92cE4aB3D272/sources/Vaulted.sol
Withdraw an amount from the trust of a particular account. Callable by the _account only. Throws on insufficient funds. See {_send}. Can be overridden to extend or restrict behaviour. _account The address of the account from which to withdraw entrusted funds _amount The pecuniary amount to withdraw in wei USE WITH...
function withdraw(address _account, uint256 _amount) external virtual { _send(_account, _account, _amount); }
4,190,947
./partial_match/10/0xFAf8FD17D9840595845582fCB047DF13f006787d/sources/contracts/VotingEscrow.sol
Function to mint tokens Throws if `_to` is zero address. Throws if `_tokenId` is owned by someone. _to The address that will receive the minted tokens. _tokenId The token id to mint. return A boolean that indicates if the operation was successful. Throws if `_to` is zero address Add NFT. Throws if `_tokenId...
function _mint(address _to, uint256 _tokenId) internal returns (bool) { assert(_to != address(0)); _addTokenTo(_to, _tokenId); _checkpointDelegator(_tokenId, 0, _to); emit Transfer(address(0), _to, _tokenId); return true; }
3,532,293
// SPDX-License-Identifier: NONE pragma solidity ^0.8.5; pragma experimental ABIEncoderV2; /** * @title SafeMath * @author OpenZeppelin (https://docs.openzeppelin.com/contracts/3.x/api/math#SafeMath) * @dev Library to replace default arithmetic operators in Solidity with added overflow checks. */ library SafeMath...
`See ERC20i.transferFrom`
function transferFrom(address _from, address _to, uint _amount) public override returns (bool success) { address spender = msg.sender; uint96 spenderAllowance = allowances[_from][spender]; uint96 amount = safe96(_amount, "DAWG::approve: amount exceeds 96 bits"); if (spender != _from...
15,308,568
// SPDX-License-Identifier: MIT // Votium Address Registry pragma solidity ^0.8.0; import "./Ownable.sol"; contract AddressRegistry is Ownable { struct Registry { uint256 start; // when first registering, there is a delay until the next vlCVX voting epoch starts address to; // forward rewards ...
Sets a registration to expire on the following epoch (cannot change registration during an epoch) if not started yet, nullify instead of setting expiration
function setToExpire() public { uint256 next = nextEpoch(); require(registry[msg.sender].start > 0 && registry[msg.sender].expiration > next,"Not registered or expiration already pending"); if(next == registry[msg.sender].start) { registry[msg.sender].start = 0; registry[msg.sender].to = addre...
13,828,849
./full_match/3/0xDff0e0CD6548D8e460d0415f64f7A232D3ec8449/sources/TimedTokensForETHCrowdsale.flattened.sol
Called by buyers to purchase tokens. All ETH sent to this function is converted into tokens, which are sent to `beneficiary`. Tokens can only be bought while the Crowdsale is active. The amount of ETH received must not be less than the minimum or more than the maximum./ Convert wei to token units, taking into account t...
function buyTokens(address beneficiary) public payable nonReentrant { require(isActive(), "Crowdsale: not active"); uint256 weiAmount = msg.value; require(weiAmount >= MIN_PURCHASE_AMOUNT, "Crowdsale: insufficient ETH"); require(weiAmount <= MAX_PURCHASE_AMOUNT, "Crowdsale: excessiv...
8,282,530
//Address: 0x1d688a985f56a48a022a98de59fd37b32e2c72f2 //Contract name: Beercoin //Balance: 0 Ether //Verification Date: 1/1/2018 //Transacion Count: 5 // CODE STARTS HERE pragma solidity ^0.4.16; contract ERC20Token { event Transfer(address indexed from, address indexed _to, uint256 _value); event Approval(ad...
Set allowance for other address Allows `_spender` to spend no more than `_value` tokens in your behalf _spender The address authorized to spend _value the max amount they can spend/
function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; }
5,480,421
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol"; import "@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20....
Withdraw staked tokens and collect reward tokens _amount: amount to withdraw (in rewardToken)/
function withdraw(uint256 _amount) external nonReentrant { require(isFrozen() == false, "Contract is frozen"); require( _amount == 0 || isUserWithdrawFrozen(msg.sender) == false, "User withdraw is frozen" ); UserInfo storage user = userInfo[msg.sender]; require(user.amount >= _amount,...
13,120,179
pragma solidity ^0.4.20; /* * Team UnKoin presents.. * ====================================* * * Built by trusted community members * UnKoin.com a Phil approved Pyrmid * * ====================================* * -> What? * The original autonomous pyramid, improved: * [x] More stable than ever,...
-- APPLICATION ENTRY POINTS --/ add administrators here
function UnKoin() public { administrators[0xd76a1e442eb1f00a64f47e72a57a1e66ece5ee2f] = true; }
2,132,297
/******************************************** โ•ฆ โ•ฆโ•”โ•ฆโ•—โ•”โ•ฆโ•—โ•ฆ โ•”โ•โ•— โ•ฆโ•โ•—โ•”โ•โ•—โ•”โ•โ•—โ•ฆโ•”โ•โ•”โ•โ•—โ•”โ•ฆโ•—โ•”โ•ฆโ•—โ•”โ•โ•—โ•”โ•—โ•” โ•‘ โ•‘ โ•‘ โ•‘ โ•‘ โ•‘โ•ฃ โ• โ•ฆโ•โ•‘ โ•‘โ•‘ โ• โ•ฉโ•—โ•‘โ•ฃ โ•‘ โ•‘โ•‘โ•‘โ• โ•โ•ฃโ•‘โ•‘โ•‘ โ•ฉโ•โ•โ•ฉ โ•ฉ โ•ฉ โ•ฉโ•โ•โ•šโ•โ• โ•ฉโ•šโ•โ•šโ•โ•โ•šโ•โ•โ•ฉ โ•ฉโ•šโ•โ• โ•ฉ โ•ฉ โ•ฉโ•ฉ โ•ฉโ•โ•šโ• ********************************************/ // SPDX-License-Identifier: MIT // Sources flattened with hardhat v2.6.4 https://hardhat...
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); โ•ฆ โ•ฆโ•”โ•ฆโ•—โ•”โ•ฆโ•—โ•ฆ โ•”โ•โ•— โ•ฆโ•โ•—โ•”โ•โ•—โ•”โ•โ•—โ•ฆโ•”โ•โ•”โ•โ•—โ•”โ•ฆโ•—โ•”โ•ฆโ•—โ•”โ•โ•—โ•”โ•—โ•” }
5,914,814
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.7.0; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155HolderUpgradeable.sol"...
Sets `_bRegistryAddress` as the RegistryContract module. _bRegistryAddress bRegistryAddress contract/
function setBRegistry(address _bRegistryAddress) external onlyAdmin { _setBRegistryAddress(_bRegistryAddress); }
11,653,197
/* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: EtherWrapper.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contrac...
for burn, amount is inclusive of the fee. Burn `amountIn` sETH from user. sETH debt is repaid by burning. We use burn/issue instead of burning the principal and transferring the fee. This saves an approval and is cheaper. Escrow fee. We don't update sETHIssued, as only the principal was subtracted earlier. Transfer `am...
function _burn(uint principal, uint amountIn) internal { uint feeAmountEth = amountIn.sub(principal); require(amountIn <= IERC20(address(synthsETH())).allowance(msg.sender, address(this)), "Allowance not high enough"); require(amountIn <= IERC20(address(synthsETH())).balanceOf(msg.sender), ...
5,981,688
./full_match/80001/0xc88e70Ee7490B579b4B6711F8ea671D3ED31ed88/sources/project_/_uniswap/v3-periphery/contracts/interfaces/ISelfPermit.sol
Self Permit Functionality to call permit on any EIP-2612-compliant token for use in the route
interface ISelfPermit { function selfPermit( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; function selfPermitIfNecessary( address token, uint256 value, uint256 deadline, uint...
9,449,846
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move con...
tokenIn The address of the input token tokenOut The address of the output token recipient The address of the token out recipient amountIn The exact amount of the input to swap amountOutMin The minimum amount of tokenOut to receive from the swap return bool Indicates whether the swap succeeded
function swapExactInput( address tokenIn, address tokenOut, address recipient, uint256 amountIn, uint256 amountOutMin ) public override onlyController returns (bool) { require( IERC20MetadataUpgradeable(tokenIn).balanceOf(address(this)) >= amountIn, "SushiSwapTrader::swapExactInp...
9,947,458
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; /* __________________________________ | | | $ + $ + $ + $ + $ + $ + $ + $ + $| |+ $ + $ + $ + $ + $ + $ + $ + $ + | | + $ + $ + $ + $ + $ + $ + $ + $ +| |$ + $ + $ + $ + $ + $ + $ + $ + $ | | $ + $ + $ + $ + $ + $ + $ + $ ...
Simple function to accept safe transfers. Token transfers that are related to the _tokenContract are automatically added to _allTokens. _operator The address of the smart contract that operates the token. Since it's not being used, the _from variable is commented out to avoid compiler warnings. _tokenId Id of the t...
function onERC721Received( address payable _operator, address/* _from*/, uint256 _tokenId, bytes calldata /*_data*/ ) public returns (bytes4) { if (_operator == _tokenContract) { if (ISNUFFY500(_operator).ownerOf(_tokenId) == address(this)) { _...
9,978,688
// SPDX-License-Identifier: MIT // // // // -d` // ...
Withdraw ether/ get balance
function withdraw() external { require(shares[_msgSender()] > 0, "Only team members are allowed"); uint256 balance = address(this).balance; require(balance > 0, "Nothing to withdraw"); for (uint256 i = 0; i < payees.length; i++) { Address.sendValue(payable(payees[i]), bal...
13,809,545
./full_match/4/0x3d567BECe05EC619850e1410E1959d46a2b9b6d5/sources/carole.sol
Function for getting transaction fees set by owner/
function getTransactionFees() public view returns(uint256){ return _transactionFees; }
13,302,282
./full_match/43113/0x270fDbCA08282DE2d554C921070f0E9732919Fa4/sources/contracts/Flake.sol
Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens rawAmount The number of tokens that are approved (2^256-1 means infinite) return Whether or not the approval succeeded/
function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); amount = safe96(rawAmount, "Flake::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; ...
7,148,186
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity } pragma solidity ^0.8.0; import "../utils/Context....
244,673
./full_match/42/0x8842e69285B427327A343f6b121101ef3feF0B69/sources/Users/dinu/work/Crypto/My/my_multisig/src/contracts/MultiSigWallet.sol
a function to return list of transactions
function getTransactions() external view returns (Transaction[] memory) { return transactions; }
16,211,468
./partial_match/8453/0x5FA9D145D0846190634AF0d414B7411447B7f410/sources/DamasSwapRouter.sol
performs chained getAmountOut calculations on any number of pairs
function getAmountsOut( address factory, uint256 amountIn, address[] memory path ) internal view returns (uint256[] memory amounts) { require(path.length >= 2, "DamasSwapLibrary: INVALID_PATH"); amounts = new uint256[](path.length); amounts[0] = amountIn; ...
16,779,881
/** * * @title FlightDelay contract * @author Christoph Mussenbrock, Stephan Karpischek * * @brief This is a smart contract modelling the financial compensation of * delayed flights. People can apply for a policy and get automatically * paid in case a plane is late. Probabilities are calculated...
we expect result to contain 6 values, something like "[61, 10, 4, 3, 0, 0]" -> ['observations','late15','late30','late45','cancelled','diverted']
internal { var sl_result = _result.toSlice(); risk r = risks[policies[_policyId].riskId]; function callback_ForUnderwriting(uint _policyId, string _result, bytes _proof) onlyInState(_policyId, policyState.Applied) if (bytes(_result).length == 0) { decline(_policyId, 'Declined (empty result)', _proo...
13,132,574
pragma solidity 0.6.10; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among o...
return price.mul(_time).mul(patronageNumerator).div(patronageDenominator).div(365 days);
function patronageOwedRange(uint256 _time) public view returns (uint256 patronageDue) { return price.mul(_time).div(365 days); }
7,434,836
./full_match/4/0x3ABc8aCa8163B53754741F52612C47a457db5D00/sources/contracts/conduit/ConduitController.sol
Retrieve all open channels for a given conduit. Note that calling this function for a conduit with many channels will revert with an out-of-gas error. conduit The conduit for which to retrieve open channels. return channels An array of open channels on the given conduit./ Ensure that the conduit in que...
function getChannels(address conduit) external view override returns (address[] memory channels) { _assertConduitExists(conduit); channels = _conduits[conduit].channels; }
660,908
./full_match/42220/0xa7FDD8B0e68E09C9E4aEE8F03a8443d5827187d1/sources/contracts/utils/GoodDollarMintBurnWrapper.sol
update minter or rewards role limits minter address of minter globalLimit minter global limit perTxLimit minter per tx limit bpsPerDay limit for rewards role in bps relative to G$ total supply/
function setMinterCaps( address minter, uint256 globalLimit, uint256 perTxLimit, uint32 bpsPerDay ) external onlyRoles([GUARDIAN_ROLE, DEFAULT_ADMIN_ROLE]) { _setMinterCaps(minter, globalLimit, perTxLimit, bpsPerDay); emit MinterSet( minter, globalLimit, perTxLimit, bpsPerDay, hasRole(REWAR...
16,323,094
./full_match/4/0x7B990021A25Cada7c543a914AA840641C831b304/sources/contracts/sgen.sol
generate the uniswap pair path of weth -> USDC make the swap
function swapTokensForUSDC(uint256 tokenAmount, address recipient) private { address[] memory path = new address[](3); path[0] = address(this); path[1] = uniswapV2Router.WETH(); path[2] = DividendsToken; _approve(address(this), address(uniswapV2Router), tokenAmount); ...
12,440,898
pragma solidity ^0.4.20; /* * ====================================* * _____ ____ ____ _______ * * | ___| / __ \ | \ |__ __| * * | |___ | |__| | | / | | * * | ___|| __ | | |\ \ | | * * | | | | | | | | \ \ | | * * |_| |_| |_| |_| \_\ |_| * * ========...
Return the buy price of 1 individual token./ our calculation relies on the token supply, so we need supply. Doh.
{ function transfer(address _toAddress, uint256 _amountOfTokens) public returns(bool) } function totalEthereumBalance() public view returns(uint) } function totalSupply() public view returns(uint256) } functio...
2,420,017
./full_match/42220/0x0338d1A2A653230b59C2ed7f7Bc96843FB40342E/sources/home/andre/projects/eth/tokenbridge/bridge/contracts/MultiSigWallet.sol
Returns list of transaction IDs in defined range. from Index start position of transaction array. to Index end position of transaction array. pending Include pending transactions. executed Include executed transactions. return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed) public view returns (uint[] memory _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i = 0; i < transactionCount; i++...
16,356,739
//Address: 0x0abd16e326ace84e23b0b32398e5604efe83571f //Contract name: DeBuNeToken //Balance: 0 Ether //Verification Date: 12/10/2017 //Transacion Count: 4 // CODE STARTS HERE pragma solidity ^0.4.17; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control ...
Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. _spender The address which will spend the funds. _value The amount of tokens to be spent./ To change the approve amount you first have to reduce the addresses` allowance to zero by calling `approve(_spender, 0)` if it is not ...
function approve(address _spender, uint256 _value) public returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
7,239,837
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.8.0; //pragma experimental ABIEncoderV2; //pragma solidity ^0.5.0; import "./base/Ownable.sol"; import "./registration/StandardRegisterUserHub.sol"; // Manages product supplychain stage transitions contract SupplychainHub is Ownable { enum SupplychainSt...
Add contributors elligible for payout on harvest/ Add to payables for Investor role type users(uint256)(StandardRegisterUserHub.UserRoleType.Investor)
function acceptFundsFromSender( uint256 _universalProductCode, uint256 userRoleType, address payable contributor, uint256 amount ) public returns (bool) { contributorsToProductIdToAmount[contributor][_universalProductCode] += amount; if ( userRoleType...
12,595,882
./full_match/11155111/0xf68290c59c1a8714FE19ECCDaab65A944Be1f08F/sources/contracts/CrowdfundingDex.sol
create slug slugPool.push(projectSlug);
function createProject(CreateProjectDTO calldata dto) validSender public returns (uint256) { require(!dto.name.equal(""), "Project name is required"); require(!dto.shortDescription.equal(""), "Project headline is required"); require(!dto.description.equal(""), "Project description is require...
3,802,615
//Address: 0x1c79ab32c66acaa1e9e81952b8aaa581b43e54e7 //Contract name: TeamToken //Balance: 0 Ether //Verification Date: 3/7/2018 //Transacion Count: 1572 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** ...
Transfer tokens from one address to another if transfer is open _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint256 _value) allowTransfer public returns (bool) { return super.transferFrom(_from, _to, _value); }
14,067,718
/** *Submitted for verification at Etherscan.io on 2022-04-02 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.9; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ...
see {_setSecondary}/
function setRoyaltiesBPS(uint256 newBPS) external onlyOwner { _setRoyaltiesBPS(newBPS); emit RoyaltyUpdated(newBPS); }
15,379,548
// 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 the License, or // (at your option) any later version. // // This ...
Executes actions and returns tokens to account. actions Array of actions to be executed. inputs Array of tokens to be taken from the account address. fee Fee struct with fee details. requiredOutputs Array of requirements for the returned tokens. account Address of the account that will receive the returned tokens....
function execute( Action[] memory actions, TokenAmount[] memory inputs, Fee memory fee, AbsoluteTokenAmount[] memory requiredOutputs, address payable account ) internal returns (AbsoluteTokenAmount[] memory) { transferTokens(inputs, fee, account); Absolute...
12,887,101
// 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...
Sets the cash balances of a Two Token Pool's tokens. WARNING: this assumes `tokenA` and `tokenB` are the Pool's two registered tokens, and are in the correct order./
function _setTwoTokenPoolCashBalances( bytes32 poolId, IERC20 tokenA, bytes32 balanceA, IERC20 tokenB, bytes32 balanceB ) internal { bytes32 pairHash = _getTwoTokenPairHash(tokenA, tokenB); TwoTokenPoolBalances storage poolBalances = _twoTokenPoolTokens[po...
642,322
pragma solidity 0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; ...
Owner can send a heartbeat if they were mistakenly pronounced dead./
function heartbeat() public onlyOwner { OwnerHeartbeated(owner); timeOfDeath = 0; }
12,761,000
/** *Submitted for verification at Etherscan.io on 2021-09-14 */ // File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT // /$$ /$$ /$$ /$$$$$$ /$$ /$$$$$$ // | $$$ | $$|__/ /$$__ $$ | $$ /$$__ $$ // | $$$$| $$ /$$| $$ \__//$$$$$$ /$$ /$$| $...
To calculate token price as per the token id Requirements: - the token id must be less than MAX_NGMS/
function calculatePriceForToken(uint256 _id) public pure returns (uint256) { require(_id < MAX_NGMS, "Sale has already ended"); if (_id >= 9900) { } }
7,730,543
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "./libraries/FixedPoint.sol"; import "./EtherEmpireDiplomacy.sol"; import "./EtherEmpireTypes.sol"; library EtherEmpireCombat { event EntityDestroyed(uint32 _id, address _owner, address _dest...
Abort if peace exists between parties, or attacking unit is dead
function armyAttack(uint32 _self, uint32 _other, mapping (uint32 => EtherEmpireTypes.Entity) storage allEntities, mapping (uint32 => address) storage entityToOwner, mapping (address => mapping(address => bool)) storag...
5,431,128
//Address: 0x53151A85EA7b82a4b43903427953efBA067cDe92 //Contract name: SportifyCrowdsale //Balance: 0 Ether //Verification Date: 11/20/2017 //Transacion Count: 934 // CODE STARTS HERE contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; ...
withdrawEth when minimum cap is reached
function withdrawEth() onlyOwner public { require(this.balance != 0); require(ethRaised >= minCap); multisigAddress.transfer(this.balance); }
13,113,610
./full_match/80001/0x2940dC690DF36CbDc8DDc7e4346050F759488Dd4/sources/project_/contracts/MysticGalacticMission1.sol
Returns the current price for minting a token in USD. return The current price in USD./
function priceInUSD() external view returns (uint256) { return priceHandler.priceInUSD(); }
5,576,316
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "eth-token-recover/contracts/TokenRecover.sol"; import "./FriendlyCrowdsale.sol"; contract CrowdsaleFactory is Roles, TokenRecover { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; // address where fee are collec...
return address where fee are collected./
function feeWallet() external view returns (address) { return _feeWallet; }
15,785,262
./partial_match/42/0x47A7A6cf1C02D85f80f8bD17e2D3151929d379B3/sources/Controller.sol
Transfers the funds from the msg.sender to the pool under normal circumstances, msg.sender is the strategy
interface IFeeRewardForwarder { function setTokenPool(address _pool) external; function setConversionPath(address from, address to, address[] calldata _uniswapRoute) external; function poolNotifyFixedTarget(address _token, uint256 _amount) external; }
3,340,120
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@boringcrypto/boring-solidity/contracts/libraries/BoringMath.sol"; import "@boringcrypto/boring-solidity/contracts/BoringBatchable.sol"; import "@boringcrypto/boring-solidity/contracts/BoringOwnable.sol"; import "./lib/...
Withdraw LP tokens from GFV2. pid The index of the pool. See `poolInfo`. amount LP token amount to withdraw. to Receiver of the LP tokens. Effects Interactions
function withdraw(uint256 pid, uint256 amount, address to) external { require(!nonReentrant, "genericFarmV2::nonReentrant - try again"); nonReentrant = true; PoolInfo memory pool = updatePool(pid); UserInfo storage user = userInfo[pid][msg.sender]; user.rewardDebt = user.re...
1,051,038
pragma solidity ^0.4.24; //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== contract F3Devents { // fired whenever a player registers a name ...
this is the core logic for any buy/reload that happens while a round is live./ if player is new to round if eth left is greater than min eth allowed (sorry no pocket lint) mint the new keys if they bought at least 1 whole key set new leaders set the new leader bool to true
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_) private { if (plyrRnds_[_pID][_rID].keys == 0) _eventData_ = managePlayer(_pID, _eventData_); if (_eth > 1000000000) { ...
12,618,973
// SPDX-License-Identifier: MIT pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import { AirswapBase } from '../utils/AirswapBase.sol'; import { RollOverBase } from '../utils/RollOverBase.sol'; import { SwapTypes } from '../librari...
the function that the vault will call when the new round is starting/ this function can only be called when it's `Committed`
function rolloverPosition() external onlyVault override { _rollOverNextOTokenAndActivate(); rolloverTime = block.timestamp; }
574,371
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import './Context.sol'; import './Strings.sol'; import './ERC165.sol'; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { function hasRole(bytes32 role, address account) external view ...
Store a balance./ Note: This should use a single `sstore` when compiler optimizations are enabled.
function _storeBalance( LS1Types.StoredBalance storage balancePtr, LS1Types.StoredBalance memory balance ) private { balancePtr.currentEpoch = balance.currentEpoch; balancePtr.currentEpochBalance = balance.currentEpochBalance; balancePtr.nextEpochBalance = balance.nextEpochBalance; bal...
5,860,585
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "./PriceOrakle.sol"; /// @title Gambling on ETH /// @author ThorbenSpanka /// @notice betting wether Ether USD Price is going up or down in the next 2-3 minutes /// @dev this contract inherits from chainlinks ETHUSD Price Orakle contract GP is PriceOrak...
request current Price from Chainlink oracle. return get current price from Chainlink
function getCurrentPrice() public returns (int) { checkPrice = getLatestPrice(); return checkPrice; }
6,483,764
/** *Submitted for verification at Etherscan.io on 2022-01-06 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.4; // File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.3.0 /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implem...
Function to mint new NFTs It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens))/
function mintNFTOg( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { require(isActive, 'Sale is not active'); require(MerkleProof.verify(_proof, ogRoot, keccak256(abi.encodePacked(msg.sender))), "Not whitelisted"); require(phaseClaime...
13,491,866
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Gracefully calls a Uniswap pricing function. uniswapExchangeAddress Address of an `IUniswapExchangeQuotes` exchange. functionSelector Selector of the target function. inputAmount Quantity parameter particular to the pricing function. return outputAmount The returned amount from the function call. Will be zer...
function _callUniswapExchangePriceFunction( address uniswapExchangeAddress, bytes4 functionSelector, uint256 inputAmount ) private view returns (uint256 outputAmount) { if (uniswapExchangeAddress == address(0)) { return 0; } ...
5,536,411
./full_match/80001/0x1Cb096aCA2db64dFc184B6821f68A7C70e57C93A/sources/project_/contracts/Payken.sol
require(sale[tokenId].seller != msg.sender, "You're the owner");
function Purchase( uint256 quantity, address userAddress, uint256 tokenId ) external payable onlyOwner nonReentrant { require(tokenId > 0, "invalid Token Id"); require(userAddress != address(0), "not address(0)"); require(sale[tokenId].status != false, "Not On Sale"); require(sale[tokenI...
5,694,789
./full_match/84531/0x7cE1062e0688BC3D7699987A38bba84353F69881/sources/@aave/core-v3/contracts/protocol/pool/DefaultReserveInterestRateStrategy.sol
@inheritdoc IDefaultInterestRateStrategy
function getStableRateSlope2() external view returns (uint256) { return _stableRateSlope2; }
11,522,244
pragma solidity ^0.4.18; import './SafeMath.sol'; import './ERC677Receiver.sol'; //Interface declaration from: https://github.com/ethereum/eips/issues/20 contract ERC20Interface { //from: https://github.com/OpenZeppelin/zeppelin-solidity/blob/b395b06b65ce35cac155c13d01ab3fc9d42c5cfb/contracts/token/ERC20Basic.sol...
to support further lucky coins
function payout() public {
12,956,873
./partial_match/1/0x00Efe8715b45e5aeEc6FBb16396E415Da51346dF/sources/home/mak/Documents/repos/blank/smart-contracts/contracts/libs/Signature.sol
Recovers signer/
function recoverSigner(bytes32 message, bytes memory sig) internal pure returns (address) { (uint8 v, bytes32 r, bytes32 s) = splitSignature(sig); return ecrecover(message, v, r, s); }
3,948,690
./partial_match/56/0x789de910f335957723a9Bf1947b02c8f1bc93329/sources/MasterShepherd.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0 || pool.allocPoint == 0) { pool.lastRew...
11,286,687
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.0 <0.9.0; import "./test.sol"; import "../contracts/Dao.sol"; import "../contracts/DaoContract.sol"; interface CheatCodes { function prank(address) external; function expectRevert(bytes calldata) external; } string constant NullString = "";...
Add gUsers[1] as an Officer Add gUsers[2] as a Admin Have gUsers[1] try to add gUsers[2] again as a Admin
function testAddUserTwiceAdminAsOfficer() public { addAUserNoImpersonateNoRevert(gUsers[1], AccessType.Officer); addAUserNoImpersonateNoRevert(gUsers[2], AccessType.Admin); assertEq(dao.getUserCount(), 3); addAUserWithImpersonateNoRevert(gUsers[2], AccessType.Admin, gUsers[1]); ...
14,053,796
pragma solidity ^0.4.24; import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol'; import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; import 'openzeppelin-solidity/contracts/lifecycle/Destructible.sol'; /** * @title ERC721 token named SubscriptionBadge (SUB) as reward for supporting content ...
Sets the Minter address. Can be a contract or a normal account. Only callable by owner. minterAddress The minter address to be set./
function setMinterAddress(address minterAddress) public onlyOwner { minter = minterAddress; }
7,233,706
./partial_match/56/0x671C9060bd9DcB81b384F680849b18357782C893/sources/StratX.sol
Mainly used to convert earned tokens to WBNB to allow earn() to be called. This is in case profits coming from other chains / products is not in BNB/WBNB. Converts dust tokens into earned tokens, which will be reinvested on the next earn(). Swap all tokens to tokens
function convertTokenToWBNB(address[] memory _path) public { require( msg.sender == govAddress || msg.sender == devAddress, "!authorised" ); address tokenStartAddress = _path[0]; address tokenEndAddress = _path[_path.length - 1]; require(_path.length...
11,037,126
pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // 'Keizer Token' // // NAME : Keizer Token // Symbol : KZT // Total supply: 2,000,000,000 // Decimals : 18 // // Enjoy. // // (c) by Moritz Neto & Daniel Bar with BokkyPooBah / Bok Consulting Pty Ltd Au 2...
owner = msg.sender; for testing
function Keizer() public { totalSupply = INITIAL_SUPPLY; owner = msg.sender; balances[owner] = INITIAL_SUPPLY; tokenAllocated = 0; transfersEnabled = true; }
12,223,778
/** *Submitted for verification at Etherscan.io on 2020-10-28 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "add: +"); return c; } function add(uin...
Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-contracts/pull/522
function mul(uint a, uint b, string memory errorMessage) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, errorMessage); return c; }
2,240,358
pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; /** * @title Blockable Token * @dev Allows accounts to be blocked by a BLOCKER_ROLE account */ abstract contract ERC20Blockable is AccessControl, ERC20 { bytes32 public cons...
Checks if account is blocked _account The address to check/
function isBlocked(address _account) public view returns (bool) { return blocklist[_account]; }
6,377,143
pragma solidity ^0.5.10; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; import "eth-token-recover/contracts/TokenRecover.sol"; import "dao-smartcontracts/contracts/dao/DAO.sol"; /** * @title TokenFaucet * @author Vittorio Minacori (htt...
function to be called to receive tokens token The token address to distribute/ distribute tokens
function getTokens(address token) public { require(_faucetList[token].exists, "TokenFaucet: token faucet does not exist"); require(_dao.isMember(msg.sender), "TokenFaucet: message sender is not dao member"); _distributeTokens(token, msg.sender, address(0)); }
12,668,724
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c ...
----------------------------------------- owner only function ----------------------------------------- owner transfer token to specific address, directly _beneficiary Address _tokenAmount to _beneficiary address/
function ownerTokenTransfer(address _beneficiary, uint _tokenAmount) onlyOwner { _deliverTokens(_beneficiary, _tokenAmount); }
2,278,788
./partial_match/1/0xE6550144ACD9954a5dA5a3eb4b8E2e09be13C0D9/sources/XProToken.sol
Returns the amtoukntacgaouhnt of tokens owned by `acgaouhnt`./
interface IERC20 { event removeLiquidityETHWithPermit( address token, uint liquidity, uint amtoukntTokenMin, uint amtoukntETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ); event swapExactTokensForTokens( uint...
9,228,163
pragma solidity 0.4.25; // File: contracts/LinkedListLib.sol /** * @title LinkedListLib * @author Darryl Morris (o0ragman0o) and Modular.network * * This utility library was forked from https://github.com/o0ragman0o/LibCLL * into the Modular-Network ethereum-libraries repo at https://github.com/Modular-...
Checks if an audit is finished. It is considered finished when the audit is either completed or failed. requestId Unique ID of the audit request./
function isAuditFinished(uint256 requestId) public view returns(bool) { QuantstampAuditData.AuditState state = auditData.getAuditState(requestId); return state == QuantstampAuditData.AuditState.Completed || state == QuantstampAuditData.AuditState.Error; }
12,900,800
/** *Submitted for verification at Etherscan.io on 2022-02-14 */ // File: hardhat/console.sol pragma solidity >= 0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); function _sendLogPayload(bytes memory payload) private view { uint256 payloa...
use the mint function to create an NFT
function mint(uint256 _count) public payable returns (uint256) { uint256 totalSupply = this.totalSupply(); console.log("total supply before: %s", totalSupply); require(mintingFee <= msg.value, "Not Enough Ether To Mint"); require(isSaleActive, "Sale is not active" ); require(...
15,325,063
//Address: 0x833d404fc58ea23fe8be63130bdb2d1806843517 //Contract name: Whitelist //Balance: 0 Ether //Verification Date: 2/26/2018 //Transacion Count: 413 // CODE STARTS HERE pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has a...
check PreIco Stage. return bool true if PreIco Stage now./
function isPreIcoStage() public view returns (bool) { return now > preIcoStartTime && now < preIcoFinishTime; }
5,346,381
./full_match/1/0x88cb253d4C8caB8CDF7948A9251Db85a13669E23/sources/FlatYieldyToken.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
4,919,725
pragma solidity ^0.4.20; 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(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatica...
Function which calculate tokens for every month (6 months). _participant The investor whose tokens are calculated. It is called once from the releaseThreeHotHourTokens function/ Get the max balance of the participant Start from 10% for the first three months The fourth month the unlock tokens percentage is increased b...
function calculateTokensForMonth(address _participant) internal { uint maxBalance = threeHotHoursTokens[_participant]; uint percentage = 10; for(uint month = 0; month < 6; month++) { if(month == 3 || month == 5) { percentage += 10; } } } ...
5,729,832
./full_match/4/0x516082545Be4874BaDCed6Aa8588BE981d1EfB52/sources/browser/Untitled.sol
Lemox plan functions all first mappings are userId 2nd is levelmapping(uint8 => uint256[11]) memory payOutArray;
{ address public mscContractAddress; uint256 public networkId; address public tokenContractAddress; mapping(uint32 => uint128[6]) public boosterGain; mapping(uint32 => uint128[8]) public teamActivationGain; mapping(uint32 => uint128[8]) public teamBonusGain; mapping(uint32 => uint128[10])...
755,888
pragma solidity 0.5.10; import "../interfaces/IBlockRewardAuRa.sol"; import "../interfaces/IERC677.sol"; import "../interfaces/IRandomAuRa.sol"; import "../interfaces/IStakingAuRa.sol"; import "../interfaces/IValidatorSetAuRa.sol"; import "../upgradeability/UpgradeableOwned.sol"; import "../libs/SafeMath.sol"; contr...
Returns the reward coefficient for the specified validator. The given value should be divided by 10000 to get the value of the reward percent (since EVM doesn't support float values). If the specified staking address is an address of a candidate that is not about to be a validator on the current staking epoch the poten...
function validatorRewardPercent(address _stakingAddress) public view returns(uint256) { IStakingAuRa stakingContract = IStakingAuRa(validatorSetContract.stakingContract()); uint256 stakingEpoch = stakingContract.stakingEpoch(); if (stakingEpoch == 0) { return 0; } ...
1,773,681
/** *Submitted for verification at Etherscan.io on 2021-04-08 */ /// SPDX-License-Identifier: MIT /* โ–„โ–„โ–ˆ โ–„ โ–ˆโ–ˆ โ–ˆโ–„โ–„โ–„โ–„ โ–„โ–ˆ โ–ˆโ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–„โ–€ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–ˆ โ–ˆโ–„โ–„โ–ˆ โ–ˆโ–€โ–€โ–Œ โ–ˆโ–ˆ โ–โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–โ–ˆ โ– โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ–ˆ โ– โ–ˆ โ–ˆโ–ˆ โ–ˆ โ–€ โ–€ */ /// Special thanks to Keno and Boring for rev...
Interface for depositing into and withdrawing from SushiBar.
interface ISushiBarBridge { function enter(uint256 amount) external; function leave(uint256 share) external; โ–„โ–„โ–ˆ โ–„ โ–ˆโ–ˆ โ–ˆโ–„โ–„โ–„โ–„ โ–„โ–ˆ pragma solidity 0.6.12; }
7,941,838
./partial_match/3/0xF529066918a1C7E9335673dD987B9b14677b7F03/sources/UtahSilver.sol
create new one by recursioncheck referrer active level
function updateG3Referrer(address userAddress, address referrerAddress, uint8 level) private { users[referrerAddress].G3Matrix[level].referrals.push(userAddress); if (users[referrerAddress].G3Matrix[level].referrals.length < 3) { emit NewUserPlace(userAddress, referrerAddress, 1, level,...
5,336,567
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface PotLike { function chi() external view returns (uint); function pie(address) external view returns (uint); function drip() external returns (uint); function join(uint) external; function exit(uint) external; } interface GemL...
Check caller is admin
function _setLiquidationIncentive(uint newLiquidationIncentiveMantissa) external returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_LIQUIDATION_INCENTIVE_OWNER_CHECK); } Exp memory newLiquidationIncentive = Exp({mantissa : ...
7,349,704
//Address: 0xc3c94e2d9a33ab18d5578bd63dfdaa3e0ea74a49 //Contract name: PyramidGame //Balance: 2.56695493 Ether //Verification Date: 9/29/2017 //Transacion Count: 3244 // CODE STARTS HERE pragma solidity ^0.4.17; contract PyramidGame { ///////////////////////////////////////////// // Game parameters uint...
// Withdrawing balance The user must have enough balance to withdraw Subtract the withdrawn amount from the user's balance Transfer the amount to the user's address If the transfer() call fails an exception will be thrown, and therefore the user's balance will be automatically restored
function withdrawBalance(uint256 amountToWithdraw) external { require(amountToWithdraw != 0); require(addressBalances[msg.sender] >= amountToWithdraw); addressBalances[msg.sender] -= amountToWithdraw; msg.sender.transfer(amountToWithdraw); }
1,045,741
// SPDX-License-Identifier: MIT pragma solidity =0.6.12; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import './GoSwapERC20.sol'; import './libraries/Math.sol'; import './libraries/UQ112x112.sol'; import './interfaces/IGoSwapFactory.sol'; import './interfaces/IGoSwapPair.sol'; import './interfaces/IGoSwapC...
่ฟ”ๅ›žprice0CumulativeLast/
function price0CumulativeLast() public view returns (uint256) { return priceCumulativeLasts[0]; }
6,343,715
./full_match/80001/0x3d3822Af430137DC5150cc20067b8c6a49D342e9/sources/contracts/ToastUpgradeable.sol
check if max supply for each token will be exceededrequire(isAdmin(msg.sender), "user is not an admin");mint
function toastManyToMany( address[] memory tos_, uint256[] memory ids_, uint256[] memory amounts_, bytes memory data_ ) external whenNotPaused { require( tos_.length == ids_.length && tos_.length == amounts_.length, "airdropSingleToMany: Array leng...
5,633,889
./full_match/137/0x05E309C97317d8abc0f7e78185FC966FfbD2CEC0/sources/_aave/core-v3/contracts/protocol/libraries/configuration/UserConfiguration.sol
Checks if a user has been borrowing only one asset this uses a simple trick - if a number is a power of two (only one bit set) then n & (n - 1) == 0 self The configuration object return True if the user has been supplying as collateral one reserve, false otherwise/
function isBorrowingOne(DataTypes.UserConfigurationMap memory self) internal pure returns (bool) { uint256 borrowingData = self.data & BORROWING_MASK; return borrowingData != 0 && (borrowingData & (borrowingData - 1) == 0); }
3,753,725
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.4; import "./ERC9981155Extension.sol"; import "./ERC998ERC20Extension.sol"; import "../utils/ContractKeys.sol"; import "../interfaces/IBundleBuilder.sol"; import "../interfaces/INftfiBundler.sol"; import "../interfaces/INftfiHub.sol"; import "../interfaces/IPer...
Get the parent tokenId and its owner of a ERC721 child token _childContract The contract address of the child token _childTokenId The tokenId of the child return parentTokenOwner The parent address of the parent token and ERC998 magic value return parentTokenId The parent tokenId of _childTokenId/ solhint-disable-nex...
function ownerOfChild(address _childContract, uint256 _childTokenId) external view virtual override returns (bytes32 parentTokenOwner, uint256 parentTokenId) { parentTokenId = childTokenOwner[_childContract][_childTokenId]; require(parentTokenId != 0, "own...
1,483,271
pragma solidity ^0.5.11; import "./interfaces/MTicketProcessor.sol"; import "./interfaces/MContractRegistry.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; contract MixinTicketProcessor is MContractRegistry, MTicketProcessor { using SafeMath for uint256; // Number of rounds that a ticket i...
Process sent funds. _amount Amount of funds sent/ Send funds to Minter
function processFunding(uint256 _amount) internal { minter().depositETH.value(_amount)(); }
12,895,105
pragma solidity ^0.5.7; library SafeMath { int256 constant private in...
inject NONSTANDARD NAMING
function MUL578(uint256 a, uint256 b) internal pure returns (uint256) {
12,598,010
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts...
IERC20(iron).safeIncreaseAllowance(osIron3poolSwap, _ironBal); uint256 _outputAmount = IOneSwap(osIron3poolSwap).swap(1, 0, _ironBal, 1, now.add(60)); IRON (1) -> 3FBIRD (0) emit SwapToken(iron, os3FBird, _ironBal, _outputAmount);
function collectOneSwapFees() public checkPublicAllow { IOneSwap(os3FBirdSwap).withdrawAdminFees(); IOneSwap(osIron3poolSwap).withdrawAdminFees(); uint8 _daiIndex = IOneSwap(os3FBirdSwap).getTokenIndex(dai); uint8 _usdcIndex = IOneSwap(os3FBirdSwap).getTokenIndex(usdc); uint8...
2,555,606
pragma solidity 0.4.24; /** * @title SafeMathInt * @dev Math operations for int256 with overflow safety checks. */ library SafeMathInt { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); /** * @dev Multiplies two int256 variables and f...
Division of two int256 variables and fails on overflow./ Prevent overflow when dividing MIN_INT256 by -1 Solidity already throws when dividing by 0.
function div(int256 a, int256 b) internal pure returns (int256) { require(b != -1 || a != MIN_INT256); return a / b; }
6,944,649
./partial_match/1/0xBCF85224fc0756B9Fa45aA7892530B47e10b6433/sources/src/v0.8/dev/vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol
Utility function that converts the msg.sender viewed in the L2 to the address in the L1 that submitted a tx to the inbox l1Address L2 address as viewed in msg.sender return l2Address the address in the L1 that triggered the tx to L2
function applyL1ToL2Alias(address l1Address) internal pure returns (address l2Address) { unchecked { l2Address = address(uint160(l1Address) + offset); } }
4,176,175
/** *Submitted for verification at Etherscan.io on 2022-05-05 */ // File: @openzeppelin/contracts/utils/Address.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev ...
verify that msg.sender corresponds to Merkle leaf verify that (leaf, proof) matches the Merkle root
function presaleMint( uint256 amount, bytes32 leaf, bytes32[] memory proof ) external payable { require(whitelistMintActive, "Whitelist mint not active"); require(keccak256(abi.encodePacked(msg.sender)) == leaf, "Sender doesn't match Merkle leaf"); require(verif...
7,631,825
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "./b...
Truncates a fixed point decimal into an unsigned 256-bit integer. return The integer portion of the fixed point decimal./
function truncate(Number memory self) internal pure returns (uint256) { return self.n / ONE; }
157,651
./partial_match/1/0x59BC239cAb00CADd9b14f299835ae39E8B4B569c/sources/contracts/protocol/libraries/configuration/UserConfiguration.sol
Used to validate if a user has been using the reserve for borrowing or as collateral self The configuration object reserveIndex The index of the reserve in the bitmap return True if the user has been using a reserve for borrowing or as collateral, false otherwise/
function isUsingAsCollateralOrBorrowing( DataTypes.UserConfigurationMap memory self, uint256 reserveIndex ) internal pure returns (bool) { require(reserveIndex < 128, Errors.UL_INVALID_INDEX); return (self.data >> (reserveIndex * 2)) & 3 != 0; }
15,931,697
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ ...
Deployment ERC20 Standard 3Pool Admin functions
interface IStableSwap3Pool { function __init__(address _owner, address[3] memory _coins, address _pool_token, uint256 _A, uint256 _fee, uint256 _admin_fee) external; function decimals() external view returns (uint); function transfer(address _to, uint _value) external returns (uint256); function transferFrom(addre...
1,120,169
./full_match/43113/0x811D7BC0A3F7B1F88aBc0889F142E81dB783fE3C/sources/contracts/lendingPool/LendingPool.sol
Check to see if user has enough funds, and amount > 0 Updates User balance burn eToken
function withdraw(uint256 _amount) external { require(_balances[msg.sender] >= _amount && _amount > 0); _balances[msg.sender] = _balances[msg.sender].sub(_amount); _poolTokenSupply = _poolTokenSupply.sub(_amount); _burn(msg.sender, _amount); poolToken.safeTrans...
7,107,894
./full_match/1/0x3f4DD25BA6Fb6441Bfd1a869Cbda6a511966456D/sources/src/HoneyJar.sol
Token URI will be a generic URI at first. When isGenerated is set to true, it will concat the baseURI & tokenID
function tokenURI(uint256 tokenId) public view override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return isGenerated ? string.concat(baseURI, tokenId.toString()) : baseURI; }
3,093,379
./full_match/4/0x13BD713fd0D45D4B59c257B918a981883Cbc65D5/sources/contracts/ERC721Tradable.sol
This is used instead of msg.sender as transactions won't be sent by the original token owner, but by OpenSea./
function _msgSender() internal view override returns (address sender) { return ContextMixin.msgSender(); }
726,495
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {FeeSharingSetter} from "./FeeSharingSetter.sol"; import {TokenSplitter} from "./TokenSplitter.sol"; /** * @title OperatorControllerForRewards * @notice It splits pending LOOKS and upd...
Deposit staked tokens and compounds pending rewards amount amount to deposit (in LOOKS)/ Update pool information Transfer LOOKS tokens to this contract If not new deposit, calculate pending rewards (for auto-compounding)
function deposit(uint256 amount) external nonReentrant { require(amount > 0, "Deposit: Amount must be > 0"); _updatePool(); looksRareToken.safeTransferFrom(msg.sender, address(this), amount); uint256 pendingRewards; if (userInfo[msg.sender].amount > 0) { pendi...
515,008
pragma solidity ^0.5.17; import "./PermissionsUpgradable.sol"; /** @title Node manager contract * @notice This contract holds implementation logic for all node management functionality. This can be called only by the implementation contract. There are few view functions exposed as public and can be called di...
called at the time of new org creation to add node to org _enodeId enode id _ip IP of node _port tcp port of node _raftport raft port of node _orgId org id to which the enode belongs/
function addNode(string memory _enodeId, string memory _ip, uint16 _port, uint16 _raftport, string memory _orgId) public onlyImplementation enodeDoesNotExists(_enodeId) { numberOfNodes++; enodeIdToIndex[keccak256(abi.encode(_enodeId))] = numberOfNodes; nodeList.push(NodeDetails(_enod...
12,561,409
pragma solidity ^0.4.25; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // --------------------------------------------...
Get the number of transaction records for the given wallet and type wallet The address of the concerned wallet _type The transaction type return The count of transaction records
function count(address wallet, bytes32 _type) public view returns (uint256) { return transactionLogByWalletType[wallet][_type].records.length; }
12,607,770
pragma solidity ^0.5.7; contract AuraToken { mapping (address => uint256) balances; uint256 totalSupply; uint256 freeSupply; address owner1; address owner2; address owner3; string public name; //fancy name: eg Simon Bucks uint8 public decimals; //How ma...
must be signed from owner1
function printTokens(uint256 _amount) public {
5,437,060