file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.6; import "@yield-protocol/utils-v2/contracts/token/IERC20.sol"; import "@yield-protocol/utils-v2/contracts/token/IERC20Metadata.sol"; import "@yield-protocol/utils-v2/contracts/token/ERC20Permit.sol"; import "@yield-protocol/utils-v2/contracts/token/SafeERC20Na...
hi and lo are only 4 bits and between 0 and 16 this method converts those values to the unicode/ascii code point for the hex representation uses upper case for the characters
function char(uint8 b) private pure returns (bytes1 c) { if (b < 10) { return bytes1(b + 0x30); return bytes1(b + 0x37); } }
224,022
// Sources flattened with hardhat v2.4.1 https://hardhat.org // File contracts/interfaces/IERC721.sol pragma solidity 0.5.7; /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// Note: the ERC-165 identifier for this interface is 0x80ac58cd interface IERC721 { /...
Checks if the given user is approved to transfer the tokenId./
function _isApproved( uint _tokenId, address _user ) internal view returns (bool) { return approved[_tokenId] == _user; }
949,512
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "./TradeableERC721Token.sol"; /** * @title ClockAuction * ClockAuction - a contract for my non-fungible creatures. */ contract ClockAuction is ERC721Tradable{ uint256 public constant maxSupply = 6400; uint256 public constant MAX_PREMINT = ...
Private function to add a token to this extension's ownership-tracking data structures. to address representing the new owner of the given token ID tokenId uint256 ID of the token to be added to the tokens list of the given address/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to].push(tokenId); _ownedTokensIndex[tokenId] = length; }
5,988,086
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "../Token.sol"; contract Core { // Token SRXToken public token; // Tokenomics uint public opsRateBIPS; // fee rate for operations uint public reserveBalance; // must be tracked for staking mechanism address...
Calculates the amount of tokens to mint for the tendered amount of reserve tokens./
function calculateMintAmount(uint tenderAmount) public view returns (uint) { require(tenderAmount >= 1000, "Tendered amount must be at least 1000 wei"); uint fee = tenderAmount * opsRateBIPS / 10000; uint mintAmount = tenderAmount - fee; return mintAmount; }
12,711,557
/** *Submitted for verification at Etherscan.io on 2020-11-24 */ // SPDX-License-Identifier: bsl-1.1 /* Copyright 2020 Unit Protocol: Artem Zakharov ([email protected]). */ // File: contracts/helpers/SafeMath.sol pragma solidity ^0.7.1; /** * @title SafeMath * @dev Math operations with safety checks that thro...
Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint the amount of tokens to be transferred/ require(_to != address(0), "ZERO_ADDRESS");
function transferFrom(address _from, address _to, uint _value) public override virtual returns (bool) { require(_value <= balances[_from], "TRANSFERFROM_INSUFFICIENT_BALANCE"); require(_value <= allowed[_from][msg.sender], "TRANSFERFROM_INSUFFICIENT_ALLOWANCE"); balances[_from] = balances[_f...
2,399,642
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./libs/maths/SafeMath.sol"; import "./libs/string.sol"; import "./interfaces/IERC20.sol"; import "./libs/sort.sol"; struct GlqStaker { address wallet; uint256 block_number; uint256 amount; uint256 index_at; bool alread...
Return the total amount deposited on a rank tier/ Total length of stakers 15% of hodlers in T1 55% of hodlers in T2
function getTierTotalStaked(uint tier) public view returns (uint256) { uint256 totalAmount = 0; uint256 totalIndex = _stakers.length.mul(1e18); uint256 t1MaxIndex = totalIndex.div(100).mul(15); uint256 t2MaxIndex = totalIndex.div(100).mul(55); uint startIndex = (tier == 1) ...
1,061,426
./full_match/3/0xa1A689f4E1750e2b444dde04D743793e084B91a4/sources/max.sol
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./
function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
14,251,573
/** *Submitted for verification at Etherscan.io on 2022-03-26 */ // SPDX-License-Identifier: MIT // File: contracts/DateTime.sol pragma solidity ^0.8.0; // ---------------------------------------------------------------------------- // DateTime Library v2.0 // // A gas-efficient Solidity date and time library // /...
Returns whether `tokenId` exists. Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`),/
function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; }
2,208,389
./partial_match/42/0x07FDd99781852B940641A1c7DeE6440e11c6D237/sources/Implementation.sol
dbg_ set internal again
function lastEpochsPrices(uint248 numEpochs) internal view returns (int256[] memory) {
3,312,966
./partial_match/1/0x56EAb4C7dC3bf7C31aa87d5Ed4Eb853A9872aBcf/sources/contracts/slopes/Slopes.sol
Update reward variables of the given pool to be up-to-date. calculate pwdr rewards to mint for this epoch if accumulating, mint them to the contract for users to claim Calculate the current PWDR rewards for a specific pool using fixed APR formula and Uniswap price IPWDR(pwdrAddress).mint(address(this), pwdrReward + a...
function _updatePool(uint256 _pid) internal SlopesActive { PoolInfo storage pool = poolInfo[_pid]; address pwdrAddress = pwdrAddress(); if (block.timestamp <= pool.lastReward || (_pid == 0 && avalancheActive)) { return; } if (poo...
4,052,624
./partial_match/1/0xaf7f1854bD78CA8322A8Ab7E9eB4FCe074a5ec60/sources/WidgetScan.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("WidgetScan", "WDGTS") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair ...
15,660,831
./partial_match/3/0x8a1fBbc9D2CD9fFBc5583a34a1e76f12198D2573/sources/ChainlinkOracle.sol
Check the last exchange rate without any state changes
function peek(bytes calldata data) public override view returns (bool, uint256) { (address multiply, address divide, uint256 decimals) = abi.decode(data, (address, address, uint256)); return (true, _get(multiply, divide, decimals)); }
5,276,814
import '@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol'; import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol'; import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol'; // File: @openzeppelin/contracts/utils/EnumerableSet.sol // SPDX-License-Identifier: MIT pragma soli...
To remove the number of points for a user. Callable only by point admins/ Increase the number of points for the user
function removeUserPoints(address _userAddress, uint256 _numberPoints) external onlyPoint { users[_userAddress].numberPoints = users[_userAddress].numberPoints.sub( _numberPoints ); }
12,785,381
// SPDX-License-Identifier: SEE LICENSE IN LICENSE pragma solidity 0.6.12; import "../utility/ContractRegistryClient.sol"; import "../token/interfaces/IDSToken.sol"; import "./interfaces/IConverter.sol"; import "./interfaces/IConverterFactory.sol"; import "./interfaces/IConverterRegistry.sol"; import "./interfaces/I...
adds an existing converter to the registry Requirements: - the caller must be the owner of the contract/
function addConverter(IConverter converter) public ownerOnly { require(isConverterValid(converter), "ERR_INVALID_CONVERTER"); _addConverter(converter); }
14,085,360
./partial_match/1/0xA0D48b8fa999ca8d6967E8b6b6a4dbe0F82996b0/sources/Payer.sol
Called to have the contract make payments The call will revert if the contract does not have adequate funds
function makePayments() external { require(paymentsSet, "Payments not set"); paymentsSet = false; for (uint256 ind = 0; ind < amounts.length; ind++) { require(token.transfer(destinations[ind], amounts[ind]), "Transfer failed"); } delete destina...
3,933,531
// SPDX-License-Identifier: ART pragma solidity ^0.8.0; // // ████████╗██╗ ██╗███████╗ // ╚══██╔══╝██║ ██║██╔════╝ // ██║ ███████║█████╗ // ██║ ██╔══██║██╔══╝ ...
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) { uint256 size; if (size > 0) { try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data) returns (bytes4 retv...
12,198,765
pragma solidity ^0.4.18; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a ...
Claim all vested tokens up to current date in behaviour of an user _to address Addres to claim tokens/
function claimTokensFor(address _to) public onlyOwner { claim(_to); }
1,147,004
./partial_match/1/0x59a3fa712bc01F3Af4E791BFF6A408dea2BbF39f/sources/Users/chichke/Documents/Work/Freelance/RealT/bridge-v2-chichke/contracts/operating/ComplianceRegistry.sol
Initializer (replaces constructor when contract is upgradable) owner the final owner of the contract/
function initialize(address owner) public initializer { Operator.initialize(owner); }
2,717,959
./partial_match/1/0xBA51AAAA95aeEFc1292515b36D86C51dC7877773/sources/src/Well.sol
Gets the Well's token reserves by reading from byte storage./
function _getReserves(uint256 _numberOfTokens) internal view returns (uint256[] memory reserves) { reserves = LibBytes.readUint128(RESERVES_STORAGE_SLOT, _numberOfTokens); }
4,363,007
./partial_match/1/0xED886fEc95Efa9FaA8D031FeF57878Ba18485782/sources/CompliantToken.sol
reject transfer/transferFrom request nonce request recorded at this particular nonce reason reason for rejection/
function rejectTransfer(uint256 nonce, uint256 reason) external onlyValidator { _rejectTransfer(nonce, reason); }
4,219,346
pragma solidity 0.6.8; library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among ot...
require(allPunksAssigned); Remember to zero the pending revault before sending to prevent re-entrancy attacks
function withdraw() public { uint256 amount = pendingWithdrawals[msg.sender]; pendingWithdrawals[msg.sender] = 0; msg.sender.transfer(amount); }
7,342,506
/** * @title Glofile * @author Jonathan Brown <jbrown@bluedroplet.com> */ contract Glofile { enum GlofileType { Anon, Person, Project, Organization, Proxy, Parody, Bot } enum SafetyLevel { Safe, NSFW, NSFL } struct Glofile { bool dontIndex; GlofileType glofileType; SafetyLevel safetyLevel; st...
Delete your Glofile topic with index `i` Deletes an topic with a specific index. i index of topic to delete/
function deleteTopic(uint i) { delete glofiles[msg.sender].topics[i]; Update(msg.sender); }
12,551,895
/* file: openzeppelin-solidity/contracts/ownership/Ownable.sol */ pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { addres...
Transfers tokens held by timelock to beneficiary./ solium-disable-next-line security/no-block-members
function release() public { require(block.timestamp >= releaseTime); uint256 amount = token.balanceOf(address(this)); require(amount > 0); token.safeTransfer(beneficiary, amount); }
976,933
pragma solidity ^0.4.24; pragma experimental ABIEncoderV2; import "./CvcOntologyInterface.sol"; import "../upgradeability/Initializable.sol"; import "../upgradeability/Ownable.sol"; import "../upgradeability/EternalStorage.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; /** * @title CvcOntology * ...
Returns all records. Currently is supported only from internal calls. return CredentialItem[]/
function getAll() public view onlyInitialized returns (CredentialItem[]) { uint256 count = getCount(); bytes32 id; CredentialItem[] memory records = new CredentialItem[](count); for (uint256 i = 0; i < count; i++) { id = getRecordId(i); records[i] = Credential...
14,016,856
pragma solidity ^0.4.11; // ---------------------------------------------------------------------------- // OAX 'openANX Token' crowdfunding contract // // Refer to http://openanx.org/ for further information. // // Enjoy. (c) openANX and BokkyPooBah / Bok Consulting Pty Ltd 2017. // The MIT Licence. // -------------...
------------------------------------------------------------------------ openANX can change the crowdsale wallet address Can be set at any time before or during the crowdsale Not relevant after the crowdsale is finalised as no more contributions are accepted -------------------------------------------------------------...
function setWallet(address _wallet) onlyOwner { wallet = _wallet; WalletUpdated(wallet); } event WalletUpdated(address newWallet);
5,478,563
./partial_match/56/0x33c5FbE4772aBA8235f62010c72857039dB0EF18/sources/StrategyCakeSmart.sol
Function that puts the funds to work. It gets called whenever someone deposits in the strategy's vault contract. It deposits cake in the MasterChef to earn rewards in cake./
function deposit() public whenNotPaused { uint256 cakeBal = IERC20(cake).balanceOf(address(this)); if (cakeBal > 0) { IMasterChef(masterchef).enterStaking(cakeBal); } }
11,044,374
./full_match/80001/0xB8B69b0702A27764293A47c9084E1d755686FB40/sources/contracts/Vault.sol
Returns the timestamp when the last fee was collected _symbol Desired token last fee withdrawal date
function getLastFeeWithdrawalDate( bytes32 _symbol ) public view virtual returns (uint) { return _lastFeeWithdrawalDates[_symbol]; }
5,677,050
pragma solidity ^0.4.17; // ---------------------------------------------------------------------------- // BLU ICO contract // // BLU mainnet token address : 0x362a95215564d895f27021a7d7314629db2e1649 // RATE = 4000 => 1 ETH = 4000 BLU // ------------------------------------------------------------------------...
---------------------------------------------------------------------------- Acceptes ETH and send equivalent BLU with bonus if any. NOTE: Add user to whitelist by invoking addToWhiteList() function. Only whitelisted users can buy tokens. For Non-whitelisted/Blacklisted users transaction will be reverted. -------------...
function contribute() onlyWhenRunning onlyifWhiteListed public payable { if (msg.value >= 5 ether && msg.value <= 9 ether) { tokenBought = tokenBought.add(bonus); } if (msg.value >= 10 ether) { tokenBought = tokenBought.a...
12,742,794
/// SPDX-License-Identifier: Unlicensed pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/access...
Set faction that is allowed to mint during presale
function setBoardingGroup(uint256 newBoardingGroup) external onlyEditor { boardingGroup = newBoardingGroup; emit BoardingGroupChanged(newBoardingGroup); }
12,602,794
pragma solidity ^0.5.0; // Import the `Roles` library import "../milkcore/Ownable.sol"; import "../milkaccesscontrol/PoultererRole.sol"; import "../milkaccesscontrol/DairyfactoryRole.sol"; import "../milkaccesscontrol/DistributorRole.sol"; import "../milkaccesscontrol/RetailerRole.sol"; import "../milkaccesscontrol/Su...
Define a function 'purchaseItemByConsumer' that allows the consumer to mark an item 'PurchasedByConsumer' Use the above modifiers to check if the item is received Update the appropriate fields - ownerID, retailerID, itemState Emit the appropriate event
function purchaseItemByConsumer(uint _upc) public onlyConsumer() checkUpcInItems (_upc) checkItemState (_upc, State.SoldToConsumer, "Milk is not sold to consumer!") { items[_upc].itemState = State.PurchasedByConsumer; emit PurchasedByConsumer(_upc, msg.sender); }
1,004,345
// Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT // pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupp...
Maps a value of `address` type to a given key. Only the owner can execute this function./
function setAddress(bytes32 _key, address _value) external onlyCurrentOwner { addressStorage[_key] = _value; }
342,398
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; imp...
Initialize contract/
function initialize() public initializer { __ERC721_init("MechaLands", "$MECHALANDS"); __ERC721Burnable_init(); __Pausable_init(); __Ownable_init(); __ReentrancyGuard_init(); __UUPSUpgradeable_init(); version = 1; }
6,883,153
./full_match/5/0xec604D759AD3c3498C9Ca0fBb89b4f1dE649C742/sources/contracts/TokenVesting.sol
Returns the array of vesting schedule ids return vestingSchedulesIds/
function getVestingSchedulesIds() external view returns (bytes32[] memory) { return vestingSchedulesIds; }
1,914,561
pragma solidity ^0.8.0; // Copyright 2020 Keyko GmbH. // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import '../Condition.sol'; import '../../token/erc1155/NFTUpgradeable.sol'; import './ITransferNFT.sol'; import '@openzeppelin/contracts-upgradeable/access/AccessCo...
hashValues generates the hash of condition inputs with the following parameters _did refers to the DID in which secret store will issue the decryption keys _nftReceiver is the address of the granted user or the DID provider _nftAmount amount of NFTs to transfer _lockCondition lock condition identifier _nftC...
function hashValues( bytes32 _did, address _nftHolder, address _nftReceiver, uint256 _nftAmount, bytes32 _lockCondition, address _nftContractAddress ) public pure override returns (bytes32) { return keccak256(abi.encode(...
13,064,265
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/DutchMarketplace.sol
Batch Returns Multiple Sale Informations For A User/
function ViewWalletSaleInformations ( uint[] calldata SaleIndexes, address Wallet, uint[] calldata MaxAmounts, address Vault, bytes32[][] calldata ProofEligibilities, bytes32[][] calldata ProofAmounts ) public view returns(_UserSaleInformation[] memory) { ...
8,471,166
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which...
Transfer tokens to a specified address. to The address to transfer to. value The amount to be transferred. return True on success, false otherwise./ underlying balance is stored in gokus, so divide by current scaling factor note, this means as scaling factor grows, dust will be untransferrable. minimum transfer value...
function transfer(address to, uint256 value) external validRecipient(to) returns (bool) { uint256 gokuValue = value.mul(internalDecimals).div(gokusScalingFactor); _gokuBalances[msg.sender] = _gokuBalances[msg.sender].sub(gokuValue); _gokuBalances[to] = _gokuBa...
7,020,719
// SPDX-License-Identifier: Apache-2.0 /* * Copyright 2021, Offchain 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 * *...
Each metadata section consists of: [numItems, l1BlockNumber, l1Timestamp, newTotalDelayedMessagesRead, newDelayedAcc] Sequencer decides how many messages (if any) to include from the delayed inbox
function addSequencerL2BatchImpl( bytes memory transactions, uint256[] calldata lengths, uint256[] calldata sectionsMetadata, bytes32 afterAcc ) private returns (bytes32 beforeAcc) { require(isSequencer[msg.sender], "ONLY_SEQUENCER"); if (inboxAccs.length > 0) { ...
12,105,086
// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amo...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 amount function _afterTokenTransfer( address from, address to, uint256 amount } pragma solidity ^0.8.0; constructor() { _transferOwnership(_msgSender()); }
5,951,541
// SPDX-License-Identifier: Apache-2.0 /* * Copyright 2019-2021, Offchain 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 ...
Hash the leaf an extra time to prove it's a leaf With a minimal path, the pair of path and proof length should always identify a unique leaf. The path itself is not enough since the path length to different leaves could potentially be different
function spendOutput( uint256 outboxIndex, bytes32[] memory proof, uint256 path, bytes32 item ) internal { require(proof.length < 256, "PROOF_TOO_LONG"); require(path < 2**proof.length, "PATH_NOT_MINIMAL"); bytes32 calcRoot = calculateMerkleRoot(proof, pa...
602,705
./full_match/3/0xa1A689f4E1750e2b444dde04D743793e084B91a4/sources/max.sol
Returns the remainder of dividing two unsigned integers, with a division by zero flag. _Available since v3.4._/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } }
14,251,534
./full_match/1/0xBe46262D55FfcCEEB80BB055fF39f862EbbE6Af9/sources/contracts/OGPass.sol
Mints a given amount of tokens to the caller of the contract _amount The amount of tokens to mint/
function mintPublic(uint256 _amount) external whenNotPaused { require(saleState == SaleState.PUBLIC, "Public sale has not started yet"); require(_amount <= MAX_PUBLIC_BATCH, "Provided amount exceeds allowed batch"); require(_amount + publicMinted[_msgSender()] <= maxAllowedPublic, "Requested...
2,953,341
./full_match/1/0x4A20F53E612E6Ab515A46EcA9dd36a290a2287F7/sources/contracts/protocol/core/callable/CallableLoan.sol
@inheritdoc ICreditLine
function principalOwed() public view override returns (uint256) { return _staleCreditLine.principalOwed(); }
9,813,818
./full_match/1/0xFb8F626AD693ad0AF769ddB265084E8973f63a3C/sources/contracts/BlockHistory.sol
Checks if a block hash is valid. A proof is required unless the block is current (accesible in the EVM). If the target block has no commited merkle root, the proof must contain a SNARK proof. hash the hash to check num the block number for the alleged hash proof the merkle witness or SNARK proof (if ...
function _validBlockHash( bytes32 hash, uint256 num, bytes calldata proof ) internal view returns (bool) { if (validCurrentBlock(hash, num)) { return true; } ProofType typ; (typ, proof) = parseProofType(proof); if (typ == ProofType.Mer...
4,930,385
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 che...
Allows the operator to update an asset's price. _tokenId the ID of the asset _tokenPrice the new price to set
function updateItemPrice(uint256 _tokenId, uint256 _tokenPrice) public onlyOperator { require(items.exists(_tokenId)); require(items.ownerOf(_tokenId) == operator); require(isTokenForSale(_tokenId)); tokenPrices[_tokenId] = _tokenPrice; }
1,789,924
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(ad...
given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = amountIn...
532,109
./full_match/42220/0xae79cd37ac9b2f7bb5272C098c787Ae4A0c17df5/sources/contracts/microcredit/MicrocreditImplementation.sol
Adds a loan _userAddress address of the user _amount amount of the loan _period period of the loan _dailyInterest daily interest of the loan _claimDeadline claim deadline of the loan/
function addLoan( address _userAddress, uint256 _amount, uint256 _period, uint256 _dailyInterest, uint256 _claimDeadline ) external override onlyAdmin { _addLoan(_userAddress, _amount, _period, _dailyInterest, _claimDeadline); }
16,319,642
./partial_match/1/0xe230Da7fC923E270BaAda5cef6bd8dc66dA9A081/sources/SilentSwapchef.sol
Safe SilentSwap transfer
function safeSILETransfer(address _to, uint256 _amount) internal { uint256 silentswapBal = silentswap.balanceOf(address(this)); if (_amount > silentswapBal) { silentswap.transfer(_to, silentswapBal); silentswap.transfer(_to, _amount); } }
2,605,984
./full_match/10/0x5932C223186F7856e08A1D7b35ACc2Aa5fC57BfD/sources/contracts/staking/GrgVault.sol
Asserts that sender is stakingProxy contract.
function _assertSenderIsStakingProxy() private view { require(msg.sender == stakingProxy, "GRG_VAULT_ONLY_CALLABLE_BY_STAKING_PROXY_ERROR"); }
3,782,188
./full_match/44787/0x8f089df1EfE48c70cCC8033106d028C53d6627Fd/sources/contracts/cns_registrar/BaseRegistrarImplementationUpgradeable.sol
Register a name. id The token ID (keccak256 of the label). nameOwner The address that should own the registration. duration Duration in seconds for the registration./
function register( uint256 id, address nameOwner, uint256 duration ) external override returns (uint256) { return _register(id, nameOwner, duration, true); }
13,250,806
//SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * fals...
Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._/
interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } }
416,278
pragma solidity ^0.4.18; import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; import './Adminable.sol'; import './Registry.sol'; /** * @title ServiceDiscovery * @dev This contract maintains registries of services and their service URIs **/ contract ServiceDiscovery is Ownable { Registry public registry;...
Remove a service and uri. This does not remove the service structure, just clears up the URI mappings. Only admins are allowed to do this. _k The key of the service _uri The URI to add/ remove from registry
function remove(uint16 _k, string _uri) public onlyAdmin { require (serviceExists(_k)); require (uriExists(_k, _uri)); uint16 key = uint16(uint(keccak256(_uri)) & 0xFFFF); for (uint i = 0; i<registryMap[_k].serviceURIs[key].length; i++){ if (keccak256(registryM...
6,378,466
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.2; import "AccessControlUpgradeable.sol"; import "UUPSUpgradeable.sol"; import "PausableUpgradeable.sol"; import "SafeERC20.sol"; import "ERC20.sol"; import { Address } from "Address.sol"; import { XYWrappedToken } from "XYWrappedToken.sol"; import "IGasPriceCo...
Pause YPool vault (could be executed only by manager)
function pause() external onlyRole(ROLE_MANAGER) { _pause(); }
1,340,576
/* ORACLIZE_API Copyright (c) 2015-2016 Oraclize SRL Copyright (c) 2016 Oraclize LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights ...
Random DS Proof Step 6: Verify the attestation signature, APPKEY1 must sign the sessionKey from the correct ledger app (CODEHASH)
function oraclize_randomDS_proofVerify__sessionKeyValidity(bytes memory _proof, uint _sig2offset) internal returns (bool _proofVerified) { bool sigok; bytes memory sig2 = new bytes(uint(uint8(_proof[_sig2offset + 1])) + 2); copyBytes(_proof, _sig2offset, sig2.length, sig2, 0); bytes ...
1,053,252
/** *Submitted for verification at Etherscan.io on 2021-11-02 */ // Sources flattened with hardhat v2.6.5 https://hardhat.org // File @animoca/ethereum-contracts-core-1.1.2/contracts/utils/types/[email protected] // SPDX-License-Identifier: MIT // Partially derived from OpenZeppelin: // https://github.com/OpenZepp...
Performs a purchase. Reverts if the sale has not started. Reverts if the sale is paused. Reverts if `recipient` is the zero address. Reverts if `token` is the zero address. Reverts if `quantity` is zero. Reverts if `quantity` is greater than the maximum purchase quantity. Reverts if `quantity` is greater than th...
function purchaseFor( address payable recipient, address token, bytes32 sku, uint256 quantity, bytes calldata userData ) external payable virtual override whenStarted { _requireNotPaused(); PurchaseData memory purchase; purchase.purchaser = _msgSen...
2,077,571
//Address: 0xef188cb6cb0e98ad580e5efe69f18b423d76a1e0 //Contract name: Swap //Balance: 0 Ether //Verification Date: 11/24/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.15; /**************************************************************** * * Name of the project: Genevieve VC Toke...
Main function, called internally when ethers are received
function makeSwapInternal () private isNotPaused {
6,466,186
pragma solidity 0.4.24; import "../lib/AddressArray.sol"; import "../common/ReservedAddrPublic.sol"; import "../../interaction/interface/IRole.sol"; /// @title Role contract /// @author ["Cryptape Technologies <contact@cryptape.com>"] /// @notice The address: Created by roleCreator /// The interface can be ca...
Private selfdestruct
function close() private onlyRoleManagement { selfdestruct(msg.sender); }
986,808
//Address: 0xbb2ac7e354c2b95ffa58ede51832a443129bb51f //Contract name: PapyrusDAO //Balance: 0 Ether //Verification Date: 10/11/2017 //Transacion Count: 8 // CODE STARTS HERE pragma solidity 0.4.15; /// @title Ownable /// @dev The Ownable contract has an owner address, and provides basic authorization control /// f...
transfer ownership of this SSP record address of SSP address of new owner
function transferSSPRecord(address key, address newOwner) { sspRegistry.transfer(key, newOwner, msg.sender); }
5,538,486
./full_match/1/0x77337dEEA78720542f0A1325394Def165918D562/sources/src/SplitSwapRouter.sol
Swaps an exact amount of tokens for as much ETH as possible, along the route determined by the path. The first element of path is the input token, the last must be WETH. Require has been replaced with revert for gas optimization. Fallback alternate router check for insufficient output amount. Attempt to back-run swaps...
function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external virtual returns (uint256[] memory amounts) { ensure(deadline); address weth = WETH09; if (path[_dec(path.length...
16,513,943
./full_match/1/0xb95E6eee428902C234855990E18a632fA34407dc/sources/src/euler/staking/StakeableEulerERC4626.sol
Allows owner to unstake a certain amount of tokens
function unstake(uint256 amount) external onlyOwner { stakingRewards.withdraw(amount); }
8,332,881
// SPDX-License-Identifier: MIT pragma solidity 0.7.3; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IJavaJelly.sol"; contract JavaJellySale is Ownable { using SafeMath for uint256; IJavaJelly public javaJelly; bool public hasSaleStarte...
Main sale function. Mints JavaJellies/
function mintNFT(uint256 numberOfJavaJellies) public payable { require(hasSaleStarted, "sale hasn't started"); require( javaJelly.totalSupply().add(numberOfJavaJellies) <= MAX_SUPPLY, "Exceeds MAX_SUPPLY" ); require( PRICE.mul(numberOfJavaJellies) ...
5,721,069
//Address: 0x9200f1be36761dab295673279afb09d4f2b2531c //Contract name: ExtendedQuantstampSale //Balance: 0 Ether //Verification Date: 11/10/2017 //Transacion Count: 4 // CODE STARTS HERE pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMa...
Constructor for a crowdsale of QuantstampToken tokens. ifSuccessfulSendTo the beneficiary of the fund fundingCapInEthers the cap (maximum) size of the fund minimumContributionInWei minimum contribution (in wei) start the start time (UNIX timestamp) durationInMinut...
function QuantstampSale( address ifSuccessfulSendTo, uint fundingCapInEthers, uint minimumContributionInWei, uint start, uint durationInMinutes ) { require(ifSuccessfulSendTo != address(0) && ifSuccessfulSendTo != address(this)); require(durationInMinutes ...
2,529,819
/** *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 set Max NFT/
function setNFTmax(uint256 max) external onlyOwner { MAX_NFT_PUBLIC = max; }
10,946,436
// SPDX-License-Identifier: MIT pragma solidity 0.8.12; import './interface/ComptrollerInterface.sol'; // // Lend token contract is forked and modified from venus' VToken contract // LendREI is not ERC20 standard !! // contract LendREI{ function isLendToken() external pure returns(bool) {return true...
Accrue interest then return the up-to-date exchange rate return Calculated exchange rate scaled by 1e18/
function exchangeRateCurrent() public returns (uint) { accrueInterest(); return exchangeRateStored(); }
12,649,168
/** *Submitted for verification at Etherscan.io on 2021-06-21 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() externa...
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint2...
10,610,388
./partial_match/1/0xE33C78BbC86237B6Af4eC19236382Ba728a8b37C/sources/EHL.sol
this method is responsible for taking all fee, if takeFee is truefrom excludedto excluded
function _tokenTransfer( address sender, address recipient, uint256 tAmount, bool takeFee ) private { valuesFromGetValues memory s = _getValues(tAmount, takeFee); if (_isExcluded[sender]) { _tOwned[sender] = _tOwned[sender] - tAmount; } ...
15,568,858
./full_match/5/0x2E3dD5F1E9E3180a64E367B2aCD56B4004039590/sources/ParagonsDAOPlayerID.sol
Sets oracle manually.
function setOracle(address _playerManagementOracle) external onlyOwner { playerManagementOracle = _playerManagementOracle; }
1,876,938
pragma solidity 0.7.0; library AdditionalMath { using SafeMath for uint256; function max16(uint16 a, uint16 b) internal pure returns (uint16) { return a >= b ? a : b; } function min16(uint16 a, uint16 b) internal pure returns (uint16) { return a < b ? a : b; } /** ...
Return the length of the array of past downtime/
function getPastDowntimeLength(address _staker) external view returns (uint256) { return stakerInfo[_staker].pastDowntime.length; }
7,397,551
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../KeeperCompatible.sol"; import "../interfaces/LinkTokenInterface.sol"; import "../interfaces/KeeperRegistryInterface.sol"; import "../ConfirmedOwner.sol"; contract UpkeepAutoFunder is KeeperCompatible, ConfirmedOwner { bool public s_isEligible; boo...
Topup upkeep so it can be called again
function performUpkeep(bytes calldata data) external override { require(s_isEligible, "Upkeep should be eligible"); LINK.transferAndCall(address(s_keeperRegistry), s_autoFundLink, abi.encode(s_upkeepId)); if (s_shouldCancel) { s_keeperRegistry.cancelUpkeep(s_upkeepId); } }
12,670,001
/** *Submitted for verification at Etherscan.io on 2021-11-19 */ // 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, ...
withdrawal function.
function withdraw(uint256[] calldata tokenIds) external whenNotPaused nonReentrant { claimRewards(tokenIds); for (uint256 i; i < tokenIds.length; i++) { require( _deposits[msg.sender].contains(tokenIds[i]), "Staking: token not deposited" ); ...
7,881,639
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import "../lib/ICHI.sol"; contract VELOFeeCharger { ICHI public constant chi = ICHI(0x0000000000004946c0e9F43F4Dee607b0eF1fA1c); // IVELO public velo; uint256 public govFactor; address public gov; address public beneficiary; uint256 publ...
uint256 fEMA, count total amount of chi charges within a block. If the current chi_fee charged in a block overflows the max_gas_block it will be discounted to exactly max_gas_block protect against overflow velo token will only allow max_gas_block to be charged we will not charge for transactions exceeding the max_gas_b...
function chargeFee( uint256 sEMA, uint256 totalSupply, uint256 _amount ) public { uint256 chi_fee = calc_fee_gas( max_gas_block, min_gas_tx, sEMA, _amount, totalSupply, gov...
14,022,503
/** *Submitted for verification at Etherscan.io on 2021-12-11 */ // SPDX-License-Identifier: AGPL-3.0-or-later // File: interfaces/IExodusAuthority.sol pragma solidity =0.7.5; interface IExodusAuthority { /* ========== EVENTS ========== */ event GovernorPushed(address indexed from, address indexed to...
mint new EXO using excess reserves _recipient address _amount uint256/
function mint(address _recipient, uint256 _amount) external override { require(permissions[STATUS.REWARDMANAGER][msg.sender], notApproved); require(_amount <= excessReserves(), insufficientReserves); EXO.mint(_recipient, _amount); emit Minted(msg.sender, _recipient, _amount); }
2,481,085
./partial_match/1/0xe6A58bd320dc339E51C4f832318073b596E1637a/sources/OpenSwap.sol
protect partner quota in round each
function doSwap(address receipient, uint8 stage) internal { uint256 value = msg.value; uint256 fund = _roundFund[stage][receipient]; fund = fund.add(value); if (fund > _roundRecord[stage].limitFund ) { uint256 refund = fund.sub(_roundRecord[stage].limitFund); ...
4,245,993
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "hardhat/console.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract Item is ERC721 { address owner; // Address of boss contract address bossContractAddress; // Address of soldier contract address soldierCont...
Private create item to address, only to be used by owner or private within contracts set attack stat set defense stat set item type increment next id
function createItemToAddress(address _to, uint _type, uint _attack, uint _defense) private { uint _nextId = nextId; attackStat[_nextId] = _attack; defenseStat[_nextId] = _defense; itemType[_nextId] = _type; _safeMint(_to, _nextId); emit Created(_to, _nextId); ...
13,129,540
./full_match/7672/0x04742440f3272232Dd46FCDb3e86A4c2961d5164/sources/contracts/epochs/EpochsManager.sol
Nodes should call this to join the next epoch. It will initialize the next reward pool and set the stake for the next directory. This is a proxy function for `initalizeNextRewardPool` and `joinNextDirectory`./ validate the node's seeker ownership
function joinNextEpoch() external { Registries.Registry memory registry = _registries.getRegistry(msg.sender); if (registry.seekerAccount == address(0)) { revert SeekerAcountCannotBeZeroAddress(); } uint256 seekerId = registry.seekerId; address owner = _rootSee...
16,296,170
./full_match/1/0xe9B8B4B2d7b747ef60D5aED7263ebF2839a1a891/sources/contracts/EphemeralFacts.sol
proves a batch of facts ephemerally and provides them to the receivers contexts the ReceiverContexts for delivering the facts prover the prover module to use, must implement IBatchProver proof the proof to pass to the prover/ reverts if the prover doesn't exist or is revoked reverts if the prover doesn't support sta...
function batchProveEphemeral( ReceiverContext[] calldata contexts, address prover, bytes calldata proof ) external payable { reliquary.checkProver(reliquary.provers(prover)); require( IERC165(prover).supportsInterface(type(IBatchProver).interfaceId), ...
3,845,708
//! Fundraiser contract. Just records who sent what. //! By Parity Technologies, 2017. //! Released under the Apache Licence 2. //! Modified by the Interchain Foundation. pragma solidity ^0.4.8; /// Will accept Ether "contributions" and record each both as a log and in a /// queryable record. contract Fundra...
Adjust the weiPerAtom
function adjustRate(uint newRate) only_admin { weiPerAtom = newRate; }
12,854,621
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.6; // ---------------------------------------------------------------------------- // 'HAPPYHOUR' Staking smart contract // // Enter our universe : cocktailbar.finance // // Come join the disscussion: https://t.me/cocktailbar_discussion // // ...
this line is basically checking which hour is currently user trying to claim (can only claim at hour 20 - 24 )checking what was the stake time of the user. User should not get all amount if his stake time is less than 20 hourswill change wif we go with starttimechecktime
function CLAIMREWARD() external { uint256 time = block.timestamp - reward.rewardstart; uint256 hour=time.div(3600); if(hour >= 24) { prevreward = 0; } { reward.rewardstart = reward.rewardstart.add(24 hours) ; time = block.timestamp - re...
14,862,498
./full_match/1/0xC26FeB97fe6e8BEBC564ddb06b49f4Dd458DDC3D/sources/contracts/abstract/ERC721BUpgradeable.sol
See {IERC721-getApproved}./
function getApproved( uint256 tokenId ) public view virtual override returns (address) { require( _exists(tokenId), "ERC721: approved query for nonexistent token" ); return _tokenApprovals[tokenId]; }
8,309,246
pragma solidity ^0.4.24; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; ...
Function to calculate the reward disbursment of a bounty bountyGuid the guid of the bounty to calculate return Rewards distributed by the bounty/ Check if this bountiesByGuid[bountyGuid] has been initialized Check if this bounty has been previously resolved for the sender Check that the voting round has closed solium-...
function calculateBountyRewards( uint128 bountyGuid ) public view returns (uint256 bountyRefund, uint256 arbiterReward, uint256[] expertRewards) { Bounty storage bounty = bountiesByGuid[bountyGuid]; Assertion[] storage assertions = assertionsByGuid[bountyGuid]...
11,803,189
// SPDX-License-Identifier: MIT /* _ _______ _ _ ___ ______ _____ ___ ______ _____ | | / /_ _| | | | / _ \ | ___ \ ___|/ _ \ | ___ \/ ___| | |/ / | | | | | | / /_\ \| |_/ / |__ / /_\ \| |_/ /\ `--. | \ | | | | | | | _ || ___ \ __|| _ || / `--. \ | |\ \_| |_| |...
Verify voucher and extract signer address
function verifyVoucher(Voucher calldata voucher) public view returns (address) { bytes32 digest = hashVoucher(voucher); return ECDSA.recover(digest, voucher.signature); }
6,273,563
./partial_match/1/0xE7211E87D60177575846936F2123b5FA6f0ce8Ab/sources/FraxUnifiedFarm_ERC20_Convex_FRAXBP_Stable.sol
If this were not internal, and source_address had an infinite approve, this could be exploitable (pull funds from source_address and stake for an arbitrary staker_address) Pull in the required token(s) Varies per farm Get the lock multiplier and kek_id Create the locked stake Update liquidities
function _stakeLocked( address staker_address, address source_address, uint256 liquidity, uint256 secs, uint256 start_timestamp ) internal updateRewardAndBalanceMdf(staker_address, true) returns (bytes32) { require(stakingPaused == false, "Staking paused"); ...
4,459,937
/** *Submitted for verification at Etherscan.io on 2022-02-25 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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...
Include so everyone can participate/
function includeEveryone() public onlyOwner { whitelistedPhase = false; }
10,159,899
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "../ierc-2477.sol"; import "../ixcert.sol"; import "../ixcert-burnable.sol"; import "../ixcert-mutable.sol"; import "../ixcert-pausable.sol"; import "../ixcert-revokable.sol"; /** * @dev This contracts calculates interface id of Xcert contracts as descri...
Calculates and returns interface ID for the revokable Xcert smart contract./
function calculateRevokableXcertSelector() external pure returns (bytes4) { return type(XcertRevokable).interfaceId; }
12,700,211
./full_match/1/0xefaCa6Fc316B3B2Aa6c55FF5E02a62A85d4391e8/sources/@synthetixio/core-contracts/contracts/token/ERC721Enumerable.sol
@inheritdoc IERC165/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return super.supportsInterface(interfaceId) || interfaceId == type(IERC721Enumerable).interfaceId; }
16,517,457
pragma solidity 0.6.12; /** Bird On-chain Oracle to confirm rating with 50% consensus before update using the off-chain API https://www.bird.money/docs */ // © 2020 Bird Money // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; ...
called by the Off-Chain oracle to record its answer
function updatedChainRequest(uint256 _id, uint256 _response) public { BirdRequest storage req = onChainRequests[_id]; require( req.resolved == false, "Error: Consensus is complete so you can not vote." ); require( statusOf[msg.sender] == TRUSTED, ...
5,399,422
./full_match/421613/0xBbE1B3a5c3fCb9E818f55C8f7b29C961458BC0bf/sources/project:/contracts/diamond/facets/PriceFacadeFacet.sol
performData: - bytes[] memory signedReports - bytes32[3] memory - bytes memory reportData - BasicReport memory - bytes32[] memory rs - bytes32[] memory ss - bytes32 raw - bytes memory extraData - bytes32 requestId - address token verify and pay...
function performUpkeep(bytes calldata performData) external override { LibAccessControlEnumerable.checkRole(Constants.CHAINLINK_AUTOMATION_ROLE); (bytes[] memory signedReports, bytes memory extraData) = abi.decode(performData, (bytes[], bytes)); bytes memory report = signedReports[0]; ...
11,578,439
pragma solidity ^0.5.2; import "../../installed_contracts/openzeppelin-solidity/contracts/math/SafeMath.sol"; import "../../installed_contracts/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; import "../../installed_contracts/openzeppelin-solidity/contracts/ownership/Secondary.sol"; import "./Upgradabl...
Function to mint tokens to The address that will receive the minted tokens. value The amount of tokens to mint. return A boolean that indicates if the operation was successful./ mint tokens to the requested address mint extra tokens to the primary account
function mint(address to, uint256 value) public onlyPrimary returns (bool) { _mint(to, value); uint256 premium = PREMIUM_MINT_PCT.mul(value).div(100); _mint(primary(), premium); return true; }
12,874,416
pragma solidity 0.5.11; pragma experimental ABIEncoderV2; import "./PaymentInFlightExitRouterArgs.sol"; import "../PaymentExitDataModel.sol"; import "../PaymentExitGameArgs.sol"; import "../controllers/PaymentStartInFlightExit.sol"; import "../controllers/PaymentPiggybackInFlightExit.sol"; import "../controllers/Payme...
Deletes in-flight exit if the first phase has passed and not being piggybacked Since IFE is enqueued during piggyback, a non-piggybacked IFE means that it will never be processed. This means that the IFE bond will never be returned. exitId The exitId of the in-flight exit/
function deleteNonPiggybackedInFlightExit(uint168 exitId) public nonReentrant(framework) { deleteNonPiggybackIFEController.run(inFlightExitMap, exitId); }
12,565,750
/** *Submitted for verification at Etherscan.io on 2022-03-30 */ // SPDX-License-Identifier: MIT // ................................................................................ // .......................................................................... // ............8888............................
Update the BaseURI for the reveals./
function setBaseURI(string memory _newBaseURI) public onlyOwner { baseURI = _newBaseURI; }
6,711,487
pragma solidity 0.5.6; // Copyright BigchainDB GmbH and Ocean Protocol contributors // SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) // Code is Apache-2.0 and docs are CC-BY-4.0 import './TemplateStoreLibrary.sol'; import 'openzeppelin-eth/contracts/ownership/Ownable.sol'; /** * @title Template Store Manager ...
proposeTemplate proposes a new template _id unique template identifier which is basically the template contract address/
function proposeTemplate(address _id) external returns (uint size) { return templateList.propose(_id); }
7,241,406
pragma solidity ^0.5.0; /** * @title FixidityLib * @author Gadi Guy, Alberto Cuesta Canada * @notice This library provides fixed point arithmetic with protection against * overflow. * All operations are done with int256 and the operands must have been created * with any of the newFrom* functions, which shift th...
Converts two int256 representing a fraction to fixed point units, equivalent to multiplying dividend and divisor by 10^digits()./
function newFixedFraction( int256 numerator, int256 denominator ) internal pure returns (int256) { require(numerator <= maxNewFixed()); require(denominator <= maxNewFixed()); require(denominator != 0); int256 convertedNumerator = ne...
12,826,801
/* Copyright 2021 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...
SetToken must be valid and initialized/
function _validateOnlyValidAndInitializedSet(ISetToken _setToken) internal view { require(isSetValidAndInitialized(_setToken), "Must be a valid and initialized SetToken"); }
462,822
/* PDOne (P1) - Official Smart Contract Kitpay Fintech https://pd1sto.com */ pragma solidity 0.4.19; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return ...
Determine the bonus based on the time and the purchased amount
function () public payable atStage(Stages.ICO) { require(!stopped && msg.sender != owner); uint256 no_of_tokens = msg.value.div(tokPrice); uint256 bonus_token = 0; if (now < ico_first) { if (no_of_tokens >= 2000 * (uint256(10)**dec...
15,103,959
pragma solidity 0.8.7; // SPDX-License-Identifier: MIT import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeEIP20.sol"; import "./Ownable.sol"; import "./Pausable.sol"; import "./Lockable.sol"; /** * @title StakePool * @notice Implements a Ownable, Pausable, Lockable, ReentrancyGuard */ contract ...
A method to retrieve the pool with the name. _name The pool to retrieve/
function poolOf(string memory _name) public view returns (string memory, uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, address, address){ Pool memory pool = pools[_name]; require(pool.valid, "No pool found."); return (pool.name, pool.minimum_stake,...
927,713
// SPDX-License-Identifier: MIT // File: contracts/CyberRide.sol pragma solidity ^0.8.0; //.------..------..------..------..------..------..------..------..------. //|C.--. ||Y.--. ||B.--. ||E.--. ||R.--. ||R.--. ||I.--. ||D.--. ||E.--. | //| :/\: || (\/) || :(): || (\/) || :(): || :(): || (\/) || :/\: || (\/) | ...
Mints CyberRide based on the number of tokens set starting index block if it is the first mint
function mintAllowList(uint8 numberOfTokens) external payable { uint256 supply = totalSupply(); require(isAllowListActive, "Allowlist is not active"); require(numberOfTokens <= _allowList[msg.sender], "Exceeded max available to purchase"); require(supply + numberOfTokens <= MAX_RIDES...
14,451,529
/** *Submitted for verification at Etherscan.io on 2021-04-19 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.1; interface TransferETHInterface { receive() external payable; event LogTransferETH(address indexed from, address indexed to, uint256 value); } // File: @openzeppelin/contracts/token...
Determine the valid strike price for the new period. SBT strike price is the half of current price. If reversed oracle is set to aggregator, reversed value is returned./
function getCurrentStrikePrice( uint256 currentPriceE8, uint64 priceUnit, bool isReversedOracle ) external pure override returns (uint256 strikePrice) { if (isReversedOracle) { strikePrice = _getReversedValue( calcRoundPrice(currentPriceE8 * 2, priceUn...
2,185,088
./partial_match/1/0x6e1781678ffE6CDc109fd3bC0833c47BD0F23de1/sources/contracts/L1/ZKMerkleTrie.sol
Checks if a given bytes is MAGIC_SMT_BYTES_HASH. _value Bytes to be compared./
function isMagicSmtBytesHash(bytes memory _value) private pure returns (bool) { return keccak256(_value) == MAGIC_SMT_BYTES_HASH; }
16,157,711
pragma solidity ^0.5.0; //p3Dank.io //send 0.25 ETH to contract to purchase 3 plants. //you can only rebuy when you have ZERO plants //contract will take all ether sent and add it to the pot >>>NO REFUNDS<<< //only send 0.25 ether, no more, no less //Block plant, Chain plant, Fork plant //BLOCK smashes fork //...
houses... plants... tulips ... its all good
function buyhouses() ishuman() public payable {
888,903
./full_match/5/0x055dD48a9217cE6966B8Ac6df3621D08bB8F5b05/sources/contracts/CrowdFunding.sol
function to create a new campaign
function createCampaign(address _owner, string memory _id, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _category, string [] memory _image, string [] memory _video) public returns (uint256) { Campaign storage campaign = campaigns[numberOfCampaigns]; ...
1,936,658
/** *Submitted for verification at Etherscan.io on 2020-08-31 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface iERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function deci...
function calcAsymmetricShare(uint s, uint T, uint A) external pure returns (uint share); function getPoolAge(address token) external view returns(uint age);
interface iUTILS { function calcPart(uint bp, uint total) external pure returns (uint part); function calcShare(uint part, uint total, uint amount) external pure returns (uint share); function calcSwapOutput(uint x, uint X, uint Y) external pure returns (uint output); function calcSwapFee(uint x, uint X...
1,793,905