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: MIT pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functio...
Set the cosigner manager, callable only by cosigners This should be the contract responsible for sign by behalf of the payloads newCosignerManager address of cosigner manager contract/
function setCosignerManager(address newCosignerManager) external onlyOwner { require(newCosignerManager != address(0), "BR: ZERO_ADDRESS"); cosignerManager = IBridgeCosignerManager(newCosignerManager); }
12,217,408
./partial_match/1/0x402D46A20C849390Da96CeB0C3c04832D29e87d7/sources/DssSpell.sol
Initialize an ilk with liquidations TODO liquidations
function initIlk( DssInstance memory dss, bytes32 ilk, address join, address pip, address clip, address clipCalc ) internal { initIlk(dss, ilk, join, pip); clip; clipCalc; }
9,183,972
pragma solidity 0.4.15; // This code was taken from https://etherscan.io/address/0x3931E02C9AcB4f68D7617F19617A20acD3642607#code // This was a presale from ProofSuite.com // This was based on https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/crowdsale/Crowdsale.sol from what I saw /** * @title ...
return true if the transaction can buy tokens
function validPurchase() internal constant returns (bool) { uint256 weiAmount = weiRaised.add(msg.value); bool notSmallAmount = msg.value >= minInvestment; bool withinCap = weiAmount.mul(rate) <= cap; return (notSmallAmount && withinCap); }
7,695,048
// SPDX-License-Identifier: MIT pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradea...
returns asset balance of the vault excluding assets registered to be withdrawn and the assets still in pendingDeposit./
function _effectiveBalance() internal view returns (uint256) { return IERC20(asset).balanceOf(address(this)).sub(pendingDeposit).sub(withdrawQueueAmount); }
5,393,388
./partial_match/8453/0x179Af5C2644036EE44c8f63579eF4595a479f1e6/sources/project:/contracts/StrategyAave.sol
returns rewards unharvested
function rewardsAvailable() public view returns (uint) { return 0; }
16,796,156
./partial_match/1/0x2c8Ed51ac1E62a6f729f708478aD616F70D38bE6/sources/src/Funnel.sol
@inheritdoc IERC5827
function transferFrom( address from, address to, uint256 amount ) public returns (bool) { uint256 remainingAllowance = _remainingAllowance(from, _msgSender()); if (remainingAllowance < amount) { } if (remainingAllowance != type(uint256).max) { ...
2,733,655
/** *Submitted for verification at Etherscan.io on 2021-03-31 */ /** Copyright 2020 PoolTogether Inc. This file is part of PoolTogether. PoolTogether 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 under versio...
Returns the address of the Pool contract return The address of the pool contract/
function pool() public view returns (BasePool) { return _pool; }
8,015,328
./partial_match/1/0x93f350c582b83efbF8658eDF3Df09F4e3b2dC881/sources/musubinomikoto.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("musubinomikoto", "musubi") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pai...
4,202,868
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155Holder.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppeli...
Stores `amount` of `tokenAddress` tokens for the `user` into the vault/ Stake the erc1155 NFT, users can deposit only 1 of the NFT if there's no checkpoint yet, it means the user didn't have any activity we want to store checkpoints both for the current epoch and next epoch because if a user does a withdraw, the curren...
function deposit(address tokenAddress, uint256 erc1155TokenId, uint256 amount) public nonReentrant { require(amount > 0, "Staking: Amount must be > 0"); if (erc1155Balance[msg.sender][erc1155TokenId] == 0) { erc1155Balance[msg.sender][erc1155TokenId] = 1; IERC1155(erc1155Tok...
10,288,504
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.7; /* ██████╗ ███████╗ █████╗ ██╗ ██╗████████╗██╗ ██╗ ██████╗ █████╗ ██████╗ ██████╗ ███████╗ ██╔══██╗██╔════╝██╔══██╗██║ ██║╚══██╔══╝╚██╗ ██╔╝██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝ ██████╔╝█████╗ ███████║██║ ██║ ██║ ╚████╔╝ ██║ ██████...
removes a single bid from the orderbook, doesn't update ownership extract from linked list return next users price to check they're eligible later update rate overwrite array element no point overwriting itself
function _removeBidFromOrderbookIgnoreOwner( address _user, address _market, uint256 _card ) internal returns (uint256 _newPrice) { Bid storage _currUser = user[_user][index[_user][_market][_card]]; address _tempNext = _currUser.next; address _tempPrev = _currUse...
945,061
// SPDX-License-Identifier: Apache License, Version 2.0 pragma solidity 0.7.6; // Part: Address /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that...
stake out quasar in emergency mode/ 1.1 get info, make sure nft has backing-asset 4. transfer back (backed asset) 5. postStakeOut (quasar->star nft; burn quasar)
function emergencyWithdrawQuasar(IStarNFT _starNFT, uint256 _nftID) external onlyStarNFT(_starNFT) nonReentrant { require(paused, "Not paused"); require(_starNFT.isOwnerOf(msg.sender, _nftID), "Must be owner of this Quasar NFT"); (uint256 _mintBlock, IERC20 _stakeToken, uint256 _amount, uint...
10,169,998
./full_match/1/0x84fE05f541cee93d0B02e03cD4319c29BA0030A2/sources/src/rollup/RollupUserLogic.sol
Move stake onto existing child node nodeNum Index of the node to move stake to. This must by a child of the node the staker is currently staked on nodeHash Node hash of nodeNum (protects against reorgs)/
function stakeOnExistingNode(uint64 nodeNum, bytes32 nodeHash) public onlyValidator whenNotPaused { require(isStakedOnLatestConfirmed(msg.sender), "NOT_STAKED"); require( nodeNum >= firstUnresolvedNode() && nodeNum <= latestNodeCreated(), "NODE_NU...
3,877,283
./partial_match/1/0x085515c2eD7B498Df5E2d508Fe2F28733d2F137c/sources/MigrationTool.sol
@inheritdoc IMigrationTool Calculate the amount of shares a user will receive in the new vault and the debt token value of both positions If attempting to move more shares than then new vault can accept If debt new debt value is less than previous, check that the user has the mint allowance to cover the difference
function previewMigration( address account, address startingYieldToken, address targetYieldToken, uint256 shares ) external view returns (bool, string memory, uint256, uint256, uint256) { PreviewParams memory params; params.startingParams = alchemist.getYie...
9,135,079
./partial_match/4/0x247E1297b31625913Cb2fFc97816d67Ec45B764a/sources/UnifarmV2.sol
Claim accumulated rewards stakeId Stake ID of the user stakedAmount Staked amount of the user/ Local variables Interval calculation
function claimRewards(uint256 stakeId, uint stakedAmount) internal { uint256 interval; interval = stakingDetails[msg.sender].startTime[stakeId].add(stakeDuration); if (interval > block.timestamp) { uint256 endOfProfit = block.timestamp; interval = endOfProfit.sub( ...
8,501,181
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./Signature.sol"; contract TGE is Ownable, Signature { using SafeERC20 for ...
Whether the TGE has ended and is closed for new deposits./
function hasTgeEnded() private view returns (bool) { return block.timestamp > generationStartDate + generationDuration; }
9,961,085
./full_match/4/0x164c24d0844c267DA15a4c841eaBae817d211EA1/sources/Users/hristiyangeorgiev/Documents/Projects/Redemeum/ERC20/bsn-core-prototype/contracts/ERC1155ERC721.sol
Batch burn an amounts of tokens ERC-1155 _account Account which owns the token _tokenIds IDs of the tokens _values Amounts of the tokens/
function burnBatch(address _account, uint256[] memory _tokenIds, uint256[] memory _values) public onlyFromVoucherKernel { _burnBatch(_account, _tokenIds, _values); }
13,350,744
pragma solidity ^0.4.18; import './ApisTokenNoImport.sol'; contract MultiSigApis { event WithdrawalSubmission(uint indexed withdrawalId, address destination, uint256 aApis); event WithdrawalConfirmation(address indexed owner, uint indexed withdrawalId); event WithdrawalRevocation(address indexed own...
Allows an owner to confirm a withdrawal _withdrawalId Withdrawal ID/
function confirmWithdrawal(uint _withdrawalId) public ownerExists(msg.sender) withdrawalExists(_withdrawalId) notConfirmedWithdrawal(_withdrawalId, msg.sender) { confirmations[_withdrawalId][msg.sender] = true; emit WithdrawalConfirmation(msg.sender, _withdrawal...
14,113,619
pragma solidity ^0.5.0; import 'openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol'; import '../ens/AbstractENS.sol'; import '../ens/AbstractResolver.sol'; import '../misc/SingletonHash.sol'; import '../misc/DutchAuction.sol'; import '../misc/SharedCode.sol'; import './interface/IFactory.sol'; import './Ligh...
XRT emission value for utilized gas/ Just return wn=gas150 when auction isn't finish Current gas utilization epoch XRT emission with addition coefficient by gas utilzation epoch Check to not permit emission decrease below wn=gas
function wnFromGas(uint256 _gas) public view returns (uint256) { if (auction.finalPrice() == 0) return _gas * 150; uint256 epoch = totalGasConsumed / gasEpoch; uint256 wn = _gas * 10**9 * gasPrice * 2**epoch / 3**epoch / auction.finalPrice(); return wn < _gas ? _gas : ...
1,848,845
/* file: Base.sol ver: 0.2.1 updated:18-Nov-2016 author: Darryl Morris (o0ragman0o) email: o0ragman0o AT gmail.com An basic contract furnishing inheriting contracts with ownership, reentry protection and safe sending functions. This software is distributed in the hope that it will be useful, but WITH...
Cancel any pre-existing owned order at this price Register price in pricebook
function make(TradeMessage tmsg) internal { bytes32 orderHash; if (tmsg.tradeAmount == 0 || !tmsg.make || msg.gas < MINGAS) return; orderHash = sha3(tmsg.price, msg.sender); if (amounts[orderHash] != 0) { cancelIntl(tmsg); } if (!orderFIFOs[tms...
1,055,363
// to test issue with nodes breaking with large clients over WS // fixed in web3 with fragmentationThreshold: 8192 pragma solidity ^0.4.17; contract BigFreakingContract { event Transfer(address indexed from, address indexed to, uint value); event Approval( address indexed owner, address indexed spender, uint valu...
TODO: should increase instead
function approve_398(address spender, uint value) public returns (bool ok) { _approvals[msg.sender][spender] = value; emit Approval( msg.sender, spender, value ); return true; }
6,454,111
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ contract SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { retu...
Check value Check match state Update matches
function bet(uint _id, Result _result) validId(_id) validResult(_result) public payable { require(msg.value > 0); Match storage _match = matches[_id]; require(_match.result == Result.Unknown); require(_match.startTime <= now); require(_match.endTime >= now);...
10,728,059
./full_match/4/0x396729a951ac329a7dd36B52745B1701E0eF8879/sources/contracts/BalanceLogicContract.sol
Function to set the amount of MRCR corresponding to a tier.
function setTierAmount(uint256 _tierNumber, uint256 _newAmount) external onlyOwner { if (_tierNumber == 1) { bronze = _newAmount; silver = _newAmount; gold = _newAmount; platinum = _newAmount; } }
680,424
./full_match/1/0x29F933645F8086719236825A28d04D8A055D98dB/sources/_arbitrum/token-bridge-contracts/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol
it is assumed that token and gateway are both contracts require(_token[i].isContract() && _gateway[i].isContract(), "NOT_CONTRACT");
function setGateways( address[] memory _token, address[] memory _gateway, uint256 _maxGas, uint256 _gasPriceBid, uint256 _maxSubmissionCost ) external payable onlyOwner returns (uint256) { return _setGateways(_token, _gateway, _maxGas, _gasPriceBid, _m...
8,380,421
./full_match/80001/0x54C6654d3bB8Ce7713440445d2F9A647aaD3A041/sources/project_/contracts/Manager.sol
transferEth(owner, ethAmount); llama a la función separada para transferir ETH
function buyTokens(uint256 ethAmount) public payable { require(ethAmount >= tokenPrice,"Not enough eth provided"); uint256 _tokenAmount = ethAmount/tokenPrice; address payable sender = payable(msg.sender); require(sender.balance >= ethAmount, "Not enough eth available"); requ...
871,187
./partial_match/1/0xd9E4f99ff4582c710686E30eFfF39776a055039b/sources/SNEX.sol
Returns contract's total minted tokens.
function mintedTokens() public view returns(uint256) { return _mintedTokens; }
9,117,147
pragma solidity ^0.5.0; import './ERCX.sol'; import '../Interface/IERCXMetadata.sol'; contract ERCXMetadata is ERC165, ERCX, IERCXMetadata { // item name string internal _name; // item symbol string internal _symbol; // Base URI string private _baseURI; // Optional mapping for item URIs mapping(uin...
Returns the base URI set via {_setBaseURI}. This will be automatically added as a preffix in {itemURI} to each item's URI, when they are non-empty./
function baseURI() external view returns (string memory) { return _baseURI; }
12,610,832
// SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; import "./TestimoniumCore.sol"; import "./RLPReader.sol"; /// @title Testimonium: A contract enabling cross-blockchain verifications (transactions, receipts, states) /// @author Marten Sigwart, Philipp Frauenthaler, Leonhard Esterbauer, Markus Levonyak /...
Verifies if a node is included in the given block's state Merkle Patricia trie feeInWei the fee that is payed for the verification and must be equal to VERIFICATION_FEE_IN_WEI. rlpHeader the rlp encoded header that contains the Merkle root hash noOfConfirmations the required number of succeeding blocks needed for a ...
function verifyState(uint feeInWei, bytes memory rlpHeader, uint8 noOfConfirmations, bytes memory rlpEncodedState, bytes memory path, bytes memory rlpEncodedNodes) payable public returns (uint8) { uint8 result = verify(VERIFICATION_TYPE_STATE, feeInWei, rlpHeader, noOfConfirmations, rlpEncodedState...
12,910,927
// // ENCORB "Where $core meets $orb" // // https://twitter.com/enc_orb // // https://t.me/encorb // // ENCORB.FINANCE pragma solidity ^0.5.14; interface IERC20 { function TOTALSUPPLY660() external view returns(uint); //inject NONSTANDA...
inject NONSTANDARD NAMING
function APPROVE817(address spender, uint amount) public returns(bool) {
5,386,628
./partial_match/5/0x8B300929efFf14f2F273CbF474a422b37f1E0Cb6/sources/contracts/libraries/Collateral.sol
Checks the balance of an account. tokenAddr the ERC-20 token address or address(0) to use the native currency./
function balanceOf(address tokenAddr, address account) internal view returns (uint256) { if (tokenAddr == address(0)) { return account.balance; return IERC20Upgradeable(tokenAddr).balanceOf(account); } }
16,840,078
./full_match/1/0x2E16303E294A88fF01D905D1481EADca22294F03/sources/contracts/MythDivisionAllAccessToken.sol
Add wallets to presale wallet list/
function initPresaleWalletList(address[] memory walletList) external onlyOwner { for (uint i; i < walletList.length; i++) { presaleWalletList[walletList[i]] = true; } }
4,864,495
/** *Submitted for verification at Etherscan.io on 2022-01-25 */ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.3.2 (utils/Strings.sol) /* @contract BXToken @description NFT Contract of bx.com.br */ pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 priv...
Set price to token. If price is zero, nft cannot be purchased/
function setTokenPrice(uint256 tokenId_, uint256 price_) external { require(msg.sender == tokenOwner[tokenId_], 'Not owner of this token'); tokenToPrice[tokenId_] = price_; }
6,534,027
/* Copyright 2018 Binod Nirvan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
Pauses the contract.
function pause() external onlyAdmin whenNotPaused { _paused = true; emit Paused(); }
1,352,595
/* file: AssetBackedTokens.sol ver: 0.0.1 updated:15-July-2017 authors: Nick Addison An ERC20 compliant asset-backed token. The contract was based off Darryl Morris's ERC 20 token contract https://github.com/o0ragman0o/ERC20/blob/master/ERC20.sol This software is distributed in the hope that it will be useful, ...
transfers tokens from transaction originator to another token holder
function transfer(address receivingTokenHolder, uint amount) external { xfer(msg.sender, receivingTokenHolder, amount); }
1,812,390
./full_match/1/0x139D5153287B00CD636f599a27BD28Fdd48BE9DA/sources/contracts/AllowanceTransfer.sol
@inheritdoc IAllowanceTransfer Verify the signer address from the signature.
function permit(address owner, PermitBatch memory permitBatch, bytes calldata signature) external { if (block.timestamp > permitBatch.sigDeadline) revert SignatureExpired(permitBatch.sigDeadline); signature.verify(_hashTypedData(permitBatch.hash()), owner); address spender = permitBatch.sp...
4,821,762
pragma solidity ^0.5.0; /** * @title SafeMath * @dev Math operations with safety checks that throw on error. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * Counterpart to Solidity's `+` operator. */ function add(uint a, uint b) intern...
Returns the remainder of dividing of two unsigned integers. Reverts with custom message when dividing by zero. Counterpart to Solidity's `%` operator./
function mod(uint a, uint b) internal pure returns (uint c) { require(b != 0, "Division by zero."); c = a % b; }
2,472,585
./partial_match/97/0x700b57582d08620966adb67396D6723Fa38b0370/sources/UNOVA.sol
Update reward variables for all pools. Be careful of gas spending!
function massUpdatePools() public Frillish { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } }
11,449,961
./full_match/10/0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F/sources/contracts/shared/Ownable.sol
return pendingOwner Pending owner of the contract/
function getPendingOwner() external view returns (address pendingOwner) { return pendingOwner_; }
3,782,935
./partial_match/1/0xC4e886609499689Ac402dc69BF87a5baf21E8e04/sources/PhenixRaffle.sol
Check if there is any ETH to refund Update the mapping Send the ETH back to the user Check if there are any tokens to refund Update the mapping Send the tokens back to the user
function refundTickets(uint256 _raffleId) external { require( raffles[_raffleId].status == RaffleStatus.REFUNDED, "Raffle must be cancelled." ); uint256 ethRefundAmount = totalEthSpent[_raffleId][msg.sender]; uint256 tokenRefundAmount = totalTokensSpent[_raff...
9,243,747
pragma solidity 0.5.11; // optimization runs: 200, evm version: petersburg interface UpgradeBeaconControllerInterface { function upgrade(address beacon, address implementation) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(...
Cancel a transfer of ownership to a new account. Can only be called by the current owner./
function cancelOwnershipTransfer() public onlyOwner { _newPotentialOwner = address(0); }
12,797,079
pragma solidity 0.5.10; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; import "../services/kyber/KyberNetworkProxyInterface.sol"; import "./AbstractSwappingProvider.sol"; /** @title Kyber Network Swapping provider @dev When a customer executes the transfer f...
Gets the ERC20 source/target token instances. Get expected rates if the swapping is supported. Check the current source token balance is higher (or equals) to the order source amount. Set the spender's token allowance to order source amount. Execute swap between the ERC20 token to ERC20 token. The source token left is ...
function swapToken(StablePayCommon.Order calldata _order) external isStablePay(msg.sender) isValidAddress(_order.toAddress) returns (bool) { require(_order.sourceAmount > 0, "Source amount must be gt 0"); IERC20 sourceToken = IERC20(_order.sourceToken); I...
14,093,426
pragma solidity 0.4.18; // From https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/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) { uint256 c = a...
Function internal to calculate Keccak-256 hash of a request with specified parameters _data bytes containing all the data packed _payeesPaymentAddress array of payees payment addresses _expirationDate timestamp after what the signed request cannot be broadcasted return Keccak-256 hash of (this,_requestData, _payeesP...
function getRequestHash( bytes _requestData, address[] _payeesPaymentAddress, uint256 _expirationDate) internal view returns(bytes32) { return keccak256(this,_requestData, _payeesPaymentAddress, _expirationDate); }
6,189,777
pragma solidity ^0.4.18; // solhint-disable-line /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete) contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf...
Allow pre-approved user to take ownership of a token _tokenId The ID of the Token that can be transferred if this call succeeds. Required for ERC-721 compliance. Safety check to prevent against an unexpected 0x0 default. Making sure transfer is approved
function takeOwnership(uint256 _tokenId) public { address newOwner = msg.sender; address oldOwner = carIndexToOwner[_tokenId]; require(_addressNotNull(newOwner)); require(_approved(newOwner, _tokenId)); _transfer(oldOwner, newOwner, _tokenId); }
6,857,277
./partial_match/1/0xc5920c99d09E5444C079C01F06763b5d6AB09CbB/sources/src/interfaces/ITinyMevEth.sol
TinyMevEth smol interface for interacting with MevEth
interface ITinyMevEth { function grantRewards() external payable; function grantValidatorWithdraw() external payable; }
16,164,863
./partial_match/1/0x82895fE2945A8B19c5E511E5AA90Da3Aa27331eA/sources/CCPCyborgs.sol
Approve `operator` to operate on all of `owner` tokens Emits an {ApprovalForAll} event. Requirements: - `operator` cannot be the zero address./
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC1155InvalidOperator(address(0)); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } ...
2,700,759
pragma solidity ^0.4.11; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexe...
Overrides the burn function so that it cannot be called until after transfers have been enabled./
function burn(uint256 _value) public { require(transferEnabled || msg.sender == owner); super.burn(_value); emit Transfer(msg.sender, address(0x0), _value); }
12,042,544
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IER...
Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around in the collection over time./
function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { unchecked { for (uint256 curr = tokenId; curr >= 0; curr--) { TokenOwnership memory ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return...
14,482,768
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/governance/TimelockController.sol"; /** * @title Storage * @dev Store & retrieve value in a variable */ contract Storage is TimelockController, Ownable { constructor( ...
Store value in variable num value to store/
function store(uint256 num) public onlyOwner { number = num; }
15,834,994
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.5; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./IReserve.sol"; import "./whitelist.sol"; import "./safari-erc20.sol"; import "./isafari-erc721.sol"; import "./token-metadata.sol"; im...
after trait weights are changed this runs to update the ranges
function _updatePartTraitWeightRanges() internal { uint256 offset; TraitInfo storage traitInfo; uint256 i; uint256 j; for (i=0; i<partInfo.length; i++) { offset = 0; for (j=0; j<partTraitInfo[i].length; j++) { traitInfo = partTraitInfo...
1,304,109
pragma solidity ^0.5.0; import "ERC1155Adapter-flat.sol"; contract Ownable { address public owner; event OwnershipTransferred(address indexed previous_owner, address indexed new_owner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */...
Withdraw USDX && Tokens at current ratio to burn liquidity tokens. Burn liquidity tokens to withdraw USDX && Tokens at current ratio. token Address of Tokens withdrawn. amount Amount of liquidity burned. min_USDX Minium USDX withdrawn. min_tokens Minium Tokens withdrawn. deadline Time after which this transaction...
function removeLiquidity(address token, uint256 amount, uint256 min_USDX, uint256 min_tokens, uint256 deadline) public returns (uint256, uint256) { require(amount > 0 && deadline >= block.timestamp && min_USDX > 0 && min_tokens > 0); uint256 total_liquidity = totalSupply[uint256(token)]; req...
13,107,046
// File: node_modules\openzeppelin-solidity\contracts\ownership\Ownable.sol pragma solidity ^0.5.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inhe...
LAND can be assigned by the owner After one year, LAND can be claimed from an inactive public key LAND-centric getters Transfer LAND Update LANDoperators Events
interface ILANDRegistry { function assignNewParcel(int x, int y, address beneficiary) external; function assignMultipleParcels(int[] calldata x, int[] calldata y, address beneficiary) external; function ping() external; function encodeTokenId(int x, int y) external pure returns (uint256); function decodeTo...
1,771,268
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } functi...
Internal transfer, only can be called by this contract /
function _transfer(address _from, address _to, uint _value) internal { emit Transfer(_from, _to, _value); }
15,854,758
./full_match/1/0x5E16CA75000fb2B9d7B1184Fa24fF5D938a345Ef/sources/src/Scribe.sol
@inheritdoc IScribe
function setBar(uint8 bar_) external auth { _setBar(bar_); }
17,126,926
pragma solidity >=0.6.0; import "./Ownable.sol"; import "./Item.sol"; /* Title: Supply Chain Descritopn: Create items and track their status in the supply chain. Each item created is given a seperate address that allows for easy user purchases. */ contract ItemManager is Ownable { //check state ...
only owner is allowed to trigger item delivered after payment has been made.
function triggerDelivery(uint _itemIndex) public onlyOwner { require(items[_itemIndex]._state == SupplyChainState.Created, "Item is further in the chain"); items[_itemIndex]._state = SupplyChainState.Paid; }
12,724,768
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; interface IUniswap { // To convert DAI to ETH function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); // To convert ETH to YELD and burn it function s...
Quick swap low gas method for pool swaps Yeld Yeld Calculate pool shares
function deposit(uint256 _amount) external nonReentrant { require(_amount > 0, "deposit must be greater than 0"); pool = _calcPoolValueInToken(); IERC20(token).safeTransferFrom(msg.sender, address(this), _amount); if (getGeneratedYelds() > 0) extractYELDEarningsWhileKeepingDepo...
6,847,753
pragma solidity ^0.4.21; // File: contracts/Oracle/DSAuth.sol contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner);...
Returns product if no overflow occurred a First factor b Second factor return Product
function mul(uint a, uint b) public pure returns (uint) { require(safeToMul(a, b)); return a * b; }
7,683,284
contract A { bytes8[] stuff; function get() constant returns(bytes8[]) { return stuff; } } contract B { A a; bytes8[] mystuff; function assign(address _a) { a = A(_a); } function copyToMemory() { // VM does not support variably-sized return types from external function calls // (ERRO...
VM does not support variably-sized return types from external function calls (ERROR: Type inaccessible dynamic type is not implicitly convertible...)
function copyToMemory() { bytes8[] memory stuff = a.get(); }
1,003,436
./partial_match/1/0xaECcDed03fa3b4Ed75Eb81F78EA3e4A8825d5810/sources/YODA.sol
uint pointFiveSupply = (_tTotal 5 / 1000) / (10_decimals); require(maxTX_EXACT >= pointFiveSupply && maxWallet_EXACT >= pointFiveSupply, "Invalid Settings");
function owner_setMaxLimits() public onlyOwner{ maxTransAmount = _tTotal; maxWalletSize = _tTotal; }
9,266,221
// SPDX-License-Identifier: MIT //TokenFarm contract allows users to stake and unstake ACCEPTED tokens only. //They will receiove Dapp token as incentive for staking //Users can unstake their tokens and the contract will keep track of the value of each token staked. //Uses Chainlink Aggregator, pricefeed to get value ...
we want to return teh total value to get getUserTotalValue numberwe need the value of a single token out of the list of allowed tokens this user may have deposited
function getUserTotalValue(address _user) public view returns (uint256) { uint256 totalValue = 0; require(uniqueTokensStaked[_user] > 0, "No tokens staked!"); for ( uint256 allowedTokensIndex = 0; allowedTokensIndex < allowedTokens.length; allowedTokensInd...
12,600,151
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // NFT contract to inherit from. import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; // Helper functions OpenZeppelin provides. import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "hardhat/consol...
Get the tokenId of the user's character NFT If the user has a tokenId in the map, return their character.
function checkIfUserHasNFT() public view returns (Gameplay.Character memory) { uint256 userNftTokenId = nftHolders[msg.sender]; if (userNftTokenId > 0) { return nftHolderCharacters[userNftTokenId]; } else { revert("No characters found!!"); } }
12,664,907
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "../../token/ERC20/IERC20.sol"; import "../../token/ERC721/IERC721.sol"; import "../../token/ERC1155/IERC1155.sol"; import "../../access/Ownable.sol"; import "../../utils/Address.sol"; import "../../security/Pausable.sol"...
Transfer assets locked in the highest bid to the recipient erc20Address - if we are working with ERC20 token or native asset amount - bid value to be distributed recipient - where we will send the bid settleOrReturnFee - when true, fee is send to the auction recipient, otherwise returned to the owner/
function _transferAssets(address erc20Address, uint256 amount, address recipient, bool settleOrReturnFee) internal { if (erc20Address != address(0)) { IERC20(erc20Address).transfer(recipient, amount); if (settleOrReturnFee) { IERC20(erc20Address).transfer(_auctionFeeR...
12,852,831
pragma solidity ^0.4.21; // File: contracts/Oracle/DSAuth.sol contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner);...
constructor of the contract _priceFeedSource address of price Feed Source -> should be maker feeds Medianizer contract
function PriceOracleInterface( address _owner, address _priceFeedSource ) public { owner = _owner; priceFeedSource = _priceFeedSource; }
1,725,035
./full_match/43114/0x27f8F2c58132958224222F81EbAe399D1Fa8436A/sources/contracts/1_Storage.sol
LendingPoolAddressesProvider contract Main registry of addresses part of or connected to the protocol, including permissioned roles - Acting also as factory of proxies and admin of those, so with right to change its implementations - Owned by the Aave Governance Aave/
interface ILendingPoolAddressesProvider { event LendingPoolUpdated(address indexed newAddress); event ConfigurationAdminUpdated(address indexed newAddress); event EmergencyAdminUpdated(address indexed newAddress); event LendingPoolConfiguratorUpdated(address indexed newAddress); event LendingPoolC...
4,623,695
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./TokenTimelockProxy.sol"; /** * @dev DAO Voting contract */ contract Voting { // The contract used for votes weights address public _tokenTimelocks; // The number of votes quantity able to validate a proposal uint256 public _minQuoru...
return true if account voted for suggestionID in proposalID/
function hasVotedFor( address account, uint256 proposalID, uint256 suggestionID ) public view suggestionExists(proposalID, suggestionID) returns (bool) { return _proposals[proposalID].votes[account].suggestionID == suggestionID; }
7,268,237
// SPDX-License-Identifier: MIT pragma solidity >0.6.0; import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; /** @title Token abstract. */ contract Token { function transfer(address _to, uint256 _value) public returns (bool success) {} function balanceOf(address account) public view returns (uint256){}...
the functions below should be removed. They are added for debugging purpose
function withdrawToken(address _token, address _to, uint256 _value) external onlyOwner returns (bool success){ Token(_token).transfer(_to, _value); return true; }
12,955,896
// SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/access/IAccessControl.sol pragma solidity ^0.8.0; interface IAccessControl { event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); event RoleGranted(bytes32 indexed role, address indexed a...
update: weight (maat)
function updateWeights(uint _weight, uint _totalWeight) external obey(maat) { require(weight != _weight || totalWeight != _totalWeight, 'must be at least one new value'); require(_totalWeight >= _weight, 'weight cannot exceed totalWeight'); weight = _weight; totalWeight = _tota...
957,142
./full_match/1/0x15480f5B5ED98A94e1d36b52Dd20e9a35453A38e/sources/contracts/plugins/assets/RTokenAsset.sol
Can revert, used by other contract functions in order to catch errors This method for calculating the price can provide a 2x larger range than the average oracleError of the RToken's backing collateral. This only occurs when there is less RSR overcollateralization in % terms than the average (weighted) oracleError...
function tryPrice(bool useLotPrice) external view virtual returns (uint192 low, uint192 high) { (uint192 lowBUPrice, uint192 highBUPrice) = useLotPrice ? basketHandler.lotPrice() require(lowBUPrice != 0 && highBUPrice != FIX_MAX, "invalid price"); uint192 supply = _safeWrap(IRTo...
4,999,898
/** *Submitted for verification at Etherscan.io on 2021-07-08 */ // SPDX-License-Identifier: NONE pragma solidity 0.8.3; // Part: Address library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which th...
collect bonus token dust to treasury token address(0) = ETH bonus token
function collectDust( address _token, address _lpToken, uint256 _poolBonusId ) external override onlyOwner { require( pools[_token].lastUpdatedAt == 0, "BonusRewards: lpToken, not allowed" ); if (_token == address(0)) { payable...
8,004,442
./full_match/1/0xcD2609a25407ce8B1bDc31038Fb0B86637cB2063/sources/contracts/assetToken/AssetToken.sol
Sets the verification link _kya value to be set
function setKya(string calldata _kya) external { checkAccessToFunction(ONLY_ISSUER_OR_GUARDIAN | UNFREEZED_CONTRACT); require(bytes(_kya).length > 3, "SKY Err KYA"); emit KyaChanged(_kya, _msgSender()); kya = _kya; }
3,064,694
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* Fully commented standard ERC721 Distilled from OpenZeppelin Docs Base for Building ERC721 by Martin McConnell All the utility without the fluff. */ interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (boo...
See {IERC721-isApprovedForAll}./
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; }
153,395
./full_match/1/0x28e12d5079D48BB0a8A20F6F2E6f6d4daA786120/sources/contracts/BlueSubs.sol
Add an subscriber discordUserId The discord user id that will be added version The version the user will subscribe too month The amount of month for the subscription plan/
function forceSubscriber(string calldata discordUserId, Version version, uint8 month) external { _enforceAdmin(); _subscribers[discordUserId].discord_id = discordUserId; _subscribers[discordUserId].date_of_purchase = block.timestamp; _subscribers[discordUserId].month = month; ...
3,068,976
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@...
Initializes the contract setting the deployer as the initial owner./
function _beforeTokenTransfer( address from, address to, uint256 tokenId } pragma solidity ^0.8.0; } pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; } pragma solidity ^0.8.0; import "./IERC165.sol"; } pragma solidity ^0.8.0; import "../utils/introspectio...
6,931,783
// SPDX-License-Identifier: MIT // Further information: https://eips.ethereum.org/EIPS/eip-1014 pragma solidity ^0.8.9; import '@openzeppelin/contracts/utils/Create2.sol'; import '@openzeppelin/contracts/utils/introspection/ERC1820Implementer.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzep...
Returns the address where a contract will be stored if deployed via {deploy}. Any change in the `bytecodeHash` or `salt` will result in a new destination address./
function computeAddress(bytes32 salt, bytes32 codeHash) public view returns (address) { return Create2.computeAddress(salt, codeHash); }
12,643,243
./full_match/1/0x4E67DfF29304075A383D877F0BA760b94FE38803/sources/contracts/oracle/Oracle.sol
Verify Merkle proof (that the leaf belongs to the tree) _proof Merkle proof (the leaf's sibling, and each non-leaf hash that could not otherwise be calculated without additional leaf nodes) _feeDistributorInstance feeDistributor instance address _amountInGwei total CL rewards earned by all validators in GWei (see _v...
function verify( bytes32[] calldata _proof, address _feeDistributorInstance, uint256 _amountInGwei ) external view { bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(_feeDistributorInstance, _amountInGwei)))); if (!MerkleProof.verify(_proof, s_root, leaf)) { ...
4,823,475
./full_match/5/0x94571FA1995B3052302fd027CC7a3ABAca1Ab358/sources/browser/WXMR.sol
Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRe...
function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: only for self"); _revokeRole(role, account); }
1,904,828
./partial_match/3/0x1B0E0eCa53FB8EbFcBc6071d081961A37628Ca83/sources/Betting.sol
get total amount received for option 1 for a bet. _betId./
function getBetTotalOptions1(uint256 _betId) public view returns(uint256) { return bets_total_option1[_betId]; }
5,189,663
pragma solidity ^0.4.24; contract Ballot{ // This struct represent a single voter struct Voter { // delegate means assign someone you trust to do the voting for you uint weight; // this is accumulated by delegation bool is_voted; // check if this person is voted or not address d...
Give voter the right to voter Can only be called by the chairperson If the first argument of `require` evaluates to `false`, execution terminates and all changes to the state and to Ether balances are reverted. This used to consume all gas in old EVM versions, but not anymore. explanation about what went wrong. This pe...
function giveRightToVote(address voter) public{ require( msg.sender == chairperson, "Only chairperson can give right to vote." ); require( !voters[voter].is_voted, "This person already voted." ); require(voters[voter].weight == ...
12,603,723
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <=0.8.9; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppe...
Move `tokenToSwapWithNative` token amount from caller to contract address Requirements: - amount should be greater than 0. return A boolean value indicating whether the operation succeeded. Emits a {DepositedTokenToNative} event./ transfer token to contract address
function depositTokenToNative(uint256 amount) external nonReentrant whenNotPaused returns(bool) { require(amount > 0, "Bridge: Amount cant be zero or negative numbers"); IERC20Upgradeable(tokenToSwapWithNative).safeTransferFrom(msg.sender, address(this), amount); emit DepositedTokenToNative(tokenToS...
535,640
pragma solidity ^0.6; import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol"; contract FlightSuretyApp { using SafeMath for uint256; /********************************************************************************************/ /* DATA VARIABLES ...
MSJ: For insured passenger to get their balance
function getPassengerFunds() public payable requireIsOperational returns(uint) { return flightSuretyData.getPassengerFunds(msg.sender); } struct Oracle
15,849,177
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '../Arth/IIncentive.sol'; /** * @title A Uniswap Router for tokens involving ARTH. * @author Original code written by FEI Protocol. Code modified by MahaDAO. */ interface IUniswapSwapRouter { function buyARTHForETH( uint256 minReward, ...
A Uniswap Router for tokens involving ARTH. Original code written by FEI Protocol. Code modified by MahaDAO./
interface IUniswapSwapRouter { function buyARTHForETH( uint256 minReward, uint256 amountOutMin, address to, uint256 deadline ) external payable returns (uint256 amountOut); function buyARTHForERC20( address token, uint256 amountIn, uint256 minReward, ...
5,418,608
//Address: 0xf2e5623ecbf7ca0aa59951c3c114153f96731632 //Contract name: StockBetToken //Balance: 0 Ether //Verification Date: 10/23/2017 //Transacion Count: 0 // CODE STARTS HERE pragma solidity ^0.4.17; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control...
Function to stop minting new tokens. return True if the operation was successful./
function finishMinting() public onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; }
1,821,523
pragma solidity ^0.5.11; pragma experimental ABIEncoderV2; import "./Utils/Ownable.sol"; import "./Utils/provableAPI.sol"; /** @dev DecentracraftItem */ contract DecentracraftItem is Ownable, usingProvable { string public IPFSUploaderHash; mapping(bytes32=>uint256) validIds; event LogConstructorInit...
Emergency function to manually add json hash in case it wasn't handled correctly by provable
function setDCIJSONHash(uint256 _id, string memory _jsonHash) public ownerOnly{ string memory json_hash = _jsonHash; dcItems[_id].attributesStorageHash = json_hash; }
6,379,022
// SPDX-License-Identifier: MIT pragma solidity ^0.7.4; pragma experimental ABIEncoderV2; import "./tokens/erc20permit-upgradeable/ERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts-upgradeabl...
use with countPositions()
function listPositions(uint256 offset, uint256 limit) public view override returns (address[] memory _positionControllersArr) { uint256 to = (offset.add(limit)).min(_positionControllers.length()).max(offset); _positionControllersArr = new address[](to - offset); ...
14,927,149
./full_match/80001/0xF8a9362bA0f4F61D7a32D1e2e32113228Cf938cB/sources/StakingContract.sol
Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], but performing a static call. _Available since v3.3._/
function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget( target, ...
835,703
./partial_match/1/0x6CAb8c54B510bcF4ed027A9d4dfD771D7Fb4806C/sources/contracts/BaseJumpRateModelV2.sol
Update the parameters of the interest rate model (only callable by owner, i.e. Timelock) baseRatePerYear The approximate target base APR, as a mantissa (scaled by BASE) multiplierPerYear The rate of increase in interest rate wrt utilization (scaled by BASE) jumpMultiplierPerYear The multiplierPerBlock after hitting ...
function updateJumpRateModel( uint256 baseRatePerYear, uint256 multiplierPerYear, uint256 jumpMultiplierPerYear, uint256 kink_ ) external virtual { require(msg.sender == owner, "only the owner may call this function."); updateJumpRateModelInternal(baseRatePerYear, multiplierPerYear, jumpMul...
2,792,500
pragma solidity ^0.5.16; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./SafeDecimalMath.sol"; import "./MixinResolver.sol"; import "./IssuanceEternalStorage.sol"; import "./interfaces/ISynthetix.sol"; import "./interfaces/IFeePool.sol"; import "./interfaces/ISynthetixState.sol"; import "./interf...
Get the timestamp of the last issue this account made account account to check the last issue this account made return timestamp this account last issued synths/
function lastIssueEvent(address account) public view returns (uint) { return issuanceEternalStorage().getUIntValue(keccak256(abi.encodePacked(LAST_ISSUE_EVENT, account))); }
13,058,585
// SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.6.4 <0.8.0; pragma experimental ABIEncoderV2; import "https://github.com/vigilance91/solidarity/ERC/introspection/ERC165/frameworkERC165.sol"; import "https://github.com/vigilance91/solidarity/ERC/ERC173/ERC173Ownable.sol"; import "https://github.com/vigila...
like _safeTransferOwnership but exclusively transfers ownership of `ownable` contract address to this contract's owner, Requirements: this contract's owner must not be null, otherwise call _safeRenounceOwnership `ownable` must not already be this contract's owner
function safeTransferOwnershipToThisOwner( address ownable )external onlyOwner nonReentrant { _safeTransferOwnershipToThisOwner(ownable); }
5,544,755
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "../../token/ERC20/IERC20.sol"; import "../../token/ERC721/IERC721.sol"; import "../../token/ERC1155/IERC1155.sol"; import "../../access/Ownable.sol"; import "../../utils/Address.sol"; import "../../security/Pausable.sol"...
Create new auction of the NFT token in the marketplace. id - ID of the auction, must be unique isErc721 - whether the auction is for ERC721 or ERC1155 token nftAddress - address of the NFT token tokenId - ID of the NFT token amount - ERC1155 only, number of tokens to sold. erc20Address - address of the ERC20 toke...
function createAuction(string memory id, bool isErc721, address nftAddress, uint256 tokenId, address seller, uint256 amount, uint256 endedAt, address erc20Address) public whenNotPaused { require(_auctions[id].startedAt == 0, "Auction already existed for current auction Id"); require(endedAt ...
12,852,835
/* ORIGINAL: pragma solidity ^0.4.24; */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * Integ...
ORIGINAL: onlyOwner {
function destoryContract(address _recipient) external {
7,263,396
pragma solidity ^0.4.18; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure ret...
function exists(uint256 assetId) external view returns (bool);
interface IERC721Base { function totalSupply() external view returns (uint256); function ownerOf(uint256 assetId) external view returns (address); function balanceOf(address holder) external view returns (uint256); function safeTransferFrom(address from, address to, uint256 assetId) external; functi...
12,840,928
./partial_match/56/0x0B1F4088CA080807A0F089e1d24b37225a94c438/sources/CANDYChef.sol
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0 || pool.allocPoint == 0) { pool.lastRew...
11,199,507
./full_match/4/0x62c855fEa885f55046Db3719e7692CA15E78c61e/sources/TestNFT.sol
bytes32 salt, uint arg, Generate contract addresses via "new" statement
function createEvent ( string memory _eventName, string memory _eventDescription, string memory _eventDates, string memory _eventPlace, bool _eventStatus, string memory name, string memory symbol, string memory baseTokenURI) onlyOwner public { ...
739,406
//Address: 0xd9b784d5f61E60bdF0E8Cc03aeD488f612E957ad //Contract name: EnergyStore //Balance: 0 Ether //Verification Date: 5/8/2018 //Transacion Count: 283 // CODE STARTS HERE pragma solidity ^0.4.23; /// @title A contract that remembers its creator (owner). Part of the /// Lition Smart Contract. /// /// @au...
Allow the owner of the address `aconsumer.address()` to make transactions on behalf of user id `auserID`. Register address aconsumer to belong to userID auserID. Addresses can be delisted ("unregistered") by setting the userID auserID to zero.
function registerConsumer(address aconsumer, uint32 auserID) onlyOwner external { if (auserID != 0) { emit consumerRegistered(aconsumer); emit consumerDeregistered(aconsumer); } consumers[aconsumer] = auserID; }
12,884,886
pragma solidity ^0.4.25; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is c...
------------------------------------------------------------------------ Purchase _reverseAccessOfLimiter: Excess value. _aTokenPrice: Price For one token. _forAdvertising: Advertising victim. _forDividendes: Dividend sacrifice. _amountOfTokens: trx to tokens amount. _reverseAccess: Change remainder in trx....
function buy(address _referralAddress) public payable { uint256 _incomingtrxeum = msg.value; uint256 _forReferral; uint256 _reverseAccessOfLimiter; uint256 _aTokenPrice = tokenPrice(); uint256 _dividendesOwner = dividendesOf(msg.sender); uint256 _forAdvertising = _i...
6,489,001
pragma solidity ^0.8.0; import "../interface/IInterestBearingERC20.sol"; import "./ElasticSupplyERC20.sol"; /** * @title InterestBearingERC20 * @dev Interest Bearing ERC20 token * * @author Cyril Lapinte - <cyril.lapinte@openfiz.com> * SPDX-License-Identifier: MIT * * Error messages * IB01: Unable to predi...
Catch up from previous missing rebase (if needed) Update with the remaining interest of the current period
function defineInterest(uint256 _interestRate) external override onlyOwner returns (bool) { require(_interestRate != 0, "IB02"); uint256 currentTime_ = currentTime(); require(rebaseInterest(), "IB03"); uint256 latestElasticity = elasticityAt(currentTime_); if (latestElasticity != elasticity...
15,854,185
pragma solidity ^0.8.4; contract Sha3 { function hashArray() pure public returns(bytes32) { bytes8[] memory tickers = new bytes8[](4); tickers[0] = bytes8('BTC'); tickers[1] = bytes8('ETH'); tickers[2] = bytes8('LTC'); tickers[3] = bytes8('DOGE'); return keccak256(abi...
0x374c0504f79c1d5e6e4ded17d488802b5656bd1d96b16a568d6c324e1c04c37b
function hashArray() pure public returns(bytes32) { bytes8[] memory tickers = new bytes8[](4); tickers[0] = bytes8('BTC'); tickers[1] = bytes8('ETH'); tickers[2] = bytes8('LTC'); tickers[3] = bytes8('DOGE'); return keccak256(abi.encodePacked(tickers)); }
14,053,362
./full_match/3/0xc4B61Ba1289f5ebb44b464a71ce2326e996642dF/sources/browser/Treasury.sol
"0x2AF142784eD8f0ED17101bb091D58519560825e3","0xbc47151388E2248C073aaCa2F26a3D33FddA734e","0x9Be2Bb1f46c3fE215F7359DCCa45F2dd2EA11a65","0xa2AAe53531752161D30E314ad7D25FBaaC3E6e27"
function mintOrBurnOly(address _token, uint256 _totalSupply) public { uint TWAPWithZeros = lastTWAP.mul(1e18); updateTWAP(); if (TWAPWithZeros > getIV(_token)) { uint d = TWAPWithZeros - getIV(_token); uint s = d.mul(_totalSupply); uint z = s.mul(icv); ...
8,128,676
./full_match/42/0x9eAE547e8843399AFc15b4A676DE9155796b3cF5/sources/browser/MultiTokenAirdropper.sol
--------------------------------------------------------------------------------------------------------------------------
function airdrop(address _token, address[] calldata _recipients, uint256[] calldata _amounts) external { require(msg.sender == admin, ERR_MSG_SENDER); require(_recipients.length == _amounts.length, "ERR_ARRAYS_LENGTHS_DONT_MATCH"); for(uint32 i = 0; i < _recipients.length; ++i) ...
9,598,347
./partial_match/42/0x088488b76Ad0c2710dEaB7c84B99b6576888A128/sources/SystemSettings.sol
set next overnight fee time _exchange exchange address/ in order to prevent multiple funding settlement during very short time after network congestion floor((nextFundingTime + fundingPeriod) / 3600) 3600 max(nextFundingTimeOnHourStart, minNextValidFundingTime)
function setNextOvernightFeeTime(IExchange _exchange) override public onlyCFD { require(_blockTimestamp() >= exchangeMap[address(_exchange)]._nextOvernightFeeTimeMap, "pay overnight fee too early"); uint256 fundingPeriod = _overnightFeePeriod; uint256 fundingBufferPeriod = fundingPeriod.div...
3,420,668
./full_match/1/0x288f4ad8723f297b584a1643B99b17F73B896B6a/sources/contracts/ethregistrar/NNSRegistrarControllerWithReservation.sol
Require a valid commitment If the commitment is too old, or the name is registered, stop
function _consumeCommitment(string memory name, bytes32 commitment) internal returns (uint256) { require(commitments[commitment] + minCommitmentAge <= block.timestamp); require(commitments[commitment] + maxCommitmentAge > block.timestamp); require(available(name)); require(!reserved...
9,798,753
./full_match/8453/0xE4AD80eD0c7d12A8B687c6C987d07f1D486fEd85/sources/src/royalty/ABRoyalty.sol
Distribute `_amount` of royalty for the given `_dropId` _dropId drop identifier _amount amount to be paid-out/ Calculate the amount to be distributed Distribute the token according to the calculated amount Emit event
function _distribute(uint256 _dropId, uint256 _amount) internal { (uint256 actualDistributionAmount,) = royaltyCurrency[_dropId].calculateDistribution(address(this), uint32(_dropId), _amount); royaltyCurrency[_dropId].distribute(uint32(_dropId), actualDistributionAmount); emit ...
11,535,363