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-02-12 */ // File: @aragon/court/contracts/lib/os/IsContract.sol // Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/common/IsContract.sol // Adapted to use pragma ^0.5.8 and satisfy our linter rules pragma solidity ^0.5.8; contract IsCon...
This function must be triggered by an external token's approve-and-call fallback. It will pull the approved tokens and convert them in Uniswap, and activate the converted tokens into a jurors registry instance of an Aragon Court. _from Address of the original caller (juror) converting and activating the toke...
function receiveApproval(address _from, uint256 _amount, address _token, bytes calldata _data) external { require(_token == msg.sender, ERROR_RECEIVED_WRONG_TOKEN); require(_data.length == 128, ERROR_WRONG_DATA_LENGTH); bool activate; uint256 minTokens; uint256 minEth; ...
12,908,670
pragma solidity ^0.5.1; contract ERC20 { function totalSupply() public view returns (uint); function balanceOf(address tokenOwner) public view returns (uint balance); function allowance(address tokenOwner, address spender) public view returns (uint remaining); function transfer(address to, uint tokens) public ret...
returns true if this amount of token can be bought - does not account for Ethereum account balance
function canBuy(uint amount) public view returns (bool possible){
2,479,056
// Grove v0.2 /// @title GroveLib - Library for queriable indexed ordered data. /// @author PiperMerriam - library GroveLib { /* * Indexes for ordered data * * Address: 0x7c1eb207c07e7ab13cf245585bd03d0fa478d034 */ struct Index { bytes3...
Insufficient Deposit Log the claim.
function claim(Call storage self, address executor, uint deposit_amount, uint basePayment) public returns (bool) { if (deposit_amount < 2 * basePayment) return false; self.claimAmount = getClaimAmountForBlock(block.number); self.claimer = executor; self.claimerDeposit = deposit_amou...
12,666,064
pragma solidity ^0.4.17; /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { // Required methods function implementsERC721() public pure returns (bool); function totalSupply() public view ret...
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; }
1,223,251
pragma solidity 0.5.3; /** * @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) { // G...
return the beneficiary1 of the Payments./
function beneficiary1() public view returns (address) { return _beneficiary1; }
7,326,887
//Address: 0x90a78f7bf5fb207a6d40e0b373c2ce1dc24712d7 //Contract name: VGCToken //Balance: 0 Ether //Verification Date: 1/23/2018 //Transacion Count: 27 // CODE STARTS HERE pragma solidity ^0.4.19; /*standart library for uint */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) ...
Tokens reserve (last screen in documentation)
function getCrowdsaleBalance() public view returns(uint) { return crowdsaleBalance; }
6,456,737
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint2...
Checks whether the period in which the crowdsale is open has already elapsed. return Whether crowdsale period has elapsed/
function hasClosed() public view returns (bool) { return now > closingTime; }
436,648
pragma solidity >=0.4.22 <0.8.0; import "./IERC20.sol"; contract CarRental { struct RentalCar { // Estrutura destinada às credenciais do carro alugado uint256 id; bool isAvailable; // disponibilidade bool isActive; // uint256 price; address owner; uint256 activeRe...
Função de criação do veículo
function createVehicle(uint256 price) public { uint256 vehicleId = cars.length; RentalCar memory car = RentalCar( vehicleId, true, true, price, 0 ); cars.push(car); }
5,419,883
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.12; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ /...
Function for creating a new kashi pair collateralAddress ERC20 address of collatral coin collatralOracleAddress Chainlink oracle address of collatral/ETH _decimals Decimals of oracle Input Address to address list
function createNewPair(address collateralAddress, address collatralOracleAddress, uint256 _decimals) public onlyByOwnGov returns (address){ bytes memory _oracleData = abi.encode(fraxEthChailinkOracleAddress, collatralOracleAddress, _decimals); bytes memory _data = abi.encode(collateralAddress, fraxA...
12,768,433
/** * TokenMinter.sol * MPS Token (Mt Pelerin Share) token minter. * More info about MPS : https://github.com/MtPelerin/MtPelerin-share-MPS * The unflattened code is available through this github tag: * https://github.com/MtPelerin/MtPelerin-protocol/tree/etherscan-verify-batch-1 * @notice Copyright ©...
update this contract minting to finish/
function finishMintingRestricted(address _minter) public onlyOwner returns (bool) { return finishMintingInternal(_minter); }
2,476,217
pragma solidity ^0.6.6; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". * * @dev We've added a second owner to share control of the timelocked owner contract. */ contract Ownabl...
Owner may change how much of the AUM should be saved in reserve each period. _reserveAmount The amount of wNXM (in token Wei) to reserve each period./
function changeReserveAmount(uint256 _reserveAmount) external onlyOwner { reserveAmount = _reserveAmount; }
8,592
./partial_match/56/0xF7EBf8670ADFCF4729D39A5c83d8521B6a3Eb8d9/sources/CandyMasterFarmer.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.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardBlock = block.number;...
11,295,107
./partial_match/4/0xc608bA9b7d5Be5A93A8eB181b99197c6600781Cf/sources/Dgate.sol
accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed
function redeemInternal(uint redeemTokens) internal nonReentrant returns (uint) { uint error = accrueInterest(); if (error != uint(Error.NO_ERROR)) { return fail(Error(error), FailureInfo.REDEEM_ACCRUE_INTEREST_FAILED); } }
8,600,873
./full_match/80001/0x49c0e6764BbbD3564bc2070238b35115E00d9ff1/sources/BRUTENFT.sol
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _getBaseURI(); if (bytes(base).length == 0) { ...
5,641,505
./full_match/83/0xF0Db6d3bbf2d728dF91B01018CDeE635cFCb1B9a/sources/Users/cuimiandashi/Documents/GitHub/meterio/cryptoblades/contracts/SpecialWeaponsManager.sol
MANUAL USE ONLY; DO NOT USE IN CONTRACTS!
function createManualEvent(string calldata name, uint8 element) external restricted { eventInfo[++eventCount] = EventInfo( name, element, 0, 0 ); }
9,558,004
./partial_match/56/0x2219A6e2B0b26223C222899B198503FF2c58e1a7/sources/Farm.sol
Unstakes a certain amount of previously deposited tokens. User also receives their alotted number of distribution tokens. amount Number of deposit tokens to unstake / withdraw./
function leave(address staker, uint256 amount) external override { require( farmer == msg.sender, "This method can be called by the geyser manager only" ); _leave(staker, amount); }
11,089,066
./partial_match/42/0xC251A1Da17bE0Cea838f087051D0Cbf683B53054/sources/DSToken.sol
This is not a function used in actual production Only for getting free token to test
function allocateTo(address owner, uint256 value) public { _balances[owner] = add(_balances[owner], value); _supply = add(_supply, value); emit Transfer(address(this), owner, value); }
3,438,230
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asser...
Return the convert lot information at a given ID _convertLotId The convert lot ID in question return id of the lot return The address of the convert lot owner return Primordial token amount in the convert lot/
function convertLotById(bytes32 _convertLotId) public view returns (bytes32, address, uint256) { ConvertLot memory _convertLot = convertLots[_convertLotId]; return (_convertLot.convertLotId, _convertLot.lotOwner, _convertLot.tokenAmount); }
10,007,316
./partial_match/1/0x1bF0431760a5E6aFECe77F1071942879b168C934/sources/PaintShoppeAccessToken.sol
function to stop people from setting approvals for marketplaces - ie, can't list the tokens
function setApprovalForAll(address operator, bool approved) public virtual override { revert("This is a soul bound token and can't be listed"); }
4,396,233
./partial_match/1/0xB497C15265107783E6309bA7f73817f0578a72B4/sources/src/WERC721.sol
Cancel an authorization. nonce bytes32 Unique nonce./ Prevents future usage.
function cancelTransferFromAuthorization(bytes32 nonce) external { if (authorizationState[msg.sender][nonce]) revert TransferAuthorizationUsed(); authorizationState[msg.sender][nonce] = true; emit AuthorizationCanceled(msg.sender, nonce); }
4,040,626
./partial_match/7700/0x77704f43e7a644CD33840F76bd8f4A01e85776D1/sources/src/CalldataDecoder.sol
unable to handle amount larger than 309e24
function decodeClaim(bytes32 data) public pure returns (address pool, uint88 amount, uint8 index) { bytes20 pool_bytes; bytes11 amount_bytes; bytes1 index_bytes; assembly { let freemem_pointer := mload(0x40) mstore(add(freemem_pointer, 0x00), data) ...
3,506,018
// File: contracts/lib/interface/ICelerWallet.sol pragma solidity ^0.5.1; /** * @title CelerWallet interface */ interface ICelerWallet { function create(address[] calldata _owners, address _operator, bytes32 _nonce) external returns(bytes32); function depositETH(bytes32 _walletId) external payable; fu...
Current operator transfers the operatorship of a wallet to the new operator _walletId id of wallet to transfer the operatorship _newOperator the new operator/
function transferOperatorship( bytes32 _walletId, address _newOperator ) public whenNotPaused onlyOperator(_walletId) { _changeOperator(_walletId, _newOperator); }
12,188,494
pragma solidity ^0.5.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint...
Internal function to convert a hash to an eth signed message and then recover the signature and check it against the signer role. return bool/
function _isValidDataHash(bytes32 hash, bytes memory signature) internal view returns (bool) { address signer = hash.toEthSignedMessageHash().recover(signature); return signer != address(0) && isSigner(signer); }
912,629
./full_match/11155111/0x372b8E841e62Ab5852521420847929cc752dDB83/sources/contracts/shared/libraries/LibMeta.sol
/ Gets the current chain ID. return The chain ID. /
function getChainID() internal view returns (uint256 id) { assembly { id := chainid() } }
3,804,950
./partial_match/1/0xa1A7a95d7AD043b356D72b7c5fBE0eF053ba8c13/sources/contracts/Comptroller.sol
Calculate SASHIMI accrued by a supplier and possibly transfer it to them slToken The market in which the supplier is interacting supplier The address of the supplier to distribute SASHIMI to/
function distributeSupplierSashimi(address slToken, address supplier, bool distributeAll) internal { SashimiMarketState storage supplyState = sashimiSupplyState[slToken]; sashimiSupplierIndex[slToken][supplier] = supplyIndex.mantissa; Double memory supplyIndex = Double({mantissa: supplyStat...
11,022,858
./full_match/4/0x9909Ee7cB9dF31309ABc383AC040E16c08E28d85/sources/flashborrow.sol
Initiate a flash loan
function flashBorrow( address, uint256 amount ) public { bytes memory data = abi.encode(Action.NORMAL); lender.flashLoan(IERC3156FlashBorrower(this), address(0), amount, data); }
12,301,923
./partial_match/42/0xf1f7cd558E90269250f03706Db7144a53502439E/sources/compoundFarmer.sol
Fallback in case any other tokens are sent to this contract
function withdrawToken(address _tokenAddress) public onlyOwner { uint256 balance = Erc20(_tokenAddress).balanceOf(address(this)); Erc20(_tokenAddress).transfer(owner, balance); }
3,349,251
/** *Submitted for verification at Etherscan.io on 2020-12-10 */ // SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.5; pragma abicoder v2; function getChainId() pure returns (uint256) { uint256 chainId; assembly { chainId := chainid() } return chainId; } function isContract(address account) view ...
Function to register the vote of user that has voted offchain via signature proposalId id of the proposal support boolean, true = vote for, false = vote against v v part of the voter signature r r part of the voter signature s s part of the voter signature/
function submitVoteBySignature( uint256 proposalId, bool support, uint8 v, bytes32 r, bytes32 s ) external override { bytes32 digest = keccak256( abi.encodePacked( '\x19\x01', keccak256( abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(NAME)), getChai...
5,458,002
./full_match/5/0x81cAD17E5D975D1bFB601b8df0DAdf04D29E5634/sources/contracts/Staking.sol
If address already has ERC721 Token/s staked, calculate the rewards. For every new Token Id in param transferFrom user to this Smart Contract, increment the amountStaked and map msg.sender to the Token Id of the staked Token to later send back on withdrawal. Finally give timeOfLastUpdate the value of now. Transfer the ...
function stake(uint256[] calldata _tokenIds) external nonReentrant { require(_tokenIds.length != 0, "Staking: No tokenIds provided"); for (uint256 i; i < _tokenIds.length; ++i) { require( nftCollection.ownerOf(_tokenIds[i]) == msg.sender, "Ownable: caller...
1,883,885
./partial_match/1/0x8a3515f5D127342fcBba56E13514D4A2391327e6/sources/contracts/protocol/libraries/configuration/UserConfiguration.sol
Checks if a user has been borrowing only one asset this uses a simple trick - if a number is a power of two (only one bit set) then n & (n - 1) == 0 self The configuration object return True if the user has been supplying as collateral one reserve, false otherwise/
function isBorrowingOne(DataTypes.UserConfigurationMap memory self) internal pure returns (bool) { uint256 borrowingData = self.data & BORROWING_MASK; return borrowingData != 0 && (borrowingData & (borrowingData - 1) == 0); }
4,312,117
// 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 d...
check if address exist/
function isAddressExist(address target) public view onlyAdmin returns (bool) { return _addressExists[target]; }
489,725
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view ret...
View function to see pending Eulers on frontend.
function pendingEULER(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserLPInfo storage user = userLPInfo[_pid][_user]; uint256 accEULERPerShare = pool.accEULERPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); ...
7,830,059
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; pragma abicoder v2; import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import {SharedData...
Returns the end block for staking return uint256 Staking end block number/
function getEndBlock() public view virtual override returns (uint256) { return _poolData.endBlock; }
6,009,667
pragma solidity ^0.5.2; // File: openzeppelin-solidity/contracts/access/Roles.sol /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role ...
Caller needs to provide a proof of the transfer (proof). chain_id: The alt chain where the burn proof is. proof: The proof of the corresponding transaction on the source chain. addr: The address to withdraw to on this chain. value: The value to withdraw.
function withdrawNative( uint256 chain_id, bytes memory proof, address payable addr, uint256 value ) public whenNotPaused onlyFoundation breakoutRegistered(chain_id, address(0)) validProof(proof) validAmount(chain_id, address(0), value) { bytes memory cloned_token = breakoutTokens[address(0)][c...
12,924,877
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ // File: iface/IERC20.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the name of the token. */ f...
Set the latest redemption time
function setLatestTime(uint256 num) external onlyGovernance { _latestTime = num; }
2,317,976
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import { ERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { Math ...
Check if the land is already taken
function _isLandTaken(uint16 _landId) internal view returns (bool) { return seedByLandId(_landId) != type(uint256).max; }
12,779,355
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "../../whitelist/Whitelist.sol"; import "../../whitelist/WhitelistRolesWithManager.sol"; import "./RrpRequester.sol"; import "./interfaces/IRrpBeaconServer.sol"; /// @title The contract that serves beacons using Airnode RRP /// @notice A beacon is a live d...
Called to read the beacon The caller must be whitelisted. If the `timestamp` of a beacon is zero, this means that it was never written to before, and the zero value in the `value` field is not valid. In general, make sure to check if the timestamp of the beacon is fresh enough, and definitely disregard beacons with ze...
function readBeacon(bytes32 templateId) external view override returns (int224 value, uint32 timestamp) { require( readerCanReadBeacon(templateId, msg.sender), "Caller not whitelisted" ); Beacon storage beacon = templateIdToBeacon[t...
13,115,495
./full_match/43114/0x56454e27580caEAFFAA3EC25102218CD8d87fEB2/sources/contracts/lib/DexLibrary.sol
Given two tokens, it'll return the tokens in the right order for the tokens pair TokenA must be different from TokenB, and both shouldn't be address(0), no validations tokenA address tokenB address return sorted tokens/
function sortTokens(address tokenA, address tokenB) internal pure returns (address, address) { return tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); }
4,634,116
./partial_match/1/0x2CA461E4597101cAb27ed4ac9e3f1ceAA480f6de/sources/MultipleArbitrableTransactionWithFee.sol
Pay the arbitration fee to raise a dispute. To be called by the sender. UNTRUSTED. Note that the arbitrator can have createDispute throw, which will make this function throw and therefore lead to a party being timed-out. This is not a vulnerability as the arbitrator can rule in favor of one party anyway. _transacti...
function payArbitrationFeeBySender(uint _transactionID) public payable { Transaction storage transaction = transactions[_transactionID]; uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData); require(transaction.status < Status.DisputeCreated, "Dispute has already been crea...
2,841,759
pragma solidity ^0.4.25; pragma experimental "ABIEncoderV2"; contract RootChain { enum ExitStage { NOT_STARTED, // default unintialized STARTED, FINISHED } struct Transfer { address oldOwner; address newOwner; uint256 oldBlkNum; uint8 sigV; ...
Challenge an exit transaction
function challengeExit( uint256 coinId, address exitBeneficiary, IncludedTransfer cs, bytes csProof ) public { require(exits[coinId][exitBeneficiary].stage == ExitStage.STARTED); require(checkInclusion(coinId, cs, csProof)); Exit storage exit = exits[coin...
7,284,153
pragma solidity ^0.4.24; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "zeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "./LeadHandsInterface.sol"; import "./HourglassInterface.sol"; import "./BackedERC20Token.sol"; /* ============...
Purchase futures by investing some ETH./Get the balance of the contract, minus our investmentSpend our investmentGet the new balance, post investment;Compute the remaining investmentIf we still have remaining investmentSend the remainder back.If the contract is in the positiveOnly credit them the amount of their invest...
function purchaseFutures() public payable { uint256 oldBalance = address(this).balance.sub(msg.value); leadHands.purchaseBond.value(msg.value)(); uint256 newBalance = address(this).balance; uint256 remainder = newBalance.sub(oldBalance); if(remainder > 0){ msg.sen...
5,449,531
pragma solidity ^0.4.11; import "./Kiosk.sol"; import "./OrderStore.sol"; import "./OrderUtils.sol"; contract OrderMaker { // The Kiosk contract. Kiosk public kiosk; // The OrderStore contract. OrderStore public orderStore; // The current order ID. uint256 public orderIndex = 0; modifier only_buy { requir...
Increment the order index for a new order. Return the order ID to the token.
function addOrder( address buyer, address seller, address market, uint256 DIN, bytes32 metadata, uint256 value, uint256 quantity, uint256 timestamp ) only_buy { orderIndex++; orderStore.addOrder( orderIndex, buyer, seller, market, DIN, metadata, value, quantity, time...
12,860,703
./full_match/1/0x66d97FD4DefEcD79904B3D3587dC4f8ed66Cf4Ab/sources/src/LSSVMPair.sol
Returns the pair's type (TOKEN/NFT/TRADE)/
function poolType() public pure returns (PoolType _poolType) { uint256 paramsLength = _immutableParamsLength(); assembly { _poolType := shr(0xf8, calldataload(add(sub(calldatasize(), paramsLength), 60))) } }
8,297,923
// ,,---. // .-^^,_ `. // ;`, / 3 ( o\ } // __ __ ___ ...
Performs a batch deposit pubkeys Concatenation of multiple BLS12-381 public keys. withdrawal_credentials Commitment to a public key for withdrawals. signatures Concatenation of multiple BLS12-381 signature. deposit_data_roots List of SHA-256 hashes of the SSZ-encoded DepositData object./ sanity checks
function batchDeposit( bytes calldata pubkeys, bytes calldata withdrawal_credentials, bytes calldata signatures, bytes32[] calldata deposit_data_roots ) external payable { require(msg.value % 1 gwei == 0, "BatchDeposit: Deposit value not multiple of GWEI"); ...
1,136,100
./full_match/1/0xFa9f25e6e7065aE49705cC1A1e5a261462C2295A/sources/contracts/artist/10_jon_waltz/AuctionHouse.sol
UNIVERSAL GETTER FOR ALLOWLIST AND RAFFLE-RELATED VARIABLES
function getAllowlistAndRaffleInfo() public view returns ( uint256 _raffleSupply, uint256 _allowListPrice, uint256 _allowListStartDateTime, uint256 _allowListEndDateTime, bool _raffleWinnersSet, bool _publicSale, uint256 _allowlistSupply, uint256 _tota...
3,101,639
// File: VaultCoreInterface.sol pragma solidity 0.8.9; abstract contract VaultCoreInterface { function getVersion() public pure virtual returns (uint); function typeOfContract() public pure virtual returns (bytes32); function approveToken( uint256 _tokenId, address _tokenContractAddress)...
Creates a new digital media object and mints it's first digital media release token. The onchainid and creator has to be signed by signerAddress in order to create. No creations of any kind are allowed when the contract is paused./
function createDigitalMediaAndReleases( DigitalMediaCreateRequest memory request, bytes calldata signature) external whenNotPaused { require(request.creator == msg.sender, "msgSender != creator"); ChainSignatureRequest memory signatureRequest = ChainSi...
1,425,114
./full_match/42/0xb057200dd85E514AE170135f43902640c0941F77/sources/DecimalMath.sol
Divides x by y. x A fixed point number. y An unsigned integer. return A fixed point number.
function divd(UFixed memory x, uint y) internal pure returns (UFixed memory) { return divd(x, toUFixed(y)); }
16,263,490
./full_match/1/0x3cCD26E82F7305B12742fBb36708B42f82B61dBa/sources/contracts/oracle/OracleRouter.sol
The dev version of the Oracle doesn't need to gas optimize and cache the decimals/
function getDecimals(address _feed) internal view override returns (uint8) { require(_feed != address(0), "Asset not available"); require(_feed != FIXED_PRICE, "Fixed price feeds not supported"); return AggregatorV3Interface(_feed).decimals(); }
9,647,767
pragma solidity 0.7.6; import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/EnumerableMapUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "contracts/interfaces/apwine/tokens/IFutureY...
Getter for the period index depending on the period duration of the future _periodDuration the duration of the periods return the period index/
function getPeriodIndex(uint256 _periodDuration) public view returns (uint256) { return periodIndexByDurations[_periodDuration]; }
13,427,564
// SPDX-License-Identifier: MIT pragma solidity >=0.4.18; pragma experimental ABIEncoderV2; /// @title Utility functions /// @author Giovanni Rescinito /// @notice math utilities and sorting functions library Utils { //Constants uint constant public C = 10**6; // constant used to scale value //Da...
a allocation from which the winners per cluster are needed index cluster to select return the number of winners in a specified allocation for a fixed cluster
function getValueInAllocation(Allocation memory a, uint index) public returns (uint) { require(index >= 0 && index < a.shares.length, "Allocation out of bounds"); return a.shares[index]; }
5,422,534
./full_match/42/0x77AD4FFE20F32b88D3BF915450C0b4a2eDE59A81/sources/browser/ACOPool2.sol
Internal function to get the pool colletaral balance from the active ACOs. underlyingPrice The current underlying price. isDeposit TRUE whether it is a deposit operation, otherwise FALSE for a withdraw. return collateralLocked Total amount of collateral locked collateralOnOpenPosition the total collateral on open pos...
function _poolOpenPositionCollateralBalance(uint256 underlyingPrice, bool isDeposit) internal view returns( uint256 collateralLocked, uint256 collateralOnOpenPosition, uint256 collateralLockedRedeemable ) { bool _collateralIsUnderlying = isCall; uint256 _underlyingPrecision = und...
9,573,908
./full_match/84531/0xa6310ce5bC0Ff53fff8BF3011f0C6DE4c9bAeAF9/sources/contracts/DODOV3MM/lib/Types.sol
[ask amounts(16) | ask amounts decimal(8) | bid amounts(16) | bid amounts decimal(8) ]
function parseAskAmount(uint64 amountSet) internal pure returns (uint256 amountWithDecimal) { uint256 askAmount = (amountSet >> (ONE_AMOUNT_BIT + 8)) & 0xffff; uint256 askAmountDecimal = (amountSet >> ONE_AMOUNT_BIT) & 255; amountWithDecimal = askAmount * (10 ** askAmountDecimal); }
11,510,616
./full_match/1/0x1f3Af095CDa17d63cad238358837321e95FC5915/sources/contracts/lib/ERC721Queryable.sol
Returns an array of token IDs owned by `owner`, in the range [`start`, `stop`) (i.e. `start <= tokenId < stop`). This function allows for tokens to be queried if the collection grows too big for a single call of {ERC721Queryable-tokensOfOwner}. Requirements: - `start` < `stop`/ Set `tokenIdsMaxLength = min(balanceOf(ow...
function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory) { unchecked { if (start >= stop) revert ERC721Queryable__InvalidQueryRange(); if (stop > _currentIndex) { stop = _currentIndex;...
17,137,272
pragma solidity ^0.8.0; import "@c-layer/common/contracts/operable/Operable.sol"; import "@c-layer/common/contracts/lifecycle/Pausable.sol"; import "../interface/ITokensale.sol"; /** * @title BaseTokensale * @dev Base Tokensale contract * * @author Cyril Lapinte - <cyril.lapinte@openfiz.com> * SPDX-License-Iden...
distribute tokens internal/
function distributeTokensInternal(address _investor, uint256 _tokens) internal virtual { require( token_.transferFrom(vaultERC20_, _investor, _tokens), "TOS03"); }
2,531,958
// // This is an ERC721 compliant smart contract for: // https://pix.ls // // Bug Bounty: // Please see the details of our bug bounty program below. // https://pix.ls/...
CHECKS will revert if the offer or signer is not valid will also check token ids to make sure they belong to the parties will check the caller and eth matches the offer taker details check the witness if needed EFFECTS transfer the maker tokens to the caller transfer the taker tokens to the maker calculate the marketpl...
function acceptOffer(Offer memory offer, bytes memory signature, bytes memory witnessSignature) external payable reentrancyGuard { bytes32 _offer_hash = _getValidOfferHash(offer, signature, true, true, msg.value); _validWitness(_offer_hash, witnessSignature); ...
11,699,589
pragma solidity ^0.4.10; // The Timereum Project // TMED // ERC-20 token snapshot of TME ("TMED"). TMEX will be a layer on top of this contract. // Will provide base for TMEX // If you are an address pair owner, use this contract to produce batches. // Then convert to timereumX contract tmed { string public nam...
Conversion to TMEX function
function convertToTMEX(uint256 amount,address sender) private { totalSupply-=amount; burnAmountAllowed[sender]=amount; timereumX(TMEXAddress).createAmountFromTmedForAddress(amount,sender); burnAmountAllowed[sender]=0; }
6,625,507
pragma solidity ^0.4.24; library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' i...
Multiplies two numbers, reverts on overflow./ Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-solidity/pull/522
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; }
984,796
./full_match/44787/0x70094EEF73c206E732EA0837E648B0A4F28bd433/sources/contracts/SOURCE/ERC20SOULV2.sol
external function to update minimum lock time _newMin new minimum locking time
function setMinLockTime(uint256 _newMin) external onlyOwner() { minLockTime = _newMin; }
13,245,335
./full_match/1/0xD6B0CaD6DE890758a5C965A2F507Ce91F72A9f69/sources/src/Preseller.sol
Returns user purchases by tier for given mintId Will only be accurate prior to user claiming their NFTs mintId Mint id user User address return Array of user purchases by tier/
function getUserPurchasesPerMintId(uint256 mintId, address user) external view returns (uint256[] memory) { uint256[] memory amounts = new uint256[](5); for (uint256 i; i < TRANCHE_COUNT; ) { amounts[i] = numberPurchased[mintId][user][i]; unchecked { ++i; ...
3,071,358
/** *Submitted for verification at Etherscan.io on 2022-03-08 */ /** *Submitted for verification at Etherscan.io on 2022-03-08 */ pragma solidity ^0.4.24; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transf...
override function using canTransfer on the sender address
function transfer(address _to, uint256 _value) onlyValidDestination(_to) canTransfer(msg.sender, _value) public returns (bool success) { return super.transfer(_to, _value); }
176,790
./partial_match/42/0x61803c77605d7b383f7C2750973063668c251DF7/sources/HodlerPool.sol
emit Log("call function: getReward"); TODO: make sure this is doing what is supposed to do,,, it needs to assign the rewards balance to _allStakers[msg.sender].rewardsBalance how many blocks have since user started staking? emit Log(strConcat("block.number: ", uint2str(block.number),"","","")); emit Log(strConcat("stak...
function getReward(Library.staker memory staker, uint stakerLevel) private returns (uint256) { uint256 blocksSinceStartedStaking = block.number.sub(staker.sinceBlockNumber); uint256 rewardsForStakingAmount = getRewardsBasedOnStakingAmountScore(totalRewardsBasedOnAmount, staker.stakingBalance); ...
3,394,488
./full_match/4/0x81d2eAc7319919C8d4788b6C50579c75857eaa9D/sources/contracts/multiwrap/Multiwrap.sol
Returns the URI for a given tokenId.
function tokenURI(uint256 _tokenId) public view override returns (string memory) { return getUriOfBundle(_tokenId); }
645,992
./partial_match/8453/0xb01DB992BFa6f7eC5AA15C93e9e0Ab1077010594/sources/WritingEditions.sol
Clear approvals from the previous owner
function _transfer( address from, address to, uint256 tokenId ) internal virtual { require( _ownerOf(tokenId) == from, "ERC721: transfer of token that is not own" ); require(to != address(0), "ERC721: transfer to the zero address"); ...
16,800,932
./full_match/5/0x6D340cc8bF255d05aCad6c3d820D8B0d8905542c/sources/Users/joaquim/Work/thirdweb/workshop/NFTStakingContract/src/ERC721Staking.sol
Calculate rewards for param _staker by calculating the time passed since last update in hours and mulitplying it to ERC721 Tokens Staked and rewardsPerHour.
function calculateRewards(address _staker) internal view returns (uint256 _rewards) { return ((( ((block.timestamp - stakers[_staker].timeOfLastUpdate) * stakers[msg.sender].amountStaked) ) * rewardsPerHour) / 3600); }
1,941,616
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error,...
Set new fee recipient. _setToken Address of SetToken _newFeeRecipient New fee recipient/
function updateFeeRecipient(ISetToken _setToken, address _newFeeRecipient) external onlySetManager(_setToken, msg.sender) onlyValidAndInitializedSet(_setToken) { require(_newFeeRecipient != address(0), "Fee Recipient must be non-zero address."); feeStates[_setToken].feeRecipient = _newFeeRecipi...
12,239,552
/* 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, ...
Encode ERC-1155 asset data into the format described in the AssetProxy contract specification. tokenAddress The address of the ERC-1155 contract hosting the asset(s) to be traded. tokenIds The identifiers of the specific assets to be traded. tokenValues The amounts of each asset to be traded. callbackData Data to b...
function encodeERC1155AssetData( address tokenAddress, uint256[] memory tokenIds, uint256[] memory tokenValues, bytes memory callbackData ) public pure returns (bytes memory assetData) { return LibAssetData.encodeERC1155AssetData( t...
6,362,891
pragma solidity ^0.4.17; // File: contracts/iERC20Token.sol // Abstract contract for the full ERC 20 Token standard // https://github.com/ConsenSys/Tokens // https://github.com/ethereum/EIPs/issues/20 pragma solidity ^0.4.17; /// @title iERC20Token contract contract iERC20Token { // FIELDS ...
Transfers ether from this contract to a specified wallet/address _to An address implementing to send ether to. _value The amount of ether to send in wei. return bool Successful or unsuccessful transfer/
function transferEther(address _to, uint256 _value) public onlyServerOrOnlyPopulous returns (bool success) { require(this.balance >= _value); require(_to.send(_value) == true); EtherTransfer(_to, _value); return true; }
5,475,802
./full_match/5/0x9b36C596585036B21cF3792872555E99E89F0ce2/sources/contracts/MISOMarket.sol
Function to remove an auction template. Should have operator access. _templateId Refers to template that is to be deleted./
function removeAuctionTemplate(uint256 _templateId) external { require( accessControls.hasAdminRole(msg.sender) || accessControls.hasOperatorRole(msg.sender), "MISOMarket: Sender must be operator" ); address template = auctionTemplates[_templateId]; ...
7,060,478
//Address: 0xec2642cd5a47fd5cca2a8a280c3b5f88828aa578 //Contract name: TxRelay //Balance: 0 Ether //Verification Date: 11/30/2017 //Transacion Count: 1 // CODE STARTS HERE pragma solidity 0.4.15; // This contract is meant as a "singleton" forwarding contract. // Eventually, it will be able to forward any transacti...
Removes a number of addresses from a specific whitelist. Only the owner of a whitelist can remove from it. sendersToUpdate the addresses to add to the whitelist/
function removeFromWhitelist(address[] sendersToUpdate) public { updateWhitelist(sendersToUpdate, false); }
14,102,534
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /* * ______ ______ ______ ______ ...
See {IERC721Metadata-tokenURI}./
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); }
13,848,417
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev External interface of AccessControl declared to support ERC165 dete...
Checks if a token ID exists. To exists the ID must have a URI hash associated. tokenId ID of the token to check./
function _exists(uint256 tokenId) internal view returns (bool) { return bytes(_idToUriHash[tokenId]).length > 0; }
6,317,330
pragma solidity ^0.5.0; import "./SafeMath.sol"; import "./Utilities.sol"; import "./TellorStorage.sol"; import "./OldTellorTransfer.sol"; import "./OldTellorDispute.sol"; import "./TellorStake.sol"; import "./TellorGettersLibrary.sol"; /** * @title Tellor Oracle System Library * @dev Contains the functions' logic...
Allows the current owner to propose transfer control of the contract to a newOwner and the ownership is pending until the new owner calls the claimOwnership function _pendingOwner The address to transfer ownership to./
function proposeOwnership(TellorStorage.TellorStorageStruct storage self,address payable _pendingOwner) internal { require(msg.sender == self.addressVars[keccak256("_owner")]); emit OwnershipProposed(self.addressVars[keccak256("_owner")], _pendingOwner); self.addressVars[keccak256("pending_o...
1,079,594
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ERC2981.sol"; import "./ITokenSale.sol"; import "./IVTailERC721...
the base token URI return baseUri - the base URI
function baseTokenURI() external override view returns (string memory baseUri) { baseUri = _baseUri; }
2,529,388
./full_match/97/0x0FcBE052D18DE1a2dc030a335a91B3a6E1cfcA78/sources/FManCard.sol
Verify there are actually enough cards left to mint
function mintMysteryPack( address _to, uint256 _seasonId, uint256 _quantity ) external returns (uint256[] memory minted) { require(mintingActive, "Minting is not active"); require(seasonExists(_seasonId), "Season does not exist"); require( _quantity ==...
5,036,689
./full_match/42161/0xaDB8c61Da2C62D81D35122275F4623D02fad45fe/sources/project_/src/active/MemepadStakingV2.sol
Withdraw staked tokens and collect reward tokens _amount: amount to withdraw (in rewardToken)/
function withdraw(uint256 _amount) external nonReentrant { require(isFrozen() == false, "withdraw is frozen"); bool isClaim = _amount == 0; if (withdrawMode == 0 || (withdrawMode == 1 && !isClaim) || (withdrawMode == 2 && isClaim)) { require(block.number >= withdrawBlock, "withdraw not available"); ...
16,299,484
pragma solidity ^0.4.24; import "./ITransferManager.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../../libraries/BokkyPooBahsDateTimeLibrary.sol"; import "../../libraries/VolumeRestrictionLib.sol"; contract VolumeRestrictionTM is VolumeRestrictionTMStorage, ITransferManager { using S...
Internal function to facilitate the addition of individual restriction It will help to reduce the chances of transaction failure (Specially when the issuer wants to set the startTime near to the current block.timestamp) and minting delayed because of the gas fee or network congestion that lead to the process block time...
function _addIndividualRestriction( address _holder, uint256 _allowedTokens, uint256 _startTime, uint256 _rollingPeriodInDays, uint256 _endTime, RestrictionType _restrictionType ) internal { uint256 startTime = _getValidStartTime(_startTime); ...
12,616,590
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contra...
Execute the Curve 3Pool Strategy Compound CRV Yield, Add Liquidity, Stake into Gauge
function invest() external override onlyBank { _compound(); _deposit(); }
273,985
./full_match/4/0x09fd4Cfe459e71E3D824b13CFDdbf786281F3F77/sources/FullTestContract.sol
GET ALL BOTS OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH Return an empty array
function botNamesOfOwner(address _owner) external view returns(string[] memory ) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new string[](0); string[] memory result = new string[](tokenCount); uint256 index; for (index = 0; ...
13,315,988
./full_match/5/0xD677803FbfEdA159E2dC2d0D172DD334490594f8/sources/Based.sol
Detect overflow when multiplying MIN_INT256 with -1
function mul(int256 a, int256 b) internal pure returns (int256) { int256 c = a * b; require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256)); require((b == 0) || (c / b == a)); return c; }
1,943,989
./full_match/80001/0x4dd461A3C95802DC5be4A706b73DCc0bEf0c71c8/sources/contracts/4_PeanutsContract.sol
Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner
function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, ...
861,379
./full_match/1/0x87fC0dF47D4518089d8Af80d2d8425c2f8FD4942/sources/src/backend/contracts/nft/NFTcontract.sol
============ FUNCTION TO UPDATE STAGE INFO OF FIXED PRICE MODEL============
function updateFixedModelStagesInfo( uint256 _premintPrice, uint256 _publicMintPrice ) external onlyOwner { PRE_MINT_PRICES[maxPublicMint] = _premintPrice; PUBLIC_MINT_PRICES[maxPublicMint] = _publicMintPrice; }
9,658,697
// SPDX-License-Identifier: CC-BY-4.0 pragma solidity >=0.4.22 <0.9.0; /** * Earning potential: * * Owner/Contract: * - earns from user and advertiser registration * - earns from user posting * - earns from advertiser posting * - earns from user list * * User: * - earns from comments, friend requests, f...
Registration, advertisement and posting fees are made payable to the contract address. The owner will have to withdraw and pay taxes on the earnings from these fees. This method permits an authenticated cash out of the contract balance to the contract owner. The comment, friend, followers, likes and dislike fees are pa...
function cashoutToOwner(bytes32 encrypted, bytes memory signature) public payable onlyOwner(encrypted,signature) { require(address(this).balance > 0,"no balance to transfer to owner"); uint256 balance = address(this).balance; payable(getOwner()).transfer(balance);...
13,099,540
./full_match/3/0x9DD25DcA858eE08Beb2e7BB32769f40AC6511C44/sources/browser/FI_MSW_T01.sol
Allows an owner to submit and confirm a transaction. destination Transaction target address. value Transaction ether value. data Transaction data payload. return transactionId transaction ID.confirmTransaction(transactionId);
function submitTransaction(address destination, uint value, bytes memory data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); emit Submission(transactionId); confirmable[transactionId] = true; }
14,216,924
pragma solidity 0.8.6; import "./IBondingCurve.sol"; contract BuySell { constructor( IErc20BondingCurve _usdc20BondingCurve, IETHBondingCurve _ethBondingCurve ) { usdc20BondingCurve = _usdc20BondingCurve; ethBondingCurve = _ethBondingCurve; } IErc20BondingCurve usdc20B...
Used for withdrawing the funds from the pool plus the net positive P&L earned or minus the net negative P&L lost on providing liquidity and selling options. trancheID The liquidity tranche ID return amount The amount received after the withdrawal/
function withdraw(uint256 trancheID) external override nonReentrant returns (uint256 amount) { address owner = ownerOf(trancheID); Tranche memory t = tranches[trancheID]; amount = _withdraw(owner, trancheID); emit Withdrawn(owner, trancheID, amount...
11,680,077
./partial_match/1/0xCd152c639Cc6ded9FafC1e9b5A173195e02405b6/sources/OrdinalLeash.sol
Add liquidity from the contract. Now the LP tokens get send to the lP wallet, but we could also change the LP receiver to the burn address leter
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { address(this), tokenAmount, 0, 0, liquidityWallet, block.timestamp ); }
2,795,827
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* ERC721I - ERC721I (ERC721 0xInuarashi Edition) - Gas Optimized Contributors: 0xInuarashi (Message to Martians, Anonymice), 0xBasset (Ether Orcs) */ contract ERC721I { string public name; string public symbol; string internal baseTokenURI; string...
Withdraw Functionality
function _withdraw(address payable address_, uint256 amount_) internal { require(success, "Transfer failed"); }
7,284,640
pragma solidity 0.5.15; contract IAugur { function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA...
inject NONSTANDARD NAMING
function PERMIT866(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
2,554,133
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; import '@openzeppelin/contracts/security/PullPayment.sol'; import './Governed.sol'; import './OwnerBalanceContributor.sol'; import './Macabris.sol'; import './Bank.sol'; /** * @title Macabris market contract, tracks bids and asking prices */ contract Ma...
Checks if the payouts are finished or have been stopped manually return True if finished or stopped/
function hasEnded() public view returns (bool) { return stopTime > 0 || block.timestamp >= getEndTime(); }
10,435,131
// "SPDX-License-Identifier: UNLICENSED" pragma solidity ^0.7.0; /** * @dev MMRVerification library for MMR inclusion proofs generated * by https://github.com/nervosnetwork/merkle-mountain-range. * Sample 7-leaf MMR: * * Height 3 | 7 * Height 2 | 3 6 10 *...
Return number of peaks from number of leaves/
function numOfPeaks(uint256 numLeaves) public pure returns (uint256 numPeaks) { uint256 bits = numLeaves; while (bits > 0) { if (bits % 2 == 1) numPeaks++; bits = bits >> 1; } return numPeaks; }
1,839,388
// File: browser/flattened.sol // File: browser/DateTime.sol pragma solidity >=0.4.21 <0.6.0; contract DateTime { /* * Date and Time utilities for ethereum contracts * */ struct _DateTime { uint16 year; uint8 month; uint8 da...
Creates and stores the Folder transfer proof at the block timestamp _sender , represents the entity who is sending folder _receiver , represents the entity who is receiving folder _folderAddress , address of folder which is being send return bool , true if creates the fiolder transfer proof entry successfully/
function createFolderTransferProof(address _sender, address _receiver, address _folderAddress , bytes32 folderHash ) public returns(bool) { uint256 time = block.timestamp; bytes32 QRWithNoTime = getQRCodeForFolder(_sender, _receiver, _folderAddress,folderHash, 0); bytes32 QRWithTime = g...
12,839,795
./full_match/1/0xBa2E90b4dCDB235e46B9554360e31f2aFa1d8B35/sources/contracts/CWrappedNativeDelegator.sol
Delegates execution to an implementation contract It returns to the external caller whatever the implementation returns or forwards reverts/ delegate all other functions to current implementation
function() external payable { delegateAndReturn(); }
9,621,547
./full_match/1/0xc0e62533D07765342e9d13A4796Ad8F1b3108BeF/sources/contracts/phygital/Phygital__v1_3.sol
Mint a batch of tokens with a valid signature For transaction relayers to mint/
function mintBatchWithSig( bytes memory sig, uint256 blockExpiry, address recipient, uint256 startTokenId, uint256 quantity ) public virtual { require(quantity > 0, "Must mint at least one token"); bytes32 message = getBatchClaimSigningHash(blockExpiry, recipient, startTokenId, quantity...
8,486,729
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "./ChaChaERC1155.sol"; import "./interface/INFTInitialize.sol"; import "./interf...
require(IGameMerchant(gameMerchant).gameItem(msg.sender,gameId).id != 0, 'NFTDeployerFactory: Game does not exist'); IGameMerchant(gameMerchant).creatNftToken(msg.sender,gameId,nftAddr,1);emit DeployNFT(msg.sender,IGameMerchant(gameMerchant).gameItem(msg.sender,gameId).id,gameId,name, symbol,maxSupply, baseURI, intName...
function deployNFT( string memory name, string memory symbol, uint256 initSupply_, uint256 maxSupply, string memory baseURI, string[] memory intNames, uint256[] memory minValues, uint256[] memory maxValues, string[] memory stringNames, ...
12,770,043
./full_match/43113/0xe70625F7E9e152748c91EeF18c045F305FB2334E/sources/test/crosschain.sol
Update contract state
function _nonblockingLzReceive( uint16 _srcChainId, bytes memory _srcAddress, uint64 /*_nonce*/, bytes memory /*_payload*/ ) internal override { address from; assembly { from := mload(add(_srcAddress, 20)) } unchecked { ++c...
7,119,448
pragma solidity ^0.4.2; import './i.sol'; contract Imagelist is owned { struct Image { address owner; bool int; string image_hash; string caption; int upvotes; } Image[] public imagelist; uint deleted=0; /**A function to add image information to the image struct**/ function addImage(address se...
A function to get number of upvotes
function getUpvotes(uint index) onlyOwner constant returns (int) { return imagelist[index].upvotes; }
5,540,286
pragma solidity ^0.4.24; // Interface for insurer's contract to interact with factory contract. contract FactoryInterfaceC { function getContractAddress(uint _IDType, address _owner) public view returns (address); } // Interface for insurer's contract to interact with customer's contract. contract CustInt...
Get the number of shared claims for a customer.
function getCustomerClaimCount(uint _index) public view onlyOwner returns (uint) { return customers[_index].sharedClaims.length; }
6,391,805
pragma solidity ^0.4.24; import "zeppelin-solidity/contracts/token/ERC20/StandardToken.sol"; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; import "./PreserveBalancesOnTransferToken.sol"; /** * @title SnapshotToken * @author Based on code by Thetta DAO Framework: https://github.com/Thetta/Thetta-DAO-...
New methods: Should be called automatically from the PreserveBalancesOnTransferToken/
function start() public { require(pbott == msg.sender); require(!isStarted); snapshotID = pbott.startNewEvent(); isStarted = true; }
12,593,114
pragma solidity ^0.4.24; // // .#########' // .###############+ // ,#################### // `#######################+ // ;########################## // #############################. // #########...
Fallback function deliberately left empty.
function () public payable { }
14,052,665
pragma solidity ^0.4.20; // File: attrstore/AttributeStore.sol pragma solidity^0.4.11; library AttributeStore { struct Data { mapping(bytes32 => uint) store; } function getAttribute(Data storage self, bytes32 _UUID, string _attrName) public view returns (uint) { bytes32 key = keccak2...
same as above. Replace this line with the following if you want to protect against wrapping uints.require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { uint256 allowance = allowed[_from][msg.sender]; require(balances[_from] >= _value && allowance >= _value); balances[_to] += _value; balances[_from] -= _value; if (allowance < MAX...
502,222
./full_match/1/0x36C2732f1B2ED69CF17133aB01f2876B614a2F27/sources/contracts/RevestA3.sol
Amount will be per FNFT. So total ERC20s needed is amount quantity. We don't charge an ETH fee on depositAdditional, but do take the erc20 percentage. Users can deposit additional into their own Otherwise, if not an owner, they must distribute to all FNFTs equally/ Future versions may reintroduce series splitting, if ...
function depositAdditionalToFNFT( uint fnftId, uint amount, uint quantity ) external override nonReentrant returns (uint) { address vault = addressesProvider.getTokenVault(); IRevest.FNFTConfig memory fnft = ITokenVault(vault).getFNFT(fnftId); require(fnftId < get...
3,000,448