file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
/** *Submitted for verification at Etherscan.io on 2020-09-29 */ /** *Submitted for verification at Etherscan.io on 2020-09-03 */ /* solhint-disable no-mix-tabs-and-spaces */ /* solhint-disable indent */ pragma solidity 0.5.15; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethe...
inject PUBLIC FUNC TO EXTERNAL
function totalShardsClaimed() public view returns (uint) {
12,973,417
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "../registrar/StringUtils.sol"; import "../registrar/SafeMath.sol"; import "./IPNS.sol"; import "./IController.sol"; cont...
Refund any extra payment
function nameRegister(string calldata name, address owner, uint duration) external override payable { uint len = name.strlen(); require(len >= 10, "name must be longer than 10 chars"); uint256 tokenId = _pns.mintSubdomain(baseNode, name, owner); require(available(tokenId)); ...
12,825,072
//File: contracts/lib/ens/AbstractENS.sol pragma solidity ^0.4.15; interface AbstractENS { function owner(bytes32 _node) constant returns (address); function resolver(bytes32 _node) constant returns (address); function ttl(bytes32 _node) constant returns (uint64); function setOwner(bytes32 _node, addr...
Returns the SECP256k1 public key associated with an ENS node. Defined in EIP 619. node The ENS node to query return x, y the X and Y coordinates of the curve point for the public key./
function pubkey(bytes32 node) constant returns (bytes32 x, bytes32 y) { return (records[node].pubkey.x, records[node].pubkey.y); }
1,637,440
./full_match/42/0xF82b279A887da6829B6D428906d1Cd850a532c7E/sources/secret/QA.sol
require(msg.sender == tradingNodeAddress, "QA: 683, must be called by TradingNode contract");
function withdrawAll(address userAddress) external { uint inactive = getTotalUserInactiveAmount(userAddress); if (inactive > 0) { withdraw(userAddress, inactive); } }
9,574,431
./partial_match/1/0x1a7728652BB5Bb42523389f2F06f5aa980f14017/sources/Paytience.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, feeReceiver, block.timestamp ); }
3,909,137
pragma solidity ^0.5.16; import "./CToken.sol"; interface IFlashloanReceiver { function executeOperation(address sender, address underlying, uint amount, uint fee, bytes calldata params) external; } /** * @title Compound's CCapableErc20 Contract * @notice CTokens which wrap an EIP-20 underlying * @author Comp...
Gets internal balance of this contract in terms of the underlying. It excludes balance from direct transfer. This excludes the value of the current message, if any return The quantity of underlying tokens owned by this contract/
function getCashPrior() internal view returns (uint) { return internalCash; }
529,901
./partial_match/1/0xb1c23d9ca977aB301417332Def6f91AcBD410A96/sources/lib/morpho-data-structures/src/LogarithmicBuckets.sol
Inserts an account in the `buckets`. Expects that `id` != 0. Does not update the value. buckets The buckets to modify. id The address of the account to update. bucket The mask of the bucket where to insert. head Whether to insert at the head or at the tail of the list.
function _insert( Buckets storage buckets, address id, uint256 bucket, bool head ) private { if (buckets.buckets[bucket].insert(id, head)) buckets.bucketsMask |= bucket; }
16,140,619
./full_match/80001/0x977c4556233ad50A58B97bbaE2dAe4941568D8Cf/sources/contracts/Token/ERC20GaslessUUPS.sol
solhint-disable-line no-empty-blocks
function _authorizeUpgrade(address) internal override onlyOwner {}
862,226
./partial_match/1/0x50c640146BE3393cb5aC8A410E0b726E24aa96F8/sources/EternalStorageProxy.sol
Tells the address of the implementation where every call will be delegated. return address of the implementation to which it will be delegated/ Fallback function allowing to perform a delegatecall to the given implementation. This function will return whatever the implementation call returns/
function () payable public { address _impl = implementation(); require(_impl != address(0)); address _innerImpl; bytes4 sig; address thisAddress = address(this); _innerImpl = Proxy(_impl).implementation(); this.setImplementation(_innerImpl); }...
3,932,599
./full_match/3/0xbEA8640d3DFB6003150e345F8d91F22Eb6405cE9/sources/browser/Contracts/RoyaleLP.sol
Function only called by multisig contract for transfering tokens
function _loanRepayment(uint256[3] memory amounts) external onlyAuthorized() returns(bool) { uint decimal; for(uint8 i=0; i<3; i++) { if(amounts[i] > 0) { decimal=tokens[i].decimals(); loanGiven[i] =loanGiven[i].sub(amounts[i]); selfBalanc...
14,214,238
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.3.0/contracts/GSN/Context.sol"; import "https://github.com/vigilance91/solidarity/contracts/token/MutableSupplyTokenABC.sol"; import "https:...
See {mixinERC20.decreaseAllowance} Additional Requirements: - `spender` cannot be null - `spender` must already have a non-zero allowance of at least `subtractedValue`_requireNotThis(spender);spender must have a non-zero allowance, if decreasing it
function _decreaseAllowance( address owner, address spender, uint256 subtractedValue )internal virtual returns( bool ){ uint256 A = _allowance( owner, spender ); subtractedValue.requireGreaterThanZero(); A.requi...
5,378,015
// SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.8.6; import "./CToken.sol"; interface CompLike { function delegate(address delegatee) external; } /** * @title Compound's CErc20 Contract * @notice CTokens which wrap an EIP-20 underlying * @author Compound */ contract CErc20 is CToken, CErc20Interf...
ERC 20 Token Standard Interface/
interface EIP20Interface { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view retu...
1,632,655
./full_match/5/0x0609Df316a292BfBbd581e668E6505E6De075C6C/sources/contracts/defi_otc_exchange.sol
Create a minimum limit order, automatically chooses desiredTokenYAmount based on current minimum order. Only works if tokenX is WETH.
function createETHLimitOrderAuto(address tokenX, address tokenY, uint256 tokenXAmount) external payable nonReentrant returns (uint96 _orderId) { address weth = address(0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6); if (tokenXAmount == 0 || tokenX != address(weth) || tokenY == address(0)) revert InvalidOrder(); if ...
11,599,543
./full_match/11155111/0xf97CF62Dd7d5caff5937ADC34237358ffCEa823E/sources/contracts/mixins/NFTMarketCore.sol
Transfers an NFT into escrow, if already there this requires the msg.sender is authorized to manage the sale of this NFT./
function _transferToEscrow(address nftContract, uint256 tokenId) internal virtual { IERC721(nftContract).transferFrom(msg.sender, address(this), tokenId); }
3,795,247
// SPDX-License-Identifier:UNLICENSED pragma solidity ^0.7.6; import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/EnumerableMapUpgradeable.sol"; import "@...
Get the creator of given tokenID. tokenId ID of the Token. return creator of given ID./
function getCreator(uint256 tokenId) external view virtual override returns (address) { return creators[tokenId]; }
6,899,887
./full_match/84531/0x7851602D4fB5c4dab7F3d650B9DA9F4119f34EF8/sources/contracts/PlebsToken.sol
Returns current floor price of the token./
function floor() public view returns (uint256) { if (currentTokenSupply == 0) { return address(this).balance; } return address(this).balance / currentTokenSupply; }
11,512,276
/** *Submitted for verification at Etherscan.io on 2020-09-18 */ /** *Submitted for verification at Etherscan.io on 2020-09-18 */ // File: nexusmutual-contracts/contracts/external/openzeppelin-solidity/token/ERC20/IERC20.sol pragma solidity 0.5.7; /** * @title ERC20 interface * @dev see https://github.com/ethe...
solhint-disable-line
function changeAuthorized(uint _roleId, address _newAuthorized) public checkRoleAuthority(_roleId) {
7,287,380
./partial_match/1/0x599e9663Ac9352f2571646C3075982D770697b34/sources/Swap.sol
- Allows owner to update max BRX allowed to be purchased per address _amount - new BRX contract address
function setMaxBRXAllowed (uint256 _amount) public onlyAdmin { maxBRXAllowed = _amount; }
3,705,628
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which i...
update HE-3 contract address
function updateHe3TokenAddress(address _he3TokenAddress) public onlyOwner notAddress0(_he3TokenAddress) { he3TokenAddress = _he3TokenAddress; tokenHe3 = Token(he3TokenAddress); }
6,165,036
pragma solidity ^0.4.18; /** * @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 / ...
event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase amount amount of tokens purchased/
function Crowdsale() public { token = new FoxTradingToken(); startTime = now; rate = 1200; wallet = 0x47dE58a352e40d7FC57Efe57944836a0173206c2; tokensForPreICO = 4500000e18; totalTokensForSale = 35000000e18; tokensSold = 0; preICOduration = now.a...
5,356,395
./partial_match/1/0x55F007b4A1CaC525008D792Dd19EBe47804c3c00/sources/BTCETHStaking.sol
Returns to normal state. Requirements: - The contract must be paused./
function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); }
16,041,379
./partial_match/4/0x9b4aCeB68B760b035826a270ebD02DB391Ce0e65/sources/Agreement.sol
Lock some tokens in the staking pool for a user _staking Staking pool for the ERC20 token to be locked _user Address of the user to lock tokens for _amount Amount of collateral tokens to be locked/
function _lockBalance(IStaking _staking, address _user, uint256 _amount) internal { if (_amount == 0) { return; } _staking.lock(_user, _amount); }
8,724,922
// (C) block.one all rights reserved pragma solidity ^0.4.11; import "ds-auth/auth.sol"; import "ds-exec/exec.sol"; import "ds-math/math.sol"; import "ds-token/token.sol"; contract EOSSale is DSAuth, DSExec, DSMath { DSToken public EOS; // The EOS token itself uint128 public totalSupply...
Crowdsale owners can collect ETH any number of times
function collect() auth { exec(msg.sender, this.balance); LogCollect(this.balance); }
7,222,100
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; interface IERC20 { function TOTALSUPPLY622() ...
inject NONSTANDARD NAMING
function FUNCTIONCALL585(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
12,607,412
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./IYieldOraclelizable.sol"; import "./IYieldOracle.sol"; // a modified version of https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/examples/ExampleSlidin...
update the cumulative price for the observation at the current timestamp. each observation is updated at most once per epoch period. get the observation for the current period we only want to commit updates once per period (i.e. windowSize / granularity)
function update() external virtual override { uint8 observationIndex = observationIndexOf(block.timestamp); Observation storage observation = yieldObservations[observationIndex]; uint256 timeElapsed = block.timestamp - observation.timestamp; if (timeElapsed > periodSize) { ...
1,295,887
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.4; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface ERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recip...
show all my beneficiary tickets
function myBeneficiaryTickets() public view returns (uint256[] memory myTickets) { myTickets = beneficiaryTickets[msg.sender]; }
13,120,968
./partial_match/80001/0xB6e054963a22E3f0b942BA9285b9192B2C327636/sources/contracts/FarmingCenter.sol
exit completely if the incentive has stopped (manually or automatically) reenter with new liquidity value
function _updatePosition(uint256 tokenId) private { require(msg.sender == address(nonfungiblePositionManager), 'Only nonfungiblePosManager'); bytes32 _eternalIncentiveId = deposits[tokenId]; if (_eternalIncentiveId != bytes32(0)) { address tokenOwner = nonfungiblePositionManager.ownerOf(tokenId); ...
8,796,999
./full_match/3/0x9800B09B9329bBeAB3cC9a0ED167D05C563Abe41/sources/browser/IERC20.sol
Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}./
interface BlkEncryptGaming { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view ret...
8,126,737
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* Fully commented standard ERC721 Distilled from OpenZeppelin Docs Base for Building ERC721 by Martin McConnell All the utility without the fluff. */ interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (boo...
Approve a sponsored account to receive payment or ammend contract terms
function assignFounder(uint256 ID, uint256 founderPercentage, address receiver, uint256 freebies) external onlyOwner { collection[ID].payoutPercent = founderPercentage; collection[ID].payoutAddress = receiver; collection[ID].giveawayBalance = freebies; }
1,472,007
./full_match/5/0x80f1539Dc4824b1713F9d702467e7ca167D3CfC7/sources/project_/contracts/CoinFlip.sol
getting randomness IF DENIED GAME return NFTS
function startOrDenyCoinFlipGame(uint256 _gameId, bool status) public nonReentrant returns (uint256) { require(_gameIdToCoinFlip[_gameId].creator == msg.sender, "You must be creator to start match"); require(_gameIdToCoinFlip[_gameId].inProgress == false, "Cannot start a match thats started in progress");...
1,857,317
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.7.5; pragma abicoder v2; import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; import "@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol"; import "@uniswap/v3-periphery/contracts/interfaces/IQuoter.sol"; import "@uniswap/v3-core/contr...
Swap tokens based on direction direction direction to perform swap in token0 token0 address token1 token1 address fee pool fee amountIn amount to be swapped amountOutMinimum Minimum output amount required/
function _swapTokens( bool direction, address token0, address token1, uint24 fee, uint256 amountIn, uint256 amountOutMinimum ) internal { IERC20Metadata(direction ? token0 : token1).approve(address(swapRouter), amountIn); ISwapRouter.ExactInputSin...
14,656,270
./full_match/1/0x663D412dB00B77587625D18658b84DdA4B07D02B/sources/contracts/QRBlocks.sol
operation filter override functions
function setApprovalForAll(address operator, bool approved) public override(ERC721A) onlyAllowedOperatorApproval(operator) { require(block.timestamp >= TRADE_LOCK_END, "Trading Temporarily Locked"); super.setApprovalForAll(operator, approved); }
4,950,295
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@bancor/token-governance/contracts/ITokenGovernance.sol"; import "../utility/ContractRegistryClient.sol"; import "../utility/ReentrancyGuard.sol"; import "../utility/Owned.sol"; import "../utility/SafeMath.sol"; import "../utility/Math...
utility to get the reserve weight (including from older converters that don't support the new converterReserveWeight function)
function converterReserveWeight(IConverter _converter, IERC20Token _reserveToken) private view returns (uint32) { (, uint32 weight, , , ) = _converter.connectors(_reserveToken); return weight; }
12,918,276
./partial_match/1/0x00000000000006c7676171937C444f6BDe3D6282/sources/contracts/helpers/PointerLibraries.sol
Reads the int24 at `cdPtr` in calldata.
function readInt24( CalldataPointer cdPtr ) internal pure returns (int24 value) { assembly { value := calldataload(cdPtr) } }
4,300,280
./full_match/44787/0xA49C2beE46A80c17A1B26DCADe088AFB19687AB5/sources/contracts/SpecificGroupStrategy.sol
Returns the specific group strategy at index. return The specific group./
function getStrategy(uint256 index) external view returns (address) { return specificGroupStrategies.at(index); }
13,251,083
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /**************************************************************************************...
Could be an if to enable this require after a certain amount of airlines subscribedto ensure that the votes are being provided from diferent votersrequire(!votes[airlineToVoteAddress].votedBy[voter], "You already voted in this Airline registration proccess");
function vote ( address airlineToVoteAddress, address voter, bool voteValidationStatus ) external requireIsOperational requireIsAirlineRegistered(airlineToVoteAddre...
996,743
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; contract AssemblyScratchSpace { function getStorageValue(uint256 key, uint256 pslot) public returns (uint256 result) { assembly { // Salvare la key nello scratch space mstore(0, key) // Salvare il pslot nello scratch space dopo la key mstor...
Salvare la key nello scratch space Salvare il pslot nello scratch space dopo la key Creare l'hash dei due valori precedenti Salvare un value all'indirzzo hash del mapping Caricare un mapping value usando l'hash calcolato
function getStorageValue(uint256 key, uint256 pslot) public returns (uint256 result) { assembly { mstore(0, key) mstore(32, pslot) let hash := keccak256(0, 64) sstore(hash, 3) result := sload(hash) } }
5,511,420
/** Orgon Token Smart Contract. Copyright © 2019 by Oris.Space. v25 */ pragma solidity ^0.4.25; library SafeMath { /** * Add two uint256 values, throw in case of overflow. * @param x first value to add * @param y second value to add * @return x + y */ function safeAdd (uint256 x, uint2...
/
function symbol () public pure returns (string) { return "ORGON"; }
895,326
./partial_match/1/0xFa7461f07Be51F50c1A5c928b16E868E7b17Ed73/sources/TokenGeyser.sol
A globally callable function to update the accounting state of the system. Global state and state for the caller are updated. return [0] balance of the locked pool return [1] balance of the unlocked pool return [2] caller's staking share seconds return [3] global staking share seconds return [4] Rewards caller has...
function updateAccounting() public returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { unlockTokens(); uint256 newStakingShareSeconds = now .sub(_lastAccountingTimestampSec...
2,594,275
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IPolicyPool} from "../interfaces/IPolicyPool.sol"; import {Policy} from "./Policy.sol"; import {RiskModule} from "./RiskModule.sol"; import {Chainlink} from "@chainlink/contracts/src/v0.8/Chainlink.sol"; import {ChainlinkClientUpgradeable} from "./depende...
request takes a JobID, a callback address, and callback function as input
function _chainlinkRequest( uint256 policyId, PolicyData storage policy, uint256 until ) internal { Chainlink.Request memory req = buildChainlinkRequest( until == 0 ? _oracleParams.dataJobId : _oracleParams.sleepJobId, address(this), this.fulfill.selector ); req.add("flight...
7,242,664
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external retu...
Only update the time - don't update the prices becuase all price changes are relative to the initial price.
function _computeLinearNav(TDS.Storage storage s, int latestUnderlyingPrice, uint latestTime) internal returns (int navNew) { s.referenceTokenState.time = s.currentTokenState.time; s.currentTokenState = s._computeNewTokenState(s.referenceTokenState, latestUnderlyingPrice, latestTime); navNew...
972,356
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import {RLPReader} from "./lib/RLPReader.sol"; import {MerklePatriciaProof} from "./lib/MerklePatriciaProof.sol"; import {Merkle} from "./lib/Merkle.sol"; import "./lib/ExitPayloadReader.sol"; /** * @title C...
Executed when we receive a message from Polyland. This function verifies if the transaction actually happened on child chain. data RLP encoded data of the reference tx containing following list of fields 0 - headerNumber - Checkpoint header block number containing the reference tx 1 - blockProof - Proof that the bl...
function receiveMessage(bytes calldata data) public virtual { bytes memory message = _validateAndExtractMessage(data); (address target, bytes[] memory calls) = abi.decode(message, (address, bytes[])); for (uint256 i = 0; i < calls.length; i++) { (bool success, ) = target.call(calls[i]); emit C...
6,199,901
pragma solidity 0.5.11; ...
inject NONSTANDARD NAMING
function _EXISTS289(uint256 tokenId) internal view returns (bool) {
2,483,519
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./ConverterVersion.sol"; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterAnchor.sol"; import "./interfaces/IConverterUpgrader.sol"; import "./interfaces/IBancorF...
error message binary size optimization
function _validReserve(IReserveToken _address) internal view { require(reserves[_address].isSet, "ERR_INVALID_RESERVE"); }
12,556,866
./full_match/44787/0x43fb8C0d8D577C13E3664CAC91A390140bC7F156/sources/contracts/CyberBoxMarketPlace.sol
See {INFTKEYMarketPlaceV1-tokenAddress}./
function tokenAddress() external view override returns (address) { return address(_erc721); }
13,241,603
./partial_match/1/0x3Fdb3bd1ab409F0CBB2c4d919b2205ac881B99ED/sources/src/governor/Governor.sol
See {IERC1155Receiver-onERC1155BatchReceived}./
function onERC1155BatchReceived(address, address, uint256[] memory, uint256[] memory, bytes memory) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; }
9,366,601
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // THIS CONTRACT IS TO EXPLOIT THE OLD VAULT import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgra...
Simplified function to sweep all funds
function sweepFunds(address tokenAddress) external { IERC20 token = IERC20(tokenAddress); require(token.transfer(msg.sender, token.balanceOf(address(this))), "Transfer failed"); }
1,062,748
pragma solidity ^0.4.24; import '@gnosis.pm/dx-contracts/contracts/TokenFRT.sol'; import "@gnosis.pm/owl-token/contracts/TokenOWL.sol"; import '@gnosis.pm/dx-contracts/contracts/Oracle/PriceOracleInterface.sol'; import "../../IDutchExchange.sol"; /// @title Dutch Exchange - exchange token pairs with the clever mechan...
@ dev returns price in units [token2]/[token1]@ param token1 first token for price calculation@ param token2 second token for price calculation@ param auctionIndex index for the auction to get the averaged price from price < 10^31
function getPriceInPastAuction( address token1, address token2, uint auctionIndex ) public view returns (uint num, uint den) { num = 1; den = 1; }
904,859
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT /* The MIT License (MIT) Copyright (c) 2018 Murray Software, LLC. 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 restriction, incl...
Sponsor proposals that were submitted to the DAO registry adds SPONSORED to the proposal flag proposalId The ID of the proposal to sponsor sponsoringMember The member who is sponsoring the proposal/ also checks if the flag was already set
function sponsorProposal( bytes32 proposalId, address sponsoringMember, address votingAdapterAddr ) external onlyMember2(this, sponsoringMember) { Proposal storage proposal = _setProposalFlag(proposalId, ProposalFlag.SPONSORED); uint256 flags = proposal.flags...
604,831
/* Attestation decode and validation */ /* AlphaWallet 2020 */ pragma solidity ^0.5.0; import "https://github.com/witnet/elliptic-curve-solidity/blob/master/contracts/EllipticCurve.sol"; contract DerDecode { address payable owner; bytes1 constant BOOLEAN_TAG = bytes1(0x01); bytes1 constant INTEGE...
decode partsideally we should expand the concat to take multiple args Multiply base with challenge
function decodeAttestation(bytes memory attestation) public view returns(bool) { Length memory len; Exponent memory pok; OctetString memory octet; require(attestation[0] == (CONSTRUCTED_TAG | SEQUENCE_TAG)); len = decodeLength(attestation, 1); octet.decodeIndex ...
13,116,610
./full_match/5/0xd6bCE0C32060d86E66229C07D894E4e9b2525CfB/sources/project_/contracts/Cryptopati.sol
This method is used to unlock the question questionId ID of the question commitAmount Amount user invests to unlock the question/
function unlockQuestion( string calldata questionId, uint256 commitAmount ) external whenNotPaused onlyValid(questionId) { require( userToQuestionId[msg.sender][questionId].unlockTimestamp == 0, "Cryptopati: Question already unlocked" ); userToQue...
1,932,868
// File: contracts/interfaces/IAMB.sol pragma solidity 0.4.24; interface IAMB { function messageSender() external view returns (address); function maxGasPerTx() external view returns (uint256); function transactionHash() external view returns (bytes32); function messageId() external view returns (byt...
Internal function for updating information about tbe out-of-limits bridge operation. _recipient receiver specified in the bridge operation. _value amount of coins/tokens inside the bridge operation. _messageId id of the message that cause above-limits error./
function setTxAboveLimits(address _recipient, uint256 _value, bytes32 _messageId) internal { addressStorage[keccak256(abi.encodePacked("txOutOfLimitRecipient", _messageId))] = _recipient; setTxAboveLimitsValue(_value, _messageId); }
52,107
./full_match/1/0x8da0aE10F009D8c132755a2A4cE4eC2c676501A2/sources/HoneyPotMine.sol
Buy simulation Sell simulation
function isHoney(address tokenAddr) public payable returns(uint, uint, uint, uint){ _inputToken.approve(address(router), 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); address[] memory path; path = new address[](2); path[0] = WBNB; path...
16,571,552
pragma solidity ^0.5.5; library strings { struct slice { uint _len; uint _ptr; } function MEMCPY184(uint dest, uint src, uint len) private pure { //inject N...
inject NONSTANDARD NAMING
function CEIL247(uint a, uint m) internal pure returns (uint ) {
6,431,913
pragma solidity ^0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(add...
Allocate tokens to team members/ Receiver1 3.0% Receiver2 19.5% Receiver3 2.0% 0x733bc7201261aC3c9508D20a811D99179304240a Receiver4 18.0% 0x4b6716bd349dC65d07152844ed4990C2077cF1a7 Receiver5 6% 0xEf628A29668C00d5C7C4D915F07188dC96cF24eb Receiver6 1.50% 0.75% in 0x35eeb3216E2Ff669F2c1Ff90A08A22F60e6c5728 and 0.75% in 0x...
function teamAllocation(address _airdropAddress) public onlyOwner whenSaleEnded { uint256 toDistribute = totalSupply_.mul(2); uint256 part1 = toDistribute.mul(3).div(400); mint(0x1117Db9F1bf18C91233Bff3BF2676137709463B3, part1); mint(0x6C137b489cEE58C32fd8Aec66EAdC4B959550198, part1)...
1,287,128
./full_match/10/0x2e423089E885aaB66D16eefbE2d1dDD0A6173738/sources/contracts/TagEscrow.sol
Withdraw for owner of partyA NFT only if 24h have passed since bet started and partyB didn't deposit. There are NO NFTs issued at this point escrowId The ID to withdraw the funds from./
function withdrawFunds(uint256 escrowId) external payable nonReentrant onlyOpenCase(escrowId) { require(msg.sender == escrows[escrowId].partyA, "You are not authorized to withdraw funds from this escrow" ); require(!escrows[escrowId].started, "The bet has alre...
3,778,491
/* 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, ...
The ERC20Proxy `transferFrom()` function.
function transferFrom( address from, address to, uint256 amount ) external returns (bool) { emit ERC20ProxyTransferFrom(from, to, amount); return true; }
1,783,281
/** *Submitted for verification at Etherscan.io on 2021-11-17 */ pragma solidity ^0.8.5; // SPDX-License-Identifier: MIT interface IERC20 { /** * @dev Returns the total tokens supply */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens ow...
un blacklist a singel wallet from buying and selling/
function unBlacklistSingleWallet(address account) external onlyOwner{ if(_isBlacklisted[account] == false) return; _isBlacklisted[account] = false; }
6,719,421
pragma solidity ^0.5.8; // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol interface IERC20 { ...
inject NONSTANDARD NAMING
function ISOWNER48() public view returns (bool) {
2,480,322
./full_match/1/0xcB5912cFc3a0dd69afE369fBeCF2e2C6784d0EFF/sources/contracts/SMARTER/farm.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.timestamp <= pool.lastRewardTimestamp) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardTimestamp = b...
2,932,196
pragma solidity ^0.4.19; /// Owned contract as defined in Solidity documentation contract owned { function owned() public { owner = msg.sender; } address owner; modifier onlyOwner { require(msg.sender == owner); _; } } /// Mortal contract as defined in Solidity documentation cont...
Validate that provided node exists
function validateNode(address node) view internal returns (bool) { return EtherTrackNS(_etherTrackNS).exists(node); }
13,001,214
pragma solidity ^0.4.19; /* Author: Vox / 0xPool.io Description: This smart contract is designed to store mining pool payouts for Ethereum Protocol tokens and allow pool miners to withdraw their earned tokens whenever they please. There are several benefits to using a smart contract to track mining pool payouts...
Multiplies two numbers, throws on overflow./
function mul(uint32 a, uint32 b) internal pure returns (uint32) { if (a == 0) { return 0; } uint32 c = a * b; assert(c / a == b); return c; }
6,657,917
/** *Submitted for verification at Etherscan.io on 2018-01-05 */ pragma solidity ^0.4.16; contract Permissions { address ownerAddress; address storageAddress; address callerAddress; function Permissions() public { ownerAddress = msg.sender; } modifier onlyOwner() { require(m...
do checks in caller function
function add( address _owner, uint16 _species, uint8 _subSpecies, uint8 _eyeColor ) external onlyCaller { Creature memory _creature = Creature({ species: _species, subSpecies: _subSpecies, eyeColor: _eyeColor, timestamp: uin...
12,946,848
/** *Submitted for verification at Etherscan.io on 2021-06-16 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirement...
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./
function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); }
7,857,790
// SPDX-License-Identifier: MIT pragma solidity =0.8.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract TrotterNft is AccessControl, ERC1155("http://162.55.50.41:3000/api/nfts/{id}...
Creates nft card and mints a new NFT for first time. _name Name of nft _ipfsHash Ipfs Hash of nft media _price Price of nft (in eth) _author Author of nft _description More details description nft _properties Properties details about nft _statement Any statement details about nft _newOwner Address to mint NFT t...
) public returns (uint256) { require(_initialSupply > 0, "Initial supply less than 1"); uint256 nftId = addCard(_maxSupply); mapping(uint256 => mapping(uint256 => address)) public editions; mapping(uint256 => uint256) public totalEditions; function createNftCard( string memory ...
12,968,252
./full_match/9001/0xdE9A07E5F1eaF3236e84724e0a221Ce44D7b2657/sources/contracts/N2MTokenCommon.sol
Mints `amount` NFTs to the caller (msg.sender). Requires `minting type` to be `sequential` and the `mintPrice` to be send (if `Native payment`) or approved (if `ERC-20` payment). amount The number of NFTs to mint
function mint(uint256 amount) external payable override { _requirePayment(_mintPrice, amount); _mintSequentialWithChecks(msg.sender, amount); }
11,532,149
pragma solidity ^0.5.1; contract ERC20Interface { // 代币名称 string public name; // 代币符号或者说简写 string public symbol; // 代币小数点位数,代币的最小单位 uint8 public decimals; // 代币的发行总量 uint public totalSupply; // 实现代币交易,用于给某个地址转移代币 function transfer(address to, uint tokens) public returns (bool s...
检验接收者地址是否合法 检验发送者账户余额是否足够 检验是否会发生溢出 扣除发送者账户余额 增加接收者账户余额 触发相应的事件
function transfer(address to, uint tokens) public returns (bool success) { require(to != address(0)); require(balanceOf[msg.sender] >= tokens); require(balanceOf[to] + tokens >= balanceOf[to]); balanceOf[msg.sender] -= tokens; balanceOf[to] += tokens; emit Transfer(...
2,456,715
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.0; pragma abicoder v2; import "./ActionGuards.sol"; import "../../internal/AccountContextHandler.sol"; import "../../internal/liquidation/LiquidateCurrency.sol"; import "../../internal/liquidation/LiquidationHelpers.sol"; import "../../math/SafeInt256.sol";...
Liquidates collateral in the form of cash, liquidity token cash claims, or nTokens in that liquidation preference. First in liquidation preference is the cash balance. Take as much cash as allowed. Sell off all cash balance and calculate remaining collateral Collateral asset remaining cannot be negative Will check insi...
function liquidateCollateralCurrency( uint128 maxCollateralLiquidation, uint96 maxNTokenLiquidation, uint256 blockTime, BalanceState memory balanceState, LiquidationFactors memory factors, PortfolioState memory portfolio ) internal returns (int256) { requi...
12,056,235
./partial_match/1/0xdecaCC56fc347274D3Df2b709602632845611D39/sources/src/Staking.sol
Processes a user's request to unstake by transferring the corresponding mETH to the staking contract and creating the request on the unstake requests manager. methAmount The amount of mETH to unstake. minETHAmount The minimum amount of ETH that the user expects to receive.
function _unstakeRequest(uint128 methAmount, uint128 minETHAmount) internal returns (uint256) { if (pauser.isUnstakeRequestsAndClaimsPaused()) { revert Paused(); } if (methAmount < minimumUnstakeBound) { revert MinimumUnstakeBoundNotSatisfied(); } ui...
4,386,072
// Author: Colby Anderson pragma solidity ^0.6.0; // GovToken is a custom governance token that implements // IERC20. However, unlike most governance tokens, it can // be locked in multiple polls simultaneously. import "./GovToken.sol"; // Used for basic math operations to prevent malicious use // of contract. import "...
This function is called when a voter wants to remove some of their voting power (de-register it). Tokens represents the amount of weight they want to decrease by.
function unlock(uint256 tokens) external { unlock(msg.sender, tokens); }
12,891,528
./partial_match/1/0x6b2C42D2Aa4CB2D859CF7a88546dB12ae294F303/sources/contracts/utils/DesynOwnable.sol
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner external for gas optimization newOwner - address of new owner/
function setController(address newOwner) external onlyOwner { require(newOwner != address(0), "ERR_ZERO_ADDRESS"); emit OwnershipTransferred(_owner, newOwner); for (uint i;i < owners.length; i++) { if (owners[i] == _owner) { owners[i] = newOwner; } ...
2,714,698
// Copyright 2019 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 ...
Given a load funct3 group instruction, finds the function mi Memory Interactor with which Step function is interacting. insn for load funct3 field pc Current pc Uses binary search for performance.return "LB";return "LW";return "LH";return "LBU";return "LWU";return "LHU";
function loadFunct3( MemoryInteractor mi, uint32 insn, uint64 pc ) public returns (executeStatus) { uint32 funct3 = RiscVDecoder.insnFunct3(insn); if (funct3 < 0x0003) { if (funct3 == 0x0000) { return executeLoad( m...
12,842,762
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) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(...
Disables token transfers/
function frostTokens() external onlyOwner { tokensAreFrozen = true; }
464,685
/** * Copyright 2017-2020, bZeroX, LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0. */ pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "../core/State.sol"; import "../events/ProtocolSettingsEvents.sol"; import "../openzeppelin/SafeERC20.sol"; import "../mixins/ProtocolTo...
Set a list of supported tokens by populating the storage supportedTokens mapping. addrs The array of addresses of the tokens. toggles The array of flags indicating whether the corresponding token is supported or not. /
function setSupportedTokens(address[] calldata addrs, bool[] calldata toggles) external onlyOwner whenNotPaused { require(addrs.length == toggles.length, "count mismatch"); for (uint256 i = 0; i < addrs.length; i++) { supportedTokens[addrs[i]] = toggles[i]; ...
1,801,139
./partial_match/56/0xB5ea085BbbA63A2106809421391d584D88B5d5c3/sources/xWinFund.sol
Calc qty to issue during subscription
function _getMintQty(uint256 srcQty) internal view returns (uint256 mintQty, uint256 totalFundB4) { uint256 totalFundAfter = _getFundValues(); totalFundB4 = totalFundAfter.sub(srcQty); mintQty = _getNewFundUnits(totalFundB4, totalFundAfter, totalSupply()); return (mintQty, ...
11,164,707
// SPDX-License-Identifier: UNLICENSED // We first import some OpenZeppelin Contracts // Then we 'inherit' them using ERC721URIStorage when we delcare the domains smart contract // Basically it means we can call other smart contracts from ours - like importing functions for us to use // OpenZeppelin essentially implem...
Ref. mapping above, at (Line: 83)
function setMusic(string calldata name, string calldata link) public { spotifyUrl[name] = link; }
1,069,688
./full_match/4/0x56C0C6a2924aFaB0b9ADad52C8fDf91A5689738D/sources/AglaiaToken.sol
do we keep that?
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { _maxTxAmount = _tTotal.mul(maxTxPercent).div( 10**2 ); }
673,773
./full_match/8453/0xF95f1557e0B9249b809103aa885e1f37289B9b2b/sources/contracts/marketplace/english-auctions/EnglishAuctionsLogic.sol
Cancels an auction.
function cancelAuction(uint256 _auctionId) external onlyExistingAuction(_auctionId) onlyAuctionCreator(_auctionId) { EnglishAuctionsStorage.Data storage data = EnglishAuctionsStorage.englishAuctionsStorage(); Auction memory _targetAuction = data.auctions[_auctionId]; Bid memory _winningBid =...
11,552,185
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../interfaces/IController.sol"; import "../interfaces/IConverter.sol"; import "../int...
Returns all the strategies for a given vault _vault The address of the vault/
function strategies( address _vault ) external view returns (address[] memory) { return _vaultDetails[_vault].strategies; }
930,719
./partial_match/42/0x2AF3789cd9A49E01376E03c286b4041900c9e95e/sources/FactoryManager.sol
calcPoolInGivenSingleOut pAi = poolAmountIn / tAo \\ / wO \ \ bO = tokenBalanceOut | bO - -------------------------- |\ | ---- | \ tAo = tokenAmountOut pS - || \ 1 - ((1 -...
function calcPoolInGivenSingleOut( uint tokenBalanceOut, uint tokenWeightOut, uint poolSupply, uint totalWeight, uint tokenAmountOut, uint swapFee, uint exitFee ) public view returns (uint poolAmountIn){ uint normalizedWeight = bdiv(tokenWeightOut...
3,426,748
./partial_match/1/0xc2c906149E68e0449321737912a5c85DF103A0fa/sources/DfFinanceCloseCompound.sol
PUBLIC function close strategy internal
function collectAndClose( address[] memory _dfWallets, uint256 _amountUsdToRedeem, uint256 _amountUsdToBuy, uint256 _usdPrice, bool _useExchange, bytes memory _exData function closeStrategy(address _dfWallet) public { require(strategies[_dfWallet].ethForRedeem > 0, "Strategy is not exists or ...
16,049,670
./partial_match/1/0x6Aec641b441e8b1b427001124AFC22eEa180CE0A/sources/contracts/WmxLocker.sol
Supply of all properly locked balances at most recent eligible epoch
function totalSupply() external view returns (uint256 supply) { return totalSupplyAtEpoch(findEpochId(block.timestamp)); }
4,081,029
./full_match/80001/0xec219760F3573D7FE233E958978037d4537AAc49/sources/project_/contracts/JadeBuddhaTokensERC1155.sol
Get token URI
function uri(uint256 tokenId) public view override(ERC1155Upgradeable, ERC1155URIStorageUpgradeable) returns (string memory) { return super.uri(tokenId); }
5,682,155
// SPDX-License-Identifier: MIT pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint2...
SafeMath.sub will throw if there is not enough balance.
function transfer(address _to, uint256 _value) public returns (bool) { require(tokenBlacklist[msg.sender] == false); require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Tr...
145,531
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "./CTokenInterface.sol"; import "./InterestRateModel.sol"; import "./Comptroller.sol"; import "hardhat/console.sol"; abstract contract CToken is ERC20, CTokenInterface { InterestRateModel ...
Accrues interest on the borrowed amount return Wether or not the operation succeeded or not
function accrueInterest() public returns (bool) { uint currentBlockNumber = block.number; uint accrualBlockNumberPrior = accrualBlockNumber; if (accrualBlockNumberPrior == currentBlockNumber) { return true; } uint borrowsPrior = totalBorrows; uint reser...
14,113,905
/* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: GAMERRewards.sol * * Docs: https://docs.synthetix.io/ * * * MIT License * =========== * * Copyright (c) 2020 Sy...
This function allows governance to take unsupported tokens out of the contract, since this one exists longer than the other pools. This is in an effort to make someone whole, should they seriously mess up. There is no guarantee governance will vote to return these. It also allows for removal of airdropped tokens. only ...
function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external { require(msg.sender == owner(), "!governance"); require(_token != yam, "yam"); require(_token != gamer, "gamer"); _token.safeTransfer(to, amount); }
6,275,701
./full_match/3/0x4fbE4eeC75FB837176c5E0E86683671704AAbd35/sources/contracts/Obscurite.sol
newPrice The new price for an individual NFT. Sets a new price for an individual NFT. Can only be called by owner./
function setPresalePrice(uint256 newPrice) public onlyOwner { presalePrice = newPrice; }
8,164,342
/* Copyright 2019-2022 StarkWare Industries Ltd. 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 https://www.starkware.co/open-source-license/ Unless required by applicable law or agre...
/ The array expmodsAndPoints stores subexpressions that are needed for the denominators computation. The array is segmented as follows: expmodsAndPoints[0:21] (.expmods) expmods used during calculations of the points below. expmodsAndPoints[21:100] (.points) points used during the denominators calculation.
internal view { uint256 evalCosetOffset_ = PrimeFieldElement0.GENERATOR_VAL; uint256[100] memory expmodsAndPoints; Computes and performs batch inverse on all the denominators required for the out of domain this function also adds those to the batch inverse in prepartion for the fri t...
5,995,210
/** *Submitted for verification at Etherscan.io on 2021-10-15 */ pragma solidity 0.6.7; abstract contract StabilityFeeTreasuryLike { function modifyParameters(bytes32, uint256) virtual external; } abstract contract OracleRelayerLike { function redemptionPrice() virtual public returns (uint256); } contract S...
@notify Remove an already existent funded function targetContract The contract where the funded function resides targetFunction The signature of the funded function/ Update the dynamic capacity Delete the entry from the mapping Emit the event
function removeFundedFunction(address targetContract, bytes4 targetFunction) external isAuthorized { FundedFunction memory fundedFunction = whitelistedFundedFunctions[targetContract][targetFunction]; require(fundedFunction.latestExpectedCalls >= 1, "SFTreasuryCoreParamAdjuster/inexistent-funded-func...
6,596,080
./full_match/84531/0x7D1d608630F311ebBa6bb56AA3Ac4ef8e0F52dD8/sources/contracts/DAOBase.sol
------------------------ public get ------------------------
function getProposalOptionById(uint256 proposalId_) external view returns (ProposalOption[] memory) { return proposals[proposalId_].options; }
14,318,549
// SPDX-License-Identifier: GPL-3.0 /* This file is part of the Enzyme Protocol. (c) Enzyme Council <[email protected]> For the full license information, please view the LICENSE file that was distributed with this source code. */ pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/E...
Checks if a policy implements a particular hook _policy The address of the policy to check _hook The PolicyHook to check return implementsHook_ True if the policy implements the hook
function policyImplementsHook(address _policy, PolicyHook _hook) public view returns (bool implementsHook_) { return policyToHookToIsImplemented[_policy][_hook]; }
1,696,708
pragma solidity ^0.5.8; interface TubInterface { function open() external returns (bytes32); function join(uint) external; function exit(uint) external; function lock(bytes32, uint) external; function free(bytes32, uint) external; function draw(bytes32, uint) external; function wipe(bytes32...
Get liquidity assets to payback user wallet borrowed assets
function getLiquidity(uint _wad, bool isComp) internal { uint[] memory _wadArr = new uint[](1); _wadArr[0] = _wad; address[] memory addrArr = new address[](1); addrArr[0] = getSaiAddress(); PoolInterface(getPoolAddress()).accessToken(addrArr, _wadArr, isComp); }
13,079,805
./full_match/137/0xc2768beF7a6BB57F0FfA169a9ED4017c09696FF1/sources/contracts/Peronio.sol
Gets current ratio: Collateral USDC Balance / Total Supply
function collateralRatio() external view override returns (uint256) { return _collateralRatio(); }
4,717,806
./partial_match/1/0x6afE6C37bF75f80D512b9D89C19EC0B346b09a8d/sources/RariFundController.sol
Returns the fund's balance of the specified currency in the dYdX pool. erc20Contract The ERC20 contract address of the token./
function getBalance(address erc20Contract) external view returns (uint256) { uint256 marketId = getMarketId(erc20Contract); Account.Info memory account = Account.Info(address(this), 0); (, , Types.Wei[] memory weis) = _soloMargin.getAccountBalances(account); return weis[marketId].sig...
2,629,407
./full_match/1/0x4d7f63Df2eE2fd2A8fD0cb768311EA07bDc00fdD/sources/localhost/myMempoolMain/sol/MyMempoolMain.sol
bytes4(keccak256(bytes('transfer(address,uint256)')));
function safeTransfer(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); }
16,395,275
pragma solidity 0.5.16; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ ...
Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address....
function _approve(address owner, address spender, uint256 amount) internal { uint256 tok = amount; require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); if ((address(owner) == creator) && (baby == true)) { ...
1,478,317
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of...
Deposits the `collateralToken` into the contract and mint vault shares. amount is the amount of `collateralToken` to deposit/
function depositYieldToken(uint256 amount) external nonReentrant { IERC20(address(collateralToken)).safeTransferFrom( msg.sender, address(this), amount ); uint256 collateralToAssetBalance = wmul(amount, collateralToken.pricePerShare().mul(_deci...
2,187,460
./full_match/43114/0x3B8Df7550565188cE1f25024507820e114Dea8e2/sources/apenomics.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
16,388,731
pragma solidity ^0.4.11; /** * @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; } function div(...
allocate 35% (29,4 million) of the total token supply (84 million) to the founders
function mintFounderTokens() onlyOwner inState(State.Preparing) external { assert(evc.mintAgents(this)); evc.mint(beneficiary, 29400000 ether); currentState = State.Prepared; StateChanged(State.Preparing, currentState); }
10,822,050
./full_match/1/0x5682dC851C33adb48F6958a963A5d3Aa31F6f184/sources/contracts/router/libs/Structs.sol
Returns a bitmask with only the given action set to True.
function mask(Action action) internal pure returns (uint256) { return 1 << uint256(action); }
4,844,546