file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
// Sources flattened with hardhat v2.8.4 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.5.0
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC20 standard as de... | Get additional info about the peg status | function price_info() public view returns (
int256 collat_imbalance,
uint256 cpi_peg_price,
uint256 fpi_price,
uint256 price_diff_frac_abs
) {
fpi_price = getFPIPriceE18();
cpi_peg_price = cpiTracker.currPegPrice();
uint256 fpi_supply = FPI_TKN.totalSuppl... | 1,301,261 |
./partial_match/1/0x396B18bbB2FF106F94872C5DC21746A32c06D760/sources/GiverOfRuggies.sol | View function to see pending RUGs on frontend. | function pendingRuggies(uint256 _pid, address _user) public view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 blockTime = block.timestamp;
uint256 accRuggiesPerShare = pool.accRuggiesPerShare;
uint256 token... | 4,490,252 |
pragma solidity ^0.4.25;
/*
██╗ ██╗██╗ ██╗██████╗ ███████╗██████╗ ███████╗████████╗ █████╗ ██╗ ██╗███████╗
██║ ██║╚██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██║ ██╔╝██╔════╝
███████║ ╚████╔╝ ██████╔╝█████╗ ██████╔╝███████╗ ██║ ███████║█████╔╝ █████╗
██╔══██║ ╚██╔╝ ██╔═══╝ ██╔══╝ ██╔... | Staking will reinvest its ETH/ triggers exchanges payable fallback buy function Some failure code | function reinvestEther()
public
{
uint256 _balance = address(this).balance;
if (_balance > 0) {
if(!address(tokenContract_).call.value(_balance)()) {
revert();
}
}
}
| 5,433,589 |
pragma solidity >=0.6.0 <0.8.0;
import '../proxy/OwnedUpgradeabilityProxy.sol';
import '../ownable/MultiOwnable.sol';
import '../../config/InternalSmartContractConfig.sol';
import '../basic/Address.sol';
import '../../wallet/UserWallet.sol';
contract UserWalletProxy is MultiOwnable{
using Address for address payab... | For backward competible newImplementation address representing the new implementation to be set/ | function setUserWalletImplementation(address newImplementation) public onlyOwner{
bytes32 position = userWalletImplPosition;
assembly {
sstore(position, newImplementation)
}
}
| 5,402,389 |
pragma solidity ^0.5.3;
/**
* @author ESPAY PTY LTD.
*/
/**
* @title ERC223ReceivingContract
* @dev ContractReceiver abstract class that define by erc223, the method tokenFallback must by receiver contract if it want
* to accept erc223 tokens.
* ERC223 Receiving Contract interface
*/
contract ERC223Receivi... | Adds two numbers, reverts on overflow./ | function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
| 949,149 |
./partial_match/42/0x4783be330C4577ab8793B3e927E70f512922A682/sources/SystemStatus.sol | Pynth exchange and transfer requires the system be active and exchanging must be active and the Pynth exchanging between the Pynths must be active and finally, the Pynths cannot be suspended | function requireExchangeBetweenPynthsAllowed(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view {
_internalRequireSystemActive();
_internalRequireExchangeActive();
_internalRequirePynthExchangeActive(sourceCurrencyKey);
_internalRequirePynthExchangeActive(dest... | 3,388,557 |
./partial_match/137/0x5F2Cdb8D6fc4Ceed5d9B983fEb8C20e1B8A99c53/sources/project_/contracts/GenesisAvatar.sol | Deleting the royalties if the avatar is sent to the 0x0...0 wallet | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256 batchSize
) internal override whenNotPaused {
super._beforeTokenTransfer(from, to, tokenId, batchSize);
if (to == address(0)) {
avatarRoyalties[tokenId] = 0;
}
... | 3,515,600 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
//
interface IERC20 {
function TOTALSUPPLY709()... | inject NONSTANDARD NAMING | function GRANTROLE137(bytes32 role, address account) public virtual { | 12,852,164 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when de... | Returns maximum total supply of the token | function getMaxTotalSupply() external view returns (uint256) {
return _maxTotalSupply;
}
| 1,193,073 |
pragma solidity ^0.4.18;
import "./interfaces/ModelInterface.sol";
import "./abstracts/ModelVariables.sol";
// TODO: collision-resistant prefix for vars, methods, events
// Doesn't use stoppable, since dummy controller can be assigned temporarily.
contract ModelManagement is ModelInterface, ModelVariables {
event D... | INTERNAL ?TODO: Verification if controller code has selfdestruct opcode | function _modelSetControllerNoAuth (address _controller_address)
internal
returns (bool)
{
require(_controller_address != 0);
ModelControllerSet(_controller_address);
model_controller = _controller_address;
return true;
}
| 12,611,410 |
./partial_match/1/0x0092CD4044E1672c9c513867eb75e6213AF9742f/sources/src/LlamaCore.sol | How policyholders that have the right role contribute towards the disapproval of an action with a reason. | function _castDisapproval(address policyholder, uint8 role, ActionInfo calldata actionInfo, string memory reason)
internal
returns (uint96)
{
(Action storage action, uint96 quantity) = _preCastAssertions(actionInfo, policyholder, role, ActionState.Queued);
action.totalDisapprovals = _newCastCount(a... | 9,329,901 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
/// @title JPEG NFT contract
/// @notice 1019 NFTs are avai... | Allows the public to mint a maximum of 2 NFTs per address. NFTs minted using this function range from 50 to 999. amount Number of NFTs to mint (max 2). | function mint(uint256 amount) external payable {
require(isPublicOpen(), "SALE_NOT_OPEN");
_mintInternal(msg.sender, amount);
}
| 6,917,212 |
./full_match/5/0x85094B1936bD7287C9444FaA09dCa0B257993832/sources/_openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol | Returns the quorum for a block number, in terms of number of votes: `supply numerator / denominator`./ | function quorum(uint256 blockNumber) public view virtual override returns (uint256) {
return (token.getPastTotalSupply(blockNumber) * quorumNumerator(blockNumber)) / quorumDenominator();
}
| 1,897,352 |
./partial_match/3/0x7659D781dD67018828b1F0b7147326B6638C45e1/sources/RamenToken.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())... | 5,262,259 |
pragma solidity 0.5.16;
import "@openzeppelin/contracts-ethereum-package/contracts/math/Math.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contr... | Finalizes (or cancels) the strategy update by resetting the data/ | function finalizeStrategyUpdate() public onlyControllerOrGovernance {
_setStrategyUpdateTime(0);
_setFutureStrategy(address(0));
}
| 1,463,893 |
/**
*Submitted for verification at Etherscan.io on 2021-04-27
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-13
*/
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier: MIT
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an ... | For children nfts, these should be setup on the matic network before the 721 if there are any This should be done before doing a classic matic deposit, that is why anyone can call it for now | function transferNFTsDataToMatic(uint256[] memory _tokenIds) external {
uint256 length = _tokenIds.length;
uint256[] memory _salePrices = new uint256[](length);
address[] memory _designers = new address[](length);
string[] memory _tokenUris = new string[](length);
for( uint2... | 520,604 |
pragma solidity 0.8.10;
//SPDX-License-Identifier: MIT
import { console } from "hardhat/console.sol";
import { IFollowModule } from "../interfaces/IFollowModule.sol";
import { ModuleBase } from "../core/modules/ModuleBase.sol";
import { Errors } from "../libraries/Errors.sol";
import { Events } from "../libraries/Even... | check that follower has paid enough | function assertSubscriptionValid(uint256 profileId, address followerAddress) public view {
if (_profiles[profileId].miniumSubscriptionAmount > _profiles[profileId].followers[followerAddress].lastPaymentAmount) {
revert PatronFollowErrors.SubscriptionInvalid();
}
if (isFollowerActive(profileId, follo... | 12,882,582 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "../external/compound/PriceOracle.sol";
import "../external/compound/CToken.sol";
import "../e... | Changes the admin and emits an event./ | function changeAdmin(address newAdmin) external onlyAdmin {
address oldAdmin = admin;
admin = newAdmin;
emit NewAdmin(oldAdmin, newAdmin);
}
| 270,099 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than a... | Remove ALL operators | function removeAllOps() public onlyOwner {
for (uint i = 0; i < operators.length; i++) {
isOperator[operators[i]] = false;
}
operators.length = 0;
}
| 580,738 |
./partial_match/56/0x982e45c8e1894b7de89e0aE547e9022b80295d68/sources/StrategyAutoMaxiLP.sol | It calculates how much {want} the contract holds./ | function balanceOfWant() public view returns (uint) {
return IERC20(want).balanceOf(address(this));
}
| 11,298,172 |
pragma solidity ^0.4.24;
/**
* @title ERC20Interface
* @dev Standard version of ERC20 interface
*/
contract ERC20Interface {
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);... | Mint GAMT tokens and aproves the passed address to spend the minted amount of tokens No more than 300,000,000 GAMT can be minted _target The address to which new tokens will be minted _mintedAmount The amout of tokens to be minted _spender The address which will spend minted funds/ | function mintTokensWithApproval(address _target, uint256 _mintedAmount, address _spender) public onlyOwner returns (bool success){
require(_mintedAmount <= _unmintedTokens);
balances[_target] = balances[_target].add(_mintedAmount);
_unmintedTokens = _unmintedTokens.sub(_mintedAmount... | 14,385,165 |
./full_match/5/0x89ff8b57e940D12B49a5D0Eda4BDDD4edeBd5fc1/sources/Contract/zerova.sol | change the free max per wallet | function setFreeMaxPerWallet(uint256 _limit) public onlyOwner {
MaxperWalletFree = _limit;
}
| 1,896,795 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./Interaction.sol";
import "./xStart... | create a modifier that verifies that ILO can be voted on | function voteForGOV(address proposalAddr_, uint amount_, VoteChoice choice_) external allowedToInteract onlyGOVVoteOpen(proposalAddr_) returns(bool) {
_disallowInteraction();
require(balance(_msgSender()) > amount_, "not enough balance");
Voter storage voter = _voters[_msgSender()];
... | 14,033,985 |
./partial_match/1/0xAdFc8C296eb7CEc677C2DdecE28007A3D4e465a1/sources/contracts/dependencies/openzeppelin/contracts/SafeMath.sol | Returns x y, reverts if overflows x The multiplicand y The multiplier return z The product of x and y | function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
unchecked {
require(x == 0 || (z = x * y) / x == y);
}
}
| 2,890,223 |
./full_match/84531/0xC5B5EaF85FA1807AB8662e3801eC6996a3642133/sources/router.sol | refund dust eth, if any | function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external virtual override payable ensure(deadline) returns (uint amountToken, uint amountETH, uint liquidity) {
(amountTok... | 14,318,486 |
./full_match/56/0x6Df6a43Be4B706c45BC028D652829299D932d000/sources/juryProject.sol | here we fetch the index of the proposal smart contract address in the arrayin order to run a require check on it if its exsists make sure that the user cannot vote more than once check the weekly votes status adding 1 to the approve coutner adding the user address to the approved mapping if you query the user address i... | function choseOptionA(uint256 selectedProposalId) public whenNotPaused {
address user = msg.sender;
require(user != address(0), "invalid address");
require(
committedBalance[user] > 0,
"Jury Protocol: user's committed balance is zero."
);
require(user... | 3,235,554 |
./full_match/97/0xD4eE067C47306B4f9620c8fd7dAc4aAF18f0B22B/sources/project_/contracts/diamond/libraries/LibTrading.sol | Check that the current market is tradable price qty 10^18 / 10^(8+10) = price qty The notional value must be greater than or equal to the minimum notional value allowed The notional value of the position must be less than or equal to the maximum notional value allowed by pair It is prohibited to open positions with ... | function _openMarketCheck(
TradingStorage storage ts,
IBook.OpenDataInput calldata odi,
IPairsManager.PairView memory pair,
uint8 tokenInDecimals
) private view {
checkTradeSwitch(ts, ITrading.TradingSwitch.MARKET_TRADING);
(uint marketPrice,) = LibPriceFacade.ge... | 5,028,985 |
./full_match/42220/0x6dB8df7e3B471Da88Fdf98C90097Ac05Cc5F3FdD/sources/contracts/governor/impactMarketCouncil/ImpactMarketCouncilImplementation.sol | Function used to propose a new proposal. Sender must have delegates above the proposal threshold. _targets Target addresses for proposal calls. _signatures Function signatures for proposal calls. _calldatas Calldatas for proposal calls. _description String description of the proposal. return Proposal id of new prop... | function propose(
address[] memory _targets,
string[] memory _signatures,
bytes[] memory _calldatas,
string memory _description
) external onlyMember returns (uint256) {
require(
_targets.length == _calldatas.length &&
_signatures.length == _callda... | 16,361,513 |
./full_match/1/0x61Bb10473464b0f123E3E4eEe4fB14654A928CC1/sources/browser/UniswapV2SlidingOracle.sol | Allows pendingGovernance to accept their role as governance (protection pattern)/ | function acceptGovernance() external {
require(msg.sender == pendingGovernance, "acceptGovernance: !pendingGov");
governance = pendingGovernance;
}
IKeeperFi public constant KFI = IKeeperFi(0x4e59DFe7c5D34C498Cfe18f0b6dB10941d6E1A8a);
address public constant factory = 0x5C69bEe701e... | 8,327,494 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asser... | Return the burn lot information at a given ID _burnLotId The burn lot ID in question return id of the lot return The address of the burn lot owner return Primordial token amount in the burn lot/ | function burnLotById(bytes32 _burnLotId) public view returns (bytes32, address, uint256) {
BurnLot memory _burnLot = burnLots[_burnLotId];
return (_burnLot.burnLotId, _burnLot.lotOwner, _burnLot.tokenAmount);
}
| 10,007,313 |
./full_match/80001/0x99Ef070eCFe954e28412eAa05c7474886501b346/sources/project_/contracts/Amberfi/Market.sol | Place bid to an auction (Native PaymentToken) auctionId_ (uint256) Auction ID bidAmount_ (uint256) Bid amount in PaymentToken/ | function placeBid(uint256 auctionId_, uint256 bidAmount_)
external
payable
nonReentrant
whenNotPaused
isValidAuction(auctionId_)
{
AmberfiLib.Auction storage auction = _auctions[auctionId_];
AmberfiLib.AuctionState auctionState = auction.auctionState;
... | 5,551,820 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when ... | Internal function to set the token URI prefix. _tokenURIPrefix string URI prefix to assign/ | function _setTokenURIPrefix(string memory _tokenURIPrefix) internal {
tokenURIPrefix = _tokenURIPrefix;
}
| 25,980 |
./full_match/100/0x27490660b54f6B1a7E07F71260329670F75a66dD/sources/src/libraries/StringUtils.sol | from https:github.com/OpenZeppelin/openzeppelin-contracts @solidity memory-safe-assembly @solidity memory-safe-assembly | function toString(uint256 value) internal pure returns (bytes memory) {
unchecked {
uint256 length = log10(value) + 1;
bytes memory buffer = new bytes(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
... | 14,286,154 |
./full_match/42161/0x755188415C88C31B9D1deb1De6aCa17eD998AA22/sources/soluneaArb/contract/base/SoluneaPair.sol | Produces the cumulative price using counterfactuals to save gas and avoid a call to sync. if time has elapsed since the last update on the pair, mock the accumulated price values subtraction overflow is desired | function currentCumulativePrices()
public
view
returns (
uint256 reserve0Cumulative,
uint256 reserve1Cumulative,
uint256 blockTimestamp
)
{
blockTimestamp = block.timestamp;
reserve0Cumulative = reserve0CumulativeLast;
r... | 16,302,478 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "../libraries/IERC20Full.sol";
import "../balancer/BPool.sol";
import "./TurboShareTokenFactory.sol";
import "./FeePot.sol";
abstract contract AbstractMarketFactoryV2 is TurboShareTokenFactoryV1, Ownable {
using SafeMathUint256 for ... | Only usable off-chain. Gas cost can easily eclipse block limit. | function listUnresolvedMarkets() public view returns (uint256[] memory) {
uint256 _totalUnresolved = 0;
for (uint256 i = 0; i < markets.length; i++) {
if (!isMarketResolved(i)) {
_totalUnresolved++;
}
}
uint256[] memory _marketIds = new uint25... | 5,428,280 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./interfaces/IERC20.sol";
import "./interfaces/IWrappedPosition.sol";
import "./interfaces/ITranche.sol";
import "./interfaces/ITrancheFactory.sol";
import "./interfaces/IInterestToken.sol";
import "./libraries/ERC20Permit.sol";
import "./librarie... | This function allows someone to trigger the speedbump and eventually allow pro rata withdraws We only allow setting the speedbump once We only allow setting it when withdraws can happen We require that the total holds are less than the supply of principal token we need to redeem We emit a notification so that i... | function hitSpeedbump() external {
require(speedbump == 0, "E:AlreadySet");
require(block.timestamp >= unlockTimestamp, "E:Not Expired");
uint256 totalHoldings = position.balanceOfUnderlying(address(this));
if (totalHoldings < valueSupplied) {
emit SpeedBumpHit(block.time... | 44,235 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "../escrow/EscrowFactoryInterface.sol";
import... | Processes the transfers for an issuance. issuanceId The ID of the issuance to process transfers./ (Transfers.TransferType transferType, address fromAddress, address toAddress, address tokenAddress, uint256 amount, bytes32 action) = issuance.getTransfer(i); Withdraw ERC20 token from Instrument Escrow IMPORTANT: Set... | function processTransfers(uint256 issuanceId, Transfers.Transfer[] memory transfers) private {
IssuanceEscrowInterface issuanceEscrow = _issuances[issuanceId].issuanceEscrow;
for (uint256 i = 0; i < transfers.length; i++) {
Transfers.Transfer memory transfer = transfers[i];
... | 7,242,649 |
pragma solidity ^0.5.0;
import "./Bytes32SetLib.sol";
import "./BytesSetLib.sol";
import "./Bytes32DictionaryLib.sol";
import "./BytesDictionaryLib.sol";
import "./Bytes32SetDictionaryLib.sol";
import "./BytesSetDictionaryLib.sol";
/**
* @title Polymorphic dictionary to store data.
* @dev Polymorphic dictionary fo... | Enumerate dictionary keys based on storage type. O(n). dictionary The PolymorphicDictionary. _type The dictionary type. OneToManyFixed/OneToManyVariable/OneToOneFixed/OneToOneVariable return bytes32[] dictionary keys./ | function enumerate(
PolymorphicDictionary storage dictionary,
DictionaryType _type
) internal view returns (bytes32[] memory) {
require(uint8(_type) < 4, "Invalid table type!");
if (DictionaryType.OneToManyFixed == _type) {
return dictionary.OneToManyFixed.enumerateK... | 14,123,656 |
/*
B.PROTOCOL TERMS OF USE
=======================
THE TERMS OF USE CONTAINED HEREIN (THESE “TERMS”) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the “PROTOCOL”) THAT enables a backstop liquidity mechanism FOR DECENTRALIZED LENDING PLATFORMS (“DLPs”).
PLEASE READ THESE... | 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) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, ... | 5,760,787 |
// File: @openzeppelin\contracts\token\ERC20\IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view retu... | Calculate the earned rewards for an account return amount earned by specified account | function earned(address account) public view returns (uint256) {
return
balanceOf(account)
.mul(rewardPerToken().sub(userRewardPerTokenPaid[account]))
.div(1e18)
.add(rewards[account]);
}
| 2,333,769 |
/**
*Submitted for verification at Etherscan.io on 2021-10-19
*/
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `s... | Contest Winners, etc. | function giveMint(uint256 _mintCountm, address sendIt) public onlyOwner {
require(!mintClosed || !listClosed, "Closed");
require(spliceFrax <= 2718, "Sold out");
for (uint256 i = 0; i < _mintCountm; i++) {
spliceAddress(sendIt);
}
}
| 10,682,217 |
/**
*Submitted for verification at Etherscan.io on 2021-05-20
*/
/*
.'''''''''''.. ..''''''''''''''''.. ..'''''''''''''''..
.;;;;;;;;;;;'. .';;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;,.
.;;;;;;;;;,. .,;;;;;;;;;;;;;;;;;;;... | Get status for a specific loan We rely on correct implementation of LoanToken id Loan ID return Status of loan/ Void loan doesn't exist because timestamp is zero Retracted loan was cancelled by borrower Running is Funded || Withdrawn Settled has been paid back in full and past term Defaulted has not been paid back in ... | function status(address id) public view returns (LoanStatus) {
Loan storage loan = loans[id];
if (loan.creator == address(0) && loan.timestamp == 0) {
return LoanStatus.Void;
}
if (loan.creator == address(0) && loan.timestamp != 0) {
return LoanStatus.Retracte... | 2,058,534 |
/**
*Submitted for verification at Etherscan.io on 2020-10-21
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with a... | Allows liquidity providers to remove liquidity liquidity the pair being unbound job the job being unbound from/ | function removeLiquidityFromJob(address liquidity, address job) external {
require(liquidityUnbonding[msg.sender][liquidity][job] != 0, "::removeJob: unbond first");
require(liquidityUnbonding[msg.sender][liquidity][job] < now, "::removeJob: still unbonding");
uint _amount = liquidityAmounts... | 280,782 |
pragma solidity 0.4.24;
// File: contracts/ExchangeHandler.sol
/// @title Interface for all exchange handler contracts
interface ExchangeHandler {
/// @dev Get the available amount left to fill for an order
/// @param orderAddresses Array of address values needed for this DEX order
/// @param or... | Synchronously executes an array of orders The orders in this function have been wrapped in structs to reduce the local variable count tokens Struct containing the arrays of token orders orders Struct containing the arrays of DEX orders NOTE - check for repetitions in the token list? If this is the last order for thi... | function internalOrderExecution(Tokens tokens, DEXOrders orders) internal {
transferTokens(tokens);
uint256 tokensLength = tokens.tokenAddresses.length;
uint256 ordersLength = orders.tokenForOrder.length;
uint256 etherBalance = msg.value;
uint256 orderIndex = 0;
for... | 1,022,565 |
pragma solidity 0.5.17;
contract IFactRegistry {
/*
Returns true if the given fact was previously registered in the contract.
*/
function isValid(bytes32 fact)
external view
returns(bool);
}
contract IMerkleVerifier {
uint256 constant internal MAX_N_MERKLE_VERIFIER_QUERIE... | Skip 0x20 bytes length at the beginning of the proof. | function initChannel(uint256 channelPtr, uint256 proofPtr, bytes32 publicInputHash)
internal pure
{
assembly {
mstore(channelPtr, add(proofPtr, 0x20))
}
initPrng(getPrngPtr(channelPtr), publicInputHash);
}
| 7,338,012 |
// 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... | Updates drips balance. lastUpdate The timestamp of the last drips update. If this is the first update, pass zero. lastBalance The drips balance after the last drips update. If this is the first update, pass zero. currEndTime Time when drips were supposed to end according to the last drips update. currAmtPerSec The ... | function _updateDripsBalance(
uint64 lastUpdate,
uint128 lastBalance,
uint64 currEndTime,
uint128 currAmtPerSec,
int128 balanceDelta
) internal view returns (uint128 newBalance, int128 realBalanceDelta) {
if (currEndTime > _currTimestamp()) currEndTime = _currTime... | 13,437,399 |
// SPDX-License-Identifier: MIT
/**
* @authors: [@unknownunknown1]
* @reviewers: []
* @auditors: []
* @bounties: []
* @deployments: []
*/
pragma solidity >=0.7;
/* solium-disable max-len*/
import "./IDisputeResolver.sol";
import "@kleros/ethereum-libraries/contracts/CappedMath.sol";
interface RealitioInt... | Gets the information of a round of a question. _questionID The ID of the question. _round The round to query. return paidFees The amount of fees paid for each fully funded answer. return feeRewards The amount of fees that will be use as rewards. return fundedAnswers IDs of fully funded answers./ | function getRoundInfo(uint256 _questionID, uint256 _round)
external
view
returns (
uint256[] memory paidFees,
uint256 feeRewards,
uint256[] memory fundedAnswers
)
{
Round storage round = questions[_questionID].rounds[_round];
fu... | 12,774,618 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @title Airdrop
/// @dev Airdrop is a contract for sending a token (ERC20) to a beneficiary.
c... | Using for set airdrop. _airdrop New airdrop address. | function setAirdrop(address _airdrop) public onlyOwner {
address airdropAddress = address(airdrop);
require(airdropAddress != _airdrop, "MyAirdrop: Airdrop already set");
emit AirdropChanged(airdropAddress, _airdrop);
airdrop = IERC20(_airdrop);
}
| 5,367,995 |
./partial_match/42/0xF1cc25a6109dBC73B8e170C2aC021642e7A4A509/sources/CyclopsBank.sol | not bullet-proof check, but additional measure, not to allow buy & sell from contracts/ | function isContract(address _addr) internal view returns (bool){
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}
| 3,303,666 |
./full_match/1/0x42ef9077d8e79689799673ae588E046f8832CB95/sources/chfry-mainnet/FriesToken.sol | This function reverts if the caller does not have the admin role. _toSetCeiling the account set the ceiling off. _ceiling the max amount of tokens the account is allowed to mint. | function setCeiling(address _toSetCeiling, uint256 _ceiling) external onlyAdmin {
ceiling[_toSetCeiling] = _ceiling;
}
| 9,713,494 |
./full_match/42/0x9978Bc141d6fb9E9b3E0E63EfEAaa359c8355081/sources/contracts/FRToken.sol | Return the borrow balance of account based on stored data account The address whose balance should be calculated return (error code, the calculated balance or 0 if error code is non-zero)/ Note: we do not assert that the market is up to date / Get borrowBalance and borrowIndex / If borrowBalance = 0 then borrowIndex i... | function borrowBalanceStoredInternal(address account) internal view returns (uint) {
uint principalTimesIndex;
uint result;
BorrowSnapshot storage borrowSnapshot = accountBorrows[account];
if (borrowSnapshot.principal == 0) {
return 0;
}
result = divUI... | 16,224,152 |
./full_match/5/0x6a9A0aAC7b64E7AF2f24D85093394B5ba125FcEC/sources/project_/contracts/CoinFlip.sol | getting randomness IF DENIED GAME | function startOrDenyCoinFlipGame(
uint256 _gameId,
bool status
) public nonReentrant returns (uint256) {
require(
_gameIdToCoinFlip[_gameId].creator == msg.sender,
"You must be creator to start match"
);
require(
_gameIdToCoinFlip[_gameId].privateGame == false,
"Creator c... | 1,875,981 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
import { ITreasury, IUniswapV2Factory, IUniswapV2Router01 } from "./ERC20.sol";
/// @dev The TaxToken is responsible for supporting generic ERC20 functionality including ERC20Pausable functionality.
/// The TaxToken will generate taxes on transfer() an... | Used to store the LP Pair to differ type of transaction. Will be used to mark a BUY. _taxType must be lower than 3 because there can only be 3 tax types; buy, sell, & send. _sender This value is the PAIR address. _taxType This value must be be 0, 1, or 2. Best to correspond value with the BUY tax ty... | function updateSenderTaxType(address _sender, uint _taxType) public onlyOwner {
require(_taxType < 3, "err _taxType must be less than 3");
senderTaxType[_sender] = _taxType;
}
| 13,595,704 |
// SPDX-License-Identifier: No License (None)
pragma solidity ^0.6.9;
//import "./SafeMath.sol";
//import "./Ownable.sol";
import "./SwapPair.sol";
interface IERC20 {
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 ... | swapAddress = user address + 1. balanceOf contain two types of balance: 1. balanceOf[user] - balance of tokens on native chain 2. balanceOf[user+1] - swapped balance of foreign tokens. I.e. on BSC chain it contain amount of ETH that was swapped. | function _swapAddress(address user) internal pure returns(address swapAddress) {
swapAddress = address(uint160(user)+1);
}
| 576,443 |
pragma solidity ^0.5.0;
import "./Adminable.sol";
import "./SafeMath.sol";
/** @title Online Marketplace. */
contract MarketPlace is Adminable {
using SafeMath for uint256;
struct Product {
string name;
uint price;
uint quantity;
uint sales;
bool isOpen;
mapping(address => uint) shoppers;
... | Get storefront count. _owner the address of store owner. return The storefront count./ | function getFrontsCount(address _owner) public view returns(uint) {
require(isStore[_owner], "the owner's store doesn't exist");
return stores[_owner].frontKeys.length;
}
| 5,412,308 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { Bo... | Update reward variables for all pools Be careful of gas spending! pids Pool IDs of all to be updated. Make sure to update all active pools. | function massUpdatePools(uint256[] calldata pids) public {
uint256 len = pids.length;
for (uint256 i = 0; i < len; ++i) {
updatePool(pids[i]);
}
}
| 14,057,516 |
./full_match/97/0x77B89d8a44BadFbb1611c995c6Bc8A083fBb0522/sources/project_/contracts/diamond/facets/TradingCoreFacet.sol | slippage = (longQty + qty) price / depthAboveUsd slippage = (shortQty + qty) price / depthBelowUsd | function slippagePrice(
PairQty memory pairQty,
IPairsManager.SlippageConfig memory sc,
uint marketPrice, uint qty, bool isLong
) public pure override returns (uint) {
if (isLong) {
uint slippage = sc.slippageLongP;
if (sc.slippageType == IPairsManager.Sli... | 5,032,241 |
./full_match/5/0x3E7b0216e335D0135fe287737102dFE546921ea6/sources/project_/contracts/launchpad.sol | Distribute fee between recipients/ | function _distributePlatformAccessFee(address pool, address fundToken, uint256 totalFeeAmount) private {
uint256 splitFee = totalFeeAmount / 2;
IERC20(fundToken).approve(stakingAddress, splitFee);
IERC20(fundToken).approve(lpStakingAddress,splitFee);
IRewards(stakingAddress).addRewards(fund... | 1,874,793 |
/*
* Nomin Contract
*
* The stable exchange token of the Havven stablecoin system.
*
* version: nUSDa.2
* date: 27 Nov 2018
* source: https://github.com/Havven/havven/blob/11aa8479f71eeaa3d17ffe0a0476043543b68b60/contracts/Nomin.sol
*
* MIT License
* ===========
*
* Copyright (c) 2018 Havven
*... | Override ERC223 transferFrom function in order to check whether the recipient account is frozen. / | function transferFrom(address from, address to, uint value, bytes data)
public
optionalProxy
returns (bool)
{
require(!frozen[to], "Cannot transfer to frozen address");
return _transferFrom_byProxy(messageSender, from, to, value, data);
}
| 12,989,433 |
./full_match/5/0x81c7a9d494c74F113cCa32d174925352bD3875f1/sources/_connext/nxtp-contracts/contracts/core/connext/libraries/AmplificationUtils.sol | Start ramping up or down A parameter towards given futureA_ and futureTime_ Checks if the change is too rapid, and commits the new A value only when it falls under the limit range. self Swap struct to update futureA_ the new A to ramp towards futureTime_ timestamp when the new A should be reached/ | function rampA(
SwapUtils.Swap storage self,
uint256 futureA_,
uint256 futureTime_
) internal {
require(block.timestamp >= self.initialATime.add(1 days), "Wait 1 day before starting ramp");
require(futureTime_ >= block.timestamp.add(MIN_RAMP_TIME), "Insufficient ramp time");
require(futureA_... | 1,910,674 |
// SPDX-License-Identifier: CC-BY-4.0
pragma solidity >=0.4.22 <0.9.0;
/**
* @title ICO CONTRACT
* @dev ERC-20 Token Standard Compliant
* @author Fares A. Akel C. f.antonio.akel@gmail.com
*/
import "../../libs/SafeMath.sol";
import "../../interfaces/IERC20.sol";
contract ICO {
using SafeMath for uint256... | check status/ | function checkIfFundingCompleteOrExpired() public {
if(state == State.preico && block.timestamp > startTime.add(14 days)){
state = State.week1;
state = State.week2;
state = State.week3;
state = State.week4;
... | 6,360,305 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol"; // solium-disable-line max-len
import "openzeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol"; // solium-disable-line max-len
import "openzeppelin-solidity/contracts/crowdsale/emission/MintedCr... | false if the ico is not started, false if the ico is started and running, true if the ico is completed/ | function ended() public view returns(bool) {
return hasClosed() || capReached();
}
| 6,454,853 |
/**
*Submitted for verification at Etherscan.io on 2021-03-23
*/
// Sources flattened with hardhat v2.1.1 https://hardhat.org
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
// File src/contracts/tokens/erc721.sol
/**
* @dev ERC-721 non-fungible token standard.
* See https://github.com/ethereum/EIPs/blob/m... | ERC-721 interface for accepting safe transfers./ | interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
}
| 7,944,228 |
./full_match/80001/0x09a80825C34751EF7c7B5749BfA32eb9d1B718a9/sources/project_/contracts/Matic/ERC20/SPORTokenMatic.sol | Only ShroomTopia DAO can call this! | function capChange(uint256 cap_) external {
require (msg.sender == shroomTopiaDao, 'ERC20: Not Authorized');
_cap = cap_;
}
| 866,840 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Token {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the a... | Set buy and sell restrictions on investors | function modifyKYCData (address user, uint256 buyRestriction, uint256 sellRestriction)
external
{
require(_whitelistControlAuthority[msg.sender] == true, "Not Whitelist Authority");
_buyRestriction[user] = buyRestriction;
_sellRestriction[user] = sellRestriction;
}
| 10,123,209 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.0;
import "./TFCToken.sol";
// TFCManager provides the functionality to let users claim TFC token by themselves. (gas paid by users)
// The deployment of TFCManager will future deploy the corresponding TFC ERC20 contract in the constructor.
// So there is n... | Builds a prefixed hash to mimic the behavior of eth_sign. | function prefixed(bytes32 hash)
internal
pure
returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
| 14,124,591 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
import './Context.sol';
import './Strings.sol';
import './ERC165.sol';
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
function hasRole(bytes32 role, address account) external view ... | Get the rewards formula parameters. return Max rewards distributed per epoch as market maker incentives. return Max rewards distributed per epoch as trader incentives. return The alpha parameter between 0 and 1, in units out of 10^18./ | function getRewardsParameters()
external
view
returns (uint256, uint256, uint256)
{
return (
_MARKET_MAKER_REWARDS_AMOUNT_,
_TRADER_REWARDS_AMOUNT_,
_TRADER_SCORE_ALPHA_
);
}
| 1,681,899 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
// GraffitETH is an NFT contract in which each token represents a pixel. The owner has the right
// to change the pixel color. Pixel... | Get the tax rate per second as nominator-denominator-tuple. | function getTaxRate() public view returns (uint256, uint256) {
return (_taxRateNumerator, _taxRateDenominator);
}
| 12,773,084 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, sinc... | refund dust eth, if any | function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
virtual
override
payable
ensure(deadline)
returns (uint[] memory amounts)
{
require(path[0] == WETH, 'CCRouter: INVALID_PATH');
amounts = ICCFactory(factory).getAmo... | 1,423,003 |
./full_match/137/0xD12345Cd15352ef5d4259BD2a918Fcb6943ce7a4/sources/contracts/core/connext/libraries/SwapUtilsExternal.sol | Return A in its raw precision See the StableSwap paper for details self Swap struct to read from return A parameter in its raw precision form/ | function getAPrecise(Swap storage self) external view returns (uint256) {
return _getAPrecise(self);
}
| 4,729,565 |
// This is a source code of Ethereum Smart contract for "Recurring Contingent Proof of Retreivability Payment (RC-PoR-P)" protocol.
// It is a conbined contract that includes both SAP and SC smart contracts.
// After deployment of the contract, to interact with the contract you can use either of the following options:... | ================================ This function stores the server's proof during in the 2st period (or delta) of each verification. it recieves the padded encrypted proofs sent by the server in step 5.c | function get_proof(bytes pi_star_j_) public{
int256 current_slot_ = current_slot();
int256 current_verification_index_ = current_verification_index();
if(current_slot_ == int(1) && msg.sender == server){
proofs[current_verification_index_] = pi_star_j_;
}
}
| 6,400,411 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uin... | We might need to return want to the vault | function prepareReturn(uint256 _debtOutstanding)
internal
override
returns (
uint256 _profit,
uint256 _loss,
uint256 _debtPayment
)
{
if (_debtOutstanding > 0) {
uint256 _amountFreed = 0;
(_amountFreed, _loss) = ... | 390,450 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/crowdsale/Crowdsale.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import '../token/ERC884/ERC884ReferenceImpl.sol';
/*
* Crowdsale will receieve 120,000,000 tokens for general token sale.
* Crowdsale will also receive 12,532,4... | Override _getTokenAmount to divide by the rate instead of multiply This is due to the ERC884 token having 0 Decimals/ | function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) {
return weiAmount.div(rate);
}
| 1,071,712 |
./partial_match/1/0xfFdf17652cca46eB98A214cb3E413C8661241E49/sources/CryptoBeastiesToken.sol | Is Token Transferable _tokenId uint256 ID of the token return bool is tokenId transferable/ | function isTransferable(uint256 _tokenId) public view returns (bool) {
return (transferableIndexes[_tokenId] > 0);
}
| 3,926,487 |
pragma solidity ^0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
... | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function transferFrom(address sender, address recipient, uint amount) extern... | 1,223,517 |
//SPDX-License-Identifier: MIT
// File: marketplace.sol
/**
*Submitted for verification at Etherscan.io on 2022-01-18
*/
pragma solidity =0.8.11;
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-... | update trade token token token to trade on | function updateTradeToken(address token) external onlyOwner{
tradeToken = token;
}
| 530,367 |
./partial_match/1/0x7aC3CBf1480Bd840d9976034bB26902AB47274e3/sources/contracts/ERC-721/ERC721Pool.sol | @inheritdoc IERC721Pool | function setENSName(address registrar, string memory name) external override onlyFactory returns (bytes32) {
bytes32 nodeHash = IReverseRegistrar(registrar).setName(name);
return nodeHash;
}
| 4,148,194 |
pragma solidity ^0.4.24;
import "zeppelin/token/ERC20/SafeERC20.sol";
import "zeppelin/math/SafeMath.sol";
import "zeppelin/math/Math.sol";
import "./lib/AdditionalMath.sol";
import "contracts/MinersEscrow.sol";
import "contracts/NuCypherToken.sol";
import "contracts/proxy/Upgradeable.sol";
/**
* @notice Contract h... | Get NodeInfo structure by delegatecall/ | function delegateGetNodeInfo(address _target, address _node)
internal returns (NodeInfo memory result)
{
bytes32 memoryAddress = delegateGetData(_target, "nodes(address)", 1, bytes32(_node), 0);
assembly {
result := memoryAddress
}
}
| 889,810 |
// SPDX-License-Identifier: MIT
// chibidbs.com
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./ERC721Accesslist.sol";
... | update the total number that can be minted via an accesslist | function updateMaxAccesslistPurchase(uint _maxAccesslistPurchase) public onlyOwner{
maxAccesslistPurchase = _maxAccesslistPurchase;
}
| 12,061,161 |
./partial_match/1/0x1E7407b5f0c3ec55cFEEb0B19Dfb006e32F8EBB0/sources/TOW3.sol | See {IERC721-approve}./ | function approve(address to, uint256 tokenId) public override {
require(tokenId != 0, "ToW: Can't approve transactions for The Tree");
super.approve(to, tokenId);
}
| 2,838,438 |
//Address: 0xd6031f24a7cc5d5ce33d763b66bc4b0c5f22936b
//Contract name: EtherToken
//Balance: 0 Ether
//Verification Date: 12/22/2017
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity 0.4.15;
/// @title Math library - Allows calculation of logarithmic and exponential functions
/// @author Alan Lu - <alan.lu... | Returns maximum of an array nums Numbers to look through return Maximum number | function max(int[] nums)
public
constant
returns (int max)
{
require(nums.length > 0);
max = -2**255;
for (uint i = 0; i < nums.length; i++)
if (nums[i] > max)
max = nums[i];
}
| 5,423,340 |
./partial_match/1/0xF82DC2f52397465fA91BD68Ec7eF23b4d45f4aDE/sources/zip/test/t5.sol | for ETH network only | function getTicket() public view returns (address) { | 2,622,774 |
/**
*Submitted for verification at Etherscan.io on 2022-02-11
*/
// File: node_modules\@openzeppelin\contracts\introspection\IERC165.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Impl... | Open registry for management of AI services run on SingularityNET SingularityNET/ ___ _ _ _ __ __ _ / _ \ _ __ __ _ __ _ _ __ (_)______ _| |_(_) ___ _ __ | \/ | __ _ _ __ ___ | |_ | | | | '__/ _` |/ _` | '_ \| |_ / _` | __| |/ _ \| '... | interface IRegistry {
event OrganizationCreated (bytes32 indexed orgId);
event OrganizationModified(bytes32 indexed orgId);
event OrganizationDeleted (bytes32 indexed orgId);
function createOrganization(bytes32 orgId, bytes calldata orgMetadataURI, address[] calldata members) external;
function ... | 15,150,140 |
./full_match/1/0xeD2323128055cE9539c6C99e5d7EBF4CA44A2485/sources/contracts/Delay.sol | Sets the duration for which a transaction is valid. expiration Duration that a transaction is valid in seconds (or 0 if valid forever) after the cooldown There need to be at least 60 seconds between end of cooldown and expiration This can only be called by the owner | function setTxExpiration(uint256 expiration) public onlyOwner {
require(
expiration == 0 || expiration >= 60,
"Expiratition must be 0 or at least 60 seconds"
);
txExpiration = expiration;
}
| 2,951,744 |
pragma solidity ^0.4.24;
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the c... | Returns whether the target address is a contract This function will return false if invoked during the constructor of a contract, as the code is not actually created until after the constructor finishes. _addr address to check return whether the target address is a contract/ XXX Currently there is no better way to ch... | function isContract(address _addr) internal view returns (bool) {
uint256 size;
return size > 0;
}
| 435,373 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns... | Function for minting the reserve NFTs for owner | function reserveNFTs(uint256 amount) public onlyOwner{
require(reserveMinted + amount <= reserve, "Max NFT limit reservation exceeded");
_safeMint(msg.sender, amount);
reserveMinted = reserveMinted + amount;
}
| 2,417,610 |
./partial_match/1/0xfBFAa6141EEd993d3999688672cb6453d7C246d5/sources/DxPoolStakingFeePool.sol | This function estimates user totalRewards, unclaimedRewards, claimedRewards based on latest timestamp. | function getUserRewardInfo(address depositor) external view returns (uint256, uint256, uint256) {
require(depositor != address(0), "depositorAddress not be empty");
return computeRewards(depositor);
}
| 4,228,890 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "./ERC1155.sol";
import "./SafeMath.sol";
import "./Counters.sol";
import "./AbstractNFTAccess.sol";
contract NFTAccess is AbstractNFTAccess {
using SafeMath for uint256;
using Counters for Counters.Counter;
uint public tier1 = 0;
uint p... | mint item in collection quantity the quantity to mint/ | function tieredMint (uint256 quantity) external payable {
uint tier;
uint currentSupply;
uint tier1CurrentSupply = tickets[tier1].currentSupply;
uint tier2CurrentSupply = tickets[tier2].currentSupply;
uint tier3CurrentSupply = tickets[tier3].currentSupply;
if (tier1... | 11,873,614 |
./full_match/1/0x44FBcD2CD2A603BACDAeD27220d7Ea5299E502F6/sources/contracts/manager/ManagerCore.sol | PRIVILEGED FACTORY FUNCTION. Adds a newly deployed manager as an enabled manager. _manager Address of the manager contract to add/ | function addManager(address _manager) external onlyInitialized onlyFactory {
require(!isManager[_manager], "Manager already exists");
isManager[_manager] = true;
managers.push(_manager);
emit ManagerAdded(_manager, msg.sender);
}
| 3,069,111 |
./partial_match/10/0xFAf8FD17D9840595845582fCB047DF13f006787d/sources/contracts/VotingEscrow.sol | @inheritdoc IVotingEscrow Throws if `_tokenId` is not a valid NFT Throws if `_approved` is the current owner Check requirements Set the approval | function approve(address _approved, uint256 _tokenId) external {
address sender = _msgSender();
address owner = _ownerOf(_tokenId);
if (owner == address(0)) revert ZeroAddress();
if (owner == _approved) revert SameAddress();
bool senderIsOwner = (_ownerOf(_tokenId) == sender)... | 3,532,272 |
pragma solidity 0.5.7;
import "../zeppelin/token/ERC20/IERC20.sol";
import "../zeppelin/math/SafeMath.sol";
import "../ownership/Ownable.sol";
import "./ReserveEternalStorage.sol";
/**
* @title An interface representing a contract that calculates transaction fees
*/
interface ITXFee {
function calculateFee(ad... | `spender` transfers `value` attotokens from `holder` to `to`. Requires allowance. Callable only by the relay contract. | function relayTransferFrom(address holder, address spender, address to, uint256 value)
external
notPaused
only(trustedRelayer)
returns (bool)
{
_transfer(holder, to, value);
_approve(holder, spender, trustedData.allowed(holder, spender).sub(value));
retu... | 15,871,418 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.6 <0.8.0;
// solhint-disable max-line-length
import {ERC1155721Inventory, ERC1155721InventoryBurnable} from "@animoca/ethereum-contracts-assets-1.1.3/contracts/token/ERC1155721/ERC1155721InventoryBurnable.sol";
import {IERC1155721InventoryMintable} from "@animoca/... | Unsafely mints a Non-Fungible Token (ERC721-compatible). See {IERC1155721InventoryMintable-batchMint(address,uint256)}./ | function mint(address to, uint256 nftId) public virtual override {
_requireMinter(_msgSender());
_mint(to, nftId, "", false);
}
| 5,415,911 |
./full_match/1/0xEeaB15F5268923B0E8B286cCC78986366a54C99F/sources/franchisedCP.sol | Internal function to process 'period'[2] proposal - state updates are broken up for security. | function processPeriodProposal(Proposal memory prop) private {
uint length = prop.value.length;
if (length == 1) {
if (prop.value[0] != 0) minVotingPeriod = uint32(prop.value[0]); /*if positive, reset min. voting period to first `value`*/
if (prop.value[1] != 0) max... | 8,370,867 |
//SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "../interfaces/IEternalFund.sol";
import "../interfaces/IEternalTreasury.sol";
import "../interfaces/IEternalFactory.sol";
im... | Updates the address of the Eternal Factory contract newContract The new address for the Eternal Factory contract/ | function setEternalFactory (address newContract) external onlyFund {
eternalFactory = IEternalFactory(newContract);
}
| 1,069,744 |
./full_match/1/0x2ea6B54759170f8E68fae947ED9AbD2F8B290eB1/sources/contracts/ZXNProtocol.sol | Returns ZXN total supply/ | function getZxnSupply() public view returns (uint256) {
return zxn.totalSupply();
}
| 16,540,076 |
pragma solidity 0.4.24;
import "../../lib/Arrays.sol";
/**
* @title ClaimStore
* @author Wu Di
* @notice Library for managing ERC735 claims
*/
library ClaimStore {
event ClaimAdded(
bytes32 indexed claimId,
uint256 indexed topic,
uint256 scheme,
address indexed issuer,
... | Removes a claim. _claimId Claim ID to remove return `true` if the claim is found and removed/ Must exist | function remove(Claims storage self, bytes32 _claimId)
public
returns (bool success)
{
Claim memory c = self.claims[_claimId];
if (!exists(self, _claimId)) {
return false;
}
_claimId,
c.topic,
c.scheme,
c.issue... | 15,825,718 |
// SPDX-License-Identifier: MIT
// AaveWalletManager.sol -- Part of the Charged Particles Protocol
// Copyright (c) 2021 Firma Lux, Inc. <https://charged.fi>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to de... | Transfer Rewards to Receiver | function _withdrawRewards(
address receiver,
address rewardsTokenAddress,
uint256 rewardsAmount
)
internal
returns (uint256)
{
address self = address(this);
IERC20 rewardsToken = IERC20(rewardsTokenAddress);
uint256 walletBalance = rewardsToken.balanceOf(self);
require(walletB... | 521,153 |
// SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.7.6;
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts... | Get the holder of a voucher _tokenIdVoucher ID of the voucher token return Address of the holder/ | function getVoucherHolder(uint256 _tokenIdVoucher)
external
view
override
returns (address)
{
return IVouchers(voucherTokenAddress).ownerOf(_tokenIdVoucher);
}
| 40,257 |
/*
Copyright 2019 ZeroEx Intl.
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, ... | Create and delegate stake to the current epoch. Only used to test purportedly unreachable states. Also withdraws pending rewards. | function delegateStakeNow(
address delegator,
bytes32 poolId,
uint256 stake
)
external
{
_withdrawAndSyncDelegatorRewards(
poolId,
delegator
);
IStructs.StoredBalance storage _stake = _delegatedStakeToPoolByOwner[delegator][pool... | 1,834,495 |
/**
*Submitted for verification at Etherscan.io on 2021-05-18
*/
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these a... | Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 a The multiplicand b The multiplier denominator The divisor return result The 256-bit result | function mulDivRoundingUp(
uint256 a,
uint256 b,
uint256 denominator
) internal pure returns (uint256 result) {
result = mulDiv(a, b, denominator);
if (mulmod(a, b, denominator) > 0) {
require(result < type(uint256).max);
result++;
}
}
| 2,407,713 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.