file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
./full_match/80001/0x24f51617c1ad2120CCd1c238AED2f770A772630E/sources/src/AllowListDrop.sol
,-. `-' /|\ | ,----------. / \ |ERC721Drop| Caller `----+-----' | adminMintAirdrop() | ...
function adminMintAirdrop(address[] calldata recipients) external override onlyRoleOrAdmin(MINTER_ROLE) canMintTokens(recipients.length) returns (uint256) { uint256 atId = _currentIndex; uint256 startAt = atId; unchecked { for ( ...
851,109
pragma solidity >=0.8.0 <0.9.0; // SPDX-License-Identifier: MIT import "./interfaces.sol"; contract Verification { uint8 public constant STATUS_WAITING = 0; uint8 public constant STATUS_VERIFYING = 1; uint8 public constant REWARD_SECTOR = 0; uint8 public constant REWARD_SEED = 1; uint8 public co...
Submit proof of the sector for verification This function must be called by sector owner proof_ the afid of the proof
function submitProof(bytes28 proof_) onlyStatus(STATUS_WAITING) external { require(sector.owner() == msg.sender, "Verification: caller is not sector owner"); require(block.number <= _submitProofDDL, "Verification: submit proof too late"); _proof = proof_; status = STATUS_VERIFYING; ...
6,344,519
./partial_match/42/0x925b6Dea592f731A9183cAe3a29568e2dD98cBE5/sources/TimeBasedSwitch.sol
inheritdoc ITimeBasedSwitch
function terminateSwitchEarly() public payable override onlyValid(msg.sender) nonReentrant { uint remains = users[msg.sender].amount; users[msg.sender].amount = 0; users[msg.sender].isValid = false; (bool success, ) = msg.sender.call.value(remains)(""); r...
9,074,591
./full_match/1/0x41f6b87E6a34D17871b23C5226057eEA96Ad3aa2/sources/contracts/RewardToolsDCLBordersContract.sol
Set the minimum number of days that a border can be removed for
function setMinDaysToRemove(uint256 minDays) public onlyOwner { settings.minDaysToRemove = minDays; }
3,126,438
pragma solidity 0.5.10; import "../interfaces/IBlockRewardAuRa.sol"; import "../interfaces/IERC677.sol"; import "../interfaces/IGovernance.sol"; import "../interfaces/IStakingAuRa.sol"; import "../interfaces/IValidatorSetAuRa.sol"; import "../upgradeability/UpgradeableOwned.sol"; import "../libs/SafeMath.sol"; /// @...
Returns the list of pool ids into which the specified delegator have ever staked. _delegator The delegator address. _offset The index in the array at which the reading should start. Ignored if the `_length` is 0. _length The max number of items to return.
) external view returns(uint256[] memory result) { uint256[] storage delegatorPools = _delegatorPools[_delegator]; function getDelegatorPools( address _delegator, uint256 _offset, uint256 _length if (_length == 0) { return delegatorPools; } uin...
13,080,994
/** *Submitted for verification at Etherscan.io on 2021-04-27 */ // File: contracts\interface\INestMapping.sol // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.3; /// @dev The interface defines methods for nest builtin contract address mapping interface INestMapping { /// @dev Set the built-i...
Get INestMining implementation contract address for ntoken return INestMining implementation contract address for ntoken
function getNTokenMiningAddress() override external view returns (address) { return _ntokenMiningAddress; }
2,450,880
./full_match/10200/0x5f02ad4d2E99172bd3414893fAeE05a208e2eA5D/sources/lib/MultiToken/src/MultiToken.sol
approveAsset Wrapping function for `approve` calls on various token interfaces. By using `safeApprove` for ERC20, caller can set allowance to 0 or from 0. Cannot set non-zero value if allowance is also non-zero. asset Struct defining all necessary context of a token. target Account/address that would be gr...
function approveAsset(Asset memory asset, address target) internal { if (asset.category == Category.ERC20) { IERC20(asset.assetAddress).safeApprove(target, asset.amount); IERC721(asset.assetAddress).approve(target, asset.id); IERC1155(asset.assetAddress).setApprovalForA...
3,784,873
pragma solidity ^0.5.0; import "./Authors.sol"; /// @title Decentralized Research Publishing Platform , Paper's Smart contract /// @author Farhan Hameed Khan (farhankhan@blockchainsfalcon.com | farhanhbk@hotmail.com) /// @dev The main purpose of this contract is to store a paper information along its history and v...
setPaperStatusByReviewer - This function allows the reviewer to set the new status for the paper associated with paper id by the reviewer contract. _paperId the paper id _status the new status to be set for the paper/
function setPaperStatusByReviewer(uint _paperId,PaperStatus _status) public { require(paperFiles[_paperId].paperExist,"Paper must be exist"); require(isReviewerAlreadyAssigned(_paperId),"Reviewer is not assigned for this paper, he must be assigned on this before changing any status"); p...
13,027,341
./partial_match/42/0xC579B84bd628d2F10EAc7B0E7eB328812e0e7ae2/sources/RIS3Farm.sol
Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}./
interface IRIS3GOVERNMENT { function startNewCycle() external view returns (uint256); function mintRewards() external view returns (uint256); function getCurrentLaws() external view returns (uint256, uint256, string memory); function getCycleStartTime() external view returns (uint256); function...
3,369,471
pragma solidity ^0.4.24; import "../openzeppelin-solidity/contracts/ownership/HasNoEther.sol"; import "../openzeppelin-solidity/contracts/ownership/HasNoTokens.sol"; import "../openzeppelin-solidity/contracts/ownership/Claimable.sol"; import "../openzeppelin-solidity/contracts/math/SafeMath.sol"; import "./TrueVND.sol...
Update this contract's trueVND pointer to newContract (e.g. if the contract is upgraded)
function setTrueVND(TrueVND newContract) public onlyOwner { emit ChangeTrueVNDEvent(newContract); trueVND = newContract; }
12,685,445
pragma solidity ^0.5.0; // --------------------------------------------------------------------------- // Pirate Lottery // // players purchase numbered tickets while a round is open; all the player's addresses are hashed together. // // after the round closes, the winner of the *previous* round can claim his ...
withdraw accumulated prize
function withdraw() public { uint256 _amount = balances[msg.sender]; balances[msg.sender] = 0; msg.sender.transfer(_amount); }
15,843,022
/* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribut...
assert(b > 0); Solidity automatically throws when dividing by 0 assert(a == b c + a % b); There is no case in which this doesn't hold
function div(uint a, uint b) internal pure returns (uint) { uint c = a / b; return c; }
5,869,167
// File: @openzeppelin/contracts/GSN/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be...
Calculate share based on share price and given amount./
function _calculateShares(uint256 amount) internal view returns (uint256) { require(amount != 0, "amount is 0"); uint256 _totalSupply = totalSupply(); uint256 _totalValue = convertTo18(totalValue()); uint256 shares = (_totalSupply == 0 || _totalValue == 0) ? amount ...
1,333,577
./full_match/1/0x32ee46755AE81ce917392ed1fB21f74a8104515B/sources/contracts/strategies/angle/AngleMerklClaimer.sol
function to claim and notify the ANGLE reward via merkle _proofs merkle proofs _vault vault to claim the reward for _token reward token _amount amount to notify the reward will be send to the vault transfer reward from vault to here
function claimAndNotify( bytes32[][] calldata _proofs, address _vault, address _token, uint256 _amount ) external { address[] memory users = new address[](1); users[0] = _vault; address[] memory tokens = new address[](1); tokens[0] = _token; ...
16,489,072
./full_match/1/0xedDF24978021B8498f9f92457c6bAA24549eAb8a/sources/browser/OXStaking.sol
------------------------------------------------------------------------ This will stop the existing staking ------------------------------------------------------------------------ update staking stats check if we have any pending rewards, add it to previousGains var update amount reset last claimed figure as well wit...
function StopStaking() external { require(users[msg.sender].activeDeposit >= 0, "No active stake"); uint256 _activeDeposit = users[msg.sender].activeDeposit; users[msg.sender].pendingGains = PendingReward(msg.sender); users[msg.sender].activeDeposit = 0; ...
2,910,240
./full_match/3/0x30de7ADec3a055Ca5b482c79A751a067e9568bed/sources/newcontract.sol
silence state mutability warning without generating bytecode - see https:github.com/ethereum/solidity/issues/2691
function _msgData ( ) internal view virtual returns (bytes memory) { this ; return msg . data ; }
14,139,741
./full_match/1/0x998a3c80807d1Df43f17453123538E4D9934b7Ca/sources/EthernaalNF2T.sol
This function is used to whitelist a tattoo partner on the platform/
function whitelistPartners(address _partner) public onlyOwner returns(bool) { require(_partner != address(0), "Partner address has to be non-zero"); whitelistPartnerMapping[_partner] = true; return whitelistPartnerMapping[_partner]; }
9,820,030
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/mixins/PoolRegistry.sol
Tests whether the given initialization by the given user is authorized on this specific pool. If not, reverts the transaction. If pool is permissionless this function will just noop. /
function verifyPermitInit (PoolSpecs.PoolCursor memory pool, address base, address quote, uint256 poolIdx) internal { if (pool.oracle_ != address(0)) { bool approved = ICrocPermitOracle(pool.oracle_). checkApprovedForCrocInit(lockHolder_, msg.sender...
4,651,127
// SPDX-License-Identifier: MIT import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./ERC721A.sol"; pragma solidity ^0.8.0; /** * @title Shark Society contract * @dev Extends ERC721A Non-Fungible Token Standard basic implementation */ contract Shark...
Returns whether `spender` is allowed to manage `tokenId`. Requirements: - `tokenId` must exist./
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721A.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedF...
370,610
./partial_match/80001/0x07DDC851a1bee757335EBcd7B14348359fDaB60f/sources/PlotXToken.sol
change operator address _newOperator address of new operator/
function changeOperator(address _newOperator) public onlyOperator returns (bool) { require(_newOperator != address(0), "New operator cannot be 0 address"); operator = _newOperator; return true; }
8,810,495
pragma solidity ^0.4.17; /** * @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); ...
Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused { require(!isBlackListed[msg.sender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); return super.transfer(_to, _value); } }
436,260
./full_match/42/0xd86721346245a47354D22a99CB31d3eC4436d9AE/sources/browser/ACOFactory.sol
Internal function to set the operator permission. operator Address of the operator. newPermission Whether the operator will be authorized./
function _setOperator(address operator, bool newPermission) internal virtual { emit SetOperator(operator, operators[operator], newPermission); operators[operator] = newPermission; }
9,567,697
// File: @openzeppelin/contracts/GSN/Context.sol pragma solidity ^0.5.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * man...
Allows a request to be cancelled if it has not been fulfilled Requires keeping track of the expiration value emitted from the oracle contract. Deletes the request from the `pendingRequests` mapping. Emits ChainlinkCancelled event. _requestId The request ID _payment The amount of LINK sent for the request _callbackF...
function cancelChainlinkRequest( bytes32 _requestId, uint256 _payment, bytes4 _callbackFunc, uint256 _expiration ) internal { ChainlinkRequestInterface requested = ChainlinkRequestInterface(pendingRequests[_requestId]); delete pendingRequests[_requestId]; ...
1,262,272
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts...
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC721, ERC721Enumerable) returns (bool) { if (interfaceId == LibRoyaltiesV2._INTERFACE_ID_ROYALTIES) { return true; } if (interfaceId ...
7,241,088
./partial_match/1/0x5638C146B1BA9e47EF62206B0f21d818A59f626c/sources/ESP.sol
Calculate bonus Suns for a new stake, if any newStakedSuns Number of Suns to stake newStakedDays Number of days to stake// Must be more than 1 day for Longer-Pays-Better /
function _stakeStartBonusSuns(uint256 newStakedSuns, uint256 newStakedDays) private pure returns (uint256 bonusSuns) { LONGER PAYS BETTER: If longer than 1 day stake is committed to, each extra day gives bonus shares of approximately 0.0548%, which is...
11,027,585
pragma solidity ^0.4.19; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; ...
Transfer tokens from one address to another with pause and freeze features for owner. Only applies when the transfer is allowed by the owner. _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/
function transferFrom(address _from, address _to, uint256 _value) whenNotPaused public returns (bool) { require(!isFrozen(msg.sender)); require(!isFrozen(_from)); super.transferFrom(_from, _to, _value); }
15,111,966
./full_match/4/0xAd8d2D5Fa5B33704f290c37BFb13fFa1dc31a257/sources/contracts/interfaces/dydx/ICallee.sol
ICallee dYdX Interface that Callees for Solo must implement in order to ingest data./ ============ Public Functions ============
interface ICallee { function callFunction( address sender, Account.Info calldata accountInfo, bytes calldata data ) external; pragma solidity ^0.8; import {Account} from "./ISoloMargin.sol"; }
12,476,160
pragma solidity ^0.5.16; // Inheritance import "./access/LimitedSetup.sol"; import "./SynthetixState.sol"; // Internal References import "./interfaces/IFeePool.sol"; // https://docs.synthetix.io/contracts/source/contracts/synthetixstate contract SynthetixStateWithLimitedSetup is SynthetixState, LimitedSetup { IF...
/ Import issuer data Only callable by the contract owner, and only for 1 week after deployment. /
function importIssuerData(address[] calldata accounts, uint[] calldata sUSDAmounts) external onlyOwner onlyDuringSetup { require(accounts.length == sUSDAmounts.length, "Length mismatch"); for (uint8 i = 0; i < accounts.length; i++) { _addToDebtRegister(accounts[i], sUSDAmounts[i]); ...
12,710,163
./partial_match/1/0xAe46E888aF6318aED82FE715b1b98b78F74e7b65/sources/LiquidityPoolV1Converter.sol
returns the number of decimal digits in a given positive integer _x positive integer return the number of decimal digits in the given positive integer/
function decimalLength(uint256 _x) internal pure returns (uint256) { uint256 y = 0; for (uint256 x = _x; x > 0; x /= 10) y++; return y; }
9,362,046
./partial_match/56/0x173BB4D9ECEfB2777C524501d876444Cf1018101/sources/O2Token.sol
Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/
function delegateBySig( address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s ) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())...
11,329,118
pragma solidity ^0.4.19; import './GroupAdmin.sol'; import './zeppelin/lifecycle/Destructible.sol'; contract Conference is Destructible, GroupAdmin { string public name; uint256 public deposit; uint public limitOfParticipants; uint public registered; uint public attended; bool public ended; bool public cancell...
return the remaining of balance if there are any unclaimed after cooling period /
function clear() external onlyOwner onlyEnded{ require(now > endedAt + coolingPeriod); require(ended); var leftOver = totalBalance(); owner.transfer(leftOver); ClearEvent(owner, leftOver); }
14,033,820
./full_match/5/0x72D4379301daE59D52FeeA82CC82B77E92B2E995/sources/contracts/SokuNFT721.sol
See {IERC165-supportsInterface}./
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable, ERC2981, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); }
1,894,966
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import { LibDiamondCut } from "./diamond/LibDiamondCut.sol"; import { DiamondFacet } from "./diamond/DiamondFacet.sol"; import { OwnershipFacet } from "./diamond/OwnershipFacet.sol"; import { LibDiamondStorage } from "./diamond/...
Writes a uint256 into a specific position in a byte array. b Byte array to insert <input> into. index Index in byte array of <input>. input uint256 to put into byte array.
function writeUint256( bytes memory b, uint256 index, uint256 input ) internal pure { writeBytes32(b, index, bytes32(input)); }
1,813,778
// File: contracts/interface/IERC165.sol /** * @title IERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface IERC165 { /** * * * ,,,,,,,, ...
Start with 10000, or 10001/
function mint(address[] memory owners, uint256 typeCount) public onlyOwner { require(!_finalized, "ERC721: minting concluded"); for(uint8 index = 0; index < owners.length; index++) { uint256 token_0001 = typeCount + index; address owner_0001 = owners[index]; ...
4,812,122
pragma solidity >=0.4.24; // It's important to avoid vulnerabilities due to numeric overflow bugs // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/ imp...
Initial funding for the insurance. Unless there are too many delayed flights resulting in insurance payouts, the contract should be self-sustaining/address payable dataContractAddress = address(uint160(dataContract));
function fundAirline() public payable requireIsOperational requireIsRegistered requireMinimumAmount { dataContractAddress.transfer(msg.value); dataContract.fund(msg.value, msg.sender); emit ContractFunded(msg.value, msg.sender); }
1,823,503
./full_match/5/0xBD5cDdc0937443B182892aB7EF678Eb7419cd09a/sources/src/contracts/core/InvestmentManager.sol
If the `depositor` has no existing shares, then they can `undelegate` themselves. This allows people a "hard reset" in their relationship with EigenLayer after withdrawing all of their stake./
function _undelegate(address depositor) internal { require(investorStrats[depositor].length == 0, "InvestmentManager._undelegate: depositor has active deposits"); delegation.undelegate(depositor); }
1,923,714
./full_match/5/0xC0f19dFa8e2dF07dC9F8BF918d13cEBe1e433fd1/sources/contracts/Gigble.sol
Create a function to accept a gig and release 10% of escrowed money to platform as fee and rest amount to the publisher Send 10% of the escrowed money to the platform as a fee Send the rest of the money to the publisher
function acceptGig(uint _gigId) public { require( gigs[_gigId].seller == msg.sender, "Only seller can accept gig" ); require(gigs[_gigId].confirmed, "Gig not yet confirmed"); require(!gigs[_gigId].accepted, "Gig already accepted"); require(!gigs[_gigId...
1,852,665
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.6.0; import "./BasicAuth.sol"; import "./VoteComputer.sol"; contract ProposalManager is BasicAuth { struct ProposalInfo { // unique address address resourceId; // creator external address address proposer; ...
revoke proposal proposal id voter address/
function revoke(uint256 proposalId, address voterAddress) public onlyOwner { ProposalInfo storage proposal = _proposals[proposalId]; require( refreshProposalStatus(proposalId) == 1, "Only newly created proposal can be revoked" ); require(proposal.proposer == v...
7,295,081
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // for WETH import "@openzeppelin/contracts/token...
Must revert to deny access.
function protectionAdminCheck() internal view override onlyOwner {}
461,531
/** *Submitted for verification at Etherscan.io on 2021-06-24 */ pragma solidity >=0.7.2; pragma experimental ABIEncoderV2; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of...
Returns the max withdrawable shares for all users in the vault/
function maxWithdrawableShares() public view returns (uint256) { uint256 withdrawableBalance = assetBalance(); uint256 total = wmul( lockedAmount, collateralToken.pricePerShare().mul(_decimalShift()) ) .add(withdrawableBalance);...
2,187,487
/* Copyright 2020 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
Populates the TWAPState struct and initiates first chunk auction. _twapAuction TWAPAuction State object _currentSet The Set to rebalance from _nextSet The Set to rebalance to _startingCurrentSetQuantity Quantity of currentSet to rebalance _chunkSizeValue ...
function initializeTWAPAuction( TWAPState storage _twapAuction, ISetToken _currentSet, ISetToken _nextSet, uint256 _startingCurrentSetQuantity, uint256 _chunkSizeValue, uint256 _chunkAuctionPeriod ) internal { LinearAuction.initializeLinearAuct...
12,726,504
pragma solidity ^0.6; import "../../../lib/SafeMath.sol"; import {Ownable} from "../ownership/Ownable.sol"; /** * Stores information for added training data and corresponding meta-data. */ interface DataHandler { function updateClaimableAmount(bytes32 dataKey, uint rewardAmount) external; } /** * Stores info...
return `true` if the contribution has already been claimed by `claimer`, otherwise `false`./ Validate found value. usually unnecessary: require(isDataEqual(existingData.d, data), "Data is not equal.");
function hasClaimed( int64[] memory data, uint64 classification, uint addedTime, address originalAuthor, address claimer) public view returns (bool) { bytes32 key = keccak256(abi.encodePacked(data, classification, addedTime, originalAuthor)); StoredData storage existi...
12,872,859
// Verified using https://dapp.tools // hevm: flattened sources of src/token.sol // SPDX-License-Identifier: MIT AND GPL-3.0-only pragma solidity >=0.8.0 <0.9.0 >=0.8.2 <0.9.0 >=0.8.7 <0.9.0; ////// lib/openzeppelin-contracts/contracts/utils/Context.sol /* pragma solidity ^0.8.0; */ /** * @dev Provides information...
Collects all received funds available for the user and transfers them out of the drips hub contract to that user's wallet. user The user currReceivers The list of the user's current splits receivers. return collected The collected amount return split The amount split to the user's splits receivers
function collect(address user, SplitsReceiver[] memory currReceivers) public virtual returns (uint128 collected, uint128 split) { (collected, split) = _collectInternal(user, currReceivers); _transfer(user, int128(collected)); }
13,437,379
pragma solidity 0.4.24; import "./interfaces/ApprovedRegistryInterface.sol"; import "./interfaces/KyberNetworkInterface.sol"; import "./interfaces/BillableInterface.sol"; import "./WETH.sol"; import "./base/math/SafeMath.sol"; import "./base/ownership/Ownable.sol"; /** @title Approved contract, tokens and gas price...
Get exchange rate for token. _tokenAddress is the address for the token./ If the token is the native currency, then the exchange rate is 1 Fail safe in case Kyber gives 0
function getRateFor(address _tokenAddress) public view returns (uint256) { if (_tokenAddress == address(wrappedEther)) { return 1*10**18; } var (, rate) = kyberProxy.getExpectedRate( ERC20(_tokenAddress), ERC20(0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee)...
14,020,366
./full_match/8453/0xe00d28787E7fd5ba420049C6Aec160a5Beb02fe1/sources/contracts/Ledger.sol
getContextArnAllocations After looking at the aggregate arn balance sheet for say, a trust or key context, you'll want to see an allocation across both providers and their collateral balances for a given asset. 'OK I see Chainlink, what is that composed of?' 'Who can withdrawal it?'. When done at the ledger level, is e...
function getContextArnAllocations(uint256 context, uint256 identifier, bytes32 arn) external view returns(address[] memory, uint256[] memory) { CollateralProviderLedger.CollateralProviderContext storage cxt = getContextLedger(context, identifier); return cxt.getProvide...
11,559,706
./full_match/97/0xe9E19bc8EE05502620610517E32f98eEb653600E/sources/project_/contracts/BetDex.sol
return _validateAuthorization(hash, input.v, input.r, input.s, input.signatureVersion, input.extraSignature);
function _validateSignatures(Input calldata input, bytes32 hash) internal view returns (bool) { require( (input.timestamp - SIGNATURE_TIMESTAMP_THRESHOLD) < block.timestamp, "INVALID_TIMESTAMP" ); return _validateAuthorization(hash, input.v...
3,290,377
./full_match/4/0xB62652A9f4ac3D85F09dA08F31963108Dd2BfD23/sources/contracts/OptionMarketPricer.sol
The entry point for the OptionMarket into the pricing logic when a trade is performed. listing The OptionListing. trade The Trade. pricingGlobals The PricingGlobals. boardBaseIv The base IV of the OptionBoard./
function updateCacheAndGetTotalCost( IOptionMarket.OptionListing memory listing, IOptionMarket.Trade memory trade, ILyraGlobals.PricingGlobals memory pricingGlobals, uint boardBaseIv ) external override onlyOptionMarket returns ( uint totalCost, uint newBaseIv, uint...
12,434,392
/** * @title Funding Vault * @author Clément Lesaege - <clement@lesaege.com> * Bug Bounties: This code hasn't undertaken a bug bounty program yet. */ pragma solidity ^0.4.15; import "../Arbitrable.sol"; import "minimetoken/contracts/MiniMeToken.sol"; /** @title Funding Vault * A contract storing the ETH ra...
Execute a ruling of a dispute. _disputeID ID of the dispute in the Arbitrator contract. _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision"./
function executeRuling(uint _disputeID, uint _ruling) internal{ Milestone storage milestone=milestones[disputeIDToMilstoneID[_disputeID]]; uint _milestoneID = disputeIDToMilstoneID[_disputeID]; if (_ruling==TEAM_WINS) { milestone.amount-=milestone.amountClaimed; mile...
2,547,961
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import {ILooksRareToken} from "../interfaces/ILooksRareToken.sol"; /** * @title LooksRareToken (LOOKS) * @notice LOOKSRARE...
Mint LOOKS tokens account address to receive tokens amount amount to mint return status true if mint is successful, false if not/
function mint(address account, uint256 amount) external override onlyOwner returns (bool status) { if (totalSupply() + amount <= _SUPPLY_CAP) { _mint(account, amount); return true; } return false; }
1,328,620
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; /// @title A mintable ERC20 token used by agora.space contract AgoraToken is ERC20, Ownable { uint8 private immutable tokenDecimals; constructor(...
Mints tokens to an account _account The address receiving the tokens _amount The amount of tokens to be minted
function mint(address _account, uint256 _amount) external onlyOwner { _mint(_account, _amount); }
12,563,144
./full_match/1/0x4a99733458349505A6FCbcF6CD0a0eD18666586A/sources/contracts/exchangeIssuance/ExchangeIssuance.sol
Issues an exact amount of SetTokens for given amount of input ERC20 tokens. The excess amount of tokens is returned in an equivalent amount of ether. _setToken Address of the SetToken to be issued _inputToken Address of the input token _amountSetToken Amount of SetTokens to issue _max...
function issueExactSetFromToken( ISetToken _setToken, IERC20 _inputToken, uint256 _amountSetToken, uint256 _maxAmountInputToken ) isSetToken(_setToken) external nonReentrant { require(_amountSetToken > 0 && _maxAmountInputToken > 0, "ExchangeIs...
16,459,118
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns t...
Turn off paused variable. Everything resumes./
function unpause() external override onlyRole(OLib.GUARDIAN_ROLE) { _paused = false; emit Unpaused(msg.sender); }
1,397,524
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./interfaces/IRewardStaking.sol"; import "./interfaces/ILockedCvx.sol"; import "./interfaces/IDelegation.sol"; import "./interfaces/ICrvDepositor.sol"; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/utils/Address....
IDelegation(_delegateContract).setDelegate(keccak256("cvx.eth"), _delegate);
function setDelegate(address _delegateContract, address _delegate) external{ require(msg.sender == operator, "!auth"); IDelegation(_delegateContract).setDelegate("cvx.eth", _delegate); }
12,891,518
./partial_match/4/0x8CAb6E250CBE9129962a5Dc837d70c478d5C3af5/sources/FatMasterFarmer.sol
lock 100% of reward if it come from bounus time
function _harvest(uint256 _pid) internal { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accFatPerShare).div(1e12).sub(user.rewardDebt); uint256 masterBal = fa...
8,563,358
./full_match/1/0x83Ed35aEE375180d4Fb7C32743DFce6510717294/sources/browser/TELOS_FAAS.sol
Deposit LP tokens to FarmingBad for FaasToken allocation.
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accFAASPerShare).div(1e12).sub(user.rewardD...
3,187,075
pragma solidity ^0.4.24; // Amis Dex OnChainOrderBook follows ERC20 Standards contract ERC20 { function totalSupply() constant returns (uint); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _f...
Public Info View - what is being traded here, what are the limits?
function getBookInfo() public constant returns ( BookType _bookType, address _baseToken, address _rwrdToken, uint _baseMinInitialSize, uint _cntrMinInitialSize, int8 _minPriceExponent, uint _feeDivisor, address _feeCollector ) { return ( BookType.ERC20EthV1, address(baseToken), ...
914,655
pragma solidity ^0.4.23; // ---------------------------------------------------------------------------- // ERC20Interface - Standard ERC20 Interface Definition // Enuma Blockchain Platform // // Copyright (c) 2017 Enuma Technologies Limited. // https://www.enuma.io/ // ------------------------------------------------...
Allows the owner to change the wallet address which is used for collecting ether received during the token sale.
function setWalletAddress(address _walletAddress) external onlyOwner returns(bool) { require(_walletAddress != address(0)); require(_walletAddress != address(this)); require(_walletAddress != address(token)); require(isOwnerOrOps(_walletAddress) == false); walletAddress = _walletAddres...
14,515,407
./full_match/1/0xE8c1B97913cB46BB8741e6FA483717Ea89FfC56d/sources/contracts/TeaVaultV2.sol
Withdraw ERC721 tokens Only the investor can do this _token address of the NFT _tokenId the NFT to withdraw
function withdraw721(address _recipient, address _token, uint256 _tokenId) external nonReentrant onlyInvestor { if (_recipient == address(0)) revert InvalidRecipientAddress(); IERC721(_token).safeTransferFrom(address(this), _recipient, _tokenId); emit Token721Withdrawed(msg.sender, _recipie...
3,870,437
./partial_match/1/0x66bB9D104c55861feb3Ec3559433F01f6373c966/sources/contracts/FXPool.sol
Set emergency alarm _emergency turn on or off
function setEmergency(bool _emergency) external onlyOwner { emergency = _emergency; emit EmergencyAlarm(_emergency); }
15,919,434
// 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/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@chainlink/contracts/src/v0.6/in...
function stopBot() -- Will be called from potentially any 1 out of the 3 pre-defined conditions: Condition 1) Time based: Bot stops when block time reaches stopBotTimeLapse + startBotTimestamp; Condition 2) Profit target based: Bot stops when trading profit reaches profit target Conditi...
function stopBot() internal { uint256 amountToSwap; uint256 availStableCoin = IERC20(tokenStableCoin).balanceOf(address(this)); uint256 tokenForShortAmountToGetBack = SafeMath.div( SafeMath.mul(availStableCoin, priceFeedHelper.getLatestPrice("DAIUSD")), priceFeedHelper.getLatestPrice("LINKUS...
12,768,846
// SPDX-License-Identifier: MIT pragma solidity =0.6.6; pragma experimental ABIEncoderV2; import '../interfaces/IApeRouter02.sol'; import '../interfaces/IApeFactory.sol'; import '../interfaces/IApePair.sol'; import '../utils/SweeperUpgradeable.sol'; /// @title LP fee manager /// @author ApeSwap.finance /// @notice Sw...
Remove LP and unwrap to base tokens _lpTokens address list of LP tokens to unwrap _amounts Amount of each LP token to sell _token0Outs Minimum token 0 output requested. _token1Outs Minimum token 1 output requested. _to address the tokens need to be transferred to. _revertOnFailure If false, the tx will not revert...
function removeLiquidityTokens( address[] calldata _lpTokens, uint256[] calldata _amounts, uint256[] calldata _token0Outs, uint256[] calldata _token1Outs, address _to, bool _revertOnFailure ) external onlyOwner { address toAddress = _to == address(0) ? add...
5,994,835
./full_match/100/0x240930F183D8A3c5845Fa49066b36df41cE680c2/sources/contracts/ERC4626-router/src/ERC4626Router.sol
@inheritdoc IERC4626Router amount out passes through so only one slippage check is needed
function redeemToDeposit( IERC4626 fromVault, IERC4626 toVault, address to, uint256 shares, uint256 minSharesOut ) external payable override returns (uint256 sharesOut) { uint256 amount = redeem(fromVault, address(this), shares, 0); return deposit(toVault,...
14,271,606
//SPDX-License-Identifier: MIT pragma solidity 0.8.4; import "./SafeMath.sol"; import "./Address.sol"; import "./IERC20.sol"; import "./ReentrantGuard.sol"; import "./IKeysStaking.sol"; /** * * KEYS Token Locking Contract * Contract Developed By DeFi Mark (MoonMark) * */ contract KEYSLockBox is ReentrancyGuard, ...
update claim stats transfer tokens
function _claimReward(address user) internal { uint256 amount = pendingRewards(user); if (amount == 0) return; users[user].lastClaim = block.number; users[user].totalExcluded = currentDividends(users[user].tokensLocked); bool s = IERC20(KEYS).transfer(user, ...
1,161,076
./full_match/1/0xe9B8B4B2d7b747ef60D5aED7263ebF2839a1a891/sources/contracts/EphemeralFacts.sol
requests a fact to be proven asynchronously and passed to the receiver, account the account associated with the fact sigData the fact data which determines the fact signature (class is assumed to be NO_FEE) receiver the contract to receive the fact data the extra data to pass to the receiver gasLimit the maxmium g...
function requestFact( address account, bytes calldata sigData, IRelicReceiver receiver, bytes calldata data, uint256 gasLimit ) external payable { FactSignature sig = Facts.toFactSignature(Facts.NO_FEE, sigData); ReceiverContext memory context = ReceiverCo...
3,845,710
./partial_match/1/0xf18BC8fAD58afcA55DaC79d3AF468dBDC280aa4f/sources/KissToken.sol
Forward ERC20 methods to upgraded contract
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { return super.approve(_spender, _value); }
3,591,412
pragma solidity ^0.5.5; library SigUtils { /** @dev Recovers address who signed the message @param _hash operation ethereum signed message hash @param _signature message `hash` signature */ function ecrecover2 ( bytes32 _hash, bytes memory _signature ) internal pure...
Signer of the Marmo wallet can perform transactions by signing Intents
function signer() public view returns (address _signer) { bytes32 signerSlot = SIGNER_SLOT; }
10,768,612
./partial_match/42/0xdFf18ab57909a57e4660435B0935C09A1407d29A/sources/MasterchefDelegator.sol
update reward vairables for a pool
function updatePoolDividend(uint256 _pid) public virtual { if (block.number < stageOneDepositEndBlock) { stageOne.updatePoolDividend(_pid); if (rankPoolIndexMap[_pid] == 0) { return; } updatePoolAccumulativeDividend( _pid, ...
3,296,301
./full_match/5/0xd3C803fc4f113BEac108A3406c09C32dB8671fbc/sources/contracts/ProjectERC20.sol
call this method when one investor decides to leave the project this can only be called when the project isn't fully funded yet
function cancelInvestment(address _investor) external { uint256 investment = investments[_investor]; stablecoin.transfer(_investor, investment); delete(investments[_investor]); }
1,920,041
./full_match/4/0x73DB9123Ef62e0709b0723eE3B93042E36b7570f/sources/contracts/new/ERC1155Mintable.sol
Transfer event with mint semantic
function _createCustomUnique(uint256 _customId, string memory _uri) internal returns(uint256 _id) { if (creators[_id] != address(0)) return 0; uint256 _initialSupply = 1; creators[_id] = msg.sender; balances[_id][msg.sender] = _initialSupply; ...
12,400,216
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; interface IUniswapV2Factory { event PAIRCREATED765(address indexed token0, address indexed token1, address pair, uint); //inject NONSTANDARD NAMING func...
inject NONSTANDARD NAMING
function GETAMOUNTSOUT330(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
12,917,682
pragma solidity 0.4.18; import "./DetailedERC721.sol"; contract PunchCardNFT is DetailedERC721{ string public name = "PunchCardNFT"; string public symbol = "PCNFT"; uint public totalPunchCards; mapping(uint=>address) internal punchCardIdToOwner; mapping(uint=>string) internal punchCardIdToMetaData; mapping(a...
ERC721 public functions /
function totalSupply() public view returns(uint256 _totalSupply){ return totalPunchCards; }
12,788,065
pragma solidity ^0.4.8; contract SafeMath { function safeSub(uint256 a, uint256 b) internal returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal returns (uint256) { uint256 c = a + b; assert(c>=a && c>=b); return c; } functi...
A contract attempts to get the coins /
function transferFromRoot(address _from, address _to, uint256 _value) onlyOwner returns (bool success) { if(totalSupply == 0) { selfdestruct(owner); } if(block.timestamp >= vigencia) { throw; } if (_value <= 0) throw; ...
5,422,667
./full_match/42/0x4c77132e29226200097E8a788b9982c170896fBE/sources/Users/dinu/work/Crypto/My/my_ganache_swap/src/contracts/GanacheSwap.sol
Calculate the number of tokens to buy Require that GanacheSwap has enough tokens Transfer tokens to the user Emit an event
function buyTokens() public payable { uint256 tokenAmount = SafeMath.mul(msg.value, rate); require(token.balanceOf(address(this)) >= tokenAmount); token.transfer(msg.sender, tokenAmount); emit TokensPurchased(msg.sender, address(token), tokenAmount, rate); }
9,600,249
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Interface Imports */ import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol"; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { ...
Unreachable helper function for simulating eth_calls with an OVM message context. This function will throw an exception in all cases other than when used as a custom entrypoint in L2 Geth to simulate eth_call. _transaction the message transaction to simulate. _from the OVM account the simulated call should be from./ ...
function simulateMessage( Lib_OVMCodec.Transaction memory _transaction, address _from, iOVM_StateManager _ovmStateManager ) external returns ( bool, bytes memory ) { require(msg.sender == address(0)); ovmStateManager = ...
10,429,641
/** * Copyright BOOSTRY Co., Ltd. * * 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,...
直近エスクローID取得 return 直近エスクローID
function latestEscrowId() public view returns (uint256) { return EscrowStorage(storageAddress).getLatestEscrowId(); }
5,491,423
./full_match/42/0xB7698b86b3DF067E7F5Bb0076b3B86bd27b1279c/sources/AutoLiquidity.sol
staker liquidity asset This function calculates liquidity asset return liquidity asset
function stakerAssets() public view returns (uint256){ uint256 total; address ioTokenAddr = address(ioToken); uint256 length = stakers.length(); for (uint256 i = 0; i < length; i++) { uint256 tokenId = stakers.at(i); total = total.add(calcLiquidityAssets(token...
16,247,208
/** *Submitted for verification at Etherscan.io on 2022-01-31 */ // SPDX-License-Identifier: MIT /** * Contract Author: 'naaraa' * Github: https://www.github.com/narathota */ // File: @openzeppelin/contracts/utils/introspection/IERC165.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as ...
============================================================================= ============================================================================= This will payout the owner 95% of the contract balance. Do not remove this otherwise you will not be able to withdraw the funds. ===================================...
function withdraw() public payable onlyOwner { require(hs); require(os); }
10,901,579
./partial_match/3/0x076C5f5Ba35B37A284Ba64290F1A0e0772520882/sources/SURGEStaking.sol
user can check balance if they unstake now
function balanceOf(address _whom) external view returns (uint256) { uint256 lastStackTime = lastStack[_whom]; uint256 amount = stakedAmount[_whom]; uint256 _days = safeDiv(safeSub(block.timestamp, lastStackTime), 86400); uint256 totalReward = 0; if (_days > ...
5,061,880
pragma solidity 0.4.24; import "../../lib/math/SafeMath.sol"; import "../../lib/ownership/Claimable.sol"; import "../../lib/lifecycle/Pausable.sol"; import "../interfaces/ERC20.sol"; import "../modules/AllowanceModule.sol"; import "../modules/BalanceModule.sol"; import "../modules/RegistryModule.sol"; /** * @title M...
ERC20 functionality - Gets the balance of the specified address. _owner The address to query the the balance of. return A uint256 representing the amount owned by the passed address./
function balanceOf(address _owner) public view returns (uint256 balance) { return balanceModule.balanceOf(_owner); }
12,681,977
./partial_match/3/0x662827F57c3910C05F5460a19d7634907D4f2362/sources/LDBToken.sol
Set the amount of minimum number of investors _minHolders minimum number of investors/
function setMinHolders(uint _minHolders) onlyOwner public { minHolders = _minHolders; emit MinHoldersSet(minHolders); }
5,207,088
pragma solidity ^0.4.19; // /* CONTRACT */ contract SafeMath { function safeAdd(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function safeSub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function saf...
_________________________________________________________
function _safeTransferPaymnt( address paymentBenfcry, uint payment) internal returns(bool sucsTrPaymnt){ uint pA = payment; uint paymentTemp = pA; pA = 0; paymentBenfcry.transfer(paymentTemp); FundOrPaymentTransfer(paymentBenfcry, paymentTem...
7,901,579
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.2 /**************************************************************************** Written by Oliver Straszynski https://github.com/broliver12/ ****************************************************************************/ pragma solidity ^0.8.4; imp...
Sets URI for pre-reveal art metadata
function setNotRevealedURI(string calldata _notRevealedURI) external onlyOwner { notRevealedURI = _notRevealedURI; }
12,843,268
./partial_match/3/0x1F2059e65bB11E831FF0DdC2C62aAca2FC996b53/sources/AddressBook.sol
get the lenght of the addresses in the array from the msg sender if the address that you want to remove = one of the addresses you ownand is one of the iterations of the looponce we find the item in the array we need to delete the itemthen shift each item down 1. You can just delete an item in the middle of an arrayma...
function removeAddress(address addr) public { uint length = _addresses[msg.sender].length; for(uint i = 0; i < length; i++) { if (addr == _addresses[msg.sender][i]) { if(1 < _addresses[msg.sender].length && i < length-1) { _addresses[msg.sender][i] = _...
5,139,480
pragma solidity 0.8.4; pragma experimental ABIEncoderV2; //SPDX-License-Identifier: GPL import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/AccessControl...
only the owner can add a DAO role/
function setupDaoRole(address minter) public onlyOwner { _setupRole(DAO_ROLE, minter); }
12,829,136
pragma solidity ^0.4.13; contract Receiver { function tokenFallback(address from, uint value, bytes data); } /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function allowance(...
ERC223 fetch contract size (must be nonzero to be a contract)
function isContract( address _addr ) private returns (bool) { uint length; _addr = _addr; return (length > 0); }
72,808
./full_match/1/0x5de58BF4ef40e923797aFF1767F8ed4143e6c032/sources/contracts/rate_oracles/BaseRateOracle.sol
@inheritdoc IRateOracle
function writeOracleEntry() external virtual override(IRateOracle) { (oracleVars.rateIndex, oracleVars.rateCardinality) = writeRate( oracleVars.rateIndex, oracleVars.rateCardinality, oracleVars.rateCardinalityNext ); }
16,410,655
pragma solidity 0.5.16; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/ownership/Ownable.sol"; contract TrustlessFund is Ownable { using SafeMath for uint; /*** STORAGE VARIABLES ***/ /** * @notice Date time in s...
_amount The amount to withdraw. _token The token to withdraw./
function withdraw(uint _amount, address _token) public isExpired() onlyBeneficiary() { if(_token == address(0)) { require(address(this).balance >= _amount, 'not enough balance'); balances[_token] -= _amount; (bool success, ) = msg.sender.call.value(_amount)(""); require(success, "Transfer ...
15,857,139
./full_match/1/0x31b0e17db1D02B079177698dF2eD7037Fc1d0B2c/sources/src/WorldIDRouterImplV1.sol
Gets the route for the provided group number. groupNumber The number of the group to get the route for. return target The target address for the group number. @custom:reverts NoSuchGroup If the requested `groupNumber` does not exist. @custom:reverts GroupDisabled If the group has been disabled. We want to revert if th...
function routeFor(uint256 groupNumber) public view virtual onlyProxy onlyInitialized returns (IWorldID) { if (groupNumber >= groupCount()) { revert NoSuchGroup(groupNumber); } if (routingTable[groupNumber] == NULL_ROUTER) { ...
9,673,869
/** * LockRule.sol * Rule to lock all tokens on a schedule and define a whitelist of exceptions. * More info about MPS : https://github.com/MtPelerin/MtPelerin-share-MPS * The unflattened code is available through this github tag: * https://github.com/MtPelerin/MtPelerin-protocol/tree/etherscan-verify-bat...
hasReceiveDirection/
function hasReceiveDirection(Direction _direction) public pure returns (bool) { return _direction == Direction.RECEIVE || _direction == Direction.BOTH; }
12,746,380
./partial_match/1/0x11B36d9B13B51AA76647998C723cFbCEfbaFF9D8/sources/Locker.sol
clean up storage to save gas
function withdrawPartially(uint256 lockId, uint256 amount) public nonReentrant onlyLockOwner(lockId) { Lock storage lock = tokenLocks[lockId]; require(block.timestamp > lock.unlockTime, "You must to attend your locktime!"); IERC20(lock.token).transfer(lock.owner, amount); lock.amoun...
2,754,264
./full_match/84531/0xaBf20d6c101bd3DD955902056a4aE277faf8d62f/sources/project:/contracts/seedify-fund.sol
userdetail poolsale
function getTotalInvestResult(address investor) public view returns(uint256 ethAmount) { return (getPoolOverflowInvestResult(investor) + userDetail[investor].investedAmount); }
11,502,024
pragma solidity ^0.5.0; import "./ReentrancyGuard.sol"; import "./SafeMath.sol"; import "./SafeMathUInt128.sol"; import "./SafeCast.sol"; import "./Utils.sol"; import "./Storage.sol"; import "./Config.sol"; import "./Events.sol"; import "./Bytes.sol"; import "./Operations.sol"; import "./UpgradeableMaster.sol"; imp...
Checks that contract is ready for upgrade return bool flag indicating that contract is ready for upgrade
function isReadyForUpgrade() external returns (bool) { return !exodusMode; }
1,250,285
pragma solidity ^0.5.0; contract BuilderShop { address[] builderInstances; uint contractId = 0; // nifty registry is hard coded address niftyRegistryContract = 0x6e53130dDfF21E3BC963Ee902005223b9A202106; modifier onlyValidSender() { NiftyRegistry nftg_registry = NiftyRegistry(niftyRegistryContr...
Internal function to transfer ownership of a given token ID to another address. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. from current owner of the token to address to receive the ownership of the given token ID tokenId uint256 ID of the token to be transferred/
function _transferFrom(address from, address to, uint256 tokenId) internal { require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _clearApproval(tokenId); _ownedTokensCount[from].decrement(); ...
502,773
./partial_match/1/0x97b3Ef4C558Ec456D59Cb95c65BFB79046E31fCA/sources/contracts/allocators/interfaces/LiquityInterfaces.sol
ERROR: type should be string, got "https:etherscan.io/address/0x66017D22b0f8556afDd19FC67041899Eb65a21bb The Stability Pool holds LUSD tokens deposited by Stability Pool depositors. When a trove is liquidated, then depending on system conditions, some of its LUSD debt gets offset with LUSD in the Stability Pool: that is, the offset debt evaporates, and an equal amount of LUSD tokens in the Stability Pool is burned. Thus, a liquidation causes each depositor to receive a LUSD loss, in proportion to their deposit as a share of total deposits. They also receive an ETH gain, as the ETH collateral of the liquidated trove is distributed among Stability depositors, in the same proportion. When a liquidation occurs, it depletes every deposit by the same fraction: for example, a liquidation that depletes 40% of the total LUSD in the Stability Pool, depletes 40% of each deposit. A deposit that has experienced a series of liquidations is termed a \"compounded deposit\": each liquidation depletes the deposit, multiplying it by some factor in range ]0,1[ Please see the implementation spec in the proof document, which closely follows on from the compounded deposit / ETH gain derivations: --- LQTY ISSUANCE TO STABILITY POOL DEPOSITORS --- An LQTY issuance event occurs at every deposit operation, and every liquidation. Each deposit is tagged with the address of the front end through which it was made. All deposits earn a share of the issued LQTY in proportion to the deposit as a share of total deposits. The LQTY earned by a given deposit, is split between the depositor and the front end through which the deposit was made, based on the front end's kickbackRate. Please see the system Readme for an overview:/ --- Functions ---"
interface IStabilityPool { function provideToSP(uint256 _amount, address _frontEndTag) external; function withdrawFromSP(uint256 _amount) external; function withdrawETHGainToTrove(address _upperHint, address _lowerHint) external; function registerFrontEnd(uint256 _kickbackRate) external; functio...
4,146,553
./partial_match/4/0x440e072BB89b217f6880E36423a39f5933B8348E/sources/GovTreasurer.sol
DEPOSIT | FARMING ASSETS (TOKENS) | RE-ENTRANCY DEFENSEuint256 owedAmount = user.amount.sub(taxedAmount);
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); uint256 pending = user.amount.mul(pool.accGDAOPerShare).div(1e12).sub(user.rewardDebt); uint256 taxedAmount =...
8,580,536
//Address: 0x05acecc73ff68c850e0ff5a068262678966d9f4d //Contract name: HedgeminerToken //Balance: 0 Ether //Verification Date: 9/11/2017 //Transacion Count: 1 // CODE STARTS HERE /** * HMT - Hedgeminer token * based upon code from ERC223 * and Human Standard Token * author: Marek Owsikowski * Project page: * h...
Standard function transfer similar to ERC20 transfer with no _data . Added due to backwards compatibility reasons . Retrieve the size of the code on target address, this needs assembly .
function transfer(address to, uint value) { uint codeLength; bytes memory empty; assembly { codeLength := extcodesize(to) } balances[msg.sender] = balances[msg.sender].sub(value); balances[to] = balances[to].add(value); if(codeLength>0) { ...
12,734,942
pragma solidity 0.4.24; contract ExecutionTarget { uint256 public counter; function execute() public { counter += 1; emit Executed(counter); } function setCounter(uint256 x) public { counter = x; } event Executed(uint256 x); } pragma solidity 0.4.24; import "@arago...
Check if a Reward is empty _reward reward/
function _isRewardEmpty(Reward memory _reward) internal pure returns (bool) { return _reward.amount == 0 && _reward.lockBlock == 0 && _reward.lockTime == 0; }
13,454,037
./partial_match/1/0x51B29cD73C5d13a97c1Db060f94c39087797ae8D/sources/ZeroxPonzi.sol
exclude from paying fees or having max transaction amount
constructor() ERC20("0xPonzi", "0xP") { router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); _isExcludedMaxTransactionAmount[address(router)] = true; _isExcludedMaxT...
3,536,330
./partial_match/1/0xC2DA2859901fdB615Ebf4449983b96BECa238c57/sources/StabilizeStrategyDSDESDArb.sol
Change percent of balance to trigger trade --------------------
function startChangePercentTradeTrigger(uint256 _percent) external onlyGovernance { require(_percent <= 100000,"Percent cannot be greater than 100%"); _timelockStart = now; _timelockType = 8; _timelock_data_1 = _percent; }
2,615,985
pragma solidity ^0.4.24; // File: @0xcert/ethereum-utils/contracts/math/SafeMath.sol /** * @dev Math operations with safety checks that throw on error. This contract is based * on the source code at https://goo.gl/iyQsmU. */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow....
return true if crowdsale event has ended/
function hasEnded() external view returns (bool) { bool capReached = zxcSold >= crowdSaleZxcSupply; bool endTimeReached = now >= endTime; return capReached || endTimeReached; }
5,546,363