file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./partial_match/1/0x7714520f383C998e8822E8743FD6f90A2979689b/sources/src/reactors/BaseReactor.sol
@inheritdoc IReactor
function execute(SignedOrder calldata order, IReactorCallback fillContract, bytes calldata fillData) external payable override nonReentrant { ResolvedOrder[] memory resolvedOrders = new ResolvedOrder[](1); resolvedOrders[0] = resolve(order); _fill(resolve...
15,960,426
./partial_match/1/0xF2EE1C3A3151a4a9537a944f46e7A667b4DE4Fb3/sources/TrueFiPool.sol
Join the pool by depositing currency tokens amount amount of currency token to deposit/ first staker mints same amount deposited
function join(uint256 amount) external override { uint256 fee = amount.mul(joiningFee).div(10000); uint256 amountToDeposit = amount.sub(fee); uint256 amountToMint = amountToDeposit; if (totalSupply() > 0) { amountToMint = totalSupply().mul(amountToDeposit).div(poolValue(...
15,635,520
./partial_match/1/0xcD4d1EDd282F992Ec78fdEcAD3f3f758bac1d594/sources/jungleofcrypto.sol
exclude from paying fees or having max transaction amount
constructor() ERC20(unicode"Jungle Of Crypto", unicode"🐊 🦧 🐳 🐞 🐵 🐍 🦍 🐛 🦒 🕊 🐋 🦎 🦋 🦄 🐝 🦜 🐆 🦀 🐉") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2R...
9,229,940
pragma solidity ^0.4.18; import './MarketLend.sol'; /** * @title MarketBorrow * @dev Contract containing business logic pertaining to borrowers within a market */ contract MarketBorrow is MarketLend { /*** EVENTS ***/ /** * @dev Triggered when a borrower enters market and requests a loan */ event L...
Retrieves the amount (in Wei) that a borrower has requested to loan from the market. Called before Request Period is complete./
function getBorrowerRequest(uint _marketId, address _address) public view returns (uint) { return markets[_marketId].borrowerRequests[_address]; }
5,504,154
./full_match/42/0xA59195b0b7F7137CAe79383c428A6d7Af25F8229/sources/CryptoRockSpawner.sol
Indicates the Wyvern schema name for assets in this factory, e.g. "ERC1155"/
function factorySchemaName() external pure override returns (string memory) { return "ERC1155"; }
9,566,942
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./tools/ERC721.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interf...
We check there is enough supply left Add the address to the list if it's not in there yet
function preMintFor(address addr, uint256 amount) public payable whenNotPaused { require(amount > 0 && amount <= 50, "Wrong amount"); require(supplyLeftToPremint > 0, "No supply left"); amount = amount > supplyLeftToPremint ? supplyLeftToPremint : amount; ...
11,690,859
pragma solidity ^0.4.25; contract IVoteHistory { function WhoDidThePlayerVote(IPlayer player) public returns(IPlayer); } contract IParticipatable { function GetParticipants() public returns(IPlayer[] memory); function EnableParticipant(IPlayer player) public ; function DisableParticipant(IPlayer player) public...
havent realized ChatMessage
function GetAllMessages() public returns(ChatMessage[]);
6,449,225
// SPDX-License-Identifier: MIT pragma solidity =0.8.4; import {Ownable} from "openzeppelin/contracts/access/Ownable.sol"; import {ConfigContract} from "./ConfigContract.sol"; import {BatcherContract, BatchConfig, TransactionType} from "./BatcherContract.sol"; import {DepositContract} from "./DepositContract.sol"; s...
Users may still submit transactions
function skipEmptyOrTimedOutBatches(uint64 maxBatches) public { uint64 halfSteps = numExecutionHalfSteps; uint64 batchIndex = halfSteps / 2; while (maxBatches > 0) { if (halfSteps % 2 == 0) { uint64 configIndex = configContract.configIndexForBatchIndex( ...
12,849,442
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import "ds-test/test.sol"; import { MockERC20 } from "./mocks/MockERC20.sol"; import { MockERC721 } from "./mocks/MockERC721.sol"; import { AuctionFactory } from "../AuctionFactory.sol"; contract AuctionFactoryTest is DSTest { MockERC20 bidToken; MockER...
Mint test tokens Approve the Auction asset on the factory
function setUp() public { bidToken = new MockERC20(); auctionAsset = new MockERC721(); factory = new AuctionFactory(); bidToken.mint(address(this), 1e22); auctionAsset.mint(address(this), 0); auctionAsset.approve(address(factory), 0); }
12,962,883
./full_match/43114/0x57Dc3DFB48252daA731e70f9166252F8cc1B116f/sources/flat.sol
approve token transfer to cover all possible scenarios add the liquidity
function addLiquidity(uint256 tokenAmount, uint256 avaxAmount) private { _approve(address(this), address(uniswapV2Router), tokenAmount); address(this), tokenAmount, address(0), block.timestamp ); }
4,605,812
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(ad...
File: contracts/interfaces/ICToken.sol
interface ICToken { function mint(uint256 mintAmount) external returns (uint256); function redeemUnderlying(uint256 redeemAmount) external returns (uint256); function balanceOf(address account) external view returns (uint256); function balanceOfUnderlying(address account) external view returns (uint256)...
1,093,424
//SPDX-License-Identifier: Unlicense pragma solidity 0.6.11; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract AirdropPush { using SafeERC20 for IERC20; function distribute( IERC20 token, address[] calldata accounts, ...
Returns true if a `leaf` can be proved to be a part of a Merkle tree defined by `root`. For this, a `proof` must be provided, containing sibling hashes on the branch from the leaf to the root of the tree. Each pair of leaves and each pair of pre-images are assumed to be sorted./ Hash(current computed hash + current ele...
function configureWhitelist(WhitelistSettings calldata settings) external; function currentStage() external returns (STAGES stage); function deposit(TokenData calldata tokenData, bytes32[] memory proof) external payable; function totalValue() external view returns (uint256 value); function getMa...
6,211,275
./partial_match/1/0xc92ec84423db017ee76354b786ac9C60beA35379/sources/UmbrellaMetaPool.sol
Given an amount of payTokens, update balance, shares, and reserves
function enter(uint128 underlying) internal { providers[msg.sender].lastProvide = safe32(block.timestamp); uint128 res = reserves; uint128 ts = totalShares; if (ts == 0 || res == 0) { providers[msg.sender].shares = safe128(uint256(providers[msg.sender].shares)...
15,513,054
./full_match/4/0xC64525B1a123138fEC2eCb0c6b61f02a0a93e5e6/sources/browser/Untitled.sol
function manualWithdrawEther() external returns (bool);
{ function acceptOwnership() external returns (address); function initialize() external; function setInternalWalletAddress(bytes32 _forWalletName, address _walletAddress) external returns (bool); function transferByMetricPlan(address _interWalletAddress, address to, uint256 amount) external returns (boo...
12,460,064
./partial_match/1/0x88597998Df22Fc449Cb0ba4DA01c611302df35CC/sources/SaffronERC20StakingPool.sol
LP user adds liquidity to the pool Pre-requisite (front-end): have user approve transfer on front-end to base asset using our contract address Calculate the dsec for deposited base_asset tokens Update pool principal eternal and epoch state Update dsec and principal balance state Transfer base_asset tokens from LP to po...
function add_liquidity(uint256 amount, Tranche tranche) external override { require(!_shutdown, "pool shutdown"); require(tranche == Tranche.S, "ERC20 pool has no tranches"); uint256 epoch = get_current_epoch(); require(amount != 0, "can't add 0"); require(epoch == 4, "v1.4: must be epoch 4 only")...
2,862,331
pragma solidity 0.4.24; pragma experimental ABIEncoderV2; //Truffle Imports import "@chainlink/contracts/src/v0.4/ChainlinkClient.sol"; import "@chainlink/contracts/src/v0.4/vendor/Ownable.sol"; import "@chainlink/contracts/src/v0.4/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.4/interfaces/A...
Get address of vehicle renter/
function getVehicleRenter() public view returns (address) { return renter; }
2,512,075
pragma solidity ^0.5.10; pragma experimental ABIEncoderV2; import {FTSU} from "./FairThunder_Stream_Utility.sol"; // Abstract 'FairThunderStreamingPessimistic' contract contract FairThunderStreamingPessimistic { function validatePoM(uint, bytes32[] memory, bytes memory, bytes32, bytes memory, bytes32, FTSU.Merkle...
Resolve dispute during the streaming, and then if indeed misbehavior is detected, the state will be set as "received" if the provider P indeed misbehaves, e.g., revealed a wrong key
function PoM(uint _i, bytes32[] memory _c_i, bytes memory _signature_c_i, bytes32 _k_i, bytes memory _signature_k_i, bytes32 _m_i_hash, FTSU.MerkleProof[] memory _merkle_proof) public payable { require(now < timeout_receive); require(round == state.initiated); if (FTSP.validatePoM(_i, _c_i, ...
5,454,431
./partial_match/42/0x9b0B75202cc30749448D0a10742e523601D22Cd3/sources/HTTokenOrbiterBank.sol
Request for a loan. User requests for a loan. _amount Loan amount. _tariffId Tariff id for Loan./
function requestLoan(uint256 _amount, uint256 _tariffId) external { require(loanAvailable,"Loans Unavailable"); if(!userInfo[msg.sender].acc_status) { userInfo[msg.sender].acc_status = true; userAddress.push(msg.sender); } uint256 _loanId = ...
8,934,720
./full_match/1/0xE208eF4b9E7b72baA67d0b132D97aB9F97a38067/sources/contracts/DeployFee.sol
called by TokenFactory, charge the deploy fee to the user tokenAddress selected token address to pay the fee, if its != deployFirstToken || deployFeeSecondToken will charge with the blockchain token/
function chargeDeployFee(address tokenAddress) internal { if (isPaymentToken[tokenAddress]) { tokenChargeDeployFeeInternal(IERC20Metadata(tokenAddress)); cryptoChargeDeployFeeInternal(); } }
8,493,941
pragma solidity ^0.4.20; /* So much wow! get moniez */ contract DOGE { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // ...
Transfer tokens from the caller to a new holder. Remember, there&39;s a 10% fee here as well./ setup make sure we have the requested tokens also disables transfers until ambassador phase is over ( we dont want whale premines ) withdraw all outstanding dividends first liquify 10% of the tokens that are transfered these ...
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { address _customerAddress = msg.sender; require( _amountOfTokens <= tokenBalanceLedger_[_customerAddress]); if(myDividends(true) > 0) withdraw()...
2,028,751
./full_match/5/0x443B523d2994762FDC76043EDD194314f60641cC/sources/contracts/ImmutableInclusionVerifier.sol
Efficient keccak256 Adapted from OpenZeppelin Contracts a arbitrary bytes32 b arbitrary bytes32 return value keccak256(abi.encodePacked(a, b)) @solidity memory-safe-assembly
function efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } }
7,063,447
./full_match/80001/0x0aCca12ade732F5Dc6afbad42ad1Eb5F0163e663/sources/contracts/dev/functions/FunctionsOracle.sol
@inheritdoc FunctionsOracleInterface/
function sendRequest( uint64 subscriptionId, bytes calldata data, uint32 gasLimit ) external override registryIsSet validateAuthorizedSender returns (bytes32) { if (data.length == 0) { revert EmptyRequestData(); } bytes32 requestId = s_registry.startBilling( data, Functions...
5,561,755
./full_match/44787/0xc775B47E2C1D6b8826AC0453a6d9f0aC452267C2/sources/project_/contracts/KolorLandToken.sol
increase number of holders set approval for dev or other operator
function newInvestment( address investor, uint256 tokenId, uint256 amount ) public onlyAuthorized { require(exists(tokenId), "KolorLandToken: land must exists!"); require( availableTokensOf(tokenId) >= amount, "KolorLandToken: exceeds max amount" ...
13,241,407
./partial_match/42/0x3e5D4cfF916f55a59761Cf4D4141fe5680ACc2E3/sources/Issuer.sol
Ensure waitingPeriod and pUSD balance is settled as burning impacts the size of debt pool Check account is liquidation open require liquidator has enough pUSD What is their debt in pUSD? Cap amount to liquidate to repair collateral ratio based on issuance ratio what's the equivalent amount of peri for the amountToLiqui...
function liquidateDelinquentAccount( address account, uint susdAmount, address liquidator ) external onlyPynthetix returns (uint totalRedeemed, uint amountToLiquidate) { require(!exchanger().hasWaitingPeriodOrSettlementOwing(liquidator, pUSD), "pUSD needs to be settled"); ...
3,402,900
pragma solidity ^0.4.11; // **----------------------------------------------- // Betstreak Token sale contract // Revision 1.1 // Refunds integrated, full test suite passed // **----------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/issues/20 // -------...
any contributor can call this to have their Eth returned. user&39;s purchased BST tokens are burned prior refund of Eth.require minCap not reachedburn user&39;s token BST token balance, refund Eth sentsend Eth back, burn tokens
function refund() { require ((amountRaisedInWei < fundingMinCapInWei) && (isCrowdSaleClosed) && (block.number > fundingEndBlock) && (fundValue[msg.sender] > 0)); uint256 ethRefund = fundValue[msg.sender]; balancesArray[msg.sender] = 0; fundValue[msg.send...
2,378,000
./full_match/1/0xEdf2818C44C0CAD3B719Bb31c52630AEe967E0B5/sources/AutoLiquidity.sol
at work liquidity asset This function calculates liquidity asset return liquidity asset
function liquidityAssets() public view returns (uint256){ uint256 total; address ioTokenAddr=address(ioToken); uint256 length = works.length(); for (uint256 i = 0; i < length; i++) { uint256 tokenId = works.at(i); total = total.add(caclLiquidityAssets(tokenId,...
9,606,457
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/exte...
Vitalik.eth or the multisig can claim this If its already been claimed
function claimFirstBat() public { if (!(msg.sender == 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 || msg.sender == MULTISIG)) { return; } if (ownerOf(1) != address(this)) { return; } _transfer(address(this), msg.sender, 1); }
5,972,235
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; // Imports import "../client/node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "../client/node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "../client/node_modules/@openzeppeli...
======================================== Function: Check if aircraft part exists by ID ========================================
function checkPartIdExist(uint256 partId) public view returns (bool){ return _exists(partId); }
5,525,818
./partial_match/1/0x46C9CFB32627B74F91e0B5ad575c247AEc7e7847/sources/contracts/NftfiBundler.sol
Internal function to add a set of BundleElementERC721 objects to the specified token ID. _tokenId The ID of the token to add the bundle elements to. _bundleElements The array of BundleElementERC721 objects to add./
function _addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal { require(_bundleElements.length > 0, "bundle is empty"); uint256 elementNumber = _bundleElements.length; for (uint256 i; i != elementNumber; ++i) { require(permittedAsset(_bundle...
9,403,858
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/co...
Obtains the address that will be assigned to a new GuildApp contract _salt salt used for deploying the contract return predicted contract address
function predictDeterministicAddress(bytes32 _salt) public view returns (address predicted) { return template.predictDeterministicAddress(_salt); }
15,782,667
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/mat...
Returns block.number, overridable for test purposes.
function _getCurrentBlock() virtual internal view returns (uint256) { return block.number; }
14,072,097
pragma solidity 0.4.25; import "../common/Owned.sol"; import "../common/IERC20.sol"; // Havven is effectively just used as an IERC20 here contract Havven is IERC20 { } // Uses very old version of LimitedSetup contract LimitedSetup { uint constructionTime; uint setupDuration; function LimitedSetup(uin...
Obtain the quantity which the next schedule entry will vest for a given user. /
function getNextVestingQuantity(address account) external view returns (uint) { uint index = getNextVestingIndex(account); if (index == numVestingEntries(account)) { return 0; } return getVestingQuantity(account, index); }
2,574,032
./full_match/10200/0x5f02ad4d2E99172bd3414893fAeE05a208e2eA5D/sources/lib/MultiToken/src/interfaces/ICryptoKitties.sol
Required methods Optional Events ERC-165 Compatibility (https:github.com/ethereum/EIPs/issues/165) Is not part of the interface id
interface ICryptoKitties { function totalSupply() external view returns (uint256 total); function balanceOf(address _owner) external view returns (uint256 balance); function ownerOf(uint256 _tokenId) external view returns (address owner); function approve(address _to, uint256 _tokenId) external; fun...
3,784,885
./full_match/1/0x0F2e209F67C8900005f71a833c484221f965B33d/sources/contracts/LPStaking.sol
It withdraws all LP tokens
function withdraw() public nonReentrant { require( _lockedUntil[_msgSender()] < block.timestamp, "LPStaking: You need to wait for time lock to expire." ); require( balanceOf(_msgSender()) > 0, "LPStaking: You need to stake LP first." );...
9,656,308
./partial_match/56/0xc15bb35A1752A40BE9D5090e784A896074E1cd89/sources/JetfuelVenusVaultBNB.sol
Function to exit the system. The vault will withdraw the required tokens from the strategy and pay up the token holder. A proportional number of IOU tokens are burned in the process./
function withdraw(uint256 _shares) public { IVenusStrategy(strategy).updateBalance(); uint256 r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); uint256 b = wbnb.balanceOf(address(this)); if (b < r) { uint256 _withdraw = r.sub(b); ...
11,082,010
./full_match/80001/0xDE8beE8bd55E86c3407F439697C5A8BBCfE87BC0/sources/token/SOAS2.sol
Bulk allow original Address of the claimer. alloweds List of allowed address./
function allow(address original, address[] memory alloweds) external { if (claimInfo[original].from != msg.sender) revert InvalidMinter(); for (uint256 i; i < alloweds.length; i++) { _allow(original, alloweds[i]); } }
5,664,619
./full_match/4/0x8436267B8b0f3051641d4ec453307e94165991AB/sources/browser/1155-clone-factory.sol
_Available since v3.1._/
interface IERC1155Receiver is IERC165 { @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,ui...
807,552
pragma solidity ^0.4.20; import "./lib/ECVerify.sol"; /* * Interfaces */ /// @dev The contract as receiver must implement these functions contract ReceiverContract { /// @notice Called to get owner of the Contract /// @return Address of the owner function getOwner() public returns (address); } /// @title Tran...
Internal function to determine if an address is a contract _addr The address being queried return True if `_addr` is a contract
function isContract(address _addr) internal view returns (bool) { uint size; if (_addr == 0) return false; assembly { size := extcodesize(_addr) } return size>0; }
12,693,249
//Address: 0x904249766b2ccf6795d7b34441cc0bcae5cb7640 //Contract name: NectarController //Balance: 0 Ether //Verification Date: 2/13/2018 //Transacion Count: 1 // CODE STARTS HERE pragma solidity ^0.4.18; /* Copyright 2016, Jordi Baylina This program is free software: you can redistribute it and/or modify ...
Total amount of fees at a specific `_blockNumber`. _blockNumber The block number when the totalPledgedFees is queried return The total amount of pledged fees at `_blockNumber` These next few lines are used when the totalPledgedFees of the token is requested before a check point was ever created for this token, it re...
function totalPledgedFeesAt(uint _blockNumber) public constant returns(uint) { if ((totalPledgedFeesHistory.length == 0) || (totalPledgedFeesHistory[0].fromBlock > _blockNumber)) { if (address(parentToken) != 0) { return parentToken.totalPledgedFeesAt(min(_blockNumber, pa...
6,429,894
pragma solidity 0.4.21; // File: contracts/BytesDeserializer.sol /* * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net * * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt */ /* * Deserialize...
Extract Ethereum address worth of data from the bytes stream./
function sliceAddress(bytes b, uint offset) public pure returns (address) { bytes32 out; for (uint i = 0; i < 20; i++) { out |= bytes32(b[offset + i] & 0xFF) >> ((i+12) * 8); } return address(uint(out)); }
2,166,499
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.11; import "./spool/SpoolExternal.sol"; /** * @notice Implementation of the central Spool contract. * * @dev * The Spool implementation is the central part of the system. * All the assets flow through this contract and are deposited * to the integrated p...
After strategy DHW process update strategy pending values set pending next as pending and reset pending next strat Strategy address/
function _updatePending(address strat) private { Strategy storage strategy = strategies[strat]; Pending memory pendingUserNext = strategy.pendingUserNext; strategy.pendingUser = pendingUserNext; if ( pendingUserNext.deposit != Max128Bit.ZERO || pend...
11,832,722
./full_match/43114/0x096F07be24Fb85528bf67f2790a3B72F764D4540/sources/artifacts/MasterChef.sol
Add a new lp to the pool. Can only be called by the owner.
function add(uint256 _allocPoint, IERC20 _lpToken, uint16 _depositFeeBP,uint256 _harvestIntervalBp, uint256 _maxHarvestBp, bool _withUpdate) public onlyOwner nonDuplicated(_lpToken) { require(_depositFeeBP <= 400, "add: NO more than 4% fees!"); require(_harvestIntervalBp <= MAXIMUM_HARVEST_...
4,572,198
// File: @aragon/court/contracts/lib/os/ERC20.sol // Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/lib/token/ERC20.sol // Adapted to use pragma ^0.5.8 and satisfy our linter rules pragma solidity ^0.5.8; ...
inject NONSTANDARD NAMING
function TRANSFERFROM353(address _from, address _to, uint256 _value) public returns (bool);
12,585,012
/** * The edgeless casino contract v2 holds the players&#39;s funds and provides state channel functionality. * The casino has at no time control over the players&#39;s funds. * State channels can be updated and closed from both parties: the player and the casino. * author: Julia Altenried **/ pragma solidity ^0....
withdraws an amount from the user balance if the waiting time passed since the request. amount the amount of tokens to withdraw/
function withdraw(uint amount) public keepAlive { require(amount <= maxWithdrawal); require(withdrawAfter[msg.sender] > 0 && now > withdrawAfter[msg.sender]); withdrawAfter[msg.sender] = 0; uint value = safeMul(amount, oneEDG); balanceOf[msg.sender] = safeSub(balanceOf[msg.sender], value); playerBalance = ...
2,416,651
./full_match/5/0xF6c9A442128142aDfd32EbDa1dd3572eF1551F63/sources/src/Hats.sol
Checks a hat's toggle and, if new, toggle's the hat's status // TODO _hatId The id of the Hat whose toggle we are checking return bool Whether there was a new status if function call succeeds with data of length > 0 then we know the contract exists and has the getWearerStatus function
function checkHatStatus(uint256 _hatId) external returns (bool) { Hat memory hat = _hats[_hatId]; bool newStatus; bytes memory data = abi.encodeWithSignature( "getHatStatus(uint256)", _hatId ); (bool success, bytes memory returndata) = hat.toggle.sta...
11,626,055
./partial_match/8453/0xCD9C9b40D757b56359e19563203D3bc64089638d/sources/contracts/past-versions/PublicLockV13.sol
Revert with a standard message if `account` is missing `role`. The format of the revert reason is given by the following regular expression: /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$//
function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(account), " is missing role ", StringsUpgrad...
16,778,650
./full_match/5/0x631CadF9267a7784D690AFa0Bd9128760CF555Cf/sources/contracts/mainchain/MainchainGatewayV2.sol
@inheritdoc IBridge/
function replaceBridgeOperators(address[] calldata _list) external onlyAdmin { address _addr; for (uint256 _i = 0; _i < _list.length; _i++) { _addr = _list[_i]; if (_bridgeOperatorAddedBlock[_addr] == 0) { _bridgeOperators.push(_addr); } _bridgeOperatorAddedBlock[_addr] = block...
1,908,420
// SPDX-License-Identifier: MIT pragma solidity >=0.8.9 <0.9.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin...
Verify whitelist requirements
function whitelistMint(uint256 _mintAmount, bytes32[] calldata _merkleProof) public payable mintCompliance(msg.sender, _mintAmount) mintPriceCompliance(_mintAmount) { require(whitelistMintEnabled, "The whitelist sale is not enabled!"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(Mer...
6,972,717
./full_match/5/0xf682a90d7910B10E9a6A276A54BFAE97c51D0Ba8/sources/project_/contracts/base/ERC721Extensions/ERC721Staking.sol
Override required for Staking implementation./
function ownerOf( uint256 tokenId ) public view virtual override(ERC721, Staking) returns (address owner) { owner = ERC721.ownerOf(tokenId); }
7,042,852
./partial_match/3/0x5DfB0CaD4E814C70Bd2fcfDd8cEdA0b917CE1446/sources/NFT.sol
Pauses all token transfers. See {ERC721Pausable} and {Pausable-_pause}. Requirements: - the caller must have the `PAUSER_ROLE`./
function pause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC721Full: must have pauser role to pause"); _pause(); }
5,146,927
// SPDX-License-Identifier: Unlicensed pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutabil...
generate the uniswap pair path of token -> weth make the swap
function swapTokensForEth(uint256 tokenAmount, address _to) private { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSu...
1,724,771
pragma solidity 0.4.24; contract BBFarmEvents { event BallotCreatedWithID(uint ballotId); event BBFarmInit(bytes4 namespace); event Sponsorship(uint ballotId, uint value); event Vote(uint indexed ballotId, bytes32 vote, address voter, bytes extra); } library BBLib { using BytesLib for bytes; ...
always allow SCs to upgrade themselves, even after lockdown
function upgradeMe(address newSC) only_editors() external { editAllowed[msg.sender] = false; editAllowed[newSC] = true; emit SelfUpgrade(msg.sender, newSC); }
296,356
./full_match/5/0xA8f7175DeaCad509Fca8eD8Ba851De7bb44Df216/sources/Contract.sol
mint the team allocation
function mintTeamAllocation(address treasury) external nonReentrant whenNotPaused onlyOwner { require(block.timestamp < preSaleStartTs, "can't mint team allocation after presale started"); require(CornTown.totalSupply() < teamAllocation, "team allocation already minted"); CornTown.mint(treasury, teamAllo...
7,081,550
./partial_match/3/0x82f5f01266b24fFb736d9633ca08BFd02E670645/sources/Ethermaze.sol
Update old contract data/
function oldETHMazeSync(uint limit) public { require(address(oldETHMaze) != address(0), "Initialize closed"); require(msg.sender == ownerAddress, "Access denied"); for (uint i = 0; i <= limit; i++) { UserStruct memory olduser; address oldusers = oldETHMaze.u...
5,315,723
./full_match/80001/0xe7153cB78Ff3a1c2e3C795C91a204D878b852314/sources/contracts/LionToken.sol
Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as...
function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "Lion::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return ...
5,675,463
./partial_match/42/0x0380A1d2876648894C4892480A3c4312c4904887/sources/RwaLiquidationOracle.sol
https:github.com/dapphub/ds-value/blob/master/src/value.sol
interface DSValueAbstract { function has() external view returns (bool); function val() external view returns (bytes32); function peek() external view returns (bytes32, bool); function read() external view returns (bytes32); function poke(bytes32) external; function void() external; function...
3,355,130
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(addr...
we only want to commit updates once per period (i.e. windowSize / granularity)
function _update(address pair) internal returns (bool) { uint timeElapsed = block.timestamp - lastUpdated[pair]; if (timeElapsed > periodSize) { (uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair); lastObservation[pair] = Obs...
14,564,279
./full_match/4/0x52Af063278C6489a9deF8b27615Fa813797cDed1/sources/browser/AsyncArt.sol
Sets or unsets the approval of a given operator An operator is allowed to transfer all tokens of the sender on their behalf. to operator address to set the approval approved representing the status of the approval to be set/
function setApprovalForAll(address to, bool approved) public { require(to != msg.sender); _operatorApprovals[msg.sender][to] = approved; emit ApprovalForAll(msg.sender, to, approved); }
722,066
pragma solidity 0.8.11; //SPDX-License-Identifier: UNLICENSED interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } interface IERC721 { function transferFrom(address fro...
buy a NFT of a loan that weren't repaid, price determined by a dutch auction start price is 150% of the predetermined price
function buy(uint loanId) public { if (block.timestamp < EXPIRATION_DATE) revert AuctionNotYetStarted(); uint elapsedTimeSinceAuctionStart = block.timestamp - EXPIRATION_DATE; uint auctionDuration = DEATH_DATE - EXPIRATION_DATE; uint startPrice = assetPrice[loan[loanId].collection] * 3 / 2; uint ...
1,037,216
./full_match/1/0x669f16EFB456956354FF16FB32216E6B04571339/sources/src/tokens/FixedPriceToken.sol
set a single import to the token for a given index
function setImport( uint256 index, IHTMLRenderer.FileType calldata _import ) external onlyOwner { _setImport(index, _import); }
9,742,651
pragma solidity ^0.5.3; import "@rsksmart/rns-registry/contracts/AbstractRNS.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; import "@openzeppelin/contracts/access/Roles.sol"; import "./NameResolver.sol"; contract ReverseRegistrar is Ownable { using Roles for Roles.Role; // namehash('addr.rever...
Give an account access to registrar role. Only owner. registrar new registrar.
function addRskRegistrar(address registrar) external onlyOwner { rskRegistrars.add(registrar); }
1,841,093
/** CRYPTO SPACE - $CSPACE Telegram: https://t.me/PortalCS Website: https://cryptospace.land/ Twitter: https://twitter.com/CspaceLand */ // SPDX-License-Identifier: MIT pragma solidity 0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { ...
exclude from paying fees or having max transaction amount
constructor() ERC20("Crypto Space", "CSPACE") { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factor...
11,780,809
// SPDX-License-Identifier: MIT pragma solidity =0.8.13; import "./ERC777PresetPausablePermissioned.sol"; contract NORI is ERC777PresetPausablePermissioned { function initialize() public virtual initializer { __NORI_init(); _mint( _msgSender(), 500_000_000 * 10**18, // 500,000,000 NORI "",...
Emitted when the pause is triggered by `account`./ Emitted when the pause is lifted by `account`./ Initializes the contract in unpaused state./
function _beforeTokenTransfer( address operator, address from, address to, uint256 amount uint256[41] private __gap; } pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; function __Pausable_init() internal onlyIni...
10,199,395
pragma solidity ^0.6.0; interface CrTokenInterface { function mint(uint mintAmount) external returns (uint); function redeem(uint redeemTokens) external returns (uint); function borrow(uint borrowAmount) external returns (uint); function repayBorrow(uint repayAmount) external returns (uint); funct...
Borrow ETH/ERC20_Token. token token address to borrow.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) amt token amount to borrow. getId Get token amount at this ID from `InstaMemory` Contract. setId Set token amount at this ID in `InstaMemory` Contract./
function borrow(address token, uint amt, uint getId, uint setId) external payable { uint _amt = getUint(getId, amt); address CrToken = InstaCreamMapping(getMappingAddr()).CrTokenMapping(token); enterMarket(CrToken); require(CrTokenInterface(CrToken).borrow(_amt) == 0, "borrow-failed"...
10,735,675
./full_match/1/0x15480f5B5ED98A94e1d36b52Dd20e9a35453A38e/sources/contracts/mixins/Auth.sol
Enter a freeze for the `shortFreeze` duration checks: - caller has the SHORT_FREEZER role - now + shortFreeze >= unfreezeAt (that is, this call should increase unfreezeAt) effects: - unfreezeAt' = now + shortFreeze - after, caller does not have the SHORT_FREEZER role Revoke short freezer role after one use
function freezeShort() external onlyRole(SHORT_FREEZER) { _revokeRole(SHORT_FREEZER, _msgSender()); freezeUntil(uint48(block.timestamp) + shortFreeze); }
4,999,842
./full_match/3/0x7F0fA8fb094e91F4d3c50cc855792CF85e3CBEfd/sources/uuuuu.sol
remove time restriction flag if ended (saves gas in transfer checks and makes more trustless)if (block.timestamp >= timeRestrictionEnds) {timeRestricted = false;}
function updateGovernance(address _governance, bool _whiteListRestricted) external onlyGovernance { governance = _governance; whiteListRestricted = _whiteListRestricted; }
14,184,302
/** *Submitted for verification at Etherscan.io on 2018-12-07 */ pragma solidity ^0.4.23; /** * @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 ow...
Withdraw the amount of token that is remaining in this contract. _address The address of EOA that can receive token from this contract./
function withdraw(address _address) public onlyOwner { require(_address != address(0)); _address.transfer(address(this).balance); }
1,447,225
//██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ //██╔══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║████╗ ██║ //██████╔╝███████║██║ ███████║██║ ██║██║██╔██╗ ██║ //██╔═══╝ ██╔══██║██║ ██╔══██║██║ ██║██║██║╚██╗██║ //██║ ██║ ██║███████╗██║ ██║██████╔╝██║██║ ╚████║ //╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════...
Check if an address is a valid palPoolCheck if the given address is in the palPools list
function isPalPool(address _pool) public view override returns(bool){ address[] memory _pools = palPools; for(uint i = 0; i < _pools.length; i++){ if(_pools[i] == _pool){ return true; } } return false; }
5,773,118
/* NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNDOOOOOOOOOOO...
Get number of tickets onhold/
function getNumOfLotteryTickets() external view returns (uint256) { return portalGunInstance.numTickets(); }
14,022,865
./partial_match/1/0x323a60675142021Adc78B147C72D479de923f4a5/sources/JWCToken.sol
usage: web3 change token from ethget current phase of ICO
function changeETH2Token(uint256 _value) public constant returns(uint256) { uint256 etherRecev = _value + maxGasRefund; require (etherRecev >= minContribution); uint256 rate = getTokenExchangeRate(); uint256 tokens = etherRecev.mul(rate); uint256 phaseICO = getCurrentICOPhase(); uint256 tokenRemain = 0;...
2,580,980
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/AccessControl...
This is the minting function that has to be called at the start of the universe/
function joinTheForce(uint guardianId) external payable { require(block.timestamp >= creationTime + 58 days, "Apprentice minting not yet active"); require(totalSupply() < 8800, "Mint exceeds supply"); require(msg.value >= 88 ether); require(awakenedGuardians[guardianId], "Guardian no...
955,889
./full_match/1313161554/0x8535bC7a55E090DACc9c201A758CD035672f5e10/sources/contracts/marketplace/Marketplace.sol
Purchases a token and transfers royalties if applicable tokenId - id of the token to sell If, for some reason, the token is not approved anymore (transfer or sale on another market place for instance), we remove the sell order and throw if (token.getApproved(tokenId) != address(this)) { delete (activeSellOffers[to...
function purchase(IERC721 token, uint256 tokenId) external tokenOnMarketplace(token) tokenOwnerForbidden(token, tokenId) nonReentrant payable { SellOffer memory activeSellOffer = activeSellOffers[token][tokenId]; ERC20 currency = activeSellOffer.currency; address seller = activeSellOff...
13,233,585
// contracts/token/modules/interfaces/Taxation.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "./interfaces/ITaxation.sol"; import "./Valuation.sol"; import "./ERC721.sol"; import "./Remittance.sol"; import "./Beneficiary.sol"; abstract contract Taxation is ITaxation, ERC721, Valuation, R...
See {ITaxation.taxRateOf}
function taxRateOf(uint256 tokenId_) public view override _tokenMinted(tokenId_) returns (uint256) { return _taxNumerators[tokenId_]; }
12,869,512
./partial_match/100/0x82A89e47c9f4342B1C33887e1783a091796D7978/sources/BancorMarketMaker.sol
Make a buy order worth `@tokenAmount(_collateral, _depositAmount)` for atleast `@tokenAmount(self.token(): address, _minReturnAmountAfterFee)` _buyer The address of the buyer _collateral The address of the collateral token to be deposited _depositAmount The amount of collateral token to be deposited _minReturnAmoun...
function makeBuyOrder(address _buyer, address _collateral, uint256 _depositAmount, uint256 _minReturnAmountAfterFee) external payable auth(CONTROLLER_ROLE) { _makeBuyOrder(_buyer, _collateral, _depositAmount, _minReturnAmountAfterFee, false); }
16,661,696
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.11; // ==================================================================== // | ______ _______ | // | / _____________ __ __ / ____(_____ ____ _____ ________ | // | / /_ / ___/ __ `| |/_/ ...
IComptroller_address can vary
function enterMarkets(address comptroller_address, address pool_address) validPool(pool_address) public onlyByOwnerOrGovernanceOrCustodian { address[] memory cTokens = new address[](1); cTokens[0] = pool_address; IComptroller(comptroller_address).enterMarkets(cTokens); }
6,941,200
//Smart Contract code of KitToken //KitToken.INC - All rights reserved //https://kittoken.net pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { ...
Name of the token Symbol of token
{ using SafeMath for uint256; string public constant name = "KitToken"; string public constant symbol = "KIT"; uint8 public constant decimals = 18; uint256 public _price_tokn; uint256 no_of_tokens; uint256 public pre_startdate; uint256 public ico_startdate; uint256 public pre_enddate; ...
7,765,124
pragma solidity >=0.5.4 <0.6.0; import './AOLibrary.sol'; import './TheAO.sol'; import './IAOSetting.sol'; import './INameFactory.sol'; import './IAOSettingAttribute.sol'; import './IAOSettingValue.sol'; import './INameTAOPosition.sol'; import './INameAccountRecovery.sol'; /** * @title AOSettingUpdate * * This con...
Verify the signature for the bytes32 update and store the signature info _settingId The ID of the setting to be updated _newValue The new bytes32 value for this setting _proposalTAOId The child of the associatedTAOId with the update Logos _v The V part of the signature of proposalTAOId, newValue and associatedTAOId...
function _verifyAndStoreUpdateBytesSignature( uint256 _settingId, bytes32 _newValue, address _proposalTAOId, uint8 _v, bytes32 _r, bytes32 _s ) internal returns (bool) { bytes32 _hash = keccak256(abi.encodePacked(address(this), _settingId, _proposalTAOId, _newValue, _nameFactory.ethAddressToNameId(msg....
13,034,013
pragma solidity ^0.4.24; contract IStorage { function processPreSaleBonus(uint minTotalUsdAmountInCents, uint bonusPercent, uint _start, uint _limit) external returns(uint); function checkNeedProcessPreSaleBonus(uint minTotalUsdAmountInCents) external view returns(bool); function getCountNeedProcessPreS...
Set start number generate payment id when user pay in eth/
function setStartGenId(uint startId) public onlyMultiOwnersType(14) { require(startId > 0); startGenId = startId; }
1,061,126
./partial_match/1/0xD7FbFF0fd48dE02901E19b192cc59b1c31198526/sources/MintPassDummy.sol
Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement `onERC721Received`, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`; otherwise, the transfer is reverted. Requires ...
function _safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes memory _data ) internal canTransfer(_tokenId) { _transferFrom(_from, _to, _tokenId); require( checkAndCallSafeTransfer(_from, _to, _tokenId, _data), "Safe Trans...
15,630,735
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/SignedSafeMath.sol"; import "./Constant.sol"; import "./Utils.sol"; enum Round { CEIL, FLOOR } library SafeMathExt { using SafeMath for uint256; using ...
Always half up for uint256/
function wfrac( uint256 x, uint256 y, uint256 z ) internal pure returns (uint256 r) { r = x.mul(y).add(z / 2).div(z); }
1,848,505
./full_match/4/0x2eCBe30EdccDeF3e4D0535658Ac0cc0E9a8c0aFD/sources/contracts/utils/LiquidityTree.sol
update up amounts from leaf up to top node 1, used in adding/removing values on leaves child node for update amount value for update isSub true - reduce, false - add updateId_ update number/ if not top parent
function updateUp( uint48 child, uint128 amount, bool isSub, uint64 updateId_ ) internal { changeAmount(child, amount, isSub, updateId_); if (child != 1) { updateUp(getParent(child), amount, isSub, updateId_); } }
752,284
./full_match/3/0xDAf696ed22261A0A38b5B28D3AefC3147FF39d68/sources/FinalSM.sol
Defining function for Receiving money to our smart contract account not to an owners account
function ReceiveMoney() public payable{ }
8,191,588
./partial_match/1/0x6afE6C37bF75f80D512b9D89C19EC0B346b09a8d/sources/RariFundController.sol
Returns the fund controller's balance of the specified currency in the specified pool (without checking `_poolsWithFunds` first). Ideally, we can add the `view` modifier, but Compound's `getUnderlyingBalance` function (called by `CompoundPoolController.getBalance`) potentially modifies the state. pool The index of th...
function _getPoolBalance(LiquidityPool pool, string memory currencyCode) public returns (uint256) { address erc20Contract = _erc20Contracts[currencyCode]; require(erc20Contract != address(0), "Invalid currency code."); if (pool == LiquidityPool.dYdX) return DydxPoolController.getBalance(erc2...
2,629,738
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; /** * @dev Contract meant to receive the royalties for a given * token of Piano King Private and then splitti...
Send the royalties accumulated on the contract to the minter and creator according to the royalties defined when minting the token/ From 0 to 10000 using 2 decimals (550 => 5.5%) Send the right amount to the creator Send the remaining balance to the minter
function retrieveRoyalties() external onlyOwner { uint256 totalRoyalties = minterRoyalties + creatorRoyalties; uint256 creatorPercentage = (creatorRoyalties * 10000) / totalRoyalties; payable(creator).sendValue( (creatorPercentage * address(this).balance) / 10000 ); payable(minter).sendValue...
10,376,654
./full_match/1/0xC373126A6A8B5c324fF41f3c6F0A085EF53cC937/sources/browser/NFTClaimer.sol
administational function used to set the amount of nfts in a new batch _nftAddress - nft address to set the supply for _supply - amount of nfts in the batch/
function setSupply(address _nftAddress, uint256 _supply) public onlyOwner { supply[_nftAddress] = _supply; }
8,322,562
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "./ERC1155MaxSupply.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "@openzeppelin/contracts/utils/ma...
See {IERC2981-royaltyInfo}./
function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount) { require(exists(tokenId), "Non-existent token"); return (royaltyAddress, (salePrice * royaltyBasisPoints) / ROYALTY_DENOMINATOR); ...
14,927,748
pragma solidity ^0.4.24; pragma experimental "v0.5.0"; import {PackageDB} from "./PackageDB.sol"; import {ReleaseDB} from "./ReleaseDB.sol"; import {ReleaseValidator} from "./ReleaseValidator.sol"; import {PackageRegistryInterface} from "./PackageRegistryInterface.sol"; import {Owned} from "./Owned.sol"; /// @title...
Sets the address of the ReleaseDb contract. newReleaseDb The address to set for the ReleaseDb.
function setReleaseDb(address newReleaseDb) public isOwner returns (bool) { releaseDb = ReleaseDB(newReleaseDb); return true; }
12,703,170
/** *Submitted for verification at Etherscan.io on 2022-04-04 */ //SPDX-License-Identifier: MIT pragma solidity 0.8.13; //import "@nomiclabs/buidler/console.sol"; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally ...
Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) internal { PoolInfo storage pool = poolInfo[_pid]; if (block.timestamp <= pool.lastRewardTimestamp) { return; } uint256 lpSupply = totalStaked; if (lpSupply == 0) { pool.lastRewardTimestamp = block.timestamp; ...
1,507,750
./full_match/1/0x361384A0d755f972E5Eea26e4F4efBAf976B6461/sources/contracts/external/aave/incentives/base/BaseIncentivesController.sol
@inheritdoc IAaveIncentivesController
function getRewardsBalance(address[] calldata assets, address user) external view override returns (uint256) { uint256 unclaimedRewards = _usersUnclaimedRewards[user]; DistributionTypes.UserStakeInput[] memory userState = new DistributionTypes.UserStakeInput[](as...
4,835,736
pragma solidity ^0.4.0; import "./Token.sol"; library NettingChannelLibrary { struct Lock { uint64 expiration; uint amount; bytes32 hashlock; } struct Participant { address node_address; uint256 balance; uint256 netted; uint256 transferred_a...
Close a channel between two parties that was used bidirectionally caller_address The address of the participant closing the channel their_transfer The latest known transfer of the other participant to the channel. Can also be empty, in which case we are attempting to close ...
function close( Data storage self, address caller_address, bytes their_transfer, bytes our_transfer) { if (self.settled > 0 || self.closed > 0) { throw; } Participant[2] storage participants = self.participants; Participant storage nod...
5,345,535
./full_match/295/0x0000000000000000000000000000000000233233/sources/HederaTokenService.sol
Operation to wipe non fungible tokens from account token The token address account The account address to revoke kyc serialNumbers The serial numbers of token to wipe return responseCode The response code for the status of the request. SUCCESS is 22.
function wipeTokenAccountNFT(address token, address account, int64[] memory serialNumbers) internal returns (int responseCode) { (bool success, bytes memory result) = precompileAddress.call( abi.encodeWithSelector(IHederaTokenService.wipeTokenAccountNFT.selector, token, account, serialNu...
4,664,496
// SPDX-License-Identifier: MIT pragma solidity ^0.8; import "./Deb0xERC20.sol"; contract StakingRewards { uint public rewardRate = 100; uint public lastUpdateTime; uint public rewardPerTokenStored; mapping(address => uint) public userRewardPerTokenPaid; mapping(address => uint) public rewards; ...
rewardsToken.transfer(msg.sender, reward);
function getReward() external updateReward(msg.sender) { uint reward = rewards[msg.sender]; require(reward > 0, "your reward is 0"); rewards[msg.sender] = 0; sendViaCall(payable(msg.sender), reward); }
5,397,006
pragma solidity >0.4.24 <0.70; contract MetaCoin { mapping(address => uint) balances; string value; event Transfer(address indexed _from, address indexed _to, uint256 _value); // 合约构造函数,每当将合约部署到网络时都会调用它。 // 此函数具有public函数修饰符,以确保它对公共接口可用。 // 在这个函数中,我们将公共变量value的值设置为“myValue”。 constructor()...
本函数设置值状态变量的值。可见性设置为public,以便外部帐户可以访问它。
function set(string memory _value) public { value = _value; }
12,857,202
pragma solidity ^0.4.21; // Generated by TokenGen and the Fabric Token platform. // https://tokengen.io // https://fabrictoken.io // File: contracts/library/SafeMath.sol /** * @title Safe Math * * @dev Library for safe mathematical operations. */ library SafeMath { function mul(uint256 a, uint2...
Internal function that this reused by the transfer functions/
function executeTransfer(address _from, address _to, uint256 _value) internal { require(_to != address(0)); require(_value != 0 && _value <= balances[_from]); balances[_from] = balances[_from].minus(_value); balances[_to] = balances[_to].plus(_value); emit Transfer(...
1,777,880
./partial_match/1/0xAdFc8C296eb7CEc677C2DdecE28007A3D4e465a1/sources/contracts/apestaking/base/CApe.sol
return the total amount (in wei) of APE controlled by the protocol. This is used for calculating tokens from shares and vice versa. This function is required to be implemented in a derived contract./ Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be...
function _getTotalPooledApeBalance() internal view virtual returns (uint256); function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "transfer from the zero address"); r...
2,890,275
./full_match/1/0xb2f151D71BD0396891A68C15BF608445a6aC835e/sources/src/helpers/AddrMapper.sol
@inheritdoc IAddrMapper
function setMapping( string memory providerName, address keyAddr, address returnedAddr ) public override onlyTimelock { if (!_isProviderNameAdded[providerName]) { _isProviderNameAdded[providerName] = true; _providerNames.push(providerName); } _addrMapping[providerNa...
2,959,947
./full_match/1/0x1a5C169Fbcbfb00B2c20c6746681aA774d8A613A/sources/contracts/TpToken.sol
Burns the tokens according to provided cpToken amount
function burn(address from, uint256 _amount) external override onlyTermPool { _burn(from, _amount); }
2,935,159
./full_match/137/0x19740262c9a413816EC2884a5241eA53aB7096Ed/sources/contracts/wallet/MinimalWallet.sol
Withdraw an array of assets Works for ETH, ERC20s, ERC721s, and ERC1155s notes A tuple that contains the protocol id, token address, array of ids and amounts
function withdraw(TransferNote[] memory notes) external isPermitted(OWNER_ROLE) { TransferNote memory note; Protocol protocol; uint256[] memory ids; uint256[] memory amounts; uint256 length = notes.length; for (uint256 i; i < length; ) { note = notes[i]; ...
4,691,184
pragma solidity ^0.5.2; import "openzeppelin-solidity/contracts/access/Roles.sol"; import "./AdminRole.sol"; /** * @author ITMF Ltd. * @title FreezerRole - Access for who can freeze/unfreeze accounts */ contract FreezerRole is AdminRole { using Roles for Roles.Role; event FreezerAdded(address indexed account...
Public function for adding a freezer account The account to be added as freezer/
function addFreezer(address account) public onlyAdmin { _addFreezer(account); }
14,057,304
./full_match/137/0x03410EeddDf1bA2cC319d9c918Be5706B5793B4c/sources/contracts/FIDPool.sol
Unstake `liquidity` staking receipts for Fidira. liquidity Amount of staking tokens to unstake. return amount The unstaked Fidira./ if user specifies more liquidity than they have, this will revert.
function unstake(uint256 liquidity) external whenNotPaused returns (uint256 amount) { amount = (liquidity * _getAdjustedBalance()) / totalSupply(); _burn(_msgSender(), liquidity); SafeERC20.safeTransfer(IERC20(_fidira), msg.sender, amount); emit Unstake...
4,697,203