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 pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./libs/IUniRouter02.sol"; import "./libs/IWETH.sol"; interface IToken { ...
Update pool limit per user Only callable by owner. _hasUserLimit: whether the limit remains forced _poolLimitPerUser: new pool limit per user/
function updatePoolLimitPerUser( bool _hasUserLimit, uint256 _poolLimitPerUser) external onlyOwner { if (_hasUserLimit) { require( _poolLimitPerUser > poolLimitPerUser, "New limit must be higher" ); poolLimitPerUser = _poolLimitPerUser; ...
14,648,913
./full_match/5/0xba4774D478cb128434F2354abA0e594bd5e7680D/sources/contracts/guild-core/GuildXP.sol
The burn function allows the guild contract to burn XP tokens. Requirements: - The caller must be the guild contract. from The address from which the tokens will be burned. amount The amount of tokens to be burned./
function burn(address from, uint256 amount) external onlyGuildContract { _burn(from, amount); }
7,052,645
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma abicoder v2; import "AccessControl.sol"; import "StorageStateCommittee.sol"; import { SafeMath } from "SafeMath.sol"; import { IERC20 } from "IERC20.sol"; import { IDAOCommittee } from "IDAOCommittee.sol"; import { ICandidate } from "ICandidate.sol"; imp...
Set new quorum _quorum New quorum
function setQuorum( uint256 _quorum ) public override onlyOwner validAgendaManager { require(_quorum > maxMember.div(2), "DAOCommittee: invalid quorum"); require(_quorum <= maxMember, "DAOCommittee: quorum exceed max member"); quorum = _quorum;...
14,550,880
//SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the am...
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...
10,376,328
./full_match/44787/0xeeC5e4793d6A343E2f0ACB1F243d8C02fa26B92f/sources/project_/contracts/Kickstart.sol
/ if the user has not already been added as an approver Add user to approvals list increase approvals count
A function for contributing to a campaign, the user must input value must be more than the minimum contribution function contribute() public nonReentrant payable { if(!approvers[msg.sender]) { addApprover(msg.sender); increaseApprovers(); } }
13,258,017
pragma solidity ^0.5.0; import "./Token.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; // Community vetted and trusted! // TODO: // [X] Set the Fee Account // [X] Deposit Ether // [X] Withdraw Ether // [X] Deposit Tokens // [X] Withdraw Tokens // [X] Check Balances // [X] Make Order // [X] Cancel...
Solving a problem before it happens with this Fetch order Mark as filled
function fillOrder(uint256 _id) public { require(_id > 0 && _id <= orderCount); require(!orderFilled[_id]); require(!orderCancelled[_id]); _Order storage _order = orders[_id]; _trade(_order.id, _order.user, _order.tokenGet, _order.amountGet, _order.tokenGive, _order.amountGiv...
12,788,431
./partial_match/1/0x1F832091fAf289Ed4f50FE7418cFbD2611225d46/sources/Nest_NToken.sol
Approval method spender Approval target value Approval amount return Whether the approval is successful/
function approve(address spender, uint256 value) override public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; }
4,302,683
./partial_match/1/0x7474Eca2Db1A4c5d1a4C2143ECE3757525347b15/sources/DLHL.sol
exclude from paying fees or having max transaction amount
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } constructor() ERC20("DOOLY HOOLY", "DLHL") { address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c65...
9,302,626
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (stri...
gets total ether owed per whale./
function _getTotalEtherOwedPerWhale() internal view returns (uint256) { uint256 etherOwed = (_getTotalEther()/800); return etherOwed; }
352,007
pragma solidity 0.5.17; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol"; import "./TokenStaking.sol"; import "./cryptography/BLS.sol"; import "./utils/AddressArrayUtils.sol"; import "./utils/PercentUtils.sol"; import "./libraries/operator/G...
Returns fee for entry verification in wei. Does not include group profit fee, DKG contribution or callback fee./
function entryVerificationFee() public view returns (uint256) { return entryVerificationGasEstimate.mul(gasPriceCeiling); }
1,840,304
./partial_match/1/0x44383018ecf3DBED34eE621439a5Ff6002e8209b/sources/contracts/libraries/GovernanceUtilV1.sol
Unstake timestamp of the account Last unstake timestamp --------------------------------------------------------------------- Amount unstaken by the account Amount unstaken by everyone --------------------------------------------------------------------- Reward received by the account Total reward received Total burned...
function updateUnstakeDetailsInternal( IStore s, address account, bytes32 coverKey, bytes32 productKey, uint256 incidentDate, uint256 originalStake, uint256 reward, uint256 burned, uint256 reporterFee ) external { bytes32 k = keccak256(abi.encodePacked(ProtoUtilV1.NS_GOVERNAN...
10,998,099
pragma solidity ^0.5.0; /** * @title Offering * @dev Contains base logic for an offering and is meant to be extended. */ import "@ensdomains/ens/contracts/ENS.sol"; import "@ensdomains/ens/contracts/HashRegistrar.sol"; import "./OfferingRegistry.sol"; import "openzeppelin-solidity/contracts/utils/Address.sol"; co...
Unregisters offering for not displaying it in UI Cannot be run if contract has ownership or it was already transferred to new owner/ New owner is not really this address, but it's the way to recogize if offering was unregistered without having separate var for it, which is costly
function unregister() public onlyOriginalOwner onlyWithoutNewOwner onlyWhenContractIsNotNodeOwner { offering.newOwner = address(0xdeaddead); fireOnChanged("unregister"); }
5,535,004
pragma solidity 0.6.12; // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/CarefulMath.sol //Copyright 2020 Compound Labs, Inc. //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: //1. ...
wepiggy's IInterestRateModel Interface wepiggy/
interface IInterestRateModel { function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint); function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view returns (uint); } }
36,561
./full_match/80001/0x18cE94D4b70dd064532127275dBf02A7Bf9f5B8C/sources/contracts/Tasks/Tasks.sol
@inheritdoc ITasksif (_requestType == RequestType.CancelTask) {
function executeRequest( uint256 _taskId, RequestType _requestType, uint8 _requestId ) external { _ensureNotDisabled(); Task storage task = _getTask(_taskId); _ensureTaskIsTaken(task); { _ensureCancelTaskRequestExists(task, _requestId); ...
844,055
pragma solidity ^0.4.23; import "./DateTime.sol"; contract GuesserStorage is DateTime{ // Data structures struct GuessStruct { string title; string description; bytes32 topic; address creator; /* The voters and the option the voted * It will store an array which hasguessesByAddress *...
Function that returns the final date of a guess _index uint256 The description of the Guess return uint128 The final date of the guess/
function getGuessVotersOption (uint256 _index, address _address, uint8 _option) isOwner external view returns (uint128) { require (_option == 0 || _option == 1 || _option == 2); return guesses[_index].votersOption[_address][_option]; }
2,561,101
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./OpenBooks.sol"; import "./EnumerablePrices.sol"; //Pausable Contract /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inherit...
Gets the price of a list of book ids _bookIds an array of bookids return bookPrices an array of the price of each book in its corresponding index in _bookIds
function getPrices(uint[] memory _bookIds) public view returns(uint[] memory bookPrices){ bookPrices = new uint[](_bookIds.length); for(uint i=0; i < _bookIds.length; i++){ uint bookId = _bookIds[i]; (openBooks.exists(bookId) && prices.contains(bookId)) ? bo...
5,345,986
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.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 no...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.e...
11,679,349
/* Copyright 2020 Set Labs Inc. 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...
Returns the new incentive fee. The calculation for the fee involves implying mint quantity so that the feeRecipient owns the fee percentage of the entire supply of the Set. The formula to solve for fee is: feeQuantity / feeQuantity + totalSupply = fee / scaleFactor The simplified formula utilized below is: feeQuantity ...
function calculateIncentiveFeeInflation( uint256 _feePercentage ) internal view returns(uint256) { uint256 a = _feePercentage.mul(totalSupply()); uint256 b = CommonMath.scaleFactor().sub(_feePercentage); return a.div(b); }
6,479,352
./full_match/1/0xA138cC52e9baA400c1105Debb42904AFD9cbFB59/sources/contracts/bootjack0.sol
Get the hash of the senders address, the runners tokenId, and the key passed This way the key will be different for everyone and they can't just share With a difficulty of 2 we require the last 2 bits to be 0 which gives a 25% hit rate
function claim(uint256 _mintAmount, string calldata key) public payable { require(_mintAmount > 0); require(_mintAmount <= 10); require(mintInfo.nextTokenId + _mintAmount <= mintInfo.maxSupply); bytes32 sig = keccak256(abi.encodePacked(msg.sender, key)); uint256 bits = uint2...
8,302,359
./full_match/1/0x41cB4a771FdD019ADBF4685bd4885fbBeedE1784/sources/contracts/EvilNoundlesVRF.sol
Pick a evil noundle randomly from our list.
function percentChance(uint256 index, uint256 total, uint256 chance) internal returns(bool) { if((RandomNumber.getRandomNumber(index) % total) < chance){ return true; return false; } }
3,121,516
// SPDX-License-Identifier: MIT pragma solidity 0.8.1; import "./interfaces/IMySpace.sol"; import "./interfaces/IRegistry.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IBlackListAgent.sol"; import "./libraries/SafeMath256.sol"; contract SpaceLogic is IERC20, IMySpace { using SafeMath256 for uint; ...
Returns the Id of the next vote
function getNextVoteId() external view override returns (uint64) { return nextVoteId; }
7,277,824
./partial_match/3/0x35f84eaF86B3860D42D8C6A851082E226b3100B2/sources/SeekRewardsDex.sol
tradeAddress 0- makertokenAddress 1- makeruserAddress 2 - takertokenaddress 3 - takeruseraddress if maker buy or sell but receiving amt is fee token
function makeOrder(uint128[8] memory makerOrder, uint128[8] memory takerOrder,address[4] memory tradeAddress,uint8[2] memory v,bytes32[4] memory rs) onlyFeeAddress public returns(bool){ require(tradeOrders[makerOrder[0]]!=true && tradeOrders[takerOrder[0]] !=true); uint256 amount__m; uint25...
5,193,032
/* ███████╗████████╗██╗ ██╗███████╗██████╗ ███████╗██╗ ██╗███╗ ███╗ ██╔════╝╚══██╔══╝██║ ██║██╔════╝██╔══██╗██╔════╝██║ ██║████╗ ████║ █████╗ ██║ ███████║█████╗ ██████╔╝█████╗ ██║ ██║██╔████╔██║ ██╔══╝ ██║ ██╔══██║██╔══╝ ██╔══██╗██╔══╝ ██║ ██║██║╚██╔╝██║ ███████╗ █...
Edits the amount of an open order. @_index is the ID of the order. @_storeOfValue refers to a "Store of value" order (True) or to a "Price increase bet" order (False). @_amount is the new amount for this specific order./ Edit an existing "Store of value" order Edit an existing "Price increase bet" order
function editOpenOrder(uint _index, bool _storeOfValue, uint128 _amount) external onlyLogicContract payable returns(bool) { if (_storeOfValue) { openOrdersStoreOfValue[_index].amount = _amount; return true; } else { openOrdersPriceIncrease[_index].amount =...
917,124
./partial_match/1/0xEcCbB13D8d2b04D2e6E5aF5Fa579E0632f64AC41/sources/MasterChef.sol
Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
function add(uint256 _allocPoint, IBEP20 _lpToken, uint16 _depositFeeBP, uint16 _withdrawFeeBP, bool _withUpdate) public onlyAdmin { require(_depositFeeBP <= 10000, "add: invalid deposit fee basis points"); require(_withdrawFeeBP <= 10000, "add: invalid withdraw fee basis points"); if (_with...
4,045,097
/** *Submitted for verification at Etherscan.io on 2021-11-14 */ // Sources flattened with hardhat v2.6.3 https://hardhat.org // File @openzeppelin/contracts/utils/introspection/[email protected] // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in th...
Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings./ opensea mainnet Whitelist OpenSea proxy contract for easy trading.
function isApprovedForAll(address owner, address operator) public view override returns (bool) { ProxyRegistry proxyRegistry = ProxyRegistry( 0xa5409ec958C83C3f309868babACA7c86DCB077c1 ); if (address(proxyRegistry.proxies(owner)) == operator) ...
1,992,960
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "../Token.sol"; contract Core { // Token SRXToken public token; // Tokenomics uint public opsRateBIPS; // fee rate for operations uint public reserveBalance; // must be tracked for staking mechanism address...
Internal function that refunds an amount of reserve token for the given tokens. The given tokens are burned./
function _sell(uint tenderAmount) internal { require(tenderAmount > 0, "Tendered amount must be greater than zero"); require(token.balanceOf(msg.sender) >= tenderAmount, "Insufficient tokens to sell"); uint refundAmount = calculateRefundAmount(tenderAmount); token.burn(msg.s...
12,711,565
//SPDX-License-Identifier: MIT pragma solidity ^0.7.4; // pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "./IRegistry.sol"; /** * @title Registry contract storing information about all refunders deployed * Used for querying and reverse querying available refund...
Returns the refunder address for a given combination of target + identifier transaction at the specified index target the target contract of the refundable transaction identifier the function identifier of the refundable transaction index the index of the refunder in the set of refunders/
function getRefunderForAtIndex( address target, bytes4 identifier, uint256 index ) external view override returns (address) { require( index < aggregatedRefundables[target][identifier].length(), "Registry: Invalid index" ); return aggregat...
6,366,608
//Address: 0x5c7621f7afb14b9ab20fefede40b428d9b4429f2 //Contract name: Gelios //Balance: 0 Ether //Verification Date: 1/20/2018 //Transacion Count: 87 // CODE STARTS HERE pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function...
transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance.
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); retu...
1,830,432
// 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...
When `flashLoan` is called on the Vault, it invokes the `receiveFlashLoan` hook on the recipient. At the time of the call, the Vault will have transferred `amounts` for `tokens` to the recipient. Before this call returns, the recipient must have transferred `amounts` plus `feeAmounts` for each token back to the Vault, ...
interface IProtocolFeesCollector { event SwapFeePercentageChanged(uint256 newSwapFeePercentage); event FlashLoanFeePercentageChanged(uint256 newFlashLoanFeePercentage); function withdrawCollectedFees( IERC20[] calldata tokens, uint256[] calldata amounts, address recipient ) exte...
140,657
pragma solidity ^0.4.17; contract LandTest { // Contract owner address public owner; // BTC Marketcap Storage string public Result; string public qry; // Callback function event CallbackGetResult(); function LandTest() public { owner = msg.sender; } function updateResult() public returns...
Calls the callback function
function updateResult() public returns (string) { emit CallbackGetResult(); }
6,466,284
./full_match/97/0x5b0e4cc107Fd3B637454038767630F39B79B1d31/sources/contracts/ZamzamDAO.sol
Release the tokens of a Zamzam Project Releases `tokenAmount` tokens of a Zamzam project `projectId` to the admin wallet `_adminWallet` The Zamzam admin then releases the tokens to the appropriate addresses. projectId The ID of the project whose tokens will be released tokenAmount The amount of tokens which will be ...
function releaseFunds( uint256 projectId, uint256 tokenAmount, address receiver ) external nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) returns (bool) { Project storage project = projects[projectId]; require((project.totalRaised - project.totalSpent) >= tokenAmount, "ZamzamDAO: Insufficient funds")...
3,265,692
//Address: 0x6354e548ed3d3bdb8419e2c2eba574707c87e59e //Contract name: PeloponnesianToken //Balance: 0 Ether //Verification Date: 5/7/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.23; // File: contracts/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and p...
Transfers tokens from one address to another from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 the amount of tokens to be transferred/
function transferFrom(address from, address to, uint256 value) public onlyValidAddress(to) onlySufficientBalance(from, value) onlySufficientAllowance(from, to, value) returns (bool) { _balanceOf[from] = _balanceOf[from].sub(value); _balanceOf[to] = _balanc...
899,080
pragma solidity 0.4.23; import "./Ownable.sol"; /** @title User * @dev User is the base class for all'the users: Student, Professor and Admin */ contract User is Ownable { bytes private name; bytes private surname; bytes private socialNumber; uint private serial; /** @dev Constructor of User ...
get for user serial return uint the string of the serial/
function getSerial() public view returns(uint) { return serial; }
6,343,173
/* ___. .__ .__ __ \_ |__ __ __ ____ ____ _____ ____ ____ ___________ ___ _|__|_____ | | ____ ____ | | __ | __ \| | \_/ ___\/ ___\\__ \ / \_/ __ \...
One way deposit function
function depositToLOCK(uint256 amountToDeposit) public returns (bool) { buccInstance = BuccV2(v2Address); depositSlip += amountToDeposit; return buccInstance.transferFrom(msg.sender, address(this), amountToDeposit); }
10,088,587
./full_match/56/0x9390695b8b1a754F3db4DB6eD74A9f017b9aB2b4/sources/project_/src/contracts/Paychanger.sol
Release vested amount of tokens. vestingScheduleId the vesting schedule identifier amount the amount to release/address payable beneficiaryPayable = payable(vestingSchedule.beneficiary);_token.safeTransfer(beneficiaryPayable, amount);return amount;
function release( bytes32 vestingScheduleId, address beneficiary, uint256 amount ) public nonReentrant onlyIfVestingScheduleNotRevoked(vestingScheduleId){ VestingSchedule storage vestingSchedule = vestingSchedules[vestingScheduleId]; bool isBenefic...
3,229,663
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; // interface IERC20 { function TOTALSUPPLY439(...
inject NONSTANDARD NAMING
function _FUNCTIONCALLWITHVALUE882(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
7,317,036
./full_match/56/0xE3448D566A9A58EEABA31cdD9d126766627aB777/sources/project_/contracts/TroyBase.sol
Service function to revoke minter role this function can only be called by owner addr_ an address which is revorked minter role/
function revokeMinterRole(address addr_) public onlyOwner { require(addr_ != address(0), 'invalid address'); minters[addr_] = false; emit MinterRoleRevoked(addr_, _msgSender()); }
3,246,725
pragma solidity ^0.4.23; contract AppMockUtil { function getSelectors() public pure returns (bytes4[] memory selectors) { selectors = new bytes4[](27); // pay selectors[0] = this.pay0.selector; selectors[1] = this.pay1.selector; selectors[2] = this.pay2.selector; // std selectors[3] = th...
pay std emit mix inv rev update
function getSelectors() public pure returns (bytes4[] memory selectors) { selectors = new bytes4[](27); selectors[0] = this.pay0.selector; selectors[1] = this.pay1.selector; selectors[2] = this.pay2.selector; selectors[3] = this.std0.selector; selectors[4] = this.std1.selector; selectors[5...
12,568,003
./full_match/11155111/0x1C7F4AA5AabC26a8255DE9427d54b210A6040fd7/sources/PolarysPort/contracts/UtilsOperator.sol
Create the time to end the auction
function calculateEndTime() internal view returns (uint256) { uint256 currentTime = block.timestamp; return endTime; }
3,817,909
./full_match/11155111/0x043d0c1a4fd26A4713BF1f53135C56fb35eF1274/sources/project_/contracts/MekeRouter02.sol
LIBRARY FUNCTIONS
function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { return MekeLibrary.quote(amountA, reserveA, reserveB); }
3,798,105
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "./Utilities/contracts/token/BEP20/IBEP20.sol"; import "./Utilities/contracts/utils/EnumerableSet.sol"; import "./Utilities/contracts/token/BEP20/SafeBEP20.sol"; import "./Utilities//contracts/math/SafeMath.sol"; im...
harvest token against lock id _lockId lock id _index investment index/
function harvest(uint256 _lockId, uint256 _index) public { uint reward = rewardOf(msg.sender, _lockId, _index); require(reward > 0, "insufficient rewards"); StakeTracker storage account = accounts[msg.sender][_lockId]; account.rewards[_index] = 0; account.claimedAt[_...
14,114,059
pragma solidity ^0.4.15; import './interfaces/ERC20Interface.sol'; import './Crowdsale.sol'; /** * @title Token * @dev Contract that implements ERC20 token standard * Is deployed by `Crowdsale.sol`, keeps track of balances, etc. */ contract Token is ERC20Interface { // YOUR CODE HERE uint256 constant private MA...
Send _value amount of tokens to address _to
function transfer(address _to, uint256 _value) returns (bool success) { if(balances[msg.sender] >= _value){ balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } return false; }
7,308,137
// SPDX-License-Identifier: MIT /* .: :. */ /* :-- :-: _______ _ _______ */ /* -==- :==-. ( ____ \( ( /|( ____ \ */ /* . ==: .===: | ( \/| \ ( || ( ...
Returns ENSIP-10 resolver for name. _name The name to resolve, in normalised and DNS-encoded form (eg: sub.example.eth) return resolverAddr Found resolver for name. return resolverOwner DNS-encoded name which set the resolver (eg: example.eth)./
function resolver(bytes calldata _name) public view returns(address, bytes memory) { (address r,uint256 o,,) = resolver(_name, 0); return (r, _name[o:]); }
6,308,879
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @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...
Simple wrapper around uniswap amtOut Amount out maxIn Maximum tokens offered as input path Router path/
function _swapExactOut( uint256 amtOut, uint256 maxIn, address[] memory path ) internal returns (uint256) { IERC20(path[0]).ondoSafeIncreaseAllowance(address(uniRouter02), maxIn); return uniRouter02.swapTokensForExactTokens( amtOut, maxIn, path, address(this...
14,793,223
./full_match/80001/0x060da490c7c7123112931716093165b8b25bF33C/sources/contracts/WolfyStreetBetsv1.sol
poolStarted => 12hr "liquidity evolution cycle" a timebox for "natural" liquidity change in pools whereby: predictors can stake LPs can add liquidity LPs can withdraw liquidity post window => pools/liquidity are locked until the next cycle, providing a stable liquid market window also allows predictors to analyse befor...
function provideLiquidity(uint256 _amount, bool _isLowRisk) public { require(_amount > 0 , "Choose an amount!"); require(poolStarted, "Cannot provide liquidity outside of the pool cycle window!"); if (_msgSender() != owner()) { if (_isLowRisk) { LiquidityDetailsR...
865,334
./full_match/1/0x7af62458e41E2F490D2Df54A8FeDc56fFedB8c17/sources/lib/solady/src/tokens/WETH.sol
Deposits `amount` ETH of the caller and mints `amount` WETH to the caller. Emits a {Deposit} event. @solidity memory-safe-assembly Emit the {Deposit} event.
function deposit() public payable virtual { _mint(msg.sender, msg.value); assembly { mstore(0x00, callvalue()) log2(0x00, 0x20, _DEPOSIT_EVENT_SIGNATURE, caller()) } }
3,202,357
pragma solidity ^0.4.24; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence // input /home/yingtong/peacebridge/solidityflattery/DepositContract.sol // flattened : Friday, 05-Apr-19 05:40:40 UTC library SafeMath { function mul(uint256...
Decode an RLPItem into an address. This will not work if the RLPItem is a list. self The RLPItem. return The decoded string.
function toAddress(RLPItem memory self) internal constant returns (address data) { if(!isData(self)) revert(); var (rStartPos, len) = _decode(self); if (len != 20) revert(); assembly { data := div(mload(rStartPos), exp(256, 12)) } }
6,489,855
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * 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 settlement proposal disqualification candidate hash of the given wallet and currency wallet The address of the concerned wallet currency The concerned currency return The settlement proposal disqualification candidate hash
function proposalDisqualificationCandidateHash(address wallet, MonetaryTypesLib.Currency memory currency) public view returns (bytes32) { uint256 index = proposalIndexByWalletCurrency[wallet][currency.ct][currency.id]; require(0 != index, "No proposal found for wallet and currency [N...
12,574,721
//SPDX-License-Identifier: MIT // solhint-disable code-complexity pragma solidity 0.8.2; import "../common/BaseWithStorage/ImmutableERC721.sol"; import "../common/interfaces/ILandToken.sol"; import "../common/interfaces/IERC721MandatoryTokenReceiver.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initial...
solhint-disable no-unused-vars TODO require(sender != address(this), "from itself"); require(sender != address(0), "sender is zero address"); require(msg.sender == sender || _metaTransactionContracts[msg.sender] || _superOperators[msg.sender], "not _check_authorized"); require(sender == _pastOwnerOf(estateI...
function transferFromDestroyedEstate( address sender, ) external view { _check_authorized(sender, WITHDRAWAL); }
1,797,052
./full_match/1/0x5231617982e340a6651bd6357f15bc3461519b2b/sources/contracts/Marketplace.sol
generates a unique hash for an order order order struct/
function getOrderHash(Order calldata order) internal pure returns (bytes32) { if (order.askAny && order.ask.length == 1) { return keccak256( abi.encode( order.bid, order.ask[0].assetType, ...
17,072,066
./full_match/80001/0xeFF6F79E330A6A3Ac3E71211D27595830e6E4404/sources/contracts/2_Owner.sol
Change owner newOwner address of new owner/
function changeOwner(address newOwner) public { emit OwnerSet(owner, newOwner); owner = newOwner; }
5,700,332
./full_match/1/0xb474f03c2c1e15596260CDa307f7827cdD3Fb749/sources/src/BearCave.sol
Gatekeeper: for claiming free honeycomb BearCave: - maxMintableHoneyComb per Bear - maxClaimableHoneyComb per Bear Gatekeeper: (per bear) Gates: - maxHoneycombAvailable per gate - maxClaimable per gate x/ Gatekeeper tracks per-player/per-gate claims
function claim( uint256 bearId_, uint32 gateId, uint32 amount, bytes32[] calldata proof ) public { if (proof.length == 0) revert Claim_InvalidProof(); uint32 numClaim = gatekeeper.claim(bearId_, gateId, msg.sender, amount, proof); if (numClaim == 0) { ...
8,391,047
pragma solidity ^0.4.19; /* Interface for ERC20 Tokens */ contract Token { bytes32 public standard; bytes32 public name; bytes32 public symbol; uint256 public totalSupply; uint8 public decimals; bool public allowTransactions; mapping (address => uint256) public balanceOf; map...
Constructor function, initializes the contract and sets the core variables
function Exchange(address feeAccount_, uint256 makerFee_, uint256 takerFee_, uint256 inactivityReleasePeriod_) { owner = msg.sender; feeAccount = feeAccount_; inactivityReleasePeriod = inactivityReleasePeriod_; makerFee = makerFee_; takerFee = takerFee_; }
2,554,733
// SPDX-License-Identifier: MIT pragma solidity ^0.4.24; import "./SafeMath.sol"; import "./Ownable.sol"; import "./Pausable.sol"; import "./ERC20.sol"; /** * @title StandardToken */ contract StandardToken is ERC20 { using SafeMath for uint256; mapping (address => mapping (address => uint256)) internal allowed; ...
Mint new tokens account The address where new tokens are minted amount The number of tokens to mint/
function mint(address account, uint256 amount) onlyOwner public { totalSupply = totalSupply.add(amount); balances[account] = balances[account].add(amount); emit Mint(address(0), account, amount); emit Transfer(address(0), account, amount); }
6,365,049
./full_match/80001/0xB93146EF0C045F9672Eb89502cdcA3538c8Ea6a9/sources/project:/contracts/Event.sol
Return all the remaining amount of tickets/
function getRemainingAmountOfTickets( uint tier ) external view returns (Ticket memory) { return _tierToTicket[tier]; } _tier - the Tier being minted amount - amount of tokens to mint
863,686
./partial_match/1/0x3850952491606A0E420Eb929B1a2E1A450d013F1/sources/contracts/PanoVerse.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapRouter.WETH(); _approve(address(this), address(uniswapRouter), tokenAmount); uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenA...
2,821,785
// SPDX-License-Identifier: MIT pragma solidity >=0.4.21 <0.7.0; // product registration. // buyer buys the product. // buyer confirms delivery so money will be transferred to the seller contract FoodSupply{ uint counter = 1; // for productId struct Product{ string name; string details; address paya...
creating function registerProduct - to product registration. enter product details inculding who is seller
function registerProduct(string memory _name, string memory _details, uint _price, uint _quantity) public{ require(_price > 0, "Price should be greater than 0."); Product memory newProduct; newProduct.name = _name; newProduct.details = _details; newProduct.quantity = _quantity; newProduct.tot...
7,242,325
// File: contracts/interfaces/IMarketHandler.sol pragma solidity 0.6.12; /** * @title BiFi's market handler interface * @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo) */ interface IMarketHandler { function setCircuitBreaker(bool _emergency) external returns (bool); function setCircuitBreakWithOwn...
Get the amount of user's borrow userAddr The address of user return the amount of user's borrow/
function getUserIntraBorrowAmount(address payable userAddr) external view returns (uint256) { return handlerDataStorage.getUserIntraBorrowAmount(userAddr); }
1,420,280
pragma solidity 0.5.8; import "../TransferManager.sol"; import "../../../libraries/Encoder.sol"; import "../../../libraries/VersionUtils.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol"; import "./GeneralTransferManagerStorage.sol"; /** ...
Default implementation of verifyTransfer used by SecurityToken _from Address of the sender _to Address of the receiver/
function verifyTransfer( address _from, address _to, uint256 /*_amount*/, bytes memory /* _data */ ) public view returns(Result, bytes32) { return _verifyTransfer(_from, _to); }
12,951,695
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.7.6; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/introspection/ERC165.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/to...
/ Validate and perform the burn. Loop through each of the batched IDs to update storage of special balances and circulation balances. Retrieve the group ID from the given item `_id` and check burn. Update storage of special balances and circulating values.
This function allows an address to destroy multiple different items in a single call. @param _burner The address whose items are burning. @param _ids The item IDs to burn. @param _amounts The amounts of the corresponding item IDs to burn. function burnBatch(address _burner, uint256[] memory _ids,...
6,199,584
pragma solidity ^0.4.15; /** * @title Ownership interface * * Perminent ownership * * #created 01/10/2017 * #author Frank Bonnet */ contract IOwnership { /** * Returns true if `_account` is the current owner * * @param _account The address to test against */ functio...
Returns the fee that is paid in tokens when using the token changer return The percentage of tokens that is charged/
function getFee() public constant returns (uint) { return fee; }
12,596,265
./partial_match/1/0xd1B9aF64Ed5CdcaEb58955d82FB384b3e558Df7B/sources/ConvexStrategy.sol
Value of CRV/CVX available to claim, denoted in base asset calculations pulled directly from CVX's contract for minting CVX per CRV claimed mint if below total cliffs for reduction% take inverse of current cliff reduce supply cap check
function _claimableRewards() internal view returns (uint256) { uint256 crv = Rewards(rewardContract).earned(address(this)); uint256 supply = IERC20(CVX).totalSupply(); uint256 cvx; uint256 cliff = supply / REDUCTION_PER_CLIFF; if (cliff < TOTAL_CLIFFS) { uint256...
9,262,027
./full_match/1/0x0197f1081F28ed90815442821109Da9DcC1f23FD/sources/boom.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 { require(sender != address(0), 'ERC20: transfer from the zero address'); require(recipient != address(0), 'ERC20: transfer to the zero address'); require(!antiBotList[recipient]); ...
2,951,146
/* * Copyright 2018 ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wr...
Interface which all voting algorithms must implement./
interface VotingAlgInterface { function assess(uint32 numParticipants, uint32 numVotedFor, uint32 numVotedAgainst) external pure returns (bool); pragma solidity ^0.4.23; }
13,030,373
./full_match/11155111/0x86fa219b240CC02f8296fE88333Cca5EA4A7b7Fa/sources/project:/contracts/Forwarder.sol
Only whitelisted addresses are allowed to broadcast meta-transactions.
function addSenderToWhitelist(address sender) public onlyOwner { require( !isWhitelisted(sender), "AwlForwarder: sender address is already whitelisted" _senderWhitelist[sender] = true; emit AddressWhitelisted(sender); }
3,789,499
./full_match/1/0xB0E6275099ED9f7E83Cf56892491706DE7E4933B/sources/browser/flat-liqmigrator.sol
Approve uniswap router to spend token and weth
function AddLiqRLR() public onlyOwner { uint256 tokenBalance = getTokenBalance(tokenMigrator.RLR()); uint256 ethBalance = getTokenBalance(WETH); IERC20(tokenMigrator.RLR()).approve(UniRouter,tokenBalance); IERC20(WETH).approve(UniRouter,ethBalance); uniswapInterface.addLiqui...
9,642,693
/** *Submitted for verification at Etherscan.io on 2020-09-11 */ pragma solidity ^0.5.17; //////////////////////////////////////////////////////////////////////////////// contract Token { //----- VARIABLES address public owner; // Owner of this contract address public ...
--------------------------------------------------------------------------
function allowance(address walletAddress, address spender) public view returns (uint remaining) { return allowances[walletAddress][spender]; }
1,450,414
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.9.0 ; pragma experimental ABIEncoderV2; import "../client/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../client/node_modules/@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../client/node_modules/@open...
ERC20 Liquidity Pool Contract/
function initialize(address _logic, address _creator) public virtual payable initializer { require(_logic != address(0), "Logic Contract cannot be a zero address"); __Ownable_init(_creator); } @param => _tokenAmounts = list of amounts of each corresponding indexed token in _tokens ...
12,583,782
./full_match/1/0x588e3A2b9a94d45a1a132ac948f2377FE48f2625/sources/contracts/ParcelPayroll.sol
Renounce ownership of the contract This function is overridden to prevent renouncing ownership/
function renounceOwnership() public view override onlyOwner { revert CannotRenounceOwnership(); }
3,202,021
./full_match/1/0xbc75da5aD73EDF07B1Dd38c4b158f45318f30339/sources/project_/contracts/utils/EIP2981.sol
Resets royalty information for the token id back to the global default./
function resetTokenRoyalty(uint256 tokenId) external haveRights { _resetTokenRoyalty(tokenId); }
8,439,037
//Address: 0xfacc5b21597487575667dde047fc6e5d58bdae55 //Contract name: Crowdsale //Balance: 0 Ether //Verification Date: 12/18/2017 //Transacion Count: 3 // CODE STARTS HERE pragma solidity ^0.4.15; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the...
Receives a donation in Ether/ calculate profit share compare to all profit share will LT 49% add share to potential_investor
function receiveETH(address beneficiary) internal { require(!(coinToSend.add(coinSentToEther) > MAX_CAP)); Backer backer = backers[beneficiary]; backer.coinSent = backer.coinSent.add(coinToSend); multisigEther.send(msg.value); if (backer.weiReceived > MIN_INVEST_BUY) { LogInvestshare...
12,667,263
./partial_match/5/0xF549C95Cd7aE153bb194e9dE250E4D7963e1aCDc/sources/DigitalaxLPStaking.sol
Unstake without caring about rewards. EMERGENCY ONLY.
function emergencyUnstake() public { lpToken.safeTransfer(address(msg.sender), stakers[msg.sender].balance); emit EmergencyUnstake(msg.sender, stakers[msg.sender].balance); stakers[msg.sender].balance = 0; stakers[msg.sender].rewardsEarned = 0; }
16,849,137
//Compatible Solidity Compiler Version pragma solidity ^0.4.25; /* This FulizaLeo Token contract is based on the ERC20 token contract standard. Additional functionality has been integrated: */ contract FulizaLeoToken { string public constant name = "Fuliza Leo Token"; string public constant symbol = "FLT"; u...
spend FulizaLeoTokens from another Ethereum account that approves you as spender if you don't have enough balance, throw if you don't have approval, throw transfer and return true
function transferFrom(address from, address to, uint value) public returns (bool ok) { if(_balances[from] < value) revert(); if(_approvals[from][msg.sender] < value) revert(); if(!safeToAdd(_balances[to], value)) revert(); _approvals[from][msg.sender] -= value; _balances[from] -= value; ...
12,977,859
pragma solidity ^0.4.18; /** SafeMath libs are inspired by: * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol * There is debate as to whether this lib should use assert or require: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/565 * `require` is ...
Send karma to existing account.
function mint(address _addr, uint64 _amount) public onlyMod { require(members[_addr].canWithdrawPeriod != 0); members[_addr].karma = members[_addr].karma.add(_amount); totalSupply = totalSupply.add(_amount); Mint(_addr, _amount); }
1,037,158
./partial_match/1/0x2baC678732F231cad0e5e2CBefE60caa98FA9959/sources/PEH.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("peh", "PEH") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2...
3,887,636
pragma solidity ^0.4.24; contract owned { address public owner; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; // 18 decimals is the strongly suggested default, avoid changing it uint8 public decimals = 18; uint256 public totalSupply; ...
Check the contract token
function balanceOf(address addr) constant public returns (uint256) { return data.balanceOf(addr); }
6,520,988
./partial_match/1/0x6D699Fd31abCB651f2F49a4526160F9281076d69/sources/SmolMuseum.sol
Returns the total ting pending for a given address. Can include the bonus from TingBooster, if second param is set to true./
function totalPendingTingOfAddress(address _user, bool _includeTingBooster) public view returns (uint256) { uint256 totalTingPerDay = 0; uint256 length = cardSetList.length; for (uint256 i = 0; i < length; ++i) { uint256 setId = cardSetList[i]; CardSet storage set = c...
2,792,713
pragma solidity 0.5.10; pragma experimental "ABIEncoderV2"; /* solium-disable-next-line */ import "@counterfactual/cf-adjudicator-contracts/contracts/ChallengeRegistry.sol"; import "./libs/LibOutcome.sol"; /// @title ConditionalTransactionDelegateTarget /// @author Liam Horne - <liam@l4v.io> contract ConditionalTra...
solium-disable-next-line no-unused-vars
function executeEffectOfFreeBalance( ChallengeRegistry challengeRegistry, bytes32 freeBalanceAppIdentityHash, address multiAssetMultiPartyCoinTransferInterpreterAddress, bytes memory multiAssetMultiPartyCoinTransferInterpreterParams ) public { require( challengeRegistry.isStateFinali...
12,846,910
/** *Submitted for verification at Etherscan.io on 2022-05-03 */ // SPDX-License-Identifier: Unlicensed pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (by...
exclude from paying fees or having max transaction amount
constructor() ERC20("OsakaInu", "OSI") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_unis...
15,128,642
//SPDX-License-Identifier: GPL-3.0 pragma solidity 0.7.3; import { IManualVolatilityOracle } from "../interfaces/IManualVolatilityOracle.sol"; import {IPriceOracle} from "../interfaces/IPriceOracle.sol"; import {DSMath} from "../libraries/DSMath.sol"; import {IERC20Detailed} from "../interfaces/IERC20Detailed.sol"...
Calculates the option's delta ONLY used when spot oracle is denominated in USDC st is the strike price of the option expiryTimestamp is the unix timestamp of expiry return delta for given option. 4 decimals (ex: 8100 = 0.81 delta) as this is what strike selection module recognizes/
function getOptionDelta(uint256 st, uint256 expiryTimestamp) external view returns (uint256 delta) { require( expiryTimestamp > block.timestamp, "Expiry must be in the future!" ); uint256 spotPrice = priceOracle.latestAnswer(); (ui...
1,507,781
./full_match/80001/0x645711fd0ED87fC70968CA0FBe7F465DCD8b455A/sources/contracts/BiletsClub.sol
Owner can withdraws balance from contract. /
function OWNER_Withdraw() external payable onlyOwner { payable(owner()).transfer(address(this).balance); }
5,615,243
pragma solidity 0.6.6; library BullswapLibrary { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA...
refund dust eth, if any
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external virtual override payable ensure(deadline) returns (uint[] memory amounts) { require(path[0] == WETH, 'BullswapRouterMain: INVALID_PATH'); ...
7,516,900
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; import "./constants/Colors.sol"; /// @title Hair SVG generator library HairDetail { /// @dev Hair N°1 => Classic Brown function item_1() public pure returns (string memory) { return base(classi...
Hair N°2 => Classic Black
function item_2() public pure returns (string memory) { return base(classicHairs(Colors.BLACK)); }
1,028,746
./full_match/1/0xC1D9B5A0776d7C8B98b8A838e5a0DD1Bc5Fdd53C/sources/contracts/ZONE.sol
Gets the available votes balance for `account` regarding locked token account The address to get votes balance return The number of available votes balance for `account`/
function voteBalanceOf(address account) public view returns (uint256) { uint256 amount = _balances[account]; LockedToken[] memory lockedTokensRef = _lockedTokens[account]; uint256 length = lockedTokensRef.length; for (uint256 i = 0; i < length; i ++) { if (lockedTokensRe...
3,030,674
pragma solidity ^0.5.11; // Defines an ERC20 standard to be able to transfer to contract IERC20 { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _fr...
Updates the trades state - either removes or puts up the amount not sold back up for purchase If only part of trade was sold then update the trade as part soldRelease the lock, mark as part buy and remove the sold tokens Update
function _updateTradeState(string memory symbol, uint index, uint tokensTaken, uint amountLeftToSell) internal returns(bool){ if(tokensTaken < amountLeftToSell){ Trade memory existingTrade = _openTrades[symbol][index]; existingTrade.isBeingUsed = false; existingTrade.isBe...
12,831,704
pragma solidity ^0.5.1; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high l...
Check that the push is not too soon after the last one.
function pushReport(uint256 payload) external { require(payload > 0 ,"price must be positive"); address providerAddress = msg.sender; Report[2] storage reports = providerReports[providerAddress]; uint256[2] memory timestamps = [reports[0].timestamp, reports[1].timestamp]; ...
6,482,457
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; } } i...
Transfer tokens Send `_value` tokens to `_to` from your account _to The address of the recipient _value the amount to send/
function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); }
2,303
./full_match/1/0x703B792346D2A8306e2Ea990316CDb38EDAca753/sources/browser/BZX2.sol
bzLToken.approve(bzx1Address, (currentMaxLiq 100));handles eth, not sure if this path is ever takenhandles all other tokenshandles weth
function performTrade(bool isItEther, uint256 amount1) internal { uint256 startingETHBalance = address(this).balance; IERC20 tokenToReceive = IERC20(currentCToken); uint256 startingCBalance = tokenToReceive.balanceOf(address(this)); IERC20 bzLToken = IERC20(currentLToken); ...
2,948,369
pragma solidity ^0.6.12; //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // // LiquidityZAP takes ETH and converts to liquidity tokens. // // 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 Fr...
Add liquidity functions
function addLiquidityTokensOnly(address from, address payable to, uint amount) public returns (uint256 liquidity) { require(to != address(0), "LiquidityZAP: Invalid address"); uint256 buyAmount = amount.div(2); require(buyAmount > 0, "LiquidityZAP: Insufficient Token amount"); (uin...
12,740,882
// File: canonical-weth/contracts/WETH9.sol // Copyright (C) 2015, 2016, 2017 Dapphub // 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)...
SafeMath will check for zero denominator
function getPartialRoundHalfUp( uint256 target, uint256 numerator, uint256 denominator ) internal pure returns (uint256) { if (target == 0 || numerator == 0) { return SafeMath.div(0, denominator); } uint result = target.mul(...
6,397,613
pragma solidity ^0.5.17; // SPDX-License-Identifier: UNLICENSED import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contr...
Deposit LP tokens to MochiChef for mochi allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accMochiPerShare).div(1e12)...
12,733,926
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; pragma experimental ABIEncoderV2; import "./IBondingCurve.sol"; import "../refs/OracleRef.sol"; import "../pcv/PCVSplitter.sol"; import "../utils/Timed.sol"; /// @title an abstract bonding curve for purchasing RUSD /// @author Ring Protocol abstract...
sets the allocate incentive amount
function setIncentiveAmount(uint256 _incentiveAmount) external override onlyGovernor { incentiveAmount = _incentiveAmount; emit IncentiveAmountUpdate(_incentiveAmount); }
1,154,584
// File: ..\..\node_modules\@openzeppelin\contracts\utils\EnumerableSet.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are ad...
Destroys `amount` tokens from the caller. See {ERC20-_burn}./
function _beforeTokenTransfer( address from, address to, uint256 amount } function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); }
1,180,263
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "./LEGENDZ.sol";...
See {IERC721-ownerOf}./
function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require( owner != address(0), "ERC721: owner query for nonexistent token" ); return owner; }
1,206,797
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ // SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * se...
Interface of the child ERC20 token, for use on sidechains and L2 networks.
interface IERC20Child is IERC20 { function mint( address recipient, uint256 amount ) external; function burn( uint256 amount ) external; } }
6,781,742
./full_match/1/0xDaf6F80AD2AFdC45014c59bfE507ED728656D11B/sources/contracts/AuctionMarketplace.sol
Changes The Current NFT Address SaleIndex The Sale Index To Change NewAddress The New NFT Address/
function ___ChangeNFTAddress(uint SaleIndex, address NewAddress) external onlyAdmin { AuctionParams[SaleIndex]._NFT = NewAddress; }
3,006,961
pragma solidity >=0.6.0; // Copyright BigchainDB GmbH and Ocean Protocol contributors // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import "../interfaces/IERC20Template.sol"; import "../interfaces/IERC721Template.sol"; import "../interfaces/IFactoryRouter.sol"; imp...
mint Only the minter address can call it. msg.value should be higher than zero and gt or eq minting fee account refers to an address that token is going to be minted to. value refers to amount of tokens that is going to be minted./
function mint(address account, uint256 value) external { require( permissions[msg.sender].minter == true, "ERC20Template: NOT MINTER" ); require( totalSupply().add(value) <= _cap, "DataTokenTemplate: cap exceeded" ); _mint(accou...
6,489,075
/** Official Contract of Mandalorian Inu https://t.me/Mandalorian_Official */ pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory...
remove limits after token is stable - 30-60 minutes
function removeLimits() external onlyOwner returns (bool){ limitsInEffect = false; gasLimitActive = false; transferDelayEnabled = false; return true; }
621,382
./full_match/80001/0xD82650Ce9Dc0c05631ed86444C577fd65C4FE3cf/sources/contracts/SolyncoProfileMinter.sol
Check if the sender owns the token Check if the sender has the required role Update the token username
function updateTokenUsername( uint256 _tokenId, string calldata _username ) public onlyRole(SOLYEDITOR_ROLE) { require( msg.sender == tokenOwner[_tokenId], "Only token owner can update username" ); require( hasRole(SOLYEDITOR_ROLE, msg...
9,529,411
pragma solidity =0.6.6; import './interfaces/core/IBitswapFactory.sol'; import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; import './libraries/BitswapLibrary.sol'; import './interfaces/IBitswapRouter01.sol'; import './interfaces/IERC20.sol'; import './interfaces/IWETH.sol'; contract BitswapRouter01 is IBit...
REMOVE LIQUIDITY
function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) public override ensure(deadline) returns (uint amountA, uint amountB) { address pair = BitswapLibrary.pairFor(fa...
10,147,910