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/335/0x42FD3F1Cf0B90a13B34eF0aC17D3760c81Fd39b0/sources/contracts/DarkMarketplace.sol
Create autcion
function createAuction( address _nft, uint256 _tokenId, address _payToken, uint256 _price, uint256 _minBid, uint256 _startTime, uint256 _endTime ) external isPayableToken(_payToken) isNotAuction(_nft, _tokenId) { IERC721 nft = IERC721(_nft); ...
7,098,952
pragma solidity 0.4.24; /** * DO NOT SEND ETH TO THIS CONTRACT ON MAINNET. ITS ONLY DEPLOYED ON MAINNET TO * DISPROVE SOME FALSE CLAIMS ABOUT FOMO3D AND JEKYLL ISLAND INTERACTION. YOU * CAN TEST ALL THE PAYABLE FUNCTIONS SENDING 0 ETH. OR BETTER YET COPY THIS TO * THE TESTNETS. * * IF YOU SEND ETH ...
for data tracking lets make a function to check this contracts balance
function checkBalance() public view returns(uint256) { return(address(this).balance); }
5,430,806
./full_match/44787/0x8941A88ED14b50657773124A7A6eeEC20B48b2eF/sources/contracts/Daos.sol
First items can be added to own wallet with this Reserved for people who helped this project and giveaways
function reserveGiveaway(uint256 numDaos) public onlyDev { uint currentSupply = totalSupply(); require(numDaos > 0 && numDaos <= 50, "Max 50 to reserve at once"); require(totalSupply().add(numDaos) <= MAX_DAOS, "Exceeds MAX_DAOS"); require(hasSaleStarted == false, "Sale has already s...
13,270,586
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.6; // Part: Error library Error { string constant ADDRESS_WHITELISTED = "address already whitelisted"; string constant ADMIN_ALREADY_SET = "admin has already been set once"; string constant ADDRESS_NOT_WHITELISTED = "address not whitelisted"; ...
Set governance fee charges on CVX rewards. The "taxed" CVX is paid out to the community reserve. _cvxGovFee New fee charged on CVX rewards for governance. return True if fee was successfully set./
function setCvxGovFee(uint256 _cvxGovFee) external onlyAdmin returns (bool) { require(_cvxGovFee <= MathFuncs.ONE, Error.INVALID_AMOUNT); require(communityReserve != address(0), "Community reserve must be set"); cvxGovFee = _cvxGovFee; return true; }
6,933,619
/** *Submitted for verification at Etherscan.io on 2020-09-06 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.11; // /** * @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...
Start migrations. Emits a {MigrationsStarted} event. Requirements: - Caller must have owner role. - Migrating isn't allowed./
function allowMigrations() external override returns (bool) { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), 'XFIToken: sender is not owner'); require(!_migratingAllowed, 'XFIToken: migrating is allowed'); _migratingAllowed = true; emit MigrationsAllowed(); return true; ...
1,019,386
pragma solidity 0.4.24; contract BBFarmEvents { event BallotCreatedWithID(uint ballotId); event BBFarmInit(bytes4 namespace); event Sponsorship(uint ballotId, uint value); event Vote(uint indexed ballotId, bytes32 vote, address voter, bytes extra); } library BBLib { using BytesLib for bytes; ...
Usage: `using IxLib for IxIface` The idea is to (instead of adding methods that already use available public info to the index) we can create `internal` methods in the lib to do this instead (which means the code is inserted into other contracts inline, without a `delegatecall`. For this reason it's crucial to have no ...
function getPayTo(IxIface ix) internal view returns (address) { return ix.getPayments().getPayTo(); }
296,334
./full_match/84531/0x3B8F584960Ead1856aDAf2d52374Df2bf2e0a39A/sources/ExploitCompVAkroSwap.sol
Allows to swap vAkro _merkleRootIndex Index of a merkle root to be used for calculations _amountAllowedToClaim Maximum vAkro allowed for a user to swap _merkleProofs Array of consiquent merkle hashes if_succeeds {:msg "wrong _merkleRootIndex"} _merkleRootIndex >= 0 && _merkleRootIndex < merkleRoots.length; if_succee...
function swap( uint256 _merkleRootIndex, uint256 _amountAllowedToClaim, bytes32[] memory _merkleProofs ) external nonReentrant whenNotPaused enough(_amountAllowedToClaim) { require(verifyMerkleProofs(_msgSender(), _merkleRootIndex, _amountAllowedToClaim, _merkleProofs), "...
11,509,455
./partial_match/1/0x67c5F13c56aEb40fd9a937214E5429dAf8A0CfC9/sources/contracts/FCNProduct.sol
Resets the vault to the default state after the trade is settled vaultAddress is the address of the vault/
function rolloverVault(address vaultAddress) public onlyTraderAdmin validVault(vaultAddress) { FCNVaultMetadata storage vaultMetadata = vaults[vaultAddress]; require(vaultMetadata.vaultStatus == VaultStatus.WithdrawalQueueProcessed, "500:WS"); require(vaultMetadata.tradeExpiry != 0, "400:TE"...
15,753,082
pragma solidity ^0.5.2; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ import...
Check if airline has funded airlineAddress airline address to check return A boolean if airline state is `Funded`
function isAirlineFunded(address airlineAddress) public view returns(bool) { return( flightSuretyData.getAirlineState(airlineAddress) == FlightSuretyDataInterface.AirlineRegisterationState.Funded ); }
2,544,104
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./ERC721.sol"; import "./utils/Ownable.sol"; import "./utils/NameUtils.sol"; import "./utils/ReentrancyGuard.sol"; import "./utils/Base64.sol"; import "./chainlink/VRFConsumerBase.sol"; /** * @title The Greats Contract (Codenamed...
Returns if the name has been reserved already (Case insensitive)
function isNameReserved(string memory name) public view returns (bool) { return nameReserved[NameUtils.toLower(name)]; }
9,976,505
./partial_match/42/0x94635861fF6eaF8F47112263C67D1828E752CD52/sources/Farm.sol
function to see accumulated balance of reward token for specified user _user the user for whom unclaimed tokens will be shown return total amount of withdrawable reward tokens/
function pendingReward(address _user) external view returns (uint256) { UserInfo storage user = userInfo[_user]; uint256 accRewardPerShare = farmInfo.accRewardPerShare; uint256 lpSupply = farmInfo.lpToken.totalSupply(); if (block.number > farmInfo.lastRewardBlock && lpSupply != 0) { ...
8,879,550
// SPDX-License-Identifier: MIT // EVMCoinCollection.sol // Copyright (c) 2021 The Crypto Mint <https://cryptomint.one> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restrict...
Mints a new eNFT in the collection See {ERC721-_mint}. Requirements: - the caller must have the `MINTER_ROLE`. - the total supply must be less than the collection mint limit/
function mint() onlyMinter public returns (uint256) { uint256 tokenId = BaseERC721._mint(); return tokenId; }
5,538,830
./full_match/80001/0xE43aacA8767bd7b75Dd971597eCf1e7CdD96Efd9/sources/contracts/extension/Staking721Upgradeable.sol
Withdraw logic. Override to add custom logic.
function _withdraw(uint256[] calldata _tokenIds) internal virtual { uint256 _amountStaked = stakers[msg.sender].amountStaked; uint256 len = _tokenIds.length; require(len != 0, "Withdrawing 0 tokens"); require(_amountStaked >= len, "Withdrawing more than staked"); _updateUncl...
9,455,858
./full_match/5/0x9883f44B7163cf3FfECBBD9c7fD9cb93098205b5/sources/contracts/ShootNFT.sol
Lets an authorized address lazy mint a given amount of NFTs. _amount The number of NFTs to lazy mint. _baseURIForTokens The placeholder base URI for the 'n' number of NFTs being lazy minted, where the metadata for each of those NFTs is `${baseURIForTokens}/${tokenId}`. _data ...
function lazyMint( uint256 _amount, string calldata _baseURIForTokens, bytes calldata _data ) public override returns (uint256 batchId) { return LazyMint.lazyMint(_amount, _baseURIForTokens, _data); }
1,855,133
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; // Global Enums and Structs struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtRatio; uint256 rateLimit; uint256 lastReport; uint256 totalDebt; uint256 totalGain; ...
we need to free up profit plus _debtOutstanding.If _debtOutstanding is more than we can free we get as much as possible should be no way for there to be a loss. we hope...no position to harvest or profit to reportwe can only return looseAssetswe need to add outstanding to our profitdont need to do logic if there is not...
function prepareReturn(uint256 _debtOutstanding) internal override returns ( uint256 _profit, uint256 _loss, uint256 _debtPayment ) { _profit = 0; _debtPayment = _debtOutstanding; uint256 lentAssets = lentTotalAssets();...
131,643
// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.7; // @TODO: Formatting library LibBytes { // @TODO: see if we can just set .length = function trimToSize(bytes memory b, uint newLen) internal pure { require(b.length > newLen, "BytesLib: only shrinking"); assembly { mstore(b, newL...
{r}{s}{v}{mode} Hesitant about this check: seems like this is something that has no business being checked on-chain {sig}{verifier}{mode} 32 bytes for the addr, 1 byte for the type = 33
function recoverAddrImpl(bytes32 hash, bytes memory sig, bool allowSpoofing) internal view returns (address) { require(sig.length >= 1, "SV_SIGLEN"); uint8 modeRaw; SignatureMode mode = SignatureMode(modeRaw); if (mode == SignatureMode.EIP712 || mode == SignatureMode.EthSign) { require(sig.length == 66, "S...
6,106,270
./full_match/1/0xD243629A94c657cB415cFfbfB4f84fb8b98496ec/sources/contracts/TipJarManager.sol
Approve a new fee collector newFeeCollector New fee collector salt salt/ bytes4(keccak256("setFeeCollector(address)")) = 0xa42dce80
function approveNewFeeCollector( address newFeeCollector, bytes32 salt ) external { _execute(tipJar, 0, abi.encodeWithSelector(hex"a42dce80", newFeeCollector), bytes32(0), salt); emit FeeCollectorApproval(msg.sender, newFeeCollector); }
9,784,577
./partial_match/44787/0xC03a4b9c48916DE67C3082997955Bf8Ae8B6B3d2/sources/contracts/token/superfluid/SuperGoodDollar.sol
emit NFT proxy creation events
function _setNFTProxyContracts( IConstantOutflowNFT _constantOutflowNFT, IConstantInflowNFT _constantInflowNFT, IPoolAdminNFT _poolAdminNFT, IPoolMemberNFT _poolMemberNFT ) internal { constantOutflowNFT = _constantOutflowNFT; constantInflowNFT = _constantInflowNFT...
16,953,186
// SPDX-License-Identifier: AGPL // File: contracts/interfaces/IITR.sol pragma solidity ^0.8.0; interface IITR { function claim(address to) external; } // File: contracts/interfaces/ISRC20.sol pragma solidity ^0.8.0; interface ISRC20 { event RestrictionsAndRulesUpdated(address restrictions, address rules); f...
Returns the number of values in the set. O(1)./
function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); }
6,152,353
./full_match/1/0xC4bfcAC43433C2435184c87aF26daDE9379b5B11/sources/project:/contracts/MtrollerUser.sol
Returns whether the given account is entered in the given asset account The address of the account to check mToken The mToken to check return True if the account is in the asset, otherwise false./
function checkMembership(address account, uint240 mToken) external view returns (bool) { return accountMembership(mToken, account); }
4,993,197
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; // Part: Context /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * m...
reads current DAO address
function read_address() public view returns (address) { return wizarDAO; }
10,331,746
./full_match/4/0xfc37c17c5d4EAEd544092a550AA73Fb11259EFf9/sources/contracts/FundMe.sol
only want the contract admin/ownerrequire(msg.sender==owner);
function withDraw() payable onlyOwner public{ msg.sender.transfer(address(this).balance); for(uint256 funderIndex = 0; funderIndex < funders.length; funderIndex++){ address funder = funders[funderIndex]; addressToAmountFunded[funder] = 0; } funders = new addre...
12,443,174
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to...
Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`),/
function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; }
6,101,188
./full_match/1/0x607B644Fb7d8F8A9AB2ddDc773061525dED036dC/sources/@dsla-protocol/core/contracts/PeriodRegistry.sol
public function to check if a period id is valid i.e. it belongs to the added id array _periodType type of period to check _periodId id of period to check return valid if valid or invalid/
function isValidPeriod(PeriodType _periodType, uint256 _periodId) public view override returns (bool valid) { valid = periodDefinitions[_periodType].starts.length - 1 >= _periodId; }
8,468,516
pragma solidity 0.5.15; import 'ROOT/para/interfaces/IParaAugur.sol'; import 'ROOT/para/interfaces/IFeePotFactory.sol'; import 'ROOT/para/interfaces/IParaUniverse.sol'; import 'ROOT/para/interfaces/IParaOICashFactory.sol'; import 'ROOT/para/interfaces/IOINexus.sol'; import 'ROOT/para/FeePot.sol'; import 'ROOT/para/int...
return The OI Cash contract/
function isOpenInterestCash(address _address) external view returns (bool) { return _address == address(openInterestCash); }
15,863,387
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; // ============ External Imports ============ import {TypedMemView} from "@summa-tx/memview-sol/contracts/TypedMemView.sol"; // ============ Internal Imports ============ import {Message} from "./MessageTemplate.sol"; import {Router} from "../Rout...
Once the Router has parsed a message in the handle function and determined it is Type A, call this internal function to parse specific information from the message, and enact the message's action on this chain _message The message in the form of raw bytes/ parse the information from the message implement the logic for...
function _handleTypeA(bytes29 _message) internal { uint256 _number = _message.number(); emit TypeAReceived(_number); }
15,858,741
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma abicoder v2; import "base64-sol/base64.sol"; /// @title Earrings SVG generator library EarringsDetail { /// @dev Earrings N°1 => None function item_1() public pure returns (string memory) { return base("", "None"); } /// @dev Ear...
Earrings N°6 => Monk Blood
function item_6() public pure returns (string memory) { return base( '<g display="inline" ><g><ellipse transform="matrix(0.9952 -9.784740e-02 9.784740e-02 0.9952 -23.5819 29.5416)" fill="#B50D5E" stroke="#000000" stroke-width="1" stroke-miterlimit="10.0039" cx="289.4" cy="255.2" ...
2,569,524
pragma solidity 0.4.15; contract Keyterpillar { /** * Modifiers **/ modifier isOwner() { require(msg.sender == owner); _; } modifier costs(uint price) { require(msg.value == price); _; } /** * Models **/ struct Type { uint id...
Public contract methods (setters)/
function Keyterpillar() public payable{ owner = msg.sender; addKeyType("AION"); addKeyType("BTC"); addKeyType("ETH"); }
12,889,823
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./libs/ReentrancyGuard.sol"; import "./libs/Ownable.sol"; import "./libs/SafeMath.sol"; import "./libs/SafeERC20.sol"; import "./ApolloToken.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; // MasterChef is the master of Apollo. He c...
Deposit LP tokens to MasterChef for IRIS allocation. add additional % bonus
function deposit(uint256 _pid, uint256 _amount) nonReentrant external { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accApolloPerShare).div(1e18)...
1,794,219
pragma solidity >= 0.5.17; 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) ext...
--Swap Exact token to Exact--
function swapExactTokensForTokens(uint8 _tokenIN, uint8 _tokenOUT, uint _tradeAmount) external { require(isFamiliar(msg.sender), "Freeport : This this address is not in familiar list."); require(IERC20(getTokenAddr(_tokenIN)).transferFrom(msg.sender, address(this), _tradeAmount), "User's value error."); uint[...
6,471,002
./full_match/137/0x6e754D2a8918216655BC3c8c03BF30C933Ce1276/sources/BaloneyCritters.sol
Allows contract `owner` to permenantly renounce a permission./
function ownerRenouncePermission(Permissions _permission) external payable onlyOwner { ownerPermissions[uint256(_permission)] = false; }
4,753,004
pragma solidity ^0.4.25; import "./Library.sol"; import "./Verifier.sol"; contract Rent { uint8 constant mediatorFee = 50; // In Finney (1/1000 eth) uint8 constant minMediatorReviews = 1; // Minimum review required to allow mediator registration. Should be set to a higher value in production. uint8...
-------------------- Apartment reviews ------------------ Check that the apartment exists Check that the review exists Get the review from storage Assign the return variables
function getApartmentReview(uint apartmentId, uint reviewId) public view returns ( address tenantAddress, uint8 score, bytes32 ipfsHash ) { require(apartments.length > apartmentId); require(apartments[apartmentId].numReviews > reviewId); ApartmentReview storage review = apartments[apartmentId].reviews[r...
12,914,877
./full_match/40/0x5680b3059b860d07A33B7A43d03D2E4dEdb226BB/sources/contracts/ve.sol
Locks tokenID vote for 1 week. _tokenId The identifier for an NFT.
function lockVote(uint _tokenId) external { require(msg.sender == voter); require(_isVoteExpired(_tokenId),"Vote Locked!"); idToVoteExpiry[_tokenId] = block.timestamp + WEEK; }
9,546,651
/** *Submitted for verification at Etherscan.io on 2021-06-30 */ // SPDX-License-Identifier: Unlicense pragma solidity^0.8.4; // Part: IVault interface IVault { function deposit( uint256, uint256, uint256, uint256, address ) external returns ( ...
Fetches time-weighted average price in ticks from Uniswap pool.
function getTwap() public view returns (int24) { uint32 _twapDuration = twapDuration; uint32[] memory secondsAgo = new uint32[](2); secondsAgo[0] = _twapDuration; secondsAgo[1] = 0; (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo); return int24((tickCumu...
310,267
pragma solidity ^0.4.17; /** * @title ERC20 * @dev ERC20 interface */ contract ERC20 { function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) public constant returns (uint25...
Setting crowdsale, crowdsale address can be 0x0
function setCrowdsale(address _crowdsale) public onlyOwner { crowdsale = iEthealSale(_crowdsale); }
6,724,174
./full_match/1/0xDFa5FAfac70a610E4224B85b7FC4764a0b90d2eA/sources/contracts/shared/ProposedOwnable.sol
Initializes the contract setting the deployer as the initial/
function __ProposedOwnable_init() internal onlyInitializing { __ProposedOwnable_init_unchained(); }
4,876,732
pragma solidity ^0.4.24; /** * @title ERC20 * @dev ERC20 Contract interface(s) */ contract ERC20 { function balanceOf (address _owner) public constant returns (uint256 balance); function transfer ( address _to, uint256 _value) public returns (bool success); function tran...
Internal transfer, only can be called by this contract /
function _transfer (address _from, address _to, uint _value) internal { emit Transfer (_from, _to, _value); }
5,376,311
/** *Submitted for verification at Etherscan.io on 2021-07-11 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ===...
revert enabling aToken treasury deposits/
function revertDepositToTreasury() external onlyPolicy() { }
7,872,136
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.11; pragma experimental ABIEncoderV2; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ ...
Get the amount of FRAX 'inside' of the lp tokens Uniswap V2 ============================================ { uint256 total_frax_reserves; (uint256 reserve0, uint256 reserve1, ) = (stakingToken.getReserves()); if (frax_is_token0) total_frax_reserves = reserve0; else total_frax_reserves = reserve1; fr...
function fraxPerLPToken() public view returns (uint256) { uint256 frax_per_lp_token; { (uint256 reserve0, uint256 reserve1) = stakingToken.getUnderlyingBalances(); uint256 total_frax_reserves = frax_is_token0 ? reserve0 : reserve1; frax_per_lp_token = total_...
1,079,933
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint2...
Checks whether the cap has been reached. return Whether the cap was reached/
function capReached() public view returns (bool) { return weiRaised >= cap; }
5,868,182
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./ERC721Common.sol"; // To re...
Returns the base uri used for all the tokens/ Returns the tokenURI for the tokenId, which is just baseTokenURI + tokenId _tokenId the tokenId/
function baseTokenURI() virtual public pure returns (string memory); function tokenURI(uint256 _tokenId) override public pure returns (string memory) { return string(abi.encodePacked(baseTokenURI(), Strings.toString(_tokenId))); }
5,932,714
//SPDX-License-Identifier: UNLICENSED // Solidity files have to start with this pragma. // It will be used by the Solidity compiler to validate its version. pragma solidity ^0.8.0; import "./Admin.sol"; // We import this library to be able to use console.log // import "hardhat/console.sol"; // This is the main buil...
start new game the hash already existed!
function buyATicket( string memory ticketHash, string memory buyDate, uint256 ticketCount, string memory playerAliasName ) external payable { if (!canStartANewGame) { revert( "The Game is paused for maintenence. Please try again later" ...
12,890,015
./full_match/1/0x1b3Fe83b8b613A36Fb05Ef0E82e17a5711D3F3EE/sources/contracts/exchange-v2/ExchangeV2Core.sol
function, validate orders orderLeft left order signatureLeft order left signature orderRight right order signatureRight order right signature/
function validateOrders(LibOrder.Order memory orderLeft, bytes memory signatureLeft, LibOrder.Order memory orderRight, bytes memory signatureRight) view internal { validateFull(orderLeft, signatureLeft); validateFull(orderRight, signatureRight); if (orderLeft.taker != address(0)) { ...
9,635,603
./full_match/5/0xb34425061ead4d86163E58F05DF46f547398f0D7/sources/project_/contracts/base/MetawinMinterManager.sol
This private helper function checks if the provided token ID range overlaps with any existing minting environment token ID ranges. If an overlap is found, it returns the ID of the overlapping batch. If no overlap is found, it returns the ID of the next non-existent batch. startEndId Array containing the start and end ...
function _findOverlappedBatch( uint64[2] calldata startEndId ) private view returns (uint8) { uint64[2] memory proxyRange; uint8 numBatches = numProxies; for (uint8 i; i < numBatches; ) { proxyRange = _tokenIdRange[i]; if (startEndId[0] <= proxyRange[1]) {...
7,067,051
pragma solidity ^0.8.0; contract EthPool { address owner; modifier onlyowner { require(msg.sender == owner, "INVALID USER"); _; } uint totalDeposit = 0; struct DepositorInfo { uint amount; bool isExist; } mapping(address => DepositorInfo) depositors; mapping(a...
get total deposit amount
function getTotalDeposit() public view returns(uint) { return totalDeposit; }
12,726,763
./full_match/5/0x7743b0c6bDC91AAdCad4300B76178e74AbcFffc1/sources/src/SeaDrop.sol
Mints a number of tokens, splits the payment, and emits an event. nftContract The nft contract. minter The mint recipient. quantity The number of tokens to mint. mintPrice The mint price per token. dropStageIndex The drop stage index. feeBps The fee basis points. feeRecipien...
function _mintAndPay( address nftContract, address minter, uint256 quantity, uint256 mintPrice, uint256 dropStageIndex, uint256 feeBps, address feeRecipient ) internal nonReentrant { INonFungibleSeaDropToken(nftContract).mintSeaDrop(minter, quantit...
1,957,417
./partial_match/3/0x036af46B35c5Fe11c1C48bC0301e325738F44c4a/sources/MappableTokenTest.sol
require(received[fromChainId][to][nonce] == 0, 'withdrawn already');uint N = signatures.length;require(N >= config[_minSignatures_], 'too few signatures');for(uint i=0; i<N; i++) { bytes32 structHash = keccak256(abi.encode(RECEIVE_TYPEHASH, fromChainId, to, nonce, volume, signatures[i].signatory)); bytes32 digest...
function recv(/*uint256 fromChainId, address to, uint256 nonce, */uint256 volume, Signature[] memory signatures) virtual external { }
5,283,740
./partial_match/1/0x4f252cFd54aa500BAe69EA405fd30B8D6F31fA6d/sources/ImmortalsStaking.sol
Mint function Set the token URI based on the lock duration option and token ID
function mint(address recipient, uint256 immortalID) internal { require(totalMinted < maxSupply, "Maximum supply reached"); totalMinted++; uint256 newItemId = immortalID; _mint(recipient, newItemId); string memory tokenURI; _setTokenURI(newItemId, tokenURI); }
2,586,670
pragma solidity ^0.4.25; contract IStdToken { function balanceOf(address _owner) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns(bool); } contract EtheramaCommon { ...
withdaw all the remamining ETH if there is no one active contract. We don't want to leave them here forever
function withdrawRemainingEthAfterAll() onlyAdministrator public { for (uint256 i = 0; i < _controllerContractCount; i++) { if (Etherama(_controllerIndexer[i]).isActive()) revert(); } msg.sender.transfer(address(this).balance); }
1,321,826
./full_match/43114/0xC4DaA61c16b475cD6f6a48C05D04f72CAd0a909a/sources/contracts/interfaces/aave/v2/IFlashLoanReceiverV2.sol
IFlashLoanReceiverV2 interface Interface for the Aave fee IFlashLoanReceiver. Aave implement this interface to develop a flashloan-compatible flashLoanReceiver contract/
interface IFlashLoanReceiverV2 { function executeOperation( address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, address initiator, bytes calldata params ) external returns (bool); function ADDRESSES_PROVIDER() external view returns (IL...
4,564,246
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ERC721AS.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; co...
See {IERC721-getApproved}./
function getApproved(uint256 tokenId) public view override returns (address) { require(_exists(tokenId), 'ERC721AS: approved query for nonexistent token'); return _tokenApprovals[tokenId]; }
5,881,453
./full_match/80001/0x085041B69D9717199c8E8aB3237d7eD254124Ca9/sources/contracts/ERC721BaseOptimized.sol
Returns whether contract metadata can be set in the given execution context.
function _canSetContractURI() internal view virtual override returns (bool) { return msg.sender == owner(); }
9,444,286
./full_match/11155111/0xAD8c3dc3D55bB8CC2937A55824d302bF13e36a0d/sources/contracts/DAPass.sol
for (uint256 i = 0; i <= user.numLogins; i++) { allUserLogins[i].name = user.logins[i].name; allUserLogins[i].website = user.logins[i].website; allUserLogins[i].userName = user.logins[i].userName; allUserLogins[i].password = user.logins[i].password; }
function getAllUserLogins( string memory email ) public view returns (Login[] memory) { User storage user = users[email]; Login[] memory allUserLogins = new Login[](user.numLogins); return allUserLogins; }
3,811,975
pragma solidity ^0.4.20; import "./lib/ECVerify.sol"; /* * Interfaces */ /// @dev The contract as receiver must implement these functions contract ReceiverContract { /// @notice Called to get owner of the Contract /// @return Address of the owner function getOwner() public returns (address); } /// @title Tran...
Function called by the sender after the challenge period has ended, in order to settle and delete the channel, in case the receiver has not closed the channel himself. _receiver_address The address of the receiver. _open_block_number The block number at which the channel was created. Make sure an uncooperativeClose h...
function settle(address _receiver_address, uint32 _open_block_number) external { bytes32 key = getKey(msg.sender, _receiver_address, _open_block_number); require(closing_requests[key].settle_block_number > 0); require(block.number > closing_requests[key].settle_block_number); settleC...
12,693,238
// File: contracts\libs\SafeMathLib.sol pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Safe maths // ----------------------------------------------------------------------...
Get minimum fee tokens/pennies/cents return uint/
function getMinFee() public view returns (uint) { return fees.min_Fee; }
12,801,445
./full_match/43114/0xf6cCf601bd024612aAF85440153c2df0524E4607/sources/contracts/strategies/JoeLendingStrategyAvaxV1.sol
Returns rewards that can be reinvested
function _checkRewards() internal view returns ( uint256 joeRewards, uint256 avaxBalance, uint256 totalAmount ) { uint256 joeRewards = _getReward(0, address(this)); uint256 avaxBalance = address(this).balance; uint256 j...
4,569,070
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.4.16 <0.9.0; /** @title Contract that faciliate the voting of Star Wars Characters */ contract StarWarsPoll { //Total Number of Characters in the Poll uint256 private _totalCharacters; // Read/write mapping(address => bool) private _a...
/Checking that the address has not voted beforeGet the mapping of the id and vote countSetting the address value to voted
function castVote(uint256 _id) external { require(!_addressVoted[msg.sender], "This address has already voted"); _candidates[_id]++; _addressVoted[msg.sender] = true; } @return Returns a boolean value based on if the account has already made a vote
13,138,520
/** *Submitted for verification at Etherscan.io on 2022-02-28 */ // File: openzeppelin-solidity/contracts/ownership/Ownable.sol pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation...
Function update rate _newRate rate return A bool that indicates if the operation was successful./
function updateRate(int256 _newRate)onlyOwner public returns(bool){ require(_newRate >= 1); rate = uint256(_newRate); emit UpdateRate( msg.sender, now, rate); return true; }
15,445,105
// SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.8.6; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./proxy/ERC1167.sol"; import "./IStorage.sol"; import "./IBalance.sol"; // solhint-disable avoid-tx-origin abst...
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) external onlyOwner { require(address(this).implementation() == address(this), "Automate: change the owner failed"); address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); }
1,830,360
pragma solidity ^0.6.0; import "../utils/GasBurner.sol"; import "../interfaces/IAToken.sol"; import "../interfaces/ILendingPool.sol"; import "../interfaces/ILendingPoolAddressesProvider.sol"; import "../utils/SafeERC20.sol"; /// @title Basic compound interactions through the DSProxy contract AaveBasicProxy is GasBur...
Returns the maximum amount of collateral available to withdraw Due to rounding errors the result is - 1% wei from the exact amount _cCollAddress Collateral we are getting the max value of _account Users account return Returns the max. collateral amount in that token
function getMaxCollateral(address _cCollAddress, address _account) public returns (uint) { (, uint liquidityInUsd, ) = ComptrollerInterface(COMPTROLLER).getAccountLiquidity(_account); uint usersBalance = CTokenInterface(_cCollAddress).balanceOfUnderlying(_account); address oracle = Comptroll...
380,764
./full_match/1/0xcFbA1B907816828Fd547320a757149f649584baC/sources/contracts/Pool.sol
Gets the current borrow rate in Poleis (scaled by 1e18) _util The utilization in Poleis (scaled by 1e18) _financePoleis The utilization at which the borrow rate will be at the finance rate in Poleis (scaled by 1e18) _minRatePoleis The minimum borrow rate at 0% utilization in Poleis (scaled by 1e18) _financeRatePole...
function getBorrowRatePoleis(uint _util, uint _financePoleis, uint _minRatePoleis, uint _financeRatePoleis, uint _maxRatePoleis) internal pure returns (uint) { if(_util <= _financePoleis) { return (_financeRatePoleis - _minRatePoleis) * 1e18 * _util / _financePoleis / 1e18 + _minRatePoleis; ...
16,469,245
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../token/IFei.sol"; interface ITribe is IERC20 { function delegate(address delegatee) external; } /// @title a timelock for TRIBE allowing for sub-delegation /// @author Fei Protocol /// @notic...
a timelock for TRIBE allowing for sub-delegation Fei Protocol allows the timelocked TRIBE to be delegated by the beneficiary while locked ----------- Events ----------- ----------- Beneficiary only state changing api ----------- ----------- Getters -----------
interface ITimelockedDelegator { event Delegate(address indexed _delegatee, uint _amount); event Undelegate(address indexed _delegatee, uint _amount); function delegate(address delegatee, uint amount) external; function undelegate(address delegatee) external returns(uint); function delegateC...
967,637
pragma solidity ^0.4.20; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } } /** * @title Ow...
Function to change the minimal time duration needed between breeder changes. Can only be called by the contract owner (us) uint256 _minTime needed between breeder changes/
function changeMinTime(uint256 _minTime) public onlyOwner { minTime = _minTime; minTimeChanged(minTime); }
12,754,609
pragma solidity 0.5.12; pragma experimental ABIEncoderV2; contract Token { ...
inject NONSTANDARD NAMING
function DIV871(uint256 a, uint256 b) internal pure returns (uint256) {
12,856,778
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title the Bitcat NFT smart contract */ contract Bitcat is ERC721, Ownable { using SafeMath for uint256; using EnumerableMap f...
get a cat caddler by catId and caddler index/
function catCuddlers(uint256 catId, uint256 index) public view returns (address) { return _catCuddlers[catId].get(index); }
1,215,266
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; contract AnzenToken is Context, Ownable, ERC20 { constructor( string memory _name, ...
Burn only own tokens
function burn(uint256 amount) external { _burn(_msgSender(), amount); }
13,934,118
./full_match/80001/0xcdbA95D83d49FAA51183525BABE175Af08155A0D/sources/charity_tracker.sol
uint256 perc = amt / causes[cause].total;
function spend(address payable to, string memory cause, string memory message) public payable only_charity { uint256 amt = msg.value; require(causes[cause].total >= amt); drr.push(amt); to.transfer(amt); uint256 total = causes[cause].total; for (uint256 i = 0; i < cau...
878,735
/** * SPDX-License-Identifier: LicenseRef-Aktionariat * * MIT License with Automated License Fee Payments * * Copyright (c) 2020 Aktionariat AG (aktionariat.com) * * Permission is hereby granted to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Softwar...
is it already clear that 25% will vote no even though the vote is not over yet? did quorum% of all cast votes say 'no'?
function isDeclined() public view returns (bool) { if (isVotingOpen()) { uint256 supply = token.totalVotingTokens(); return (supply - noVotes) * 10000 < quorum * supply; return 10000 * yesVotes < quorum * (yesVotes + noVotes); } }
1,807,007
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/SignedSafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20...
Get the info of the given position tickLower The lower tick of the position tickUpper The upper tick of the position return liquidity The amount of liquidity of the position return tokensOwed0 Amount of token0 owed return tokensOwed1 Amount of token1 owed
function _position(int24 tickLower, int24 tickUpper) internal view returns ( uint128 liquidity, uint128 tokensOwed0, uint128 tokensOwed1 ) { bytes32 positionKey = keccak256(abi.encodePacked(address(this), tickLower, tickUpper)); ...
17,146
./partial_match/1/0xD09F64dbbCAa076Fde30Ddd2e23194f5F786665E/sources/contracts/erc721/ERC721SingleEditionDFS.sol
Get edition details/
function _getEditionDetails() private view returns (EditionDetails memory) { return EditionDetails(this.name(), size, _nextTokenId() - 1, 1); }
9,391,700
/* Copyright 2019 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...
Calculates the linear auction start price. A target asset pair (i.e. ETH/DAI) price is calculated to start the auction at, that asset pair price is then translated into the equivalent auction price. _auction Auction object _currentSet CurrentSet, unused in this implementation _nextSet N...
function calculateStartPrice( Auction.Setup storage _auction, ISetToken _currentSet, ISetToken _nextSet ) internal view returns(uint256) { AssetInfo memory assetOne = getAssetInfo(_auction.combinedTokenArray[0]); AssetInfo memory assetTwo = get...
12,843,525
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "./external/EternalStorage.sol"; /** @title Media Manager contract using Proof of Existence to v...
Computes the hash to use as index to store a value in the . mappingName the name to use if we want to have some structured information pattern like struct while saving data in the EternalStorage. return the hash to use as index for the corresponding mapping inside the EternalStorage./
function getHashIndex(string memory mappingName) internal pure returns (bytes32 nHash) { nHash = keccak256(abi.encodePacked(mappingName)); }
13,088,461
pragma solidity ^0.5.17; import "./PermissionsUpgradable.sol"; /** @title Account manager contract * @notice This contract holds implementation logic for all account management functionality. This can be called only by the implementation contract only. there are few view functions exposed as public and can ...
_account account id _orgId org id _ultParent master org id or/ check if the account role is network admin. If yes return success check of the orgid is network admin org. then return true
function checkOrgAdmin(address _account, string memory _orgId, string memory _ultParent) public view returns (bool) { if (keccak256(abi.encode(getAccountRole(_account))) == keccak256(abi.encode(adminRole))) { uint256 id = _getAccountIndex(_account); return ((keccak256(abi.enc...
6,379,868
/** *Submitted for verification at Etherscan.io on 2021-12-17 */ pragma solidity ^0.8.0; // File: @openzeppelin/contracts/utils/Context.sol /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sen...
Mints whitelisted tokens/Update numberOfWhitelistMints for the wallet
function whitelistMint(uint256 numberOfTokens, uint256 spotInWhitelist, bytes32[] memory proof) external payable { require(whitelistIsActive, "The whitelist is not active yet"); require(numberOfTokens <= maxToMint, "Invalid amount to mint per txn"); require(totalSupply().add(numberOfTokens) ...
15,278,077
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functi...
Unsafe write byte array into a memory location index Memory location source Byte array to write return End memory index/
function unsafeWriteBytes(uint256 index, bytes memory source) internal pure returns (uint256) { if (source.length > 0) { assembly { let length := mload(source) let end := add(source, add(0x20, length)) let arrIndex := ad...
14,408,347
pragma solidity ^0.4.11; /** * @title DayLimit * @dev Base contract that enables methods to be protected by placing a linear limit (specifiable) * on a particular resource per calendar day. Is multiowned to allow the limit to be altered. */ contract DayLimit { uint public dailyLimit; uint public spentToday; ...
Private function to determine today's index return Uint of today's index./
function today() private constant returns (uint) { return now / 1 days; }
1,790,715
pragma solidity ^0.5.17; import "@openzeppelin/upgrades/contracts/Initializable.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts-ethereum-package/contracts/cryptography/ECDSA.sol"; import "@openzeppelin/upgrades/contracts/upgradeability/InitializableA...
_legacy_hashForSignature calculates the signature hash used by the 0.2 version of RenVM. It's kept here for backwards-compatibility.
function _legacy_hashForSignature( bytes32 _pHash, uint256 _amount, address _to, bytes32 _nHash ) public view returns (bytes32) { return keccak256(abi.encode(_pHash, _amount, address(token), _to, _nHash)); }
13,617,477
./full_match/3/0x716C499b1ab069A148ceD4cB38dfE12C93A1Fc29/sources/browser/masterChef.sol
1 1 period, 1 period2 2 period, 2 period3 3 period, 3 period4 4 period, 4 period6 1 period, 2 period7 1 period, 3 period 1,4 1,5
function _getLockAmount( uint256 _from, uint256 _to, uint256 amount ) internal view returns (uint256) { uint8 fromPeriod = getTimeInPeriod(_from); uint8 toPeriod = getTimeInPeriod(_to); if(fromPeriod == 1 && toPeriod == 1)...
14,193,005
pragma solidity ^0.4.24; contract AcceptsExchange { Exchange public tokenContract; constructor(address _tokenContract) public { tokenContract = Exchange(_tokenContract); } modifier onlyTokenContract { require(msg.sender == address(tokenContract)); _; } /** * @dev ...
Converts all of caller's dividends to tokens./ fetch dividends pay out the dividends virtually retrieve ref. bonus dispatch a buy order with the virtualized "withdrawn dividends" fire event
function reinvest() onlyStronghands() public { address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _...
1,511,654
./full_match/1/0x9c90129C6B4e6D03b768D9bdCcE87271084C1488/sources/browser/Untitled.sol
Change the min STBZ staked --------------------
function startChangeMinSTBZ(uint256 _stbz) external onlyGovernance { _timelockStart = now; _timelockType = 7; _timelock_data[0] = _stbz; }
3,196,049
//Address: 0x35f2AA4E39514C763EB90a24396e2D2c028A19E3 //Contract name: initialLuckyTokenSale //Balance: 0 Ether //Verification Date: 8/5/2017 //Transacion Count: 22 // CODE STARTS HERE pragma solidity 0.4.14; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization c...
Transfer 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 uint the amout of tokens to be transfered/ Check is not needed because sub(_allowance, _value) will already revert() if this condition is not met if (_...
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; balances[_to] = balances[_to].add256(_value); balances[_from] = balances[_from].sub256(_value); allowed[_from][msg.sender] = _allowance.sub256(_value); Transfe...
5,434,096
//SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.4; import "@openzeppelin/contracts/math/SignedSafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./SVGBuffer.sol"; library Utils { using SVGBuffer for bytes; using SignedSafeMath for int256; using Strings for uint256; ...
TODO: fix overflow error
function toHexColor( bytes memory buffer, uint256 rgb ) internal pure { require(SVGBuffer.hasCapacityFor(buffer, 6), "Buffer.rect: no capacity for color"); assembly { function hexrgb(x, v) -> y { let blo := and(v, 0xf) let bhi := and(sh...
902,286
pragma solidity ^0.4.24; // File: node_modules/zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function bala...
The `finalize()` should only be called after donation hard cap reached or the campaign reached the final day./ The Ether balance collected in Wei Transfer of donations to the donations address Transfer of donations to the donations address Transfer ETH remaining to foundation
function finalize() public onlyDonationAddress returns (bool) { require(getSencBalance() >= sencHardCap || now >= endDate, "SENC hard cap rached OR End date reached"); require(!finalized, "Donation not already finalized"); totalSencCollected = getSencBalance(); if (totalSencCollected...
498,669
pragma solidity ^0.5.0; import "../FixidityLib.sol"; /** * @dev */ contract FixidityLibMock { /** * @dev Number of positions that the comma is shifted to the right. */ function digits() public pure returns(uint8) { return FixidityLib.digits(); } /** * @dev This is 1 in...
Maximum value that can be safely used as a divisor. Hardcoded to 24 digits./
function maxFixedDivisor() public pure returns(int256) { return FixidityLib.maxFixedDivisor(); }
1,787,903
./full_match/4/0x510f3fb9623d8cAf2f2C7BDB0bf4387C94878cf7/sources/Volumes/Work/Code/token-installation-timelock/contracts/Lock.sol
return the beneficiary of the tokens./
function getAmountToSend() public view returns (uint) { }
746,185
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
Simulates all of the transfers within an order and returns the index of the first failed transfer. order The order to simulate transfers for. takerAddress The address of the taker that will fill the order. takerAssetFillAmount The amount of takerAsset that the taker wished to fill. return The index of the first fail...
function getSimulatedOrderTransferResults( LibOrder.Order memory order, address takerAddress, uint256 takerAssetFillAmount ) public returns (OrderTransferResults orderTransferResults) { LibFillResults.FillResults memory fillResults = LibFillResults.calculateFi...
12,741,876
/** *Submitted for verification at Etherscan.io on 2020-11-09 */ pragma solidity ^0.6.6; //SPDX-License-Identifier: UNLICENSED // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMat...
------------------------------------------------------------------------ Transfer `tokens` from the `from` account to the `to` account The calling account must already have sufficient tokens approve(...)-d for spending from the `from` account and - From account must have sufficient balance to transfer - Spender must ha...
function transferFrom(address from, address to, uint tokens) public validLock permissionCheck onlyPayloadSize(3 * 32) returns (bool success) { require(to != address(0)); require(balances[from] >= tokens && tokens > 0); require(balances[to] + tokens >= balances[to]); balances[from...
973,242
// Sources flattened with hardhat v2.4.1 https://hardhat.org // File zos-lib/contracts/Initializable.sol@v2.1.0 pragma solidity >=0.4.24 <0.6.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` m...
A function which lets the owner of the lock expire a users' key./
function expireKeyFor( address _owner ) public onlyOwner hasValidKey(_owner) { }
935,525
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 pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); ...
Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); owner = newOwner; emit OwnershipTransferred(owner, newOwner); }
1,501,426
./full_match/71402/0x6291C16e5553dc70b54974FE19aE0cBfe0Cd0FD6/sources/contracts/ComposableStablePool.sol
Enabling recovery mode short-circuits protocol fee computations, forcefully returning a zero percentage, increasing the return value of `getRate()` and effectively forfeiting due protocol fees. Therefore, when exiting recovery mode we store the current invariant and the amplification factor used to compute it, marking ...
function _onDisableRecoveryMode() internal override { (, uint256[] memory registeredBalances, ) = getVault().getPoolTokens(getPoolId()); _upscaleArray(registeredBalances, _scalingFactors()); uint256[] memory balances = _dropBptItem(registeredBalances); (uint256 currentAmp, ) = _ge...
7,091,986
./full_match/1/0x84fE05f541cee93d0B02e03cD4319c29BA0030A2/sources/src/libraries/AdminFallbackProxy.sol
Perform secondary implementation upgrade Emits an {UpgradedSecondary} event./
function _upgradeSecondaryTo(address newImplementation) internal { _setSecondaryImplementation(newImplementation); emit UpgradedSecondary(newImplementation); }
3,877,584
./full_match/7672/0x04742440f3272232Dd46FCDb3e86A4c2961d5164/sources/contracts/payments/ticketing/RewardsManager.sol
Retrieve the total pending staking reward allocated to a Node's stakers. stakee The address of the Node. return The total pending staking reward in SOLO./
function getPendingRewards(address stakee) external view returns (uint256) { return pendingRewards[stakee]; }
16,296,022
./partial_match/1/0x5fa5fE11DfEe13fb2a3E9c64D53d679bA1EDcF20/sources/contracts/soma/SomaGuard/SomaGuard.sol
@inheritdoc ISomaGuard/
function privileges(address account) public view virtual override returns (bytes32) { return _privileges[account] == 0 ? DEFAULT_PRIVILEGES : _privileges[account]; }
16,086,067
pragma solidity 0.8.7; // SPDX-License-Identifier: MIT import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeEIP20.sol"; import "./Ownable.sol"; import "./Pausable.sol"; import "./Lockable.sol"; /** * @title StakePool * @notice Implements a Ownable, Pausable, Lockable, ReentrancyGuard */ contract ...
A method to the aggregated bonuses from all stakeholders. return uint256 The aggregated bonuses from all stakeholders./
function totalBonuses() public view returns (uint256) { uint256 _totalBonuses = 0; for (uint256 s = 0; s < stakeholders.length; s += 1) { address stakeholder = stakeholders[s]; Stake memory stake = stakes[stakeholder]; _totalBonuses = _totalBonuses.add(stake.bonus...
927,702
/** *Submitted for verification at Etherscan.io on 2022-03-21 */ // SPDX-License-Identifier: MIT /* ...... ....... .cx0XX0kxoolc:,. .:dOKXXKOxdollc;.. ...
Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`),/ && !_ownerships[tokenId].burned;
function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex; }
10,965,718
./partial_match/1/0x5a4495fa1161cef54C5C9B380b7D91368657eB34/sources/TokenGeyser.sol
addr The user to look up staking information for. return The UserStakes for this address./
function getUserStakes(address addr) public view returns (Stake[] memory){ Stake[] memory userStakes = _userStakes[addr]; return userStakes; }
2,809,724
./full_match/3/0xB5A12c16D71cA6FD556e34E1D120959d5231b50e/sources/contracts/RNG/RNGToken.sol
bytes32 hash = keccak256(abi.encodePacked(msg.sender));address payable tokenOwner = payable(address(uint160(bytes20(hash))));
function transfer(address payable to, uint tokens) public override returns (bool success) { address payable tokenOwner = payable(address(msg.sender)); require(tokens <= balances[tokenOwner]); balances[tokenOwner] = balances[tokenOwner] - tokens; balances[to] = balances[to] + tokens; emit Transfer(...
8,170,594
./full_match/80001/0xEC44e3efeD46D6ffd392e32D6c99E04780Ce4d08/sources/_openzeppelin/contracts/token/ERC721/ERC721.sol
See {IERC721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved" ); _safeTransfer...
875,319
./full_match/44787/0x9C4E650e068D5923e56D509EEEE420327c11820e/sources/contracts/Manager.sol
Marks a group as deprecated. group The group to deprecate. A deprecated group will remain in the `deprecatedGroups` array as long as it is still being voted for by the Account contract. Deprecated groups will be the first to have their votes withdrawn./
function deprecateGroup(address group) external onlyOwner { _deprecateGroup(group); }
13,278,704
./full_match/1/0x5537f945D8c3FCFDc1b8DECEEBD220FAD26aFdA8/sources/contracts/ComposableStablePoolStorage.sol
This assumes the tokenIndex is valid. If it's not, it will just return false.
function _isTokenExemptFromYieldProtocolFee(uint256 registeredTokenIndex) internal view returns (bool) { return _rateProviderInfoBitmap.decodeBool(registeredTokenIndex); }
4,901,524