file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/84531/0x352526ec35BAFb288d2A1c302f6625e1ce85aaEa/sources/contracts/WeightedPoolProtocolFees.sol
Returns the contribution to the total rate product from a token with the given weight and rate provider./
function _getRateFactor(uint256 normalizedWeight, IRateProvider provider) internal view returns (uint256) { return provider == IRateProvider(0) ? FixedPoint.ONE : provider.getRate().powDown(normalizedWeight); }
14,299,096
/** * Copyright 2017-2020, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.8; pragma experimental ABIEncoderV2; import "./AdvancedToken.sol"; import "../shared/OracleNotifierInterface.sol"; interface IBZx { function takeOrderFromiToken( bytes...
.add(loanOrder.marginPremiumAmount); adjust value since interest is also borrowed
function getDepositAmountForBorrow( uint256 borrowAmount, public view returns (uint256 depositAmount) { if (borrowAmount != 0) { leverageAmount = uint256(keccak256(abi.encodePacked(leverageAmount,collateralTokenAddress))); LoanData memory loanOrder...
5,462,752
pragma solidity 0.5.16; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "./CompoundInteractor.sol"; import "./CompleteCToken.sol"; impor...
Returns the current balance. Ignores COMP that was not liquidated and invested./
function investedUnderlyingBalance() public view returns (uint256) { uint256 assets = underlying.balanceOf(address(this)).add(supplied); return borrowed > assets ? 0 : assets.sub(borrowed); }
14,124,644
./partial_match/1/0x25F2111008db4D99627bf62aEe5f3A311B82ff65/sources/BetDaddy.sol
team renounce blacklist commands
function renounceBlacklist() public onlyOwner { blacklistRenounced = true; }
15,678,647
// ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ODIN token contract // ---------------------------------------------------------------------------- pragma solidity ^0.4.21; library SafeMath { function mul(uint256 a, uint256 b) internal pu...
------------------------------------------------------------------------ not implemented ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) { return allowed[tokenOwner][spender]; }
1,769,872
./full_match/42/0x54f8211c36cAF632aC2cC848E1c8e81F37a79F36/sources/dex/Main.sol
address 0xd0A1E359811322d97991E03f863a0C30C2cF029C Kovan
interface WETH { function deposit() external payable; function withdraw(uint wad) external; function approve(address guy, uint wad) external returns (bool); function transfer(address dst, uint wad) external returns (bool); function transferFrom(address src, address dst, uint wad)external returns (bo...
9,590,115
// SPDX-License-Identifier: GPL-3.0-or-later // File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they ...
Allows the ERC pool contract to receive and send tokens/
function approve() public { RESERVE.safeApprove(address(POOL), uint(0)); DAI.safeApprove(address(CURVE), uint(0)); USDT.safeApprove(address(CURVE), uint(0)); USDC.safeApprove(address(CURVE), uint(0)); CRV3.safeApprove(address(YEARN), uint(0)); RESERV...
13,884,214
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Interface Imports */ import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol"; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { ...
Returns the integer division of two unsigned integers. Reverts with custom message on division by zero. The result is rounded towards zero. Counterpart to Solidity's `/` operator. Note: this function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming...
function div(uint256 a, uint256 b, string memory errorMessage) internal returns (uint256) { Lib_SafeExecutionManagerWrapper.safeREQUIRE(b > 0, errorMessage); uint256 c = a / b; return c; }
10,429,871
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/Constants.sol"; import { PoolParams } from "./interfaces/Types.sol"; import "./interfaces/IVestingPools.sol"; import "./utils/Claimable.sol"; import "./utils/DefaultOwnable.sol"; impor...
Returns amount that may be released for the given stake and factor imprecise division safeguard
function _releasableAmount(Stake memory stake, uint256 _factor) internal pure returns (uint256) { uint256 share = (_factor * uint256(stake.allocated)) / SCALE; if (share > stake.allocated) { share = uint256(stake.allocated); } return share - ui...
12,762,090
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; // IERC721 is the ERC721 interface that we´ll use to make Maniac´s NFT ERC721 import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; // IERC721Receiver must be implemented to accept safe transfers // It is included on the ERC721 standard import "@openzeppel...
Checks if Artwork exists
function _exists(uint256 NFTmaniacId) internal view returns (bool) { address owner = NFTmaniacToOwner[NFTmaniacId]; return owner != address(0); }
12,536,972
pragma solidity ^0.4.11; contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.va...
Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) public returns (bool success) { if(isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } }
232,968
./full_match/1/0xA1F18e3E99976AdA8F598458c6c0dc0b5c713Db4/sources/contracts/ElemintCollection.sol
For BaseUriBacktrackLength/
function getBaseUriBacktrackLength() external view returns (uint16) { return _getBaseUriBacktrackLength(); }
3,075,754
pragma solidity ^0.4.19; //0.4.19+commit /*--------------------------------------- ERC 20 Credit Washington Share Coin March 2, 2018 sale_pause remains false during ICO return_pause remains true during ICO -----------------------------------------*/ contract owned { address public owner; func...
Added by Credit Washington, March 2, 2018 Set the bool value of sale_pause _pauseSale the bool value
function set_pauseSale(bool _pauseSale) onlyOwner public { sale_pause=_pauseSale; }
15,436,286
pragma solidity 0.5.16; import "./UniswapERC20.sol"; import "./IUniswapFactory.sol"; import "./IUniswapExchange.sol"; contract MockUniswapExchange is UniswapERC20 { /***********************************| | Variables && Events | |__________________________________*/ // Variables bytes32 publi...
Public price function for ETH to Token trades with an exact output. tokens_bought Amount of Tokens bought. return Amount of ETH needed to buy output Tokens./
function getEthToTokenOutputPrice(uint256 tokens_bought) public view returns (uint256) { require(tokens_bought > 0); uint256 token_reserve = token.balanceOf(address(this)); uint256 eth_sold = getOutputPrice(tokens_bought, _ethBalance, token_reserve); return eth_sold; }
12,848,461
/** *Submitted for verification at Etherscan.io on 2020-08-13 */ // File: @aragon/os/contracts/common/UnstructuredStorage.sol /* * SPDX-License-Identifier: MIT */ import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; pragma solidity 0.6.12; library Uint256He...
Returns the current block number, converted to uint64. Using a function rather than `block.number` allows us to easily mock the block number in tests./
function getBlockNumber64() internal view returns (uint64) { return getBlockNumber().toUint64(); }
7,271,693
./full_match/80001/0xc415006ac51e0D8adD1CC6fcAc74b25721512dc7/sources/contracts/ERC721A.sol
If the data at the starting slot does not exist, start the scan. Invariant: There will always be an initialized ownership slot (i.e. `ownership.addr != address(0) && ownership.burned == false`) before an unintialized ownership slot (i.e. `ownership.addr == address(0) && ownership.burned == false`) Hence, `tokenId` will...
function _packedOwnershipOf( uint256 tokenId ) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; if (packed == 0) { if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexist...
835,995
./partial_match/4/0x40B4d33637e7b50c08D5AfC6499F49f6DBb4caaC/sources/REVVInventory.sol
See {IERC1155721InventoryBurnable-burnFrom(address,uint256,uint256)}./
function _burnFrom( address from, uint256 id, uint256 value ) internal virtual { address sender = _msgSender(); bool operatable = _isOperatable(from, sender); if (isFungible(id)) { _burnFungible(from, id, value, operatable); _burnNFT(from,...
8,519,795
/* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 ...
initial funding for the treasury: committer reward: contributor rewards:
function initialize() initializer public { }
994,633
pragma solidity ^0.4.13; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically t...
FALL BACK FUNCTION TO ALLOW ETHER DONATIONS Smallest investment is 0.00001 ether Investment periods Pre-sale ICO ICO Invalid investment period Apply Bonuses
function() payable { require(allowInvestment); uint256 amountOfWei = msg.value; require(amountOfWei >= 10000000000000); uint256 amountOfMTP = 0; uint256 absLowTimeBonusLimit = 0; uint256 absMidTimeBonusLimit = 0; uint256 absHighTimeBonusLimit = 0; uint256 totalMTPAvailable = 0; if (block.timestam...
6,571,647
pragma solidity ^0.5.0; interface HydroTokenTestnetInterface { function transfer(address _to, uint256 _amount) external returns (bool success); function transferFrom(address _from, address _to, uint256 _amount) external returns (bool success); function doTransfer(address _from, address _to, uint _amount) e...
To get the ein owner of a product for the dispute contract _id The id of the product return Returns the ein owner
function getProductEinOwner(uint256 _id) public view returns(uint256) { return productById[_id].einOwner; }
13,136,572
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/interfaces/IERC20.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import './ERC721B.sol'; import './IStrongService.sol'; /** * @title SNN contract * @dev...
Create Strong Node & Mint SNN/
function mint() external payable { require(isSale, "Sale must be active to mint"); uint256 supply = _owners.length; uint256 naasRequestingFeeInWei = strongService.naasRequestingFeeInWei(); uint256 naasStrongFeeInWei = strongService.naasStrongFeeInWei(); ...
6,157,229
./full_match/1/0x667101b3b2d9389b49F6d0527D974e87ebdceFE1/sources/contracts/SpyBot.sol
Trigger this post launch once price is more stable. Made to avoid whales and snipers hogging supply.
function updateLimitsAndFees( uint256 maxTx, uint256 _maxWallet, uint256 buyFees, uint256 sellFees ) external onlyOwner { maxTransactionAmount = maxTx; maxWallet = _maxWallet; buyTotalFees = buyFees; sellTotalFees = sellFees; }
16,502,364
pragma solidity ^0.5.8; /// @title A contract that is able to facilitate donations to different charities /// whenever a user wants to make a transfer of funds to another user. contract Charitable { address payable owner; address payable taxCollectAddress; uint256 taxPercent; uint256 totalDonationsAmou...
change tax percent newTaxPercent New tax percent
function setTaxAddress(uint256 newTaxPercent) public restrictToOwner() { require(newTaxPercent != 0); emit TaxPercentageTransferred(taxPercent, newTaxPercent); taxPercent = newTaxPercent; }
1,328,309
./full_match/5/0x4a10c90C0A6616e98336BBc5C521c628FA1Ed663/sources/contracts/contracts-v10/contracts/CheckerMaster.sol
Tasks --------------------
function isWorkerOnTask( uint256 _taskID, address _address ) public view returns (bool) { address worker = IStandardSubstrate(standardSubstrateAddress) .getTask(_taskID) .worker; if (worker == _address) { return true; } return f...
11,586,449
./partial_match/1/0x5094a8f54B12AEc540bF7cCd0Dd7B62f4FecF7f2/sources/Users/Elena/Source/argent-contracts/contracts/modules/TransferManager.sol
Lets the owner of a wallet change its daily limit. The limit is expressed in ETH. Changes to the limit take 24 hours. _wallet The target wallet. _newLimit The new limit./
function changeLimit(address _wallet, uint256 _newLimit) external onlyWalletOwnerOrFeature(_wallet) onlyWhenUnlocked(_wallet) { ILimitStorage.Limit memory limit = LimitUtils.changeLimit(limitStorage, versionManager, _wallet, _newLimit, securityPeriod); emit LimitChanged(_wallet, _newLimit, limit.cha...
9,255,163
./full_match/56/0xCA251B47A0A31A15251BfA0d6C58c6A6b152d902/sources/project_/contracts/0xb58f7b3de606df08abd86aab5ad51be01a83c3a2_CHEEMSCATV2_CATV2_2023-04-04_22-14-26.sol
Checks if an address is blacklisted return bool
function blacklisted(address account) external view virtual returns (bool) { return _blacklist[account]; } checks from or to addresses is blacklisted
3,227,693
pragma solidity ^0.4.21; import "./open-zeppelin/math/SafeMath.sol"; import "./FundToken.sol"; import "./FundWallet.sol"; import "./FundToken.sol"; import "./Fund.sol"; // @title FundOperator // @dev This class is a suggestion for an implementation of a multi-sig operator of the Fund class // Every function of the Fu...
Constructor which adds all hot accounts and trust party accounts to the fund. No more accounts of this type can be added at a later point. To change them redeploy a new version of all components. Does not allow for any duplicates. No trustparty accounts have to be added. _hotTreshold Amount of signatures from hot acco...
function FundOperator (uint256 _hotThreshold, uint256 _trustPartyThreshold, address[] _hotAccounts, address[] _trustPartyAccounts) public { require(_hotAccounts.length <= 10 && _hotAccounts.length != 0); require(_trustPartyAccounts.length <= 10); require(_hotThreshold <= _hotAcco...
12,681,095
// SPDX-License-Identifier: MIT-open-group pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "./utils/Admin.sol"; import "./utils/Mutex.sol"; import "./utils/MagicEthTransfer.sol"; import "./utils/EthSafeTransfer.sol"; import "./math/Sigmoid.sol"; import ".....
Mints a virtual deposit into the Madnet Chain without actually minting or burning any token. This function converts ether sent in Madbytes.
function _mintDeposit(uint8 accountType_, address to_, uint256 minMB_, uint256 numEth_) internal returns (uint256) { require(!_isContract(to_), "MadByte: Contracts cannot make MadBytes deposits!"); require(numEth_ >= _MARKET_SPREAD, "MadByte: requires at least 4 WEI"); numEth_ = numEth_/_MAR...
12,836,804
./full_match/1/0x16ec075B2faD51E2a6Cb549526FF484A13fAD147/sources/killa.sol
applies taxes, checks for limits, locks generates autoLP and stakingBNB, and autostakesrequire(senderBalance >= amount, "Transfer exceeds balance");If seller sold less than sellLockTime(2h) ago, sell is declined, can be disabled by Team require(_sellLock[sender]<=block.timestamp||sellLockDisabled,"Seller in sellLock");...
function _taxedTransfer(address sender, address recipient, uint256 amount,bool isBuy,bool isSell) private{ uint256 recipientBalance = _balances[recipient]; uint256 senderBalance = _balances[sender]; uint8 tax; if(isSell){ if(isBlacklist) { require(!_black...
3,108,788
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/ContractRegistryClient.sol"; import "../token/interfaces/IDSToken.sol"; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterFactory.sol"; import "./interfaces/IConverterRegistry.sol"; import "./interfaces/I...
adds a liquidity pool to the registry/
function _addLiquidityPool(IConverterRegistryData converterRegistryData, IConverterAnchor liquidityPoolAnchor) internal { converterRegistryData.addLiquidityPool(liquidityPoolAnchor); emit LiquidityPoolAdded(liquidityPoolAnchor); }
14,085,390
//Address: 0x45ea7f2514d6f0f99639682eb1feeafbf25fbbf4 //Contract name: BRDCrowdsaleAuthorizer //Balance: 0 Ether //Verification Date: 12/13/2017 //Transacion Count: 44 // CODE STARTS HERE pragma solidity ^0.4.18; // File: contracts/zeppelin-solidity-1.4/Ownable.sol /** * @title Ownable * @dev The Ownable contrac...
allow the provided address to authorize accounts
function addAuthorizer(address _newAuthorizer) onlyOwnerOrAuthorizer public { authorizers[_newAuthorizer] = true; }
5,372,695
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.10; import "hardhat/console.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract marketERC1155 is Ownable { event Transfer( address indexed from, address indexed to, uint256 id, uint256 amount ); eve...
cancel listing is possible if pending approval from admins/org
function cancelListing(uint256 id) public { require(assetOwner(msg.sender, id) == true); require(_listApproved[id] == false, "Asset is listed"); _listed[id] = false; _totalAssets -= _listedAmt[id]; emit CancelledListing(msg.sender, id); }
12,869,042
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; // Sources flattened with hardhat v2.8.4 https://hardhat.org // File contracts/Uniswap_V2_TWAMM/core/interfaces/IUniswapV2FactoryV5.sol interface IUniswapV2FactoryV5 { event PairCreated(address indexed token0, address indexed token1, address ...
event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8);...
interface IUniswapV2PairPartialV5 { event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, ...
1,349,923
./full_match/80001/0x4aFd677127a324F4d760499c8a7822a445905dF0/sources/contracts/ERC3525GettingStarted.sol
from_ がオペレーターかトークンの所有者であることの確認は重複するため不要 require( from_ == ownerOf(tokenId_) | msg.sender == owner, "ERC3525GettingStarted: transfer of token that is not owned" ); to が登録済であることを確認
function transfer( address from_, address to_, uint256 tokenId_ ) external payable { require( "ERC3525GettingStarted: transfer to unregistered recipient" ); transferFrom(from_, to_, tokenId_); }
9,496,861
./partial_match/3/0x798cEb69Da2dA7988b6248cE8800444408987466/sources/Identity.sol
Computes if the context in which the function is called is a constructor or not. return true if the context is a constructor./ solhint-disable-next-line no-inline-assembly
function _isConstructor() private view returns (bool) { address self = address(this); uint256 cs; return cs == 0; }
5,096,848
./partial_match/1/0x1699FE9CaDC8a0b6c93E06B62Ab4592a0fFEcF61/sources/src/contracts/voting/libs/RLPReader.sol
returns raw rlp encoding in bytes
function toRlpBytes( RLPItem memory item ) internal pure returns (bytes memory) { bytes memory result = new bytes(item.len); if (result.length == 0) return result; uint256 ptr; assembly { ptr := add(0x20, result) } copy(item.memPtr, ptr, item.len); return result; }
9,364,396
/** *Submitted for verification at Etherscan.io on 2022-04-11 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /////////////////////////////////////////////////////////////////////////// // __/| // __//// /| This smart contract is part of Mover infrastructure // |// //_/// https://viamove...
used to get funds from UBT invest proxy for withdrawal (if current amount to withdraw is insufficient) it is not possible to resize memory arrays, so declare sized one great, this node contract can provide funds no single Node contract has enough safe amount to get funds from, sort and pick largest ones to save gas as ...
function retrieveFunds(uint256 _amount) internal returns (uint256) { uint256 amountTotal = 0; uint256 length = stakeNodeContracts.length; uint256[] memory amounts = new uint256[](length); uint256[] memory indexes = new uint256[](length); for (uint256 i; i < length; i++) { ...
2,238,732
//Address: 0x872f634ce643a9b5a4d9bcfa0714382267839fcc //Contract name: JaroCoinCrowdsale //Balance: 3 wei //Verification Date: 5/30/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /...
Approve the passed address to spend tokens on behalf of msg.sender. This function is more authorizeOperator and revokeOperator from ERC777 that Approve from ERC20. so I prefer to use operator concept. If you want to revoke approval, just put 0 into _value. _spender The address which will spend the funds. _value Fake ...
function approve(address _spender, uint256 _value) public returns (bool) { require(_spender != msg.sender); if (_value > 0) { isOperatorFor[_spender][msg.sender] = true; emit AuthorizedOperator(_spender, msg.sender); isOperatorFor[_spender][msg.sender] = false; ...
7,316,319
./partial_match/1/0x27BE2e83c3D098625DDF98e687a9353f31646527/sources/contracts/Governor.sol
Cast a vote for a proposal with a reason proposalId The id of the proposal to vote on support The support value for the vote. 0=against, 1=for, 2=abstain reason The reason given for the vote by the voter/
function castVoteWithReason(uint256 proposalId, uint8 support, string calldata reason) public { emit VoteCast(msg.sender, proposalId, support, _castVoteInternal(msg.sender, proposalId, support), reason); }
16,092,480
pragma solidity ^0.5.0; import "./interfaces/SnowflakeInterface.sol"; import "./interfaces/IdentityRegistryInterface.sol"; /** * @title Ice Protocol * @author Harsh Rajat * @notice Create Protocol Less File Storage, Grouping, Hassle free Encryption / Decryption and Stamping using Snowflake * @dev This Contract fo...
Private Function to get global item via the record struct _rec is the GlobalRecord Struct/
function _getGlobalItemViaRecord(GlobalRecord memory _rec) internal pure returns (uint _i1, uint _i2) { _i1 = _rec.i1; _i2 = _rec.i2; }
2,542,281
./partial_match/1/0x8AD1BFAb08Fc8f5664cCa46E5E1C69B2f4619645/sources/contracts/EAPass.sol
Allow adjustment of mintable supply supply - Mintable supply, limited to the maximum supply/
function setMintableSupply(uint256 supply) external onlyOwner { require( supply >= _totalMinted() && supply <= MAX_SUPPLY, "Invalid Supply" ); mintableSupply = supply; }
15,776,783
/** * This smart contract code is Copyright 2019 TokenMarket Ltd. For more information see https://tokenmarket.net * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt * NatSpec is used intentionally to cover also other than public functions */ interface...
This mapping contains signature hashes which have been already used: / Mapping of all the attributes for all the users: / These can be used from other contracts to avoid typos with roles: / Interal function for setting the attributes, and emmiting the event user Address of the user whose attributes we would like to...
function writeAttributes(address user, uint256 newAttributes) internal { attributes[user] = newAttributes; emit AttributesSet(user, attributes[user]); }
948,692
./full_match/4/0xC209E294664C8Cb5B55EbF1CAE6CaCCd024Cb822/sources/contracts/ERC721A.sol
Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used)./
function _getAux(address owner) internal view virtual returns (uint64) { return uint64(_packedAddressData[owner] >> BITPOS_AUX); }
727,636
pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED interface IBEP20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); functio...
Resets buy lock of caller to the default buyLockTime should something go very wrong
function AddressResetBuyLock() public{ _buyLock[msg.sender]=block.timestamp+buyLockTime; }
965,469
./partial_match/3/0x2cE4dA983a7F2EaB54E2785A6E7c2Dc5DE600344/sources/contracts/FeeToSetter.sol
allows owner to change feeToSetter after vesting
function setFeeToSetter(address feeToSetter_) public { require(block.timestamp >= vestingEnd, 'FeeToSetter::setFeeToSetter: not time yet'); require(msg.sender == owner, 'FeeToSetter::setFeeToSetter: not allowed'); IValueswapV2Factory(factory).setFeeToSetter(feeToSetter_); }
5,057,907
pragma solidity ^0.7.0; /** * @title Aave v1. * @dev Lending & Borrowing. */ import { TokenInterface } from "../../../common/interfaces.sol"; import { Stores } from "../../../common/stores.sol"; import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; import { AaveInterface, AaveCoreInterfa...
Enable collateral Enable an array of tokens as collateral tokens Array of tokens to enable collateral/
function enableCollateral( address[] calldata tokens ) external payable returns (string memory _eventName, bytes memory _eventParam) { uint _length = tokens.length; require(_length > 0, "0-tokens-not-allowed"); AaveInterface aave = AaveInterface(aaveProvider.getLendingPool()); ...
12,637,882
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// This file is forked from Solmate v6, /// We stand on the shoulders of giants interface IERC721 { function ownerOf(uint256 tokenId) external view returns (address owner); } /// @notice Modern, minimalist, and gas efficient ERC-721 implementatio...
Underflow of the sender's balance is impossible because we check for ownership above and the recipient's balance can't realistically overflow.
function transferFrom( address from, address to, uint256 id ) public { require(from == ownerOf[id], "WRONG_FROM"); require(to != address(0), "INVALID_RECIPIENT"); require( msg.sender == from || msg.sender == getApproved[id] || isApprovedForAll[from][...
12,647,695
./full_match/4/0x78B1412CFE3370FF711779a3DB276C4a3B3Bb4F3/sources/contracts/nft/MatrixDao.sol
Returns the number of all minted tokens from an address _minter Minter address return minted Number of all minted tokens from the minter
function numberMinted(address _minter) external view returns (uint256 minted) { return _numberMinted(_minter); }
13,319,354
/*---------------------------------------------------------------------------------------------------------- Ethpixel - Ethereum based collaborative pixel art Official site: ethpixel.io J...
Update pixel information /
function putPixel(uint _index, address _owner, uint8 _color, uint88 _price) private { canvas[_index].owner = _owner; canvas[_index].color = _color; canvas[_index].price = _price; ------------------------------------------------------------------------------------------------------*/ ...
14,024,401
// File: @openzeppelin/contracts/math/SafeMath.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually...
Delete the specified loyalty account timestamp _rewardAddress of the loyalty account to perfornm the delete/ Validate calling address (msg.sender) Validate specified address Delete callers timestamp for specified address
function _deleteTimestamp(address _rewardAddress) internal { require(ISparkleTimestamp(timestampAddress).deleteTimestamp(_rewardAddress), 'Delete failed'); emit DeleteTimestampEvent(_rewardAddress); }
6,070,162
//File: contracts/lib/ens/AbstractENS.sol pragma solidity ^0.4.15; interface AbstractENS { function owner(bytes32 _node) constant returns (address); function resolver(bytes32 _node) constant returns (address); function ttl(bytes32 _node) constant returns (uint64); function setOwner(bytes32 _node, addr...
Function called by apps to check ACL on kernel or to check permission statu _who Sender of the original call _where Address of the app _where Identifier for a group of actions in app _how Permission parameters return boolean indicating whether the ACL allows the role or not/
function hasPermission(address _who, address _where, bytes32 _what, bytes memory _how) public view returns (bool) { uint256[] memory how; uint256 intsLength = _how.length / 32; assembly { mstore(how, intsLength) } }
1,637,520
pragma solidity ^0.5.0; import "./Ownership.sol"; import "@openzeppelin/upgrades/contracts/Initializable.sol"; contract DoorFactory { address[] public doorAddresses; event NewDoorCreated( address indexed doorOwner, address indexed doorAddress, string indexed doorName, uint tic...
assuming that the event creator is honest and will verify correctly
function setUserHasAttendedByOwner(address payable userAddress) public onlyOwner{ require(eventHasStarted, 'The event has not been started yet.'); require(users[userAddress].ticketStatus != AttendanceTypes.ATTENDED, 'User has already attended.'); users[userAddress].ticketStatus = AttendanceT...
12,552,822
import './_ErrorReporter.sol'; pragma solidity ^0.5.10; contract _CarefulMath is _ErrorReporter { /** * @dev Multiplies two numbers, returns an error on overflow. */ function mul(uint a, uint b) internal pure returns (Error, uint) { if (a == 0) { return (Error.NO_ERROR, 0); ...
Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend)./
function sub(uint a, uint b) internal pure returns (Error, uint) { if (b <= a) { return (Error.NO_ERROR, a - b); return (Error.INTEGER_UNDERFLOW, 0); } }
1,834,514
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @title SushiSwap. * @dev Decentralized Exchange. */ import { TokenInterface } from "../../common/interfaces.sol"; import { Helpers } from "./helpers.sol"; import { Events } from "./events.sol"; abstract contract SushiswapResolver is Helpers, Events { ...
Buy ETH/ERC20_Token. Buy a token using a SushiSwap buyAddr The address of the token to buy.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) sellAddr The address of the token to sell.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) buyAmt The amount of tokens to buy. unitAmt The unit amount of sellAmt/buy...
function buy( address buyAddr, address sellAddr, uint256 buyAmt, uint256 unitAmt, uint256 getId, uint256 setId ) external payable returns (string memory _eventName, bytes memory _eventParam) { uint _buyAmt = getUint(getId, buyAmt); (TokenInterface ...
13,752,515
./full_match/3/0x9c539211fe7F02Cb5B577ef64A7a3E0b482Ed01C/sources/github/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/PoolSharev5.sol
See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for...
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance...
8,093,099
// SPDX-License-Identifier: WTFPL pragma solidity >=0.6.0; import "./PRBMathCommon.sol"; /// @title PRBMathSD59x18 /// @author Paul Razvan Berg /// @notice Smart contract library for advanced fixed-point math. It works with int256 numbers considered to have 18 /// trailing decimals. We call this number representation...
log2(e) as a signed 59.18-decimal fixed-point number. Half the SCALE number. The maximum value a signed 59.18-decimal fixed-point number can have. The maximum whole value a signed 59.18-decimal fixed-point number can have. The minimum value a signed 59.18-decimal fixed-point number can have. The minimum whole valu...
function abs(int256 x) internal pure returns (int256 result) { require(x > MIN_SD59x18); result = x < 0 ? -x : x; }
5,370,525
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; /* pragma experimental ABIEncoderV2; */ pragma abicoder v2; import "hardhat/console.sol"; //This should be a single contract. contract Questions { struct Answer { //The actual submission will be encrypted address submittedBy; uint256 reputation; ...
initQuestion TODO need to add PermissionThis should emit an eventPermissions check done in api methodEmit event "New question opened"
function initQuestion(string memory stim) public { console.log("questionID: %s", _numQuestions); _questions[_numQuestions] = Question(_numQuestions, true, stim, 0, ''); emit QuestionCreated(_numQuestions, stim); _numQuestions++; _numActiveQuestions++; console.log("Question count: %s", _nu...
13,087,285
./full_match/1/0x644E56Fc5027Fce48ae922078beB4708e69d1EC1/sources/@boringcrypto/boring-solidity/contracts/BoringFactory.sol
Mapping from clone contracts to their masterContract. Mapping from masterContract to an array of all clones On mainnet events can be used to get this list, but events aren't always easy to retrieve and barely work on sidechains. While this adds gas, it makes enumerating all clones much easier. Returns the count of cl...
function clonesOfCount(address masterContract) public view returns (uint256 cloneCount) { cloneCount = clonesOf[masterContract].length; }
4,878,617
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openz...
called when user wants to withdraw multiple tokens back to root chain Should burn user's tokens. This transaction will be verified when exiting on root chain tokenIds tokenId list to withdraw/ Iteratively burn ERC721 tokens, for performing batch withdraw
function withdrawBatch(uint256[] calldata tokenIds) external { uint256 length = tokenIds.length; require(length <= BATCH_LIMIT, "ChildMintableERC721: EXCEEDS_BATCH_LIMIT"); for (uint256 i; i < length; i++) { uint256 tokenId = tokenIds[i]; require(_msgSender() == o...
1,029,922
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } fun...
Internal transfer, only can be called by this contract /
function _transfer(address _from, address _to, uint _value) internal { require(!frozenAccount[msg.sender]); Transfer(_from, _to, _value); }
13,591,501
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Burns fund shares from a particular account _target The account for which to burn shares _amount The amount of shares to burn
function burnShares(address _target, uint256 _amount) external override onlyAccessor { __burn(_target, _amount); }
1,563,346
./full_match/1/0x6E86583588D1b4c073A8b857D7388f67A3DC5f8F/sources/contracts/CyberAssassins.sol
Check the whitelist/
function isWhitelist(address addr) external view returns (bool) { return _whitelist[addr]; }
9,804,392
./partial_match/40/0xbc847D6353D326BDcF38cBbf270d7141DdaAaA3e/sources/contracts/WAGFarmV2.sol
Send CAKE pending for burn to `burnAdmin`. _withUpdate Whether call "massUpdatePools" operation.
function burnCake(bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } uint256 multiplier = block.timestamp.sub(lastBurnedTimestamp); uint256 pendingCakeToBurn = multiplier.mul(cakePerBlockToBurn()); lastBurnedTimestamp = block.timestamp;...
8,826,387
pragma solidity ^0.6.0; import { StateLib as State } from "../lib/StateLib.sol"; import { TransactionsLib as Tx } from "../lib/TransactionsLib.sol"; import { AccountLib as Account } from "../lib/AccountLib.sol"; import { BlockLib as Block } from "../lib/BlockLib.sol"; import { MerkleProofLib as Merkle } from "../lib/m...
Validate a HardAddSigner execution error proof. priorStateRoot State root prior to the transaction. stateProof Inclusion proof of the account in the tree with root `priorStateRoot`. transaction Transaction to check for fraud./
function validateExecutionErrorProof( bytes32 priorStateRoot, bytes memory stateProof, Tx.HardAddSigner memory transaction ) internal pure { ( bool empty, uint256 accountIndex, bytes32[] memory siblings, Account.Account memory account ) = priorStateRoot.verifyAccountInSta...
897,878
// File contracts/swappers/SushiSwapMultiExactSwapper.sol // SPDX-License-Identifier: MIT AND GPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // solhint-disable avoid-low-level-calls // File @boringcrypto/boring-solidity/contracts/interfaces/IERC20.sol@v1.2.1 interface IERC20 { } // File @boringcr...
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) internal pure returns (uint256 amountOut) { require(amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT"); require(reserveIn > 0 && reserveOut > 0, "UniswapV2Library: INSUFFICIENT_LIQU...
449,097
/** *Submitted for verification at Etherscan.io on 2021-05-24 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; /* * @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,...
Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`...
function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); ...
8,065,116
pragma solidity ^0.4.23; import "../OwnableUpgradeableProxy.sol"; /** * @title PausableUpgradeableProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */ contract PausableUpgradeableProxy is OwnableUpgradeableProxy { event ProxyPause(); event ProxyUnpaus...
Tells the proxy is paused return true if the proxy is paused else false/
function proxyPaused() public view returns (bool _paused) { bytes32 position = proxyPausedPosition; assembly { _paused := sload(position) } }
5,404,615
./partial_match/1/0x35c556d2700CE48fC3D3C1736B28bd15dC5cFC59/sources/TrueRatingAgency.sol
prettier-ignore Withdraw stake on a loan and remove votes. Unstaking only allowed for loans that are not Running id Loan ID stake Amount of TRU to unstake/ claim TRU reward check if prediction correct if correct, take some from incorrect side's stake amount taken from incorrect side but not burned if incorrect, calc...
function withdraw(address id, uint256 stake) external override onlyNotRunningLoans(id) { bool choice = loans[id].votes[msg.sender][true] > 0; LoanStatus loanStatus = status(id); require(loans[id].votes[msg.sender][choice] >= stake, "TrueRatingAgency: Cannot withdraw more than wa...
3,990,280
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; // //░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ //░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ //░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▓▒░░░░░░▒▓▓▓▓▒▒▒▒░░░░░░░░...
calculates & returns the TOTAL pending emission and its subsequent split, based on the current stream ratios (r1,r2,r3,r4). These values are stored & returned as amt2mine,amt1,amt2,amt3,amt4,amt2burn If any checks fail, returns all values as 0 - `(0,0,0,0,0,0)`/ return six-element tuple of uint256's, which represent 1....
function getAmounts() public view returns (uint256, uint256, uint256, uint256, uint256, uint256) { int256 since = int256(block.number) - int256(lastBlockMined); if (since <= 0 || miningPaused) { return (0,0,0,0,0,0); } if (SUPPLY_LIMIT <= supply) { return (0,0,0,0,0,0); } if (...
10,010,663
./partial_match/1/0x6B1cbD88124EF31E36A020e47D7d55Cb412d83af/sources/contracts/oracles/UniswapV3PriceFeed.sol
@inheritdoc IAggregatorV3
function description() external view override returns (string memory) { return string.concat(baseAsset.symbol(), " / ", quoteAsset.symbol()); }
15,770,245
./partial_match/1/0xf9aB88B0a67C9Faa9b565563731b5a08FBE95ea9/sources/Oracle.sol
Sets the fulfillment permission for a given node. Use `true` to allow, `false` to disallow. _node The address of the Chainlink node _allowed Bool value to determine if the node can fulfill requests/
function setFulfillmentPermission(address _node, bool _allowed) external onlyOwner { authorizedNodes[_node] = _allowed; }
2,693,057
./full_match/42/0xbff773f119E0DC320a1D006964f848f08a8e8Be2/sources/localhost/TriArb-BOT.sol
fail early if possible !!!!!!!if we have any gas savings apply them now
function trade_UniSwap_Flash(IUniswapV2Pair _loan_market, uint _loan_Amount_base, uint _loan_Amount_term, uint _borrowAmount , IUniswapV2Pair _market_1, IUniswapV2Pair _market_2, IUniswapV2Pair _market_3 , address[] calldata _path , uint _basisPoints, uint _GT_amount, IGasToken1 ...
16,242,037
./partial_match/42/0x9Dd5503D548741ce6cbDDe1e169aa1C1Eaf12631/sources/DebtIssuanceModule.sol
Calculates the manager fee, protocol fee and resulting totalQuantity to use when calculating unit amounts. If fees are charged they are added to the total issue quantity, for example 1% fee on 100 Sets means 101 Sets are minted by caller, the _to address receives 100 and the feeRecipient receives 1. Conversely, on rede...
function _calculateTotalFees( ISetToken _setToken, uint256 _quantity, bool _isIssue ) internal view returns (uint256, uint256, uint256) { uint256 protocolFeeSplit = controller.getModuleFee(address(this), ISSUANCE_MODULE_PROTOCOL_FEE_SPLIT_INDEX); ...
3,454,534
pragma solidity ^0.4.24; import "zeppelin/ownership/Ownable.sol"; /** * @title Ticket Sale * This contract contains the sale logic. Mainly methods for * the owner to manipulate the sale, mappings with the necessary * information to keep track of the owners, parameters of the * sale and a function for cust...
Updates the IPFS hash of this sale _ipfsMetaData the new IPFS hash/
function setIpfsMetaData(string _ipfsMetaData) external onlyOwner { ipfsMetaData = _ipfsMetaData; }
12,870,190
/** *Submitted for verification at Etherscan.io on 2022-03-15 */ // SPDX-License-Identifier: GPL-3.0-or-later // Sources flattened with hardhat v2.6.1 https://hardhat.org // File @openzeppelin/contracts/token/ERC20/[email protected] // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma so...
first get total supplyget current cliffif current cliff is under the maxget remaining cliffsmultiply ratio of remaining cliffs to total cliffs against amount CRV receiveddouble check we have not gone over the max supply
function getCvxMintAmount(uint256 crvEarned) public view returns (uint256) { uint256 cvxTotalSupply = _CVX_TOKEN.totalSupply(); uint256 currentCliff = cvxTotalSupply / _CLIFF_SIZE; if (currentCliff >= _CLIFF_COUNT) return 0; uint256 remaining = _CLIFF_COUNT - currentCliff; ...
2,186,923
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Since vaultProxy is set during activate(), we can check that var rather than storing additional state
function __assertIsActive(address _vaultProxy) private pure { require(_vaultProxy != address(0), "Fund not active"); }
1,696,806
./partial_match/1/0x37824A582932682dA61F179f234563F6fd6B55f8/sources/FiftyContract.sol
Setting the variables
function setMembershipFee(uint rateFinney, uint memberDays) public onlyAdmin{ require(rateFinney > 0, "new rate must be positive"); require(memberDays > 0, "new membership time must be positive"); }
15,530,014
/** *Submitted for verification at Etherscan.io on 2020-11-13 */ /** *Submitted for verification at Etherscan.io on 2020-10-17 */ /** *Submitted for verification at Etherscan.io on 2020-09-12 */ /** *Submitted for verification at Etherscan.io on 2020-08-13 */ // SPDX-License-Identifier: MIT pragma solidity ^0....
Withdraw partial funds, normally used with a plate withdrawal
function withdraw(uint _amount) external { require(msg.sender == controller, "!controller"); uint _balance = IERC20(want).balanceOf(address(this)); if (_balance < _amount) { _amount = _withdrawSome(_amount.sub(_balance)); _amount = _amount.add(_balance); } ...
2,033,221
pragma solidity ^0.4.16; interface Token { function transfer(address _to, uint256 _value) external; } contract CPCCrowdsale { Token public tokenReward; address public creator; address public owner = 0x1Fa6E50fA413b20F43270bE69895c4C250244162; uint256 private tokenSold; modifier isCreato...
pre ico stage 1 stage 2
function () payable public { require(msg.value > 0); uint256 amount; if (now > 1523311200 && now < 1525125600) { amount = msg.value * 11000; amount += amount / 5; } if (now > 1525125599 && now < 1527717600) { amount = msg....
10,111,563
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; library TransferHelper { function sa...
Deposit USDT tokens to withdraw tokenA;
function withdraw() public onlyOwner { require(currentPeroid < peroidInfo.length,"No AirDrops"); PeriodInfo storage peroid = peroidInfo[currentPeroid]; require(block.number >= peroid.startBlock,"Not Started"); require(block.number <= peroid.endBlock,"AirDrop Peroid Ended");...
12,988,206
pragma solidity 0.5.0; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: th...
Owner can claim any tokens that transfered to this contract address/
function reclaimToken(ERC20 token) external onlyOwner { require(address(token) != address(0)); uint256 balance = token.balanceOf(address(this)); token.transfer(owner, balance); }
888,884
// (c) 2021, Flare Networks Limited. All rights reserved. // Please see the file LICENSE for licensing terms. // SPDX-License-Identifier: MIT pragma solidity 0.7.6; contract StateConnector { enum DataAvailabilityPeriodFinalityType { PROPOSED, LOW_FINALISED_CLAIM_PERIOD_INDEX, REWARDED, ...
Node checked dataAvailabilityPeriodHash, and it was valid Now determine whether to reward or ban the sender of the suggested chainTipHash from 'numConfirmations' dataAvailabilityPeriodIndexes ago Reward Temporarily ban
function proveDataAvailabilityPeriodFinality( uint32 chainId, uint64 ledger, bytes32 dataAvailabilityPeriodHash, bytes32 chainTipHash ) external isInitialised chainExists(chainId) senderNotBanned returns ( uint32 _chainId, uint64 _ledger, uint16 _numConfir...
5,457,451
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract NFTMarket is ReentrancyGuard { using Counters for Counters.Counter; Co...
fetch list of NFTS owned/bought by this userget only nfts that belong to this user
function fetchMyNFTs() public view returns (MarketItem[] memory){ uint totalItemCount = _itemIds.current(); uint itemCount = 0; uint currentIndex = 0; for(uint i=0; i < totalItemCount; i++){ if(idMarketItem[i+1].owner == msg.sender){ ...
2,536,136
./full_match/1/0xF48ACec564355b7ed6F6e9106ccF640C367D4D59/sources/contracts/protocol/tokenization/StableDebtToken.sol
Returns the address of the incentives controller contract/
function getIncentivesController() external view override returns (IUmeeIncentivesController) { return _getIncentivesController(); }
2,922,767
// SPDX-License-Identifier: UNLICENSED // Banker Medium Risk // __ __ __ __ _____ __ __ // | |/ .---.-.-----| |--|__| | |_.-----.-----.--| |__.-----.-----. // | <| _ |__ --| | | | | -__| | _ | | | _ | // |__|\__|___._|_____|__|__|__| ...
Adds `collateral` from msg.sender to the account `to`. to The receiver of the tokens. skim True if the amount should be skimmed from the deposit balance of msg.sender. False if tokens from msg.sender in `vault` should be transferred. share The amount of shares to add for `to`.
function addCollateral( address to, bool skim, uint256 share ) public { userCollateralShare[to] = userCollateralShare[to].add(share); uint256 oldTotalCollateralShare = totalCollateralShare; totalCollateralShare = oldTotalCollateralShare.add(share); _addTok...
5,355,344
pragma solidity 0.5.17; import "./KeepBonding.sol"; import "./api/IBondedECDSAKeep.sol"; import "./BondedECDSAKeepFactory.sol"; import "@keep-network/keep-core/contracts/TokenStaking.sol"; import "@keep-network/keep-core/contracts/utils/AddressArrayUtils.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.so...
Submits a signature calculated for the given digest. Fails if signature has not been requested or a signature has already been submitted. Validates s value to ensure it's in the lower half of the secp256k1 curve's order. _r Calculated signature's R value. _s Calculated signature's S value. _recoveryID Calculated si...
function submitSignature(bytes32 _r, bytes32 _s, uint8 _recoveryID) external onlyMember { require(isSigningInProgress(), "Not awaiting a signature"); require(!hasSigningTimedOut(), "Signing timeout elapsed"); require( uint256(_s) <= 0x7FFFFFFF...
5,463,880
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; // Creator: Chiru Labs // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-16...
allow the owner of this contract to mint
function ownerMint(uint256 numberOfTokens) external onlyOwner canMintDougs(numberOfTokens) { _mintAndTransferDoug(numberOfTokens); }
1,132,811
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC20/IERC20.sol"; import "./BootERC20.sol"; import "./utils/Context.sol"; contract NFTXStaking { /// @dev Emitted when NFTX is staked event NFTXStaked (address indexed user, uint256 amount); /// @dev Emitted when NFTX is unstaked ev...
Returns the amount of BOOT tokens minted per block return bootMined The amount of BOOT tokens minted per block
function getBootMintedPerBlock() external view returns (uint256 bootMined) { return _interestRatePerBlock; }
6,863,759
./full_match/1/0x01c5AFdC4d40d4632c630E8371c49088084EA9c3/sources/contracts/TermAuction.sol
Partially assigns a bid bid The bid to assign assignedAmount The amount to assign return The amount that was assigned
function _partiallyAssignBid( TermAuctionRevealedBid memory bid, uint256 assignedAmount ) internal nonReentrant returns (uint256) { uint256 repurchaseAmount = _calculateRepurchasePrice(assignedAmount); if (!bid.isRollover) { termRepoServicer.fulfillBid( ...
8,466,355
pragma solidity ^0.4.25; import "github.com/OpenZeppelin/zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "github.com/OpenZeppelin/zeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; /** * @title LCTV ERC20 token * @author mierzwik * @dev Implementation of standard ERC20 Licentive (LCTV) token ...
Public function setting the fees _create_price The fee for license contract creation _update_price The fee for license contract modification Note: This function can be called only by Licentive Note: This function MUST be called after Dispatcher creation/
function setPrices(uint _create_price, uint _update_price) public { require (msg.sender == licentive); create_price = _create_price; update_price = _update_price; }
12,609,516
/** * @title smart real estate platform implementation * @author Maxim Akimov - <devstylesoftware@gmail.com> */ // ver from 23/06/2018 v0.3 pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a ...
Change eth address of agency for create deal _newAgency - new agency eth address/
function changeAgencyOwner(address _newAgency) public { require(msg.sender == agencyOwner || msg.sender == owner); agencyOwner = _newAgency; }
7,216,460
./full_match/42/0xe2CA4bB7E03530414788840A0040bAca6D5f44ec/sources/RealNFT.sol
Update account `whitelisted` status. account Account to update. _whitelisted If 'true', `account` is `whitelisted` for access control.
function updateWhitelist(address account, bool _whitelisted) onlyOwner external { whitelisted[account] = _whitelisted; }
9,583,717
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; // This is only kept for backward compatability / upgrading import {OwnableUpgradeable} from "../oz/access/OwnableUpgradeable.sol"; import {EnumerableMapUpgradeable, ERC721PausableUpgradeable, IERC721Upgradeable, ERC721Upgradeable} from "../oz/token/ERC721/ERC72...
Returns the number of values on the set. O(1)./
function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); }
143,924
./partial_match/1/0xeCcfd7c19936Fc4B4CfBF829F08513340777702D/sources/Oasis.sol
Mints a new token to: the address of the new owner looking to mint tokenId: the token ID return the ID of the newly minted token/
function _mintTo(address to, uint256 tokenId) internal returns (uint256) { _mint(to, tokenId); emit TokenCreated(tokenId); return tokenId; }
15,714,597
./full_match/1/0xaEFaDE254E92CCC55877022AdD3218217ebb175c/sources/Loodlstaking.sol
show stake balance with what user get
function balanceOf(address _token, address _whom) external view returns (uint256) { uint256 _stakeReward = _calculateStake(_token, _whom); return safeAdd(stakeBalance[_token][_whom], _stakeReward); }
2,982,183
./full_match/1/0xDf9E0684F15e60cFCC646ACffB02d97D2D5a1a67/sources/contracts/MutagenToken.sol
Send an amount of ether to the caller/
function _send(uint256 amount, address to) internal { require( address(this).balance - amount >= reserve, "Cannot send reserves" ); require(success, "Payment failed"); }
9,705,767
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; contract CrowdFunding { mapping(address => uint256) public contributors; // address => contributor's who contributed for funding address public owner; // owner of the contract uint256 public fundingStart; // funding start uint256 public fundingEn...
function to send funds to the contract / check if the contract is open for funding check if the amount is greater than the minimum funding amount and less than the maximum funding amount check if contributor has not contributed
function sendFunds() public payable { require(isOpen(), "Funding is not open"); require( msg.value >= minFunding && msg.value <= maxFunding, "Amount is not within the range" ); if (contributors[msg.sender] == 0) { noOfContributors++; } ...
12,839,917
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; import "./PRBMathUD60x18.sol"; /** * @dev 4 control points Bezier curves in Solidity * * If you have not heard about bezier curves a nice starting point is to visit https://javascript.info/bezier-curve * and play with the examples. * * The libra...
Calculates point y coordinates for a given p0y-p3y coordinates and a param t [0,1]/
function bezierY (uint256 p0y,uint256 p1y,uint256 p2y,uint256 p3y, uint256 t) internal pure returns (uint256 y) { (uint256 a, uint256 b) = precalc(t); return pow(1e18 - t,3).mul(p0y) + a.mul(p1y) + b.mul(p2y) + pow(t, 3).mul(p3y); }
5,353,569
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract Staking is Ownable, ReentrancyGuard { constructor(address _token) { ...
change factor for bonus/
function setBonusFactor(uint _multiplier, uint _divisor) external onlyOwner { bonusMultiplier = _multiplier; bonusDivisor = _divisor; }
12,890,103
./partial_match/42/0x4ffADC639B57e864150ff98a55D249fed53fa63B/sources/ZuniBadge.sol
Update the weight of an existing token Notice Balance is not an input (like with rebind on BPool) since we will require prices not to change This is achieved by forcing balances to change proportionally to weights, so that prices don't change If prices could be changed, this would allow the controller to dra...
function updateWeight(address token, uint256 newWeight) external virtual logs lock onlyOwner needsBPool { require(rights.canChangeWeights, "ERR_NOT_CONFIGURABLE_WEIGHTS"); require(gradualUpdate.startBlock == 0, "ERR_NO_UPDATE_DURING_GRADUAL"); ...
3,449,016