file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/100/0x21cd73a7f09032689F833624e2840CBB958d9181/sources/RandomAuRa.sol
Returns the cipher of the validator's number for the specified collection round and the specified validator stored by the validator through the `commitHash` function. For the past collection rounds the cipher is empty as it's erased by the internal `_clearOldCiphers` function. _collectRound The serial number of the co...
function getCipher(uint256 _collectRound, address _miningAddress) public view returns(bytes memory) { address stakingAddress = validatorSetContract.stakingByMiningAddress(_miningAddress); return _ciphers[_collectRound][stakingAddress]; }
16,647,070
./full_match/42161/0xF83675ac64a142D92234681B7AfB6Ba00fa38dFF/sources/project_/contracts/core/LfgSwapRouter.sol
refund dust eth, if any
function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) { (amountTo...
16,301,487
// File: contracts/external/govblocks-protocol/interfaces/IProposalCategory.sol /* Copyright (C) 2017 GovBlocks.io This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the Li...
Changes the master address and update it's instance/
function setMasterAddress() public { OwnedUpgradeabilityProxy proxy = OwnedUpgradeabilityProxy( address(uint160(address(this))) ); require(msg.sender == proxy.proxyOwner(), "Sender is not proxy owner."); require(masterAddress == address(0), "Master address already set");...
14,744,350
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.7; /* ██████ ██████ ██ ██ ███ ██ ██████ ██ ██ ██ ██ ██ ████ ██ ██ ██ ███████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ██████ ██████ ██ ████ ██████ */ import {IERC2981Upgr...
Returns token URI (metadata URL). e.g. https://sound.xyz/api/metadata/[artistId]/[editionId]/[tokenId] Concatenate the baseURI, editionId and tokenId, to create URI.
function tokenURI(uint256 _tokenId) public view override returns (string memory) { require(_exists(_tokenId), 'ERC721Metadata: URI query for nonexistent token'); uint256 editionId = tokenToEdition(_tokenId); return string(abi.encodePacked(baseURI, editionId.toString(), '/', _tokenId.toStri...
5,724,107
./partial_match/1/0xd27c12d2b7749280057592BF03eC2a63158F4716/sources/contracts/MMPRESALE.sol
To update the payout address _id Presale id to update _newAddress payout address/
function changePayoutAddress(uint256 _id, address _newAddress) external checkPresaleId(_id) onlyOwner { require(_newAddress != address(0), "Zero token address"); address prevValue = presale[_id].payout; presale[_id].payout = _newAddress; emit PresalePayoutAddressUpdated(prevValue, _newAddress, block.t...
4,151,573
pragma solidity >=0.4.22 <0.6.0; //----------------------------------------------------------------------------- /// @title Ownable /// @dev The Ownable contract has an owner address, and provides basic /// authorization control functions, this simplifies the implementation of /// "user permissions". //-----...
------------------------------------------------------------------------- Set the address of the VIP180 to `_newAddress`. Throws if ehrtAddress is the zero address. _newAddress The address of the Eight Hours Token.------------------------------------------------------------------------- initialize ehrtAddress to new...
function setEhrtContractAddress (address _newAddress) external notZero(uint(_newAddress)) onlyOwner { ehrtAddress = _newAddress; }
13,104,894
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; /// @title BRZ token Bridge /// @author Solange Gueiros // Inpired on // https://github.com/rsksmart/tokenbridge/blob/master/bridge/contracts/Bridge.sol // https://github.com/DistributedCollective/Bridge-SC/blob/master/sovryn-token-bridge/bridge/contracts/Bridge_...
This function starts the process of crossing tokens in the Bridge. > Any account / person can call it! Can not be called if the Bridge is paused. Parameters: - amount - gross amount of tokens to be crossed. - The Bridge fee will be deducted from this amount. - transactionFee - array with the fees: - transactionFee[...
function receiveTokens( uint256 amount, uint256[2] memory transactionFee, string memory toBlockchain, string memory toAddress ) external override whenNotPaused returns (bool) { require(existsBlockchain(toBlockchain), "toBlockchain not exists"); require(!compareStrings(toAddress, ""), "toAddr...
12,927,575
./full_match/1/0x7F6163674b6FD9c3D7238F2C5F958AC5C9A40aF8/sources/contracts/exchange/Exchange.sol
Call atomicMatch - Solidity ABI encoding limitation workaround, hopefully temporary./
function atomicMatch_( address[14] memory addrs, uint[18] memory uints, uint8[8] memory feeMethodsSidesKindsHowToCalls, bytes memory callDataBuy, bytes memory callDataSell, bytes memory replacementPatternBuy, bytes memory replacementPatternSell, bytes ...
9,770,968
pragma solidity ^0.5.0; import "@studydefi/money-legos/compound/contracts/IComptroller.sol"; import "@studydefi/money-legos/compound/contracts/ICEther.sol"; import "@studydefi/money-legos/compound/contracts/ICToken.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/Saf...
Source: balanceOfUnderlying from any ctoken
function getBorrowBalanceUnderlying( address cToken, address owner ) public view returns (uint256) { ( uint256 err, uint256 cTokenBalance, uint256 borrowBalance, uint256 exchangeRateMantissa ) = ICToken(c...
13,034,798
//SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "../interfaces/IEternalFund.sol"; import "../interfaces/IEternalStorage.sol"; import "../interfaces/ITimelock.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; /** * @title The Eternal Fund co...
Queues an individual proposal action into the timelock contract. target The address of the contract whose function is being called value The amount of AVAX being transferred in this transaction signature The function signature of this proposal's action data The function parameters of this proposal's action eta The...
function _queueOrRevert(address target, uint256 value, string memory signature, bytes memory data, uint256 eta) private { require(!timelock.queuedTransaction(keccak256(abi.encode(target, value, signature, data, eta))), "Proposal action already queued"); timelock.queueTransaction(target, value, signa...
12,810,502
pragma solidity ^0.4.23; // File: @ensdomains/dnssec-oracle/contracts/BytesUtils.sol library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * ...
Transfers ownership of a node to a new address. May only be called by the current owner of the node. node The node to transfer ownership of. owner The address of the new owner./
function setOwner(bytes32 node, address owner) public only_owner(node) { Transfer(node, owner); records[node].owner = owner; }
1,413,912
./full_match/4/0xd08F669E774Afc5E0eA0ba1D2c09f92931Ffcf12/sources/_openzeppelin/contracts_4.7.2/governance/compatibility/GovernorCompatibilityBravo.sol
See {Governor-_countVote}. In this module, the support follows Governor Bravo./
function _countVote( uint256 proposalId, address account, uint8 support, uint256 weight, ) internal virtual override { ProposalDetails storage details = _proposalDetails[proposalId]; Receipt storage receipt = details.receipts[account]; require(!receipt.ha...
707,430
// File: @aragon/os/contracts/common/UnstructuredStorage.sol /* * SPDX-License-Identitifer: MIT */ pragma solidity ^0.4.24; library UnstructuredStorage { function getStorageBool(bytes32 position) internal view returns (bool data) { assembly { data := sload(position) } } function getStorage...
Get index associated to entry `_addr` from the registry. getter for the entries mapping for an index in entryArr _addr The Ethereum address of the entry to get return contentId pointing to the IPFS structured content object for the entry/
function getEntryIndex(address _addr) external view isInitialized entryExists(_addr) returns (uint256 index) { index = entries[_addr].index; }
14,077,951
//Address: 0x77ceff4173a56cd22b6184fa59c668b364ae55b8 //Contract name: CarTaxiIco //Balance: 0 Ether //Verification Date: 9/26/2017 //Transacion Count: 3791 // CODE STARTS HERE pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract SafeMath { ...
Send tokens to bountyOwner depending on crowdsale results. Can be send only after ICO.Calculate total tokens sold on pre-ICO and ICOCalculate bounty tokens depending on total tokens sold
function sendTokensToBountyOwner() onlyManager whenInitialized { require(!sentTokensToBountyOwner); uint tokensSold = add(soldTokensOnIco, soldTokensOnPreIco); cartaxiToken.emitTokens(bountyOwner, bountyTokens); sentTokensToBountyOwner = true; }
6,349,669
// CryptoPuppies Source code // Copied from: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user...
Returns a URI pointing to a metadata package for this token conforming to ERC-721 (https://github.com/ethereum/EIPs/issues/721) _tokenId The ID number of the Puppy whose metadata should be returned.
function tokenMetadata(uint256 _tokenId, string _preferredTransport) external view returns (string infoUrl) { require(erc721Metadata != address(0)); bytes32[4] memory buffer; uint256 count; (buffer, count) = erc721Metadata.getMetadata(_tokenId, _preferredTransport); return _...
498,291
./full_match/42161/0x68bfbe1001568da0FeD281a1C99A16794bDa2754/sources/contracts/libraries/LinkedListLibrary.sol
pops the first entry from the linked list self stored linked list from contract _direction pop from the head (NEXT) or the tail (PREV)
function pop(LinkedList storage self, bool _direction) internal returns (uint256) { bool exists; uint256 adj; (exists, adj) = getAdjacent(self, HEAD, _direction); return remove(self, adj); }
16,301,309
pragma solidity ^0.4.18; contract HasManager { address public manager; modifier onlyManager { require(msg.sender == manager); _; } function transferManager(address _newManager) public onlyManager() { require(_newManager != address(0)); manager = _newManager; } } contract Ownable { addre...
backers refund their ETH if the crowdsale was cancelled or has failed either cancelled or failed prevent from doing it twice
function refund() public { require(stopped || isFailed()); uint256 amount = participants[msg.sender]; require(amount > 0); participants[msg.sender] = 0; msg.sender.transfer(amount); }
10,674,776
//Address: 0xe736091fc36f1ad476f5e4e03e4425940822d3ba //Contract name: SingularDTVFund //Balance: 3.630685972653289973 Ether //Verification Date: 10/5/2016 //Transacion Count: 294 // CODE STARTS HERE /// Implements ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20 /// @title Abstract token contract ...
Withdraws revenue for user. Returns revenue. forAddress user's address.
function calcRevenue(address forAddress) internal returns (uint) { return singularDTVToken.balanceOf(forAddress) * (totalRevenue - revenueAtTimeOfWithdraw[forAddress]) / singularDTVToken.totalSupply(); }
970,894
./partial_match/1/0xd2947e1E2eA5c4cD14AaA2b7492549129b087DAA/sources/CosmicDriftNFT.sol
Set the Base Extension to be used for the revealed NFTs Callable only by Owner _newBaseExtension Metadata file extension
function setBaseExtension(string memory _newBaseExtension) external onlyOwner { baseExtension = _newBaseExtension; emit BaseExtensionSet(_newBaseExtension); }
16,149,375
./full_match/4/0x0d86ffF389aAaAd1738CBf1a917ce33dBad20a06/sources/contracts/contrato.sol
Não há uma forma eficiente de obter a lista toda... Então temos uma ineficiente.
function getWhitelist() public view onlyOwner returns (whiteListData[] memory) { return whitelistedMints; }
12,470,434
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../ProxyToken/ProxyToken.sol"; import "../UniversalProtocolToken/UniversalProtocolToken.sol"; import "./ProxyTokenAuthorizable.sol"; import "./ProxyTokenRequestsStorage.sol"; /** * @title ProxyTokenRequestsV0 */ contract Pr...
Fulfills a mint request, minting `amount` tokens requestId requestId of mint request to fulfill data external data logged as part of the mint request/
function fulfillMintRequest( uint256 requestId, string memory data) public onlyNewMintRequest(requestId) onlyAuthorizedMintFulfiller(msg.sender) { _storage.setMintRequestStatus(requestId, ProxyTokenRequestsStorageV0.Status.FULFILLED); _storage.setMintRequestAddressMap(requestId, "fulfill...
7,277,707
./full_match/5/0x4E95da32B1D75CD399b79cd85fE77f0e2935CC46/sources/contracts/CrowdFunding.sol
fucntionscheck all okincrement number of campaigns
function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) { Campaign storage campaign = campaigns[numberOfCampaigns]; require(campaign.deadline < block.timestamp, "Deadline is a Da...
11,621,227
./full_match/8453/0x6AE3fFA7bb6f95fAcA1F1A7f85880C87141c0236/sources/contracts/staking/sys/MixinFinalizer.sol
@inheritdoc IStaking Make sure the previous epoch has been fully finalized. mint epoch inflation, jump first epoch as all registered pool accounts will become active from following epoch mint happens before time has passed check, therefore tokens will be allocated even before expiry if method is called but will not b...
function endEpoch() external override returns (uint256 numPoolsToFinalize) { uint256 currentEpoch_ = currentEpoch; uint256 prevEpoch = currentEpoch_ - 1; uint256 numPoolsToFinalizeFromPrevEpoch = aggregatedStatsByEpoch[prevEpoch].numPoolsToFinalize; require(numPoolsToFinalizeFromPre...
11,544,541
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implemen...
See {IWOWSCryptofolio-burn}./
function burn() external override { require(msg.sender == address(_deployer), 'CF: Only deployer'); for (uint256 i = 0; i < _tradefloors.length; ++i) { IERC1155BurnMintable tradefloor = IERC1155BurnMintable(_tradefloors[i]); uint256[] storage opIds = _cryptofolios[address(tradefloor)]; if (o...
14,767,993
// 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...
See {IERC20-transferFrom}./
function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { uint256 currentAllowance = _allowances[sender][_msgSender()]; require( currentAllowance >= amount, "transferFrom: transfer amount ex...
489,718
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Check that total supply is greater than min supply needed for issuance Note: A min supply amount is needed to avoid division by 0 when SetToken supply is 0
function _validateIssuanceInfo(ISetToken _setToken, uint256 _minSetTokenReceiveQuantity, ActionInfo memory _issueInfo) internal view { require( _issueInfo.previousSetTokenSupply >= navIssuanceSettings[_setToken].minSetTokenSupply, "Supply must be greater than minimum to enable issuan...
91,158
//SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.13; // Imports import "./Ownable.sol"; import "./ReentrancyGuard.sol"; import "./IERC20.sol"; import "./IERC721.sol"; // MOD Interface interface MODToken { function mint(address recipient, uint256 amount) external; } /// @title MOD - Staking Contract contra...
balance The balance of a user Gets total yield per second of all staked tokens of a user/
function getTotalYieldPerSecond(uint256 balance) public view returns (uint256) { if (balance == 0) { return 0; } if (balance <= lowYieldEndBound) { return balance * lowYieldPerSecond; return lowYieldEndBound * lowYieldPerSecond + (balance - lowYieldEndBound) * mediumYieldPerSecond; ...
1,421,411
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./ERC721Enumerable.sol"; imp...
Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d...
function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { ...
1,582,382
./partial_match/1/0x20d3613ce72EA75dcB16C09b7e82002C090dC434/sources/CHUCKY.sol
generate the uniswap pair path of token -> weth make the swap
function swapTokensForETH(uint256 tokenAmount) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = ROUTER.WETH(); _approve(address(this), address(ROUTER), tokenAmount); ROUTER.swapExactTokensForETHSupportingFeeOnTransferTokens( ...
2,632,923
./full_match/4/0xC209E294664C8Cb5B55EbF1CAE6CaCCd024Cb822/sources/contracts/ERC721A.sol
See {IERC721-ownerOf}./
function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); }
727,651
./full_match/1/0x16089279eFBAC25b174686E60F89a5f8fd5fB8a6/sources/browser/FoldingOnAnchor.sol
Gets a flash loan from flashLoaner passing dataToExecuteOn. This data will be used inside the call to proxyUseFlashLoan (below) Set the flashLoaner we want to use for this flash loan request
function getFlashLoan( address flashLoaner, address tokenToLoan, uint256 flashLoanAmount, bytes memory dataToExecuteOn ) internal { require(flashLoanAmount > 0, "PFL: amount is 0"); require(approvedFlashLoaners[flashLoaner], "PFL: FlashLoaner not approved"); targetFlashLoaner = flashLo...
4,994,460
./full_match/40/0xe231B919963c1cA0968FaC88e5B1Fdd87B38B4F3/sources/contracts/ZappyUsdcTlos.sol
Determines the amount of reward in wTLOS upon calling the harvest function
function callReward() public view returns (uint256) { uint256 outputBal = rewardBalance(); uint256 wrappedOut; if (outputBal > 0) { uint256[] memory amountsOut = IUniSwapRouter(router).getAmountsOut(outputBal, outputToWrappedPath); wrappedOut = amountsOut[amountsOut...
9,543,217
/** *Submitted for verification at Etherscan.io on 2020-07-05 */ /* ___________________________________________________________________ _ _ ______ | | / / / --|-/|-/-----__---/----__----__---_--_----__-...
assembly function which converts buytes to address./
function bytesToAddress(bytes memory bys) private pure returns (address addr) { assembly { addr := mload(add(bys, 20)) } }
13,074,648
./full_match/1/0x66600c4f55527C410D4067b21474c0fa1fe1331D/sources/contracts/Collection.sol
@inheritdoc IERC2981 Resolve royalty info from the engine powering the sequence.
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { IEngine engine = sequences[_tokenData[tokenId].sequenceId].engine; return engine.getRoyaltyInfo(address(this), tokenId, salePrice); }
4,932,330
pragma solidity >=0.4.22 <0.7.0; import "./HashBaseCon.sol"; /** * This contract will take charge of submitting file hash to blockchain * */ contract DRCFileHashCon is DRCHashBase { struct FileInfo { string fileName; // must have a value string fileUrl; // could be empty string author; // could be ...
selectHash,select hash from contract _hash is input value of hash return true/false,saver,save time/
function selectHash(string memory _hash) public view returns (bool, address, bytes memory, uint256, string memory) { bool selectRes; HashOperateLib.ExInfo memory exInfo; (selectRes, exInfo.saver, exInfo.saverName, exInfo.saveTime) = hashInfoLib.selectHash(_hash); string memory selec...
12,830,199
//SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/GSN/Context.sol pragma solidity >=0.6.0 <0.8.0; pragma experimental ABIEncoderV2; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via ms...
Removes a value from a set. O(1). Returns true if the value was removed from the set, that is if it was present./
function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); }
61,501
./partial_match/56/0x6997eDB5b5c7BCe3f1B30B3fcf3e94B301Bf33A7/sources/ClientRaindrop.sol
Copies a slice to a new string. self The slice to copy. return A newly allocated string containing the slice's text./
function toString(slice memory self) internal pure returns (string memory ) { string memory ret = new string(self._len); uint retptr; memcpy(retptr, self._ptr, self._len); return ret; }
11,152,643
./full_match/1/0xa49102f00c7d76C725235563A65aF4eb7507d0a3/sources/contracts/presale-pool/PreSaleFactory.sol
Get the number of all created pools return Return number of created pools/
function allPoolsLength() public view returns (uint256) { return allPools.length; }
3,219,677
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ // hevm: flattened sources of src/UniswapV3ConverterMedianizer.sol pragma solidity =0.6.7 >=0.4.0 >=0.5.0; ////// lib/geb-treasury-reimbursement/src/math/GebMath.sol /* pragma solidity 0.6.7; */ contract GebMath { uint256 public constant RAY = 10...
--- Administration --- Modify address parameters parameter Name of the parameter to modify data New parameter value/
function modifyParameters(bytes32 parameter, address data) external isAuthorized { require(data != address(0), "UniswapV3ConverterMedianizer/null-data"); if (parameter == "converterFeed") { require(data != address(0), "UniswapV3ConverterMedianizer/null-converter-feed"); converter...
6,772,930
./full_match/80001/0xB44Ae12e3245A3FbdD9445c536ef568a702e77DF/sources/contracts/PhatRollupAnchor.sol
Get the next item id in queue.
function getTailIndex() public view returns (uint32) { uint32 tail = queueGetUint(KEY_TAIL); return tail; }
845,159
./full_match/1/0x9621809F47dBB9d9e48E4c1cEE679DEd6c9aeA06/sources/contracts/drops/AllowList.sol
Returns the length of the allow list./
function _length() internal view returns (uint256) { return _allowList.length(); }
9,611,615
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/Types.sol"; import "../interfaces/ILedger.sol"; import "../interfaces/IOracleMaster.sol"; import "./utils/ReportUtils.sol"; contract Oracle { using ReportUtils for uint256; event Completed(uint256); // is already pushed flag...
Returns true if member is already reported _index oracle member index return is reported indicator/
function isReported(uint256 _index) external view returns (bool) { return (currentReportBitmask & (1 << _index)) != 0; }
967,661
//Address: 0xd1670c55f5e68fede5fddd8ace64a3329f778b89 //Contract name: ATSTokenReservation //Balance: 215.853806028 Ether //Verification Date: 5/30/2018 //Transacion Count: 81 // CODE STARTS HERE pragma solidity ^0.4.23; /* * Contract accepting reservations for ATS tokens. * The actual tokens are not yet created ...
transfers an alien deposit back to the sender Note: this implementation requires that alienDeposits has a primitive value type. With a complex type, this code would produce a dangling reference.
function refundAlienDeposit(address _addr) public onlyWhitelistControl { uint256 withdrawAmount = alienDeposits[_addr]; require(withdrawAmount > 0); cumAlienDeposits -= withdrawAmount; emit Refund(_addr, withdrawAmount); }
1,041,367
// File: @ensdomains/ens/contracts/ENS.sol pragma solidity >=0.4.24; interface ENS { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. ...
Sets the `name()` record for the reverse ENS record associated with the calling account. First updates the resolver to the default reverse resolver if necessary. name The name to set for this address. return The ENS node hash of the reverse record./
function setName(string memory name) public returns (bytes32) { bytes32 node = claimWithResolver(address(this), address(defaultResolver)); defaultResolver.setName(node, name); return node; }
897,086
pragma solidity 0.4.25; import "./TokenSSID.sol"; contract SistemaSanitario is TokenSSID { string sanidad_nombre; string sanidad_pais; address public sanidad_addr; struct Medico { address medico; string especialidad; uint fechaalta; uint fechabaja; bool autoriza...
Baja ciudadano, solo Sanidad puede dar de baja un ciudadano revert si el ciudadano no existe _adrCiudadano address del ciudadano/
function bajaCiudadano (address _adrCiudadano) public restrictedBySanidad { require(ciudadanos[_adrCiudadano].isExist, "Ciudadano no existe"); ciudadanos[_adrCiudadano].fechabaja = now; }
929,011
./full_match/1/0x5537f945D8c3FCFDc1b8DECEEBD220FAD26aFdA8/sources/contracts/ComposableStablePool.sol
Pay any due protocol fees and calculate values necessary for performing the join/exit./ If the amplification factor is the same as it was during the last join/exit then we can reuse the value calculated using the "old" amplification factor. If not, then we have to calculate this now.
function _beforeJoinExit(uint256[] memory registeredBalances) internal returns ( uint256, uint256[] memory, uint256, uint256 ) { (uint256 lastJoinExitAmp, uint256 lastPostJoinExitInvariant) = getLastJoinExitData(); ( ...
4,901,440
./full_match/1001/0xfCCf3d314806a76D405c31F45188a7A5393C119a/sources/_klaytn/contracts/KIP/token/KIP7/KIP7.sol
Same as {xref-KIP7-safeTransfer-address-uint256-}[`safeTransfer`], with an additional `_data` parameter which is forwarded in {IKIP7Receiver-onKIP7Received} to contract recipients. Emits a {Transfer} event/
function safeTransfer( address recipient, uint256 amount, bytes memory _data ) public virtual override { address owner = _msgSender(); _safeTransfer(owner, recipient, amount, _data); }
16,364,092
./full_match/3/0xDB16AB107b4A72030fc0D7eaA5Cd4362480FD294/sources/contracts/ARTWi.sol
Actually perform the safeTransferFrom. _from The current owner of the NFT. _to The new owner. _tokenId The NFT to transfer. _data Additional data with no specified format, sent in call to `_to`./
function _safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes memory _data ) private validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(_from == tokenOwner, "Token not owned by given address"); require(_to != address(0), ZERO_ADDRESS); ...
8,092,814
// SPDX-License-Identifier: MIT pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "./CannonState.sol"; import "./TicketFactory.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title Nifty Cannon * @author Cliff Hall * @notice Allows direct or deferred transfer of NFTs from one sender ...
Pick up a Volley There must be one or more Volleys awaiting the recipient This contract must already be approved as an operator for the NFTs specified in the Volley. _index the index of the volley in the recipient's list of will-call volleys/ Verify there are one or more waiting volleys and the specified index is vali...
function pickupVolley(uint256 _index) internal returns (bool success) { uint256 length = willCallVolleys[msg.sender].length; require(length > 0, "Caller has no volleys to accept."); require(_index < length, "Volley index out of bounds."); Volley memory volley = willCallVolleys[msg....
1,069,496
./full_match/43113/0xd177045390B445227d8743313b0d19f8ca9ec409/sources/chainlink/v0.7/vendor/BufferChainlink.sol
Writes a byte string to a buffer. Resizes if doing so would exceed the capacity of the buffer. buf The buffer to append to. off The start offset to write to. data The data to append. len The number of bytes to copy. return The original buffer, for chaining./ Memory address of the buffer data Length of existing...
function write( buffer memory buf, uint256 off, bytes memory data, uint256 len ) internal pure returns (buffer memory) { require(len <= data.length); if (off + len > buf.capacity) { resize(buf, max(buf.capacity, len + off) * 2); } uint256 dest; uint256 src; assembly {...
7,163,214
./full_match/5/0x5A5C7810444C6B392ACb012F79bCDa167F5470e1/sources/project_/contracts/ERC721MetaProxy.sol
Convert the metadata struct to JSON
function _getTokenMetaJsonBase64( address tokenContract, uint256 tokenId ) internal view returns (string memory) { TokenMeta memory meta = getTokenMeta(tokenContract, tokenId); string memory json = string( abi.encodePacked( '{"name":"', ...
11,596,238
pragma solidity ^0.4.11; // ---------------------------------------------------------------------------- // Abab.io preICO // The MIT Licence // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // Safe...
------------------------------------------------------------------------ Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value. ------------------------------------------------------------------------
function approve( address _spender, uint256 _amount ) returns (bool success) { allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; }
1,002,725
pragma solidity 0.5.10; import 'openzeppelin-eth/contracts/ownership/Ownable.sol'; import './MixinDisableAndDestroy.sol'; import '../interfaces/IUnlock.sol'; import './MixinFunds.sol'; /** * @title Mixin for core lock data and functions. * @author HardlyDifficult * @dev `Mixins` are a design pattern seen in the 0...
A function which lets the owner of the lock update the beneficiary account, which receives funds on withdrawal./
function updateBeneficiary( address _beneficiary ) external onlyOwnerOrBeneficiary { require(_beneficiary != address(0), 'INVALID_ADDRESS'); beneficiary = _beneficiary; }
5,532,517
/* Consumer https://github.com/devinaconley/token-hold-example SPDX-License-Identifier: MIT */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./IERC721Holder.sol"; /** * @title Consumer * * @notice this contract imp...
get the functional owner of a token tokenId token id of interest/ get raw owner if owner is not contract, return contract does not support token holder interface
function getOwner(uint256 tokenId) external view returns (address) { address owner = token.ownerOf(tokenId); if (!owner.isContract()) { return owner; } try IERC165(owner).supportsInterface(0x16b900ff) returns (bool ret) { if (!ret) { return owner; } return owner; ...
12,636,270
pragma solidity ^0.5.0; import "openzeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol"; import "openzeppelin-solidity/contracts/crowdsale/emission/MintedCrowdsale.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20Mintable.sol"; import "openzeppelin-solidity/contracts/token/ERC20/ERC20De...
low level token purchase This function has a non-reentrancy guard, so it shouldn't be called by another `nonReentrant` function. Emits a {TokensPurchased} event. beneficiary Recipient of the token purchase amountInEUR Amount of EUR the tokens should be purchased for/ calculate token amount to be created update state
function buyTokens(address beneficiary, uint256 amountInEUR, uint rateETHEUR) public whenNotPaused nonReentrant onlyOwner stopInEmergency onlyMerchant payable returns(uint256) { uint256 weiAmount = amountOfETHInEUR(amountInEUR); _preVal...
12,787,013
./partial_match/1/0x72AD58f0917deB04eC8b6AdA584ABd0dBe502128/sources/StrategyQueue.sol
Add a strategy to the end of the queue _strategy address of strategy to add creates a new node which is inserted at the end of the strategy queue. the strategy is assigned an id and is linked to the previous tail. Note that this ID isnt necessarily the same as the position in the withdrawal queue
function _push(address _strategy) internal returns (uint256) { if (strategyId[_strategy] > 0) revert StrategyExists(_strategy); uint48 nodeId = _createNode(_strategy); return uint256(nodeId); }
3,586,922
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ /** *Submitted for verification at Etherscan.io on 2022-02-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.12; // File @openzeppelin/contracts/utils/[email protected] /** * @dev Provides information about the current execution context, i...
Function to mint all NFTs for giveaway and partnerships/
function mintMultipleByOwner( address[] memory _to, uint256 _num ) public onlyOwner { for(uint256 i = 0; i < _to.length; i++){ require(totalSupply()+_num <= MAX_NFT, "Tokens number to mint cannot exceed number of MAX tokens"); _safeMint(_to[i]...
10,946,445
./partial_match/1/0x4eDA33EA48052006850966Fc1182CF46F325501d/sources/SquidFarmer.sol
send referral eggsboost market to nerf squid hoarding
function hatchEggs(address ref) public { require(initialized); if (ref != address(0)) referrals[msg.sender] = ref; uint256 eggsUsed = getMyEggs(msg.sender); hatcherySquid[msg.sender] = SafeMath.add(hatcherySquid[msg.sender], eggsUsed); claimedEggs[msg.sender] = 0; las...
2,773,760
./full_match/5/0x2e89601fAE0fe0690e7C8cAC0c1C43a2cE48F356/sources/src/Mintpass.sol
Mark the token as revoked tokenId Identifier of the token
function revoke(uint256 tokenId) external onlyOwner { require(isValid(tokenId), "Token is already invalid"); _revocations[tokenId] = true; emit Revoked(tokenId); }
11,629,064
// File: openzeppelin-solidity/contracts/math/SafeMath.sol pragma solidity ^0.5.2; /** * @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(uint...
Checks the return value of the previous function up to 32 bytes. Returns true if the previous function returned 0 bytes or 1./ default to failure check number of bytes returned from last function call no bytes returned: assume success 32 bytes returned copy 32 bytes into scratch space load those bytes into returnValue
function checkSuccess( ) private pure returns (bool) { uint256 returnValue = 0; assembly { switch returndatasize case 0x0 { returnValue := 1 } case 0x20 { returndatacopy(0x0, 0x0, 0x20)...
1,081,068
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be...
Set new reward handler RewardHandler is by concept upgradeable / see investment::Controller.sol./ Update state
function setRewardHandler(IRewardHandler newRewardHandler) external onlyOwner { rewardHandler = newRewardHandler; }
10,321,984
/* __ __ .__ .___ _____ / \ / \___________| | __| _/ _____/ ____\ \ \/\/ / _ \_ __ \ | / __ | / _ \ __\ \ ( <_> ) | \/ |__/ /_/ | ( <_> ) | ...
See {IGovernor-hasVoted}./
function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) { return _proposals[proposalId].voteCount[account] > 0; }
14,851,109
pragma solidity ^0.5.8; interface IERC20 { function TRANSFER724(address to, uint256 value) external returns (bool); //inject NONSTANDARD NAMING function A...
inject NONSTANDARD NAMING
function INCREASEALLOWANCE446(address spender, uint256 addedValue) public returns (bool) {
2,579,022
pragma solidity 0.4.18; import "zeppelin-solidity/contracts/ownership/Ownable.sol"; /** * The TokenRegistry is a basic registry mapping token symbols * to their known, deployed addresses on the current blockchain. * * Note that the TokenRegistry does *not* mediate any of the * core protocol's business logic, bu...
Given a symbol, resolves the current address of the token the symbol is mapped to./
function getTokenAddressBySymbol(string symbol) public view returns (address) { return symbolHashToTokenAddress[keccak256(symbol)]; }
2,528,066
./partial_match/100/0x82A89e47c9f4342B1C33887e1783a091796D7978/sources/BancorMarketMaker.sol
Add `_collateral.symbol(): string` as a whitelisted collateral token _collateral The address of the collateral token to be whitelisted _virtualSupply The virtual supply to be used for that collateral token [in wei] _virtualBalance The virtual balance to be used for that collateral token [in wei] _reserveRatio ...
function addCollateralToken(address _collateral, uint256 _virtualSupply, uint256 _virtualBalance, uint32 _reserveRatio) external auth(CONTROLLER_ROLE) { require(isContract(_collateral) || _collateral == ETH, ERROR_INVALID_COLLATERAL); require(!_collateralIsWhitelisted(_collateral), ...
16,661,692
./full_match/43113/0x29FB6CA56d7F4485eCBaf0AEd941d52E7A662307/sources/contracts/protocol/SetToken.sol
PRIVELEGED MODULE FUNCTION. Decreases the "account" balance by the "quantity". _burn checks that the "account" already has the required "quantity"./
function burn(address _account, uint256 _quantity) external onlyModule whenLockedOnlyLocker { _burn(_account, _quantity); }
7,191,736
/** *Submitted for verification at Etherscan.io on 2021-04-27 */ // File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are gen...
Mints a new ALOHA NFT for a wallet./
function awardItem( address wallet, uint256 tokenImage, uint256 tokenRarity, uint256 tokenBackground ) public onlyOwner() returns (uint256) { _tokenIds.increment(); uint256 newItemId = _tokenIds.current(); _mint(wallet, newItem...
1,965,440
pragma solidity 0.4.24; pragma experimental "v0.5.0"; /* Copyright 2018 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENS...
Gets the total amount of owed token lent for a loan. loanHash Unique hash of the loan offering return The total filled amount of the loan offering./
function getLoanFilledAmount( bytes32 loanHash ) external view returns (uint256) { return state.loanFills[loanHash]; }
1,594,077
./partial_match/1/0x0059A21dAc9730DE83A7d624921c66c05f102ca2/sources/PersonalCornerSale.sol
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, AccessControl) returns (bool) { return interfaceId == _INTERFACE_ID_FEES || ERC721Enumerable.supportsInterface(interfaceId) || AccessC...
3,688,579
pragma solidity ^0.4.24; // produced by the Solididy File Flattener (c) David Appleton 2018 // contact : dave@akomba.com // released under Apache 2.0 licence contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function t...
Deny an administrative transfer. This ensures it cannot be approved. _approvedTransfer The contract address of the multisignature transfer./
function denyTransfer(address _approvedTransfer) public onlyRole(ADMIN_ROLE) returns (bool) { MultiSigTransfer transferToApprove = MultiSigTransfer(_approvedTransfer); transferToApprove.denyTransfer(); } address public crowdsale = address(0);
1,027,457
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "../VotePo...
Enable admin to set the user share ratio The ratio base is 10000, only admin can do this ratio The interest user share ratio (1-10000), default is 9000
function setPoolUserShareRatio(uint64 ratio) public onlyOwner { require(ratio > 0 && ratio <= RATIO_BASE, "ratio should be 1-10000"); poolUserShareRatio = ratio; emit RatioChanged(ratio); }
12,963,318
pragma solidity ^0.4.23; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/IdentityProtocol.sol"; import "../contracts/identity/Identity.sol"; import "./helpers/ThrowProxy.sol"; contract TestIdentity { Identity identity = new Identity(address(this),"QmeHy1gq8QHVchad7ndEsdA...
Testing setFinancialData() function
function testOwnerCanChangeProfile() public { bool result = identity.setFinancialData("QmeHy1gq8QHVchad7ndEsdAnaBWGu1CAVmYCb4aTJW2879"); Assert.equal(result, true, "The profile must be changed"); }
7,321,751
// Project: BUZcoin.io (original) // v11, 2018-04-17 // This code is the property of CryptoB2B.io // Copying in whole or in part is prohibited. // Authors: Ivan Fedorov and Dmitry Borodin // Do you want the same TokenSale platform? www.cryptob2b.io // *.sol in 1 file - https://cryptob2b.io/solidity/buzcoin/ pragma so...
0 - destruct 1 - close 2 - restart 3 - refund 4 - test 5 - update Exchange call from Crowdsale.distructVault(true) for exit arg1 - nothing arg2 - nothing Call from Crowdsale.finalization() [1] - successfull round (goalReach) [3] - failed round (not enough money) arg1 = weiTotalRaised(); arg2 = nothing;internalCalc(...
function setup(address _beneficiary, uint256 _arg1, uint256 _arg2, uint8 _state) external onlyOwner { if (_state == 0) { selfdestruct(_beneficiary); } else if (_state == 1 || _state == 3) { require(state == State.Active); state = S...
203,532
pragma solidity 0.7.1; pragma experimental ABIEncoderV2; contract CoreUniLotterySettings { // Percentage calculations. // As Solidity doesn't have floats, we have to use integers for // percentage arithmetics. // We set 1 percent to be equal to 1,000,000 - thus, we // simulate 6 decimal poin...
Update holder array, if new token holder joined, or if a holder transfered his whole balance. Sender transferred his whole balance - no longer a holder. Use the Router's functionality. Set the exchange path to WETH -> ULT (ULT is Lottery Token, and it's address is our address). Compute time factor value for the current...
function updateHolderData_preTransfer( address sender, address receiver, uint256 amountSent, uint256 amountReceived ) internal returns( bool holderCountChanged ) { holderCountChanged = false; ...
7,578,526
pragma solidity >=0.5; pragma experimental ABIEncoderV2; /** * @title DexStatus * @dev Status for Dex */ contract DexStatus { string constant ONLY_RELAYER = "ONLY_RELAYER"; string constant ONLY_AIRDROP = "ONLY_AIRDROP"; string constant ONLY_INACTIVITY = "ONLY_INACTIVITY"; string...
ecrecover the withdraw sign return return a withdraw hash/
function ecrecoverWithdraw(address from,address payable to,address token,uint256 amount,uint256 nonce,uint8 v,bytes32[2] memory rs, address feeToken,uint256 feeWithdrawal,uint timestamp,uint signType) public pure returns (bytes32 orderHash) { if(signType == 1 ) { orderHash = k...
1,805,345
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title A base MisBlock token contract /// @author Anderson L /// @notice This contract is inherited by MisBlockETH and MisBlockBSC token contracts. /// @dev All functions requiring onlyOwner are also pausable. import "@openzeppelin/contracts/token/ERC20/ERC...
include the account into the reward list. Must be called from only owner./
function includeInReward(address account) external onlyOwner whenNotPaused { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; ...
5,426,042
//Address: 0x75ca11f71b53cb72dde48a78a3b3d5fe0df5e0df //Contract name: TESTTESTToken //Balance: - //Verification Date: 5/27/2018 //Transacion Count: 0 // CODE STARTS HERE pragma solidity ^ 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { fu...
return true if the transfer was successful/
function transferFrom(address _from, address _to, uint256 _amount) public returns(bool) { require(!tokensAreFrozen); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); ...
2,514,699
pragma solidity ^0.4.24; import "zos-lib/contracts/migrations/Migratable.sol"; import "../access/Blacklist.sol"; /** * @title Nexty governance smart contract */ contract Nexty is Migratable, Blacklist { mapping(address => uint256) balances; mapping(address => address) public coinbase; mapping(address => bool...
Token holder can call method to set their coinbase for mining. _coinbase Destination address/
function setCoinbase(address _coinbase) public validDestination(_coinbase) returns (bool) { require(balances[msg.sender] > 0); require(sealer[msg.sender] == false); coinbase[_coinbase] = msg.sender; signers.push(_coinbase); sealer[msg.sender] = true; emit SetCoinbase(msg.sender, _coinbase...
7,291,911
./full_match/4/0x8EF7B88a59Db9eaACd80E5E249D6F1AeF8755C7E/sources/browser/ClaimToken.sol
Function that withdraws all available tokens for the current period/
function claim() public { require(whiteListedAddresses[msg.sender].exists, "The requested address is not whitelisted!"); require(whiteListedAddresses[msg.sender].notClaimed, "Claimed already!"); whiteListedAddresses[msg.sender].withdrawnAmount = whiteListedAddresses[msg.sender].withdrawPerce...
13,361,494
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, ...
See {ERC1155-_mint}./
function mint( uint256 membershipId, address account, uint256 id, uint256 amount ) public payable { require( block.number < endBlock, "GenArtTokenAirdropPass: mint pass sale ended" ); require( id == 1 || id == 2 || id ==...
11,994,834
pragma solidity ^0.4.24; interface PlayerBookReceiverInterface { function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external; function receivePlayerNameList(uint256 _pID, bytes32 _name) external; } contract PlayerBook { using NameFilter for string; using SafeMath f...
============================================================================== _ |_ |. _ |` _ __|_. _ _ _ . |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . (use these to interact with contract)====|========================================================================= registers a name. UI will always...
function registerNameXID(string _nameString, uint256 _affCode, bool _all) isHuman() public payable { require (msg.value >= registrationFee_, "umm..... you have to pay the name fee"); bytes32 _name = NameFilter.nameFilter(_nameString); address _a...
2,083,466
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; // Part: IBasicRewards interface IBasicRewards { function stakeFor(address, uint256) external returns (bool); function balanceOf(address) external view returns (uint256); function earned(address) external view returns (uint256); function wit...
Swap native ETH for CVX on Curve amount - amount to swap minAmountOut - minimum expected amount of output tokens return amount of CRV obtained after the swap
function _ethToCvx(uint256 amount, uint256 minAmountOut) internal returns (uint256) { return CVXETH_ETH_INDEX, CVXETH_CVX_INDEX, amount, minAmountOut ); }
75,331
pragma solidity 0.5.10; import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /// @title DShops - Online Market Place Contract /// @author CHET S contract DShops is Pausable { using SafeMath for uint256; //////////////////////////////////...
Check if a product exists by its productCode productCode The productCode return doesExist The boolean result of whether the product exists
function productExists(bytes32 productCode) public view returns (bool doesExist) { if (productIndexes.length == 0) return false; return (productIndexes[products[productCode].index] == productCode); }
14,112,207
pragma solidity ^0.5.8; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyData { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABLE...
Transfers eligible payout funds to insuree/
function pay(address payable passenger) external payable requireIsOperational requireAuthorized { require(passengersFund[passenger] > 0, "Passenger doesn't have funds"); uint toRefund = passengersFund[passenger]; passengersFund[passenger] = passengersFund[passenger].sub(toRefund); p...
15,788,532
./partial_match/3/0x9A28784E4eb2d2Fb1C8E74094DFC1536B54C62aF/sources/PrizeDistribution.sol
Returns the prize distribution for a given competition/
function getPrizeDistribution( uint256 _competitionId ) public competitionExists(_competitionId) view returns(uint256[] memory) { Competition storage competition = competitions[_competitionId]; return competition.prizeDistribution; }
5,101,472
pragma solidity ^0.4.18; contract ERC20 { function totalSupply() constant public returns (uint supply); function balanceOf( address who ) constant public returns (uint value); function allowance( address owner, address spender ) constant public returns (uint _allowance); function transfer( addr...
uint128 coinGiftA = 100000000; 0.1 billion coin gift for vendue
function initialize(DSToken tokenReward) public auth { assert(address(CES) == address(0)); assert(tokenReward.owner() == address(this)); assert(tokenReward.authority() == DSAuthority(0)); assert(tokenReward.totalSupply() == 0); ...
12,546,205
// @author Unstoppable Domains, Inc. // @date June 16th, 2021 pragma solidity ^0.8.0; import '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol'; import '@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol'; import '../cns/IResolver.sol'; import '../utils/ERC677Receiver.sol'; import ...
Validation was requested from Smart Contract. We need to search for price in mapping
function _calculatePaymentForValidation(uint256 requestId) private returns (uint256 paymentPerValidation) { if (requestId > 0) { paymentPerValidation = _userRequests[requestId]; _frozenTokens = _frozenTokens.sub(paymentPerValidation); delete _userRequests[requestId]; ...
6,437,565
// Sources flattened with hardhat v2.0.11 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.1.0 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of toke...
Migrates UserInfo from TacoChef to eTacoChef. Can be called by user one time and required to call deposit function./
function swap() public { uint256 _amount = _taco.balanceOf(msg.sender); _taco.transferFrom(msg.sender, address(this), _amount); _etaco.transfer(msg.sender, _amount); }
5,511,346
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../interfaces/IFlashloan.sol"; import "../dodo/IDODO.sol"; import "../libraries/RouteUtils.sol"; contract DodoBase is IFlashloan { //Note: CallBack function executed by DODOV2(DVM) flashLoan pool function DVMFlashLoanCall( address sender,...
Note: CallBack function executed by DODOV2(DSP) flashLoan pool
function DSPFlashLoanCall( address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data ) external { _flashLoanCallBack(sender, baseAmount, quoteAmount, data); }
2,523,749
pragma solidity 0.6.12; import "./libs/SafeMath.sol"; import "./interfaces/IBEP20.sol"; import "./libs/Address.sol"; import "./libs/SafeBEP20.sol"; /** * @title SafeBEP20 * @dev Wrappers around BEP20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead...
Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw() public { PoolInfo storage pool = poolInfo[0]; UserInfo storage user = userInfo[msg.sender]; uint256 amountToTransfer = user.amount; user.amount = 0; user.rewardDebt = 0; if (amountToTransfer > 0){ pool.lpToken.safeTransfer(addr...
5,436,926
pragma solidity ^0.7.4; //"SPDX-License-Identifier: UNLICENSED" import "./Vote.sol"; contract VoteFactory{ // Representation of an instance of Group struct groupStruct { string name; string description; address[] members; // uint groupID; } // Representation o...
Returns a specific group of the website
function getGroup(uint8 id) public view returns(string memory aName, string memory aDescription, address[] memory aMembers, uint aMembersLength) { groupStruct storage g = groupInfo[id]; }
12,610,061
./full_match/9001/0x110DD7887321f24477BF4A135a1E5eB7Bf31691a/sources/contracts/StreamingBoundHedgeys.sol
Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account does...
interface IERC20Permit { function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; function nonces(address owner) external view returns (uint256); function DOMAIN_SEPARATOR() external view returns (bytes32); pragma s...
11,531,650
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../common/implementation/FixedPoint.sol"; // Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below). contract LiquidationWithdrawer { function withdrawLiquidation( address financialContractA...
Whether `a` is less than or equal to `b`. a a uint256. b a FixedPoint. return True if `a <= b`, or False./
function isLessThanOrEqual(uint256 a, Unsigned memory b) internal pure returns (bool) { return fromUnscaledUint(a).rawValue <= b.rawValue; }
98,863
pragma solidity ^0.5.2; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ import...
Check if airline is registered airlineAddress airline address to check return A boolean if airline state is `Registered`
function isAirlineRegistered(address airlineAddress) public view returns(bool) { return( flightSuretyData.getAirlineState(airlineAddress) == FlightSuretyDataInterface.AirlineRegisterationState.Registered ); }
2,544,103
./partial_match/1/0xdefac16715671b7b6aeeFE012125f1E19Ee4b7d7/sources/_Voting.sol
Gets the number of votes a suggestion has received. Blockwell Exclusive (Intellectual Property that lives on-chain via Smart License)/
function getVotes(uint256 suggestionId) public view returns (uint256) { return suggestions[suggestionId].votes; }
2,630,718
./full_match/5/0x8031255AbD1be24cf4D9e9256b5d1f1E65dcb2D1/sources/contracts/StakeChain.sol
Get the status of maximum stake (true => paused / false => unpaused)./
function getMaximumStakeStatus(uint256 poolId) public view returns (bool) { return _maximumStakeActive[poolId]; }
1,953,243
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./SafeMath.sol"; import "./Events.sol"; import "./Ownable.sol"; import "./Upgradeable.sol"; import "./UpgradeableMaster.sol"; /// @title Upgrade Gatekeeper Contract /// @author Matter Labs /// @author ZKSwap L2 Labs contract UpgradeGatekeeper is Upgrad...
NOTE: theoretically possible overflow of (_offset + 3)
function readUInt24(bytes memory _data, uint _offset) internal pure returns (uint new_offset, uint24 r) { new_offset = _offset + 3; r = bytesToUInt24(_data, _offset); }
287,876
./partial_match/1/0x5A63Bd386DAC512De49c75fa9e71b3A0F3C4096F/sources/TwoChan.sol
only use to disable contract sales if absolutely necessary (emergency use only)
function updateContrattSellEnabled(bool enabled) external onlyOwner(){ swapEnabled = enabled; }
2,611,140
pragma solidity ^0.5.1; // File: contracts/Cogmento.sol interface IERC20 { function TOTALSUPPLY452() external view returns (uint256); //inject NONSTANDARD NAMING function BALANCEOF833(address who) external view returns (uint256); //inject NONSTANDARD NAMING function ALLOWANCE554(address owner, address spender...
inject NONSTANDARD NAMING
function ACCEPTOWNERSHIP717() public {
5,457,931
./full_match/80001/0xc632E7fde2cA79D0D5D5e25399d7048EfE7b868f/sources/TestSasWecoin.sol
Returns the total staking power for the given epoch. epochToCheck The epoch to check if adjustement ahs been made return The total staking power with adjustments made for the given epoch/
function _latestStakingPower(uint epochToCheck) internal returns (uint) { EpochInfo storage epoch = epochs[epochToCheck]; ( uint stakingPower, uint adjustment, bool update ) = _getLatestStakingPower(epochToCheck); if (update) { epoch.ad...
875,262