file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// // &&&& // &&&& // &&&& // &&&& &&&&&&&&& &&&&&&&&&&&& &&&&&&&&&&/ &&&&.&&&&&&&&& // &&&&&&&&& &&&&& &&&&&& &&&&&, &&&&& &&&&& &&&&&&&& &&&& // &&&&&& &&&& &&&&# &&&& &&&&& ...
name the schedule name return the schedule/
function getSchedule(string calldata name) external view returns (uint128[] memory, uint128[] memory) { return ( schedules[name].durations, schedules[name].percents ); }
409,078
./full_match/5/0x1caD01f5028d265E079096B3fBF6E102f7708eE1/sources/project_/contracts/Main.sol
calculates gross Mint Reward/
function getGrossReward( uint256 rankDelta, uint256 amplifier, uint256 term, uint256 eaa ) public pure returns (uint256) { int128 log128 = rankDelta.fromUInt().log_2(); int128 reward128 = log128.mul(amplifier.fromUInt()).mul(term.fromUInt()).mul(eaa.fromUInt()); ...
1,946,332
./full_match/1/0x130AD7815c795De55B9FADB443cc0E4A343d0F85/sources/contracts/TokenSale.sol
Allows admin to collect payment for the sold tokens./
function withdraw() external onlyOwner whenSuccess { require(sent, "Transfer failed"); }
8,400,932
./full_match/44787/0x000e0ce15E44C928C302DC4b71eCA15505034582/sources/contracts/GlobalP2P.sol
Change address of wallet implementayion to a new one _walletLogic address of contracts/
function updateWalletLogic(address _walletLogic) public onlyOwner whenPaused { walletLogic = _walletLogic; }
13,259,732
//██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ //██╔══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║████╗ ██║ //██████╔╝███████║██║ ███████║██║ ██║██║██╔██╗ ██║ //██╔═══╝ ██╔══██║██║ ██╔══██║██║ ██║██║██║╚██╗██║ //██║ ██║ ██║███████╗██║ ██║██████╔╝██║██║ ╚████║ //╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════...
Burn the given token owner Address of the token owner tokenId Id of the token to burn return bool : success/Reset the token approvalUpdate data in storage
function _burn(address owner, uint256 tokenId) internal virtual returns(bool) { _approve(address(0), tokenId); totalSupply = totalSupply.sub(1); _removeTokenToOwner(owner, tokenId); owners[tokenId] = address(0); emit Transfer(owner, address(0), tokenId); return tru...
12,938,581
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "../node_modules/hardhat/console.sol"; /** * @notice this contract outlines a Badger NFT's attributes and mint/burn mechanics */ contract Badger { // Events are logging mechanisms that log in a transactions logs on chain // Learn more here: ht...
increases a Badger's level and burns the Badger when maxLevel is reached _badgerId is the badger to increase level/ 1) simply increase _badgerId's level by 1. Note: you can add one into solidity like this: variable++ Before solidity 0.8.0 you had to use a math library to prevent overflow 2) check if _badgerId's level ...
function _levelUp(uint256 _badgerId) private { }
12,659,674
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "./UniswapLib.sol"; import "../../interfaces/ISwapQueryHelper.sol"; import "../../access/Controllable.sol"; /** * @dev Uniswap helpers */ contract UniswapQueryHelper is ISwapQueryHelper, Controllable { address private customFactory; /** ...
does token have a pool/
function hasPool(address token) external view override returns (bool) { return UniswapLib.hasPool(token); }
15,854,876
// SPDX-License-Identifier: MIT // // TNT-721 Non-Fungible Token implementation based on the OpenZeppelin Lib // pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view vir...
solhint-disable-next-line max-line-length
function transferFrom(address from, address to, uint256 tokenId) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "TNT721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); }
892,039
// File: @ensdomains/ens/contracts/ENS.sol pragma solidity >=0.4.24; interface ENS { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. ...
Configures a domain, optionally transferring it to a new owner. name The name to configure. _owner The address to assign ownership of this domain to. _transfer The address to set as the transfer address for the name when the permanent registrar is replaced. Can only be set to a non-zero value once./ Ne...
function configureDomainFor(string memory name, address payable _owner, address _transfer) public owner_only(keccak256(bytes(name))) { bytes32 label = keccak256(bytes(name)); Domain storage domain = domains[label]; if (BaseRegistrar(registrar).ownerOf(uint256(label)) != address(this)) { ...
1,073,574
pragma solidity 0.7.0; // SPDX-License-Identifier: MIT import { IERC20 } from "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol"; library Math { function min(uint x, uint y) internal pure returns (uint z) { ...
lend(WETH, amount);
function lendETH() external payable { uint amount = msg.value; address asssetPool = factoryV1.getPool(WETH); require(asssetPool != address(0), 'UnilendV1: Pool Not Found'); require(IUniLendV1Pool(asssetPool).getLendStatus(), 'UnilendV1: Asset not Available for Lending'); ...
7,302,797
./partial_match/1/0x16448014A29484b82E3A5A6cF254E5C563A28929/sources/ERC20.sol
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - only minter can mint - `to` cannot be the zero address./
function _mint(address account, uint256 amount) internal virtual { require(_msgSender() == minter, "ERC20: only the minter can mint"); require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.a...
2,845,217
./full_match/3/0x857cde2d9bF01D860A7C8e9406A655BA546e527a/sources/browser/TicketControl.sol
Get ticket's identification document
function getTicketDocument(uint _ticketId) external view isControlAgent returns(string memory) { require(tickets[ticketIdToKey[_ticketId]].expiracyTime > block.timestamp, "The ticket is expired!"); return tickets[ticketIdToKey[_ticketId]].identificationDocumentHash; }
14,202,657
./full_match/137/0xb6Bc9B50b4AC1397AB03d8a24d8fa529a5070ff0/sources/contracts/access/AccessController.sol
Internal function to set user permission over a role role The bytes32 value of the role account The address of the account permission The permission status
function _setPermission(bytes32 role, address account, bool permission) internal { bytes32 key = _getKey(role, account); key.setBool(permission); emit PermissionSet(role, account, permission); }
4,740,288
./full_match/3/0xA1cA1Ee2164C091898B8104c5eC6c05cE9ef196a/sources/localhost/mastercheff.sol
Perform LP token migration from legacy UniswapV2 to PollSwap. Take the current LP token address and return the new LP token address. Migrator should have full access to the caller's LP token. Return the new LP token address. XXX Migrator must have allowance access to UniswapV2 LP tokens. PollSwap must mint EXACTLY the ...
interface IMigratorToPollSwap { function migrate(IERC20 token) external returns (IERC20); }
14,258,168
./full_match/43114/0x352bBd0702A4B6275afA215a18cAeD517B378b0C/sources/contracts/PREZALE.sol
function togglePurchaseEnabled(address tokenAddress, bool disabled) public onlyOwner { ProjectAddress memory addy = ProjectAddresses[tokenAddress]; if(addy.tokenAddress == tokenAddress) { PresalePart2 storage presaleinfo2 = presaleInfos2[addy.index]; presaleinfo2.disabledPurchase = disabled; ...
function buyTokensForBnb(address tokenAddress, address referrerAddress) public payable { require(referrerAddress != tx.origin, "You cannot be the referrer for your own wallet, please use address 0x000.. instead"); ProjectAddress memory addy = ProjectAddresses[tokenAddress]; if(addy.tokenAddr...
4,533,135
./full_match/5/0x8c479c44Ff55859D2812d75A72bD3ebA037816f3/sources/contracts/Operazioni.sol
Set the new vale `_n2 2` The Alexandr N. Tetearing algorithm could increase precision _n2 The number of rings from dendrochronological sample
function multiplyBy(uint _n2) public { n1 = n1 * _n2; }
1,925,333
pragma solidity ^0.4.23; pragma solidity ^0.4.17; /** * @title Token * @dev Token interface necessary for working with tokens within the exchange contract. */ contract IToken { /// @return total amount of tokens function totalSupply() public constant returns (uint256 supply); /// @param _owner The add...
calculate fee including special promotions
function calculateFee(uint amount) private constant returns(uint256) { uint256 feeTakeXfer = 0; uint length = specialFees.length; bool applied = false; for(uint i = 0; length > 0 && i < length; i++) { SpecialTokenBalanceFeeTake memory special = specialFees[i]; if(special.exist &&...
15,338,492
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import { console } from "hardhat/console.sol"; import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import { ERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import { IERC20 } from "@openzeppelin/...
Check if the contract has enough LINK to pay the oracle
function requestRandomNumberFor(uint256 plantId) internal { if (LINK.balanceOf(address(this)) < chainlinkFee) revert InsufficientLinkFunds(); bytes32 requestId = requestRandomness(chainlinkKeyHash, chainlinkFee); requestIdToPlantId[requestId] = plantId; requestIdToAddress[requestId] ...
12,543,933
./full_match/1/0x0cBE2dF57CA9191B64a7Af3baa3F946fa7Df2F25/sources/Synth.sol
Set the exchange fee, anywhere within the range 0-10%. The fee rate is in decimal format, with UNIT being the value of 100%./
function setExchangeFeeRate(uint _exchangeFeeRate) external optionalProxy_onlyOwner { require(_exchangeFeeRate <= MAX_EXCHANGE_FEE_RATE, "Exchange fee rate must be below MAX_EXCHANGE_FEE_RATE"); exchangeFeeRate = _exchangeFeeRate; emitExchangeFeeUpdated(_exchangeFeeRate...
4,836,213
./partial_match/5/0x982EA290FeA23539dBd6B642410eB3c105926616/sources/FxERC20ChildTunnel.sol
deposit tokens call `onTokenTranfer` on `to` with limit and ignore error solium-disable-next-line security/no-inline-assembly
function _syncDeposit(bytes memory syncData) internal { (address rootToken, address depositor, address to, uint256 amount, bytes memory depositData) = abi.decode(syncData, (address, address, address, uint256, bytes)); address childToken = rootToChildToken[rootToken]; IFxERC20 childTokenCont...
16,832,828
./full_match/56/0xD8cf478df654912431f1b41B635a7C8393B8a495/sources/project_/contracts/BUSDStakerV12.sol
withdraw capital by deposit id
function withdrawCapital(uint256 id) public nonReentrant { require(!paused, "Withdraw paused!!!"); require( depositState[id].investor == msg.sender, "only investor of this id can claim reward" ); require( depositState[id].depositAt + withdrawPeriod...
3,252,387
./full_match/80001/0xCB881D41157ad64Fe76A0Cd0476EF3E3233d86Fe/sources/project_/contracts/ClaimTopicsCollection.sol
Add a batch of trusted claim topics claimTopics claim topic identification/
function _addClaimTopicBatch(uint256[] memory claimTopics) internal { for (uint256 i = 0; i < claimTopics.length; i++) { _addClaimTopic(claimTopics[i]); } }
843,483
./full_match/42220/0xaBb380Bd683971BDB426F0aa2BF2f111aA7824c2/sources/contracts/MarketPlace/MarketPlaceV2.sol
See {INFTKEYMarketPlaceV1-getBidderTokenBid}./
function getBidderTokenBid(uint256 tokenId, address bidder) public view returns (Bid memory) { Bid memory bid = _tokenBids[tokenId].bids[bidder]; if (_isBidValid(bid)) { return bid; } }
16,314,825
pragma solidity ^0.4.23; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address publi...
Enable the transfers of this token. Can only be called once./
function enableTransfers() external onlyOwner { require(!transferable); transferable = true; emit EnabledTransfers(); }
6,382,230
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "./IManagement.sol"; import "./ACL.sol"; import "./ERC165.sol"; import "./ERC20Token/ILivelyToken.sol"; contract Management is ERC165, ACL, IManagement { int8 private constant _CONSENSUS_ACCEPTED_QUORUM_FULL = 100; int8 private constant _CONSENSUS...
convert bytes to unit8/
function _toUint8(bytes memory data, uint256 start) private pure returns (uint8) { if (data.length < start + 1) revert IllegalArgumentError(); uint8 tempUint; assembly { tempUint := mload(add(add(data, 0x1), start)) } return tempUint; }
12,861,191
// 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...
Return address of the pooled token at given index. Reverts if tokenIndex is out of range. index the index of the token return address of the token at given index/
function getToken(uint8 index) public view virtual returns (IERC20) { require(index < swapStorage.pooledTokens.length, "Out of range"); return swapStorage.pooledTokens[index]; }
35,123
./full_match/1/0x4d40ea8FaB99544A64C6B7c2C98DD19d7BC170A7/sources/XFatherBot.sol
once enabled, can never be turned off
function enableTrading() external onlyOwner { tradingActive = true; swapEnabled = true; preMigrationPhase = false; buyRevShareFee = 2; buyLiquidityFee = 3; buyTeamFee = 10; buyTotalFees = buyRevShareFee + buyLiquidityFee + buyTeamFee; sellRevShareFee...
9,778,374
./partial_match/1/0x8053DA7eb0014c65275fC099C7a7e0d9a5616863/sources/Dino.sol
get the participant address by her index starting from 0.
function getParticipantAddressByIndex(uint256 index) public view returns(address){ return _participants[index]; }
2,637,411
./partial_match/1/0x0c9796fD8B4645358ee23Fb7920F9d4e617a524d/sources/OneCoinToken.sol
See {IERC1820Implementer-canImplementInterfaceForAddress}./
function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) public view override returns (bytes32) { return _supportedInterfaces[interfaceHash][account] ? _ERC1820_ACCEPT_MAGIC : bytes32(0x00); }
2,609,966
./full_match/97/0xef5a6C4C5411D3cc3680b10A71afb235c8aF127b/sources/project_/contracts/factory.sol
Sets the address of initial implementation, and the contract's deployer as the initial owner of the contract./
function initialize(address _beacon) public initCheck { factoryOwner = payable(msg.sender); beacon = _beacon; }
3,273,644
pragma solidity 0.5.16; pragma experimental ABIEncoderV2; import "./LibEIP712.sol"; import "./LibOrder.sol"; contract LibRequest is LibEIP712, LibOrder { // solhint-disable max-line-length string private constant REQUEST_TYPE = "CancelRequest(Order order,uint256 nonce)Order(address userAddress,uint256 amo...
solhint-disable max-line-length
{ string private constant REQUEST_TYPE = "CancelRequest(Order order,uint256 nonce)Order(address userAddress,uint256 amount,uint256 price,uint256 orderType,bool side,uint256 salt,address baseAssetAddress,address quoteAssetAddress,address feeAddress,uint256 makerFeePercentage,uint256 takerFeePercentage)"; bytes32...
7,327,030
./partial_match/7700/0x1Fe6845ebc54D4B4aE1Dde438BA44fc4d41342d5/sources/src/EfficientlyAllocatingPool.sol
view allocation balance change ABI to `constant`
function sharesBalanceOfPool(address _allocation) external override returns (uint256) { return _balance(platformAdapter[_allocation], _allocation); }
3,506,077
pragma solidity ^0.4.18; // solhint-disable-line /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f0b0a1b0a2f0e17060002150a01410c00">[email&#160;protected]</a>> (https://github.com/dete) c...
Third-party initiates transfer of token from address _from to address _to _from The address for the token to be transferred from. _to The address for the token to be transferred to. _tokenId The ID of the Token that can be transferred if this call succeeds. Required for ERC-721 compliance.
function transferFrom( address _from, address _to, uint256 _tokenId ) public { require(_owns(_from, _tokenId)); require(_approved(_to, _tokenId)); require(_addressNotNull(_to)); _transfer(_from, _to, _tokenId); }
6,648,119
/** *Submitted for verification at Etherscan.io on 2022-04-25 */ /** https://t.me/InsidorEthEntry ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠉⠙⠲⡀⠀ ⠀⠀⠀⣴⠿⠏⠀⠀⠀⠀⠀⠀ ⢳⡀⠀⡏⠀⠀⠀⠀ ⠀ ⢷ ⠀⠀⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀⠀⠀⠀ ⡇ ⠀⠀⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿⠀⣸ hello ⡇ ⠀⠀⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀ ⣿⠀⢹⠀⠀⠀⠀⠀ ⡇ ⠀⠀⠙⢿⣯⠄⠀⠀⠀⢀⡀⠀⠀⡿⠀⠀⡇⠀⠀⠀⠀ ⡼ ⠀⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀⠀⠘⠤⣄⣠⣄⣠⣄⠞...
exclude from paying fees or having max transaction amount
constructor() ERC20("INSIDOR", "INSIDOR") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IU...
15,345,079
// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "LinkTokenInterface.sol"; import "VRFConsumerBase.sol"; import "Ownable.sol"; import "ERC721.sol"; //import "ERC721URIStorage.sol"; import "EthUsPriceConversion.sol"; import "State.sol"; contract MyStorage is ERC721, VRFConsumerBase, Ownable { usin...
Update the funding state newState - change to new state/
function setState(uint32 newState) external { require((newState >= 0 && newState <=2), "Invalid number for state. 0=OPEN 1=END 2=CLOSED"); if (newState == 0) state = STATE.OPEN; else if(newState == 1) state = STATE.END; else if(newState == 2) stat...
358,960
./full_match/5/0x433223b7Da337c68240683f552d97571F0484D3f/sources/project_/contracts/STR.sol
Requests to mint a specified amount of tokens. amount The amount of tokens to be minted.
function requestToMint(uint256 amount) public onlyParticipant { realDigital.mint(msg.sender, amount); }
1,917,347
./full_match/1/0xb688801cadb4Ddb6980bb777d42972C24f920855/sources/solidity/contracts/core/VaultController.sol
Change the initial borrowing fee _newBorrowingFee The new borrowing fee
function changeInitialBorrowingFee(uint192 _newBorrowingFee) external override onlyOwner { if (_newBorrowingFee >= MAX_INIT_BORROWING_FEE) revert VaultController_FeeTooLarge(); uint192 _oldBorrowingFee = initialBorrowingFee; initialBorrowingFee = _newBorrowingFee; emit ChangedInitialBorrowingFee(_old...
9,677,975
pragma solidity ^0.5.8; // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol interface IERC20 { ...
inject NONSTANDARD NAMING
function RENOUNCEOPERATOR674() public {
2,480,334
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `...
owner call to withdraw this contracts EON balance 20% to the Imperial guild treasury, the remainder is then burned
function withdrawEonAndBurn() external onlyOwner { uint256 guildAmt = eonToken.balanceOf(address(this)) * (ImperialGuildTax / 100); uint256 amtToBurn = eonToken.balanceOf(address(this)) - guildAmt; eonToken.transferFrom(address(this), ImperialGuildTreasury, guildAmt); eon...
1,247,607
/** *Submitted for verification at Etherscan.io on 2022-04-01 */ // Sources flattened with hardhat v2.9.1 https://hardhat.org // File @openzeppelin/contracts/utils/[email protected] // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides in...
See {IERC721-approve}./
function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) revert ApprovalCallerNotOwnerNorApproved(); _approve(to, ...
2,328,108
./full_match/1/0x5036BD87b5294878587230C3A87d50584B52ae39/sources/contracts/facets/AdminFacet.sol
Allow owner to freeze the metadata/
function freezeMetadata() external onlyOwner { require(!LibDiamondDapes.diamondDapesStorage().metadataFrozen, "ApeFathers: metadata is already frozen"); LibDiamondDapes.diamondDapesStorage().metadataFrozen = true; }
16,465,648
pragma solidity >=0.4.24; /** * @title -Security PO8 Token * SPO8 contract records the core attributes of SPO8 Token * * ███████╗██████╗ ██████╗ █████╗ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ * ██╔════╝██╔══██╗██╔═══██╗██╔══██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ * ███████╗██████╔...
Change CEO and CFO and BOD address or name
function changeCEO(address newCEO) public onlyBoss { require(newCEO != address(0)); emit CEOTransferred(CEO, newCEO); CEO = newCEO; }
2,482,209
./full_match/100/0xb99DD00840AeAbCCb4F30cBBe1F51Db7BCb020eD/sources/contracts/official/IRO1/IRO1Token.sol
Gets current interest/
function getCurrentInterest() public view returns (uint256) { return getPercentByTime(block.timestamp); }
14,284,836
/** *Submitted for verification at Etherscan.io on 2021-07-12 */ // File: @openzeppelin/contracts/math/SafeMath.sol pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in...
set cap/ TODO: When this function is improved to be called on-chain, the source of `getStorageLastCumulativeHoldersPriceCap` can be rewritten to `getStorageLastCumulativeHoldersRewardPrice`.
function updateCap(uint256 _cap) external { address setter = IPolicy(config().policy()).capSetter(); require(setter == msg.sender, "illegal access"); ( , uint256 holdersPrice, , uint256 cCap ) = calculateCumulativeRewardPrices(); setStorageCumulativeHoldersRewardCap(cCap)...
5,442,647
// SPDX-License-Identifier: MIT ...
inject NONSTANDARD NAMING
function ADDVOTES925(address voter, uint amount) external {
12,851,148
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * ...
Count all NFTs assigned to an owner NFTs assigned to the zero address are considered invalid, and this function throws for queries about the zero address. _owner An address for whom to query the balance return The number of NFTs owned by `_owner`, possibly zero
function balanceOf(address _owner) override external view returns (uint256) { require(_owner != address(0), "Invalid owner"); return balances[_owner]; }
105,854
pragma solidity 0.4.20; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev In...
For external purchases & pre-sale via btc/fiat
function externalPurchaseTokens(address _investor, uint _amount, uint _bonusAmount) onlyOwner external { require(_amount > 0); uint256 totalTokensToAllocate = _amount.add(_bonusAmount); require(getTokensLeft() >= totalTokensToAllocate); totalTokensAllocated = totalTokensAllocated.add(totalT...
5,343,266
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; // ============ Internal Imports ============ import {BridgeRouter} from "./BridgeRouter.sol"; import {IWeth} from "../../interfaces/bridge/IWeth.sol"; // ============ External Imports ============ import {TypeCasts} from "@celo-org/optics-sol/con...
Assert that the given domain has a xApp Router registered and return its address _domain The domain of the chain for which to get the xApp Router return _remote The address of the remote xApp Router on _domain/
function _mustHaveRemote(uint32 _domain) internal view returns (bytes32 _remote) { _remote = remotes[_domain]; require(_remote != bytes32(0), "!remote"); }
1,209,184
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./SpaceshipToken.sol"; ///@title Spaceship Marketplace ///@author Dhruvin ///@notice A platform to buy-sell spaceship ///@dev Escrow contract contract SpaceshipMarketplace { ///@notice custom Sale struct with attributes struct Listing { ...
Get total number of listings read the length of the {listings}return uint256 The lenght of the {listings}
function nListing() public view returns(uint256) { return listings.length; }
14,082,006
./partial_match/1/0x13F56D5d6193EE95F094fe9448Cbbd783dF95498/sources/src/Replicator.sol
@inheritdoc ERC721SeaDrop/
function tokenURI( uint256 tokenId ) public view override(ERC721SeaDrop) returns (string memory) { if (!_exists(tokenId)) revert Replicator_TokenDoesNotExist(); return bytes(_baseURI()).length > 0 ? string(abi.encodePacked(_baseURI(), _toS...
3,587,517
./full_match/7700/0x4f07f0a2AE51ac40fb5FbdDaC242B5D22Cc0C992/sources/contracts/Plebness.sol
@inheritdoc IPlebness
function getSpreadForFacialHairAssets() external view override returns (uint256) { return facialHairSpreadFactor; }
4,649,790
./full_match/5/0x32ff4D05236E95FF60299E9b7BaB351179138389/sources/contracts/core/interfaces/callback/ISwapCallback.sol
Callback for IPoolswap Any contract that calls IPoolswap must implement this interface
interface ISwapCallback { function swapCallback( int256 deltaQty0, int256 deltaQty1, bytes calldata data ) external; pragma solidity >=0.8.0; }
1,940,676
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title IFlashLoanReceiver 接口 /// @dev 实现这个接口,开发aave闪电贷 interface IFlashLoanReceiver { function executeOperation(address _reserve, uint256 _amount, uint256 _fee, bytes calldata _params) external; }
IFlashLoanReceiver 接口 实现这个接口,开发aave闪电贷
interface IFlashLoanReceiver { function executeOperation(address _reserve, uint256 _amount, uint256 _fee, bytes calldata _params) external; }
7,217,776
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when ...
set staking Address
function setStakingAddress(address addr) public onlyOwner { allowed[stakingContract] = false; stakingContract = addr; allowed[stakingContract] = true; }
11,684,295
/** *Submitted for verification at Etherscan.io on 2021-12-18 */ // Sources flattened with hardhat v2.6.5 https://hardhat.org // File contracts/libs/TransferHelper.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.6; // helper methods for interacting with ERC20 tokens and sending ETH that do n...
Returns lastPriceList and triggered price info channelId 报价通道编号 pairIndex 报价对编号 count The number of prices that want to return return prices An array which length is num 2, each two element expresses one price like blockNumber|price return triggeredPriceBlockNumber The block number of triggered price return trigger...
function lastPriceListAndTriggeredPriceInfo(uint channelId, uint pairIndex, uint count) external view override noContract returns ( uint[] memory prices, uint triggeredPriceBlockNumber, uint triggeredPriceValue, uint triggeredAvgPrice, uint triggeredSigmaSQ ) { ...
6,700,075
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.3; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@...
Returns the number of offers made./
function getOfferQuantities() external view returns (uint256) { return offerCounter.current(); }
13,037,280
./full_match/5/0xec604D759AD3c3498C9Ca0fBb89b4f1dE649C742/sources/contracts/TokenVesting.sol
Computes the vested amount of tokens for the given vesting schedule identifier. return the vested amount/
function computeReleasableAmount(bytes32 vestingScheduleId) public view onlyIfVestingScheduleNotRevoked(vestingScheduleId) returns (uint256) { return _computeReleasableAmount(vestingSchedules[vestingScheduleId]); }
1,914,562
pragma solidity 0.4.24; // File: node_modules/zeppelin-solidity/contracts/math/SafeMath.sol /** * @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) in...
unverified investors can withdraw their money only after the VREO Sale ended
function withdrawInvestment() public { require(hasClosed()); super.withdrawInvestment(); }
7,310,453
./full_match/5/0x3BC316d7a8538f0EE6Ae1917360f0e0f5Fd41576/sources/contracts/ConferPay.sol
Expert can only cancel if the student has not deposited yet
function abort() external onlyOwner inState(State.Created){ expert.transfer(address(this).balance); state = State.Inactive; }
11,612,491
pragma solidity ^0.5.0; /** * @title Elliptic curve signature operations * @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d * TODO Remove this library once solidity supports passing a signature to ecrecover. * See https://github.com/ethereum/solidity/issues/864 */ library ECDSA { /...
Calculate EIP712Domain TypeHash
function hashDomain(EIP712Domain memory eip712Domain) internal pure returns (bytes32) { return keccak256( abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(eip712Domain.name)), keccak256(bytes(eip712Domain.version)), eip712Domain....
895,943
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @title QuickScopeVote - A simple contract which collects votes to act the Unimergency operation * @dev the vote can be done by staking the tokens of the preselected DFOhub Programmable Equities (buidl, arte, UniFi). * The vote can be performed for a cert...
return The block number indicating the start of the voting period/
function startBlock() public view returns (uint256) { return _startBlock; }
1,988,992
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/Context.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contra...
Set a new address for SCV's share/
function setSCVReward(address scvReward_) public virtual { require( hasRole(OPERATOR_ROLE, _msgSender()), 'must have operator role to change cp reward address' ); scvReward = scvReward_; }
1,786,880
./full_match/43113/0x2148a45E33050A799b3fEb906da7644466F2F2aC/sources/contracts/Lottery.sol
changes the fees. make sure they add up to 100%
function setFees( uint256 prize, uint256 rollOver, uint256 buyBack, uint256 dividents, uint256 insurance, uint256 affiliate ) external onlyOwner { prizeFee = prize; rollOverFee = rollOver; buyBackFee = buyBack; dividentsFee = dividents; insuranceFee = insurance; affiliateRewardsFee = affiliate...
13,181,868
./full_match/137/0x9755F4FeE8A4e5026a32423f54114Adf5b050545/sources/contracts/DexAdapter.sol
Curve does not check the deadline hence this check is necessary before the swap.
function _swapWithCurve(SwapParams memory _params) private returns (uint256[3] memory) { _require(_params.deadline >= block.timestamp, Errors.SWAP_DEADLINE_PASSED.selector); (address[] memory path, address[] memory pools) = abi.decode(_params.encodedPath, (address[], address[])); uint256 amo...
4,756,782
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import { Lib_PredeployAddresses } from "../../../libraries/constants/Lib_PredeployAddresses.sol"; import { L1BuildDeposit } from "./L1BuildDeposit.sol"; import { L1BuildStep1 } from "./L1BuildStep1.sol"; import { L1BuildStep2 } from "./L1BuildStep2.sol"; import {...
Sets the addresses of L1CrossDomainMessenger, L1CrossDomainMessengerProxy L1StandardBridgeProxy, L1ERC721BridgeProxy _chainId Chain ID of the Verse-Layer network. _l1CrossDomainMessenger Address of the L1CrossDomainMessenger contract. _l1CrossDomainMessengerProxy Address of the L1CrossDomainMessengerProxy contract. ...
function setStep3Addresses( uint256 _chainId, address _l1CrossDomainMessenger, address _l1CrossDomainMessengerProxy, address _l1StandardBridgeProxy, address _l1ERC721BridgeProxy ) external { require(msg.sender == step3Address, "only the L1BuildStep3 can call"); ...
12,868,021
./full_match/137/0x350c116680b8556D04a57A5a96baa4f375325197/sources/contracts/MainV2Beta.sol
Change the Tokens contract address
function changeTokensAddress(address _newTokensAddress) external onlyOwner { tokens = ITokens(_newTokensAddress); }
4,672,942
pragma solidity ^0.4.17; import "zeppelin-solidity/contracts/ECRecovery.sol"; import "zeppelin-solidity/contracts/MerkleProof.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; library JobLib { using SafeMath for uint256; // Prefix hashed with message hash when a signature is produced by the eth_s...
Checks if a transcode receipt hash was included in a committed merkle root _streamId StreamID for the segment _segmentNumber Sequence number of segment in the stream _dataHash Hash of segment data _transcodedDataHash Hash of transcoded segment data _broadcasterSig Broadcaster signature over h(streamId, segmentNumb...
function validateReceipt( string _streamId, uint256 _segmentNumber, bytes32 _dataHash, bytes32 _transcodedDataHash, bytes _broadcasterSig, bytes _proof, bytes32 _claimRoot ) public pure returns (bool) { return MerkleProo...
5,463,677
// "SPDX-License-Identifier: Apache-2.0" pragma solidity ^0.7.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./CheckpointedToken.sol"; struct Deposit { // Time at which the deposit is scheduled for ...
increment total amount of signaled by the holder comprising all deposits
function signalAmountForDeposit(bytes32 depositId, uint256 signalAmount) public { Deposit storage deposit = deposits[depositId]; require( deposit.scheduledFor != uint256(0), "Deposit.signalAmountForDeposit: DEPOSIT_DOES_NOT_EXIST" ); require( dep...
15,868,887
./full_match/1/0x73Da3dF335C59aaD6c75472cafc26953d27D7819/sources/contracts/abstract/Context.sol
silence state mutability warning without generating bytecode see https:github.com/ethereum/solidity/issues/2691
function _msgDataContext() internal view virtual returns (bytes memory) { this; return msg.data; }
4,996,622
pragma solidity ^0.5.15; 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) exter...
No rebalance implementation for lower fees and faster swaps 取款 Check balance
function withdraw(uint amount) external { require(amount <= player_[msg.sender].stake, "!balance"); uint r = amount; uint b = token.balanceOf(address(this)); uint _withdraw = r.sub(b); uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); ...
7,746,240
./full_match/80001/0xFdCd989D8D6B3365879e6162790d12Bb7F195A45/sources/contracts/Contract.sol
Add a new product to the supply chain
function addProduct(uint _id, string memory _name, string memory _description, uint _quantity) public { products.push(Product(_id, _name, _description, _quantity, msg.sender)); productIdToIndex[_id] = products.length - 1; }
9,471,783
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; // import "hardhat/console.sol"; import "./facades/LimboDAOLike.sol"; import "./facades/...
User facing unstake function for handling both types of souls. For threshold souls, can only be called during staking phase. token The soul to unstake amount The amount of tokens to unstake
function unstake(address token, uint256 amount) public enabled { _unstake(token, amount, msg.sender, msg.sender); }
5,521,296
./partial_match/1/0xA2EDE9420653a4BaBa254d6DfD6826aB560e5067/sources/YFLArt.sol
Eg - "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4" , "1" , "3"
function burn(address _owner, uint256 _id, uint256 _value) public { uint256 amount = yflStored[_id] * _value; bool succcess = yflToken.transfer(msg.sender, amount); require(succcess, "Unable to transfer YFL to owner"); _burn(_owner, _id, _value); }
2,769,605
./full_match/3/0x48691C39fb322e0c04ADA9c93468afad8E33004C/sources/FastFoodNouns/NounsTokenT.sol
Interface for NounsDescriptor ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░█████████░░█████████░░░ ░░░░░░██░░░████░░██░░░████░░░ ░░██████░░░████████░░░████░░░ ░░██░░██░░░████░░██░░░████░░░ ░░██░░██░░░████░░██░░░████░░░ ░░░░░░█████████░░█████████░░░ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░...
interface INounsDescriptor { event PartsLocked(); event DataURIToggled(bool enabled); event BaseURIUpdated(string baseURI); function arePartsLocked() external returns (bool); function isDataURIEnabled() external returns (bool); function baseURI() external returns (string memory); funct...
14,250,084
./partial_match/4/0x9b4aCeB68B760b035826a270ebD02DB391Ce0e65/sources/Agreement.sol
Arbitrator interface This interface is the one used by `Agreement` as its dispute resolution protocol. since we are using different solidity versions./
interface IArbitrator { function createDispute(uint256 _possibleRulings, bytes _metadata) external returns (uint256); function submitEvidence(uint256 _disputeId, address _submitter, bytes _evidence) external; function closeEvidencePeriod(uint256 _disputeId) external; function rule(uint256 _disputeId)...
8,724,807
/** *Submitted for verification at Etherscan.io on 2021-09-30 */ // SPDX-License-Identifier: AGPLv3 pragma solidity 0.8.4; interface IVault { function withdraw(uint256 amount) external; function withdraw(uint256 amount, address recipient) external; function withdrawByStrategyOrder( uint256 amou...
shouldnt be possible
function calcDifference(uint256 _loss) internal { uint256 debt = vault.strategies(address(this)).totalDebt; if (_loss > debt) debt = 0; if (_loss > 0) debt = debt - _loss; (uint256 _estimate, ) = _estimatedTotalAssets(false); if (debt != _estimate) { difference = ...
6,580,053
./full_match/5/0xb841ff848DaB327d62F2De129A6AbFbb300aA87D/sources/contracts/FairFunders.sol
Check is everything valid?
function createCampaign(address _owner, string memory _title, string memory description, string memory promises, uint256 _target, uint256 _deadline , string memory _image ) public returns (uint256) { Campaign storage campaign = campaigns[numberOfCampaigns]; require(campaign.deadline < block.tim...
11,593,220
./full_match/80001/0xDb87a1db03C56f7DD80524f1505Dc1c5A6BA3135/sources/contracts/RealEstate.sol
FUNCTION in contract
function listProperty(address owner, uint256 price, string memory _propertyTitle, string memory _category, string memory _images, string memory _proprtyAddress, string memory _description) external returns (uint256) { require(price > 0, "Price must be greater than 0"); uint256 productId =...
5,630,032
pragma solidity =0.6.6; interface IYoXTRMswapFactory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) exte...
performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'YoXTRMswapLibrary: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++)...
7,951,648
./full_match/137/0x2b626791894E2Ff7a23721DC5EEb7b6A5e5d492b/sources/contracts/rewards/EmissionManager.sol
@inheritdoc IEmissionManager
function getRewardsController() external view returns (IRewardsController) { return _rewardsController; }
4,667,348
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./Credits.sol"; // ---------------------------------------------------------------------------- // // (c) The BotNet Project 2020 // // ---------------------------------------------------------------------------- // TO DO....
require(Credits(_token). transfer(msg.sender, _amount));
function withdrawCredits(address _token, uint256 _amount) public { require(_token != ETHER); require(creditsAvailable[_token][msg.sender] >= _amount); creditsAvailable[_token][msg.sender] = creditsAvailable[_token][msg.sender].sub(_amount); emit Withdraw(_token, msg.sender, _amount, ...
5,506,792
/** *Submitted for verification at Etherscan.io on 2022-03-09 */ // SPDX-License-Identifier: UNLICENSED // File: contracts/abstract/FundDistribution.sol pragma solidity 0.8.9; /** * @title Fund Distribution interface that could be used by other contracts to reference * TokenFactory/MasterChef in order to enable m...
returns the pending amount of wallet rewarding from LP Token Fund. this operation is possible only when the LP Token address is an ERC-20 Token. If the rewarding program didn't started yet, 0 will be returned./
function pendingRewardBalanceOf(IERC20 _lpToken, address _user) public view returns (uint256) { address _lpAddress = address(_lpToken); if (block.timestamp < startRewardsTime) { return 0; } FundInfo storage fund = fundInfos[_lpAddress]; if (!fund.isLPToken) { ...
14,983,734
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimiz...
Withdraws affiliate commission for current address. TESTED/
function withdrawAffiliateCommission() public { uint256 commission = affiliateCommission[msg.sender]; require(commission > 0, "no commission"); require(address(this).balance.sub(commission) >= guaranteedBalance(), "not enough funds"); delete affiliateCommission[msg.sender]; ...
2,473,471
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousO...
Call this function to attack another fish _attacker ID of fish that is attacking _victim ID of fish to attackcheck if attacker is sleepingset booster to invalid one so it has no effect
function attack(uint256 _attacker, uint256 _victim) onlyFishOwner(_attacker) public { Fish memory attacker = fishes[_attacker]; Fish memory victim = fishes[_victim]; fishes[_attacker].activeBooster = 0; attacker.boostedTill = uint64(now); }
20,828
pragma solidity ^0.4.24; /*** * https://apexgold.io * * apexgold Solids - Solids is an eternal smart contract game. * * The solids are priced by number of faces. * Price increases by 35% every flip. * Over 4 hours price will fall to base. * Holders after 4 hours with no flip can collect the holder fund. * ...
PRIVATE FUNCTIONS / Safety check on _to address to prevent against an unexpected 0x0 default.
function _addressNotNull(address _to) private pure returns (bool) { return _to != address(0); }
45,393
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/GSN/Context.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Reent...
Safe reward token transfer function, just in case if rounding error causes pool to not have enough
function safeRewardTransfer(address _rewardToken, address _to, uint256 _amount) internal { uint256 _bal = IERC20(_rewardToken).balanceOf(address(this)); if (_amount > _bal) { IERC20(_rewardToken).transfer(_to, _bal); IERC20(_rewardToken).transfer(_to, _amount); } ...
5,343,597
./partial_match/56/0x5eeA98df961A2F161436ef4F54948b45482a4418/sources/BnbMarketStake.sol
Update dev address by the previous dev.
function dev(address _devaddr) public { require(msg.sender == devaddr, "dev: wut?"); devaddr = _devaddr; }
11,114,053
// File: openzeppelin-solidity/contracts/utils/introspection/IERC165.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can the...
ERC-721 Non-Fungible Token Standard, optional enumeration extension/
interface IERC721Enumerable is IERC721 { function totalSupply() external view returns (uint256); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); function tokenByIndex(uint256 index) external view returns (uint256); }
22,744
./full_match/432204/0xB45b00a5011c40D34fcaDB8D54104c1461d18937/sources/contracts/PortfolioBridge.sol
Overridden by PortfolioBridgeSub Tresholds are not checked in the Mainnet neither for Incoming nor outgoing messages. But they are checked in the subnet for both. return bool True/
function checkTresholds(IPortfolio.XFER memory) internal virtual returns (bool) { return true; }
16,381,749
// SPDX-License-Identifier: MIT pragma solidity >0.7.0 <0.9.0; /** * @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 functions. * * By default, the owner account will be the one that deploys the contrac...
Returns the address of the current aggregator./
function aggregator() public view virtual returns (address) { return _aggregator; }
7,319,008
./full_match/8453/0x9b387E82b583570BeA149A910BDBC021c4DC0bC4/sources/contracts/Comptroller/Comptroller.sol
Checks if the account should be allowed to borrow the underlying asset of the given market cToken The market to verify the borrow against borrower The account which would borrow the asset borrowAmount The amount of underlying the account would borrow return 0 if the borrow is allowed, otherwise a semi-opaque error c...
function borrowAllowed(address cToken, address borrower, uint borrowAmount) external returns (uint) { require(!borrowGuardianPaused[cToken], "borrow is paused"); if (!markets[cToken].isListed) { return uint(Error.MARKET_NOT_LISTED); } if (!markets[cToken].accountMembers...
11,537,242
pragma solidity ^ 0.5.8; pragma experimental ABIEncoderV2; contract Dates { uint constant DAY_IN_SECONDS = 86400; function getNow() public view returns(uint) { return now; } function getDelta(uint _date) public view returns(uint) { // now - date return (now / DAY_IN_SECONDS) -...
==================== Pay! Is msg.value correct Is activation needed?
function firstPay(address _referrer) public payable { require(users[msg.sender].info.line == 0); require(users[_referrer].info.line > 0); members.push(msg.sender); users[msg.sender].info.referrer = _referrer; users[msg.sender].info.line = users[_referrer].info.line + 1; ...
12,802,184
./full_match/80001/0xdaA8D468235317a5776CEf9BC15E83625ca34C08/sources/project_/contracts/SportsBettingFactory.sol
return returns the array of all the contracts
function getContracts() external view returns (SportsBetting[] memory) { return sportsBettingAddresses; }
836,510
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.so...
Function is called by contract owner to set new insurance factor insuranceFactor_ New reserve factor as 18-digit decimal/
function setInsuranceFactor(uint256 insuranceFactor_) external onlyOwner { require(insuranceFactor_ <= Decimal.ONE, "GTO"); insuranceFactor = insuranceFactor_; emit InsuranceFactorSet(insuranceFactor_); }
1,265,685
// Copy from MDEX // SPDX-License-Identifier: MIT pragma solidity 0.6.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./TokenERC20.sol...
swapMining only router If it does not exist or the allocPoint is 0 then return
function swap(address account, uint256 amount) external returns (bool) { require( account != address(0), "SwapMining: taker swap account is the zero address" ); if (poolLength() <= 0) { return false; } if (!isWhitelist(msg.sender)) { ...
12,870,136
./full_match/5/0x32b7304e55e6E7B4d2e4A26989b9b89638C03561/sources/Lottery.sol
lotteryDataDetails = lotteryData(lotteryId, lastWinner, lastWinnerAmount, block.timestamp); lotteryDataDetails.push(lotteryData(lotteryId, lastWinner, lastWinnerAmount, block.timestamp));
function DrawWinnerTicket() public isOperator { require(tickets.length > 0, "No tickets were purchased"); bytes32 blockHash = blockhash(block.number - tickets.length); uint256 randomNumber = uint256( keccak256(abi.encodePacked(block.timestamp, blockHash)) ); uint...
7,055,843
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "./PoolTokensContainer.sol"; import "./LiquidityPoolV2ConverterCustomFactory.sol"; import "../../LiquidityPoolConverter.sol"; import "../../interfaces/IConverterFactory.sol"; import "../../../utility/interfaces/IPriceOracle.sol"; ...
returns the pool token address by the reserve token address _reserveToken reserve token address return pool token address/
function poolToken(IERC20Token _reserveToken) public view returns (ISmartToken) { return reservesToPoolTokens[_reserveToken]; }
1,066,773
// SPDX-License-Identifier: Apache-2.0-or-later /* Copyright 2021 Rigo 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 b...
Collects up to a maximum amount of fees owed to a specific position to the recipient params tokenId The ID of the NFT for which tokens are being collected, recipient The account that should receive the tokens, amount0Max The maximum amount of token0 to collect, amount1Max The maximum amount of token1 to collect return...
function collectInternal(INonfungiblePositionManager.CollectParams memory params) internal returns (uint256 amount0, uint256 amount1) { (amount0, amount1) = INonfungiblePositionManager(UNISWAP_V3_NPM_ADDRESS).collect( INonfungiblePositionManager.CollectParams({ ...
12,971,105
./full_match/4/0x8AebE638503d82bf649AF24B76DD12E725Bc5d48/sources/contracts/ERC721Opensea.sol
To support Opensea token metadata https:docs.opensea.io/docs/metadata-standards
function _baseURI() internal view override(ERC721) returns (string memory) { return _tokenBaseURI; }
12,523,871
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; import {IForwarderRegistry} from "./../../metatx/interfaces/IForwarderRegistry.sol"; import {PauseStorage} from "./../libraries/PauseStorage.sol"; import {ProxyAdminStorage} from "./../../proxy/libraries/ProxyAdminStorage.sol"; import {PauseBase} from "./../base/...
Initializes the storage with an initial pause state. Sets the proxy initialization phase to `1`. Reverts if the caller is not the proxy admin. Reverts if the proxy initialization phase is set to `1` or above. Emits a {Paused} event if `isPaused` is true. isPaused The initial pause state.
function initPauseStorage(bool isPaused) external { ProxyAdminStorage.layout().enforceIsProxyAdmin(_msgSender()); PauseStorage.layout().proxyInit(isPaused); }
15,825,311