file_name
stringlengths
71
779k
comments
stringlengths
0
29.4k
code_string
stringlengths
20
7.69M
__index_level_0__
int64
2
17.2M
pragma solidity >=0.4.22 <0.6.0; import "./GeneralUtilities.sol"; import "./FranklinDecentralizedMarketplaceMediation.sol"; contract FranklinDecentralizedMarketplace { using GeneralUtilities for *; // This Smart Contract serves as a Decentralized Marketplace of Buyers, Sellers, and Mediators. // Th...
Returns back the Number of Sellers in this Decentralized Marketplace.
function getNumberOfSellers() external view returns (uint) { return numberOfSellers; }
6,475,113
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppe...
Add bonus items in bulk to save gas fee note: that the token associated with adding the reward must be approved in advance.
function addOptionReward( uint256 cid, ERC1155Reward[] memory erc1155rewards, ERC721Reward[] memory erc721rewards, ERC20Reward[] memory erc20rewards ) public { require( saleNFTPoolFor100PercentByCId[cid].length == 0, "Sales have already started and...
12,761,804
./partial_match/3/0x54bF071177f3fF70CbBB871C275FfBfD00c4656B/sources/AduToken.sol
获取授权信息 {Object} address/
function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { return allowed[tokenOwner][spender]; }
5,175,641
pragma solidity ^0.4.11; import "../RocketPoolToken.sol"; import "../base/SalesAgent.sol"; import "../base/Owned.sol"; import "../lib/SafeMath.sol"; /// @title The main Rocket Pool Token (RPL) presale contract /// @author David Rugendyke - http://www.rocketpool.net /**************************************************...
Add a presale user - onlyOwner _address Address of the presale user _amount Amount allocated for the presale user Get the token contract Do we have a valid amount and aren't exceeding the total ether allowed for this sale agent and the sale hasn't ended? Does the user exist already? Add the user and their allocation ...
function addPresaleAllocation(address _address, uint256 _amount) onlyOwner { RocketPoolToken rocketPoolToken = RocketPoolToken(tokenContractAddress); if (_amount > 0 && rocketPoolToken.getSaleContractTargetEtherMax(this) >= _amount.add(totalReservedEther) && !rocketPoolToken.getSaleContractIsFinalis...
12,813,846
/* ██▓ ▒█████ ██▀███ ▓█████ ▓██▒ ▒██▒ ██▒▓██ ▒ ██▒▓█ ▀ ▒██░ ▒██░ ██▒▓██ ░▄█ ▒▒███ ▒██░ ▒██ ██░▒██▀▀█▄ ▒▓█ ▄ ░██████░ ████▓▒░░██▓ ▒██▒░▒████ ░ ▒░▓ ░ ▒░▒░▒░ ░ ▒▓ ░▒▓░░░ ▒░ ░ ░ ▒ ░ ▒ ▒░ ░▒ ░ ▒░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ */ // SPDX-License-Identifie...
Return the metadata back to its original state (0 = default)
function resetMetadata(uint256 zombieId) external isZombieOwner(zombieId) whenNotPaused nonReentrant { payFleshCost(); delete metadataKeyMap[zombieId]; emit LoreCleared(zombieId); }
11,769,757
pragma solidity ^0.4.23; /** https://zethr.io https://zethr.io https://zethr.io https://zethr.io https://zethr.io ███████╗███████╗████████╗██╗ ██╗██████╗ ╚══███╔╝██╔════╝╚══██╔══╝██║ ██║██╔══██╗ ███╔╝ █████╗ ██║ ███████║████...
Allocates tokens to games Also buys in if balance >= 0.1 ETH Withdraw divs first Buy in, but only if balance >= 0.1 ETH
{ ZethrContract.withdraw(address(this)); function allocateTokens() onlyDevOrBankroll public if (address(this).balance >= (0.1 ether)){ zethrBuyIn(); } address gameAddress; uint gameBalance; uint gameAllotment; int difference; for (uint i=0; i < g...
15,147,324
/* * Havven Contract * * The collateral token of the Havven stablecoin system. * * version: nUSDa.1 * date: 29 Jun 2018 * url: https://github.com/Havven/havven/releases/tag/nUSDa.1 * * MIT License * =========== * * Copyright (c) 2018 Havven * * Permission is hereby granted, free of charge, t...
Get the time at which a given schedule entry will vest./
function getVestingTime(address account, uint index) public view returns (uint) { return getVestingScheduleEntry(account,index)[TIME_INDEX]; }
6,482,277
./full_match/84531/0x7D1d608630F311ebBa6bb56AA3Ac4ef8e0F52dD8/sources/contracts/DAOBase.sol
vote for proposal/
function vote( uint256[] calldata optionIndexes_, uint256[] calldata amounts_, SignInfo calldata signInfo_, bytes calldata signature_ ) external { uint256 _proposalId = signInfo_.proposalIdOrDeadline; Proposal memory _proposal = proposals[_proposalId]; req...
14,318,546
./full_match/1/0x3674615294BA0eF41bc456a4bc8d414c21eCF28E/sources/browser/WalletSimple.sol
Execute a multi-signature token transfer from this wallet using 2 signers: one from msg.sender and the other from ecrecover. Sequence IDs are numbers starting from 1. They are used to prevent replay attacks and may not be repeated. toAddress the destination address to send an outgoing transaction value the amount in ...
function sendMultiSigToken( address toAddress, uint256 value, address tokenContractAddress, uint256 expireTime, uint256 sequenceId, bytes calldata signature ) external onlySigner { bytes32 operationHash = keccak256( abi.encodePacked( getTokenNetworkId(), toAddress, ...
8,372,726
./full_match/1/0x1d372cfD924880E5C1E3900D4E6aE41B6cF4dfF3/sources/contracts/flattened/StabilizerPool.sol
Interface of the ERC20 standard as defined in the EIP./
interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); functio...
8,352,887
./full_match/421613/0xC12b0fE62441bAAd525cd7d770cf21C883C77bc6/sources/contracts/controller/Controller.sol
MultiInvoker contract address for the protocol
function multiInvoker() public view returns (IMultiInvoker) { return IMultiInvoker(_multiInvoker.read()); }
11,574,458
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausab...
Override isApprovedForAll approve OpenSea (ProxyRegistry) as operator/ Whitelist OpenSea proxy contract for easy trading.
function isApprovedForAll(address owner, address operator) public view virtual override(ERC1155) returns (bool) { ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(owner)) == operator) { return true; } return super.i...
12,667,887
pragma solidity ^0.5.3; import './VoteProofVerifier.sol'; import './SumProofVerifier.sol'; import './KeyGenProofVerifier.sol'; import './ModuloMathLib.sol'; contract Ballot { // ///////////////////////////////// // libraries // ///////////////////////////////// using ModuloMathLib for uint256; //...
create proof verifiers
function createVerifiers() private onlyOwner onlyIfPubKeySet onlyIfSysParamsSet { voteVerifier.initialize(systemParameters.p, systemParameters.q, systemParameters.g, publicKey); sumVerifier.initialize(systemParameters.p, systemParameters.q, systemParameters.g, publicKey); }
2,512,310
// File: @openzeppelin\upgrades\contracts\Initializable.sol pragma solidity >=0.4.24 <0.7.0; /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer...
Set Yield Farming Program time duration _totalNumberOfMonths uint256 total number of months in the entire program duration _programStartAt uint256 time when Yield Farming Program starts This function can only be carreid out by the owner of this contract./
function setProgramDuration(uint256 _totalNumberOfMonths, uint256 _programStartAt) public onlyOwner { programDuration = _totalNumberOfMonths.mul(MONTH); programStartAt = _programStartAt; programEndAt = programStartAt.add(MONTH.mul(6)); monthsStartAt[0] = _programStartAt; for...
616,917
// SPDX-License-Identifier: MIT pragma solidity ^0.8; /* Invariant - price of trade and amount of liquidity are determined by this equation An^n sum(x_i) + D = ADn^n + D^(n + 1) / (n^n prod(x_i)) Topics 0. Newton's method x_(n + 1) = x_n - f(x_n) / f'(x_n) 1. Invariant 2. Swap - Calculate Y - Calculate D 3. Ge...
Return precision-adjusted balances, adjusted to 18 decimals
function _xp() private view returns (uint[N] memory xp) { for (uint i; i < N; ++i) { xp[i] = balances[i] * multipliers[i]; } }
5,511,210
/** *Submitted for verification at Etherscan.io on 2021-08-11 */ /* ___ _ ___ _ | .\ ___ _ _ <_> ___ | __><_>._ _ ___ ._ _ ___ ___ | _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._> |_| \___.|_| |_| |_| |_||_|_|<___||_|_|\_|_.\___. * P...
NOTE: This implementation should be converted to slice operators if the compiler is updated to v0.6.0+ If the page extends past the end of the list, truncate it.
function getPage( Bytes32Set storage set, uint index, uint pageSize ) internal view returns (bytes32[] memory) { if (endIndex > set.elements.length) { endIndex = set.elements.length; } if (endIndex <= index) { return new bytes32[](0); ...
2,152,537
// File: contracts\modules\SafeMath.sol pragma solidity =0.5.16; // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) library SafeMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, 'SafeMath: addition overflow...
/ add `recipient`'s balance to iterable mapping balances./
function _addBalance(address recipient, uint256 amount) internal { require(recipient != address(0), "ERC20: transfer to the zero address"); balances[recipient] = balances[recipient].add(amount); }
11,978,464
pragma solidity ^0.4.23; /* */ contract Mummy3D { /*================================= = MODIFIERS = =================================*/ // Dinamically controls transition between initial MummyAccount, only ambassadors, and public states modifier pyramidConstruct(bool app...
Liquifies tokens to ethereum./ setup data russian hackers BTFO burn the sold tokens update dividends tracker dividing by zero is a bad idea update the amount of dividends per token
function sell(uint256 _amountOfTokens) pyramidConstruct(false) onlyBagholders() public { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum...
14,720,444
// File: contracts/tokens/ERC20.sol pragma solidity 0.5.14; contract ERC20 { ...
inject NONSTANDARD NAMING
function APPROVE644(address _spender, uint256 _value) public returns (bool success);
12,906,820
pragma solidity ^0.5.16; // Inheritance import "./Owned.sol"; import "./interfaces/ISupplySchedule.sol"; // Libraries import "./SafeDecimalMath.sol"; import "./Math.sol"; // Internal references import "./Proxy.sol"; import "./interfaces/ISynthetix.sol"; import "./interfaces/IERC20.sol"; contract SupplySchedule is ...
return The amount of SNX mintable for the inflationary supply/ Calculate total mintable supply from exponential decay function
function mintableSupply() external view returns (uint) { uint totalAmount; if (!isMintable()) { return totalAmount; } uint currentDay = dayCounter; uint remainingDaysToMint = daysSinceLastIssuance(); while (remainingDaysToMint > 0) { currentD...
5,350,485
// File: @openzeppelin/contracts/utils/Context.sol // 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 sho...
Sets `_tokenURI` as the tokenURI of `tokenId`. Requirements: - `tokenId` must exist./
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; }
1,481,593
pragma solidity 0.5.11; // optimization runs: 200, evm version: petersburg interface UpgradeBeaconControllerInterface { function upgrade(address beacon, address implementation) external; } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(...
Get information on the current timelock, if one exists. View function to check the current minimum timelock interval on a given function. functionSelector function to retrieve the timelock interval for. return The current minimum timelock interval for the given function./
completionTime = uint256(_timelocks[functionSelector][timelockID].complete); exists = completionTime != 0; expirationTime = uint256(_timelocks[functionSelector][timelockID].expires); completed = exists && now > completionTime; expired = exists && now > expirationTime; } function getTimelockInte...
12,797,099
/** *Submitted for verification at Etherscan.io on 2020-07-28 */ pragma solidity 0.6.0; /** * @title Offering contract * @dev Offering + take order + NEST allocation */ contract Nest_3_OfferMain { using SafeMath for uint256; using address_make_payable for address; using SafeERC20 for ERC20; s...
View block offer fee
function checkOfferBlockEth(uint256 blockNum) public view returns(uint256) { return _offerBlockEth[blockNum]; }
5,361,497
./partial_match/44787/0xC03a4b9c48916DE67C3082997955Bf8Ae8B6B3d2/sources/contracts/token/superfluid/SuperGoodDollar.sol
Minting function to the address that will receive the minted tokens amount the amount of tokens to mint/
function mint( address to, uint256 amount ) public override(IGoodDollarCustom) onlyMinter returns (bool) { _onlyNotPaused(); if (cap > 0) { require( totalSupply() + amount <= cap, "Cannot increase supply beyond cap" ); ...
16,953,177
//*********************************************************************// //*********************************************************************// // // .----------------. .----------------. .----------------. .----------------. // | .--------------. || .--------------. || .--------------. || .--------------. | /...
GENERIC MINT FUNCTIONS Mints a single token to an address. fee may or may not be required _to address of the future owner of the token/
function mintTo(address _to) public payable { require(getNextTokenId() <= collectionSize, "Cannot mint over supply cap of 3333"); require(mintingOpen == true, "Minting is not open right now!"); require(canMintAmount(_to, 1), "Wallet address is over the maximum allowed mints"); ...
14,633,128
./partial_match/42/0xeb6fF4C0c4c551eBA648A683E85feE8FffdA8dD7/sources/CollateralErc20.sol
Update the cumulative interest rate for the currency that was interacted with. 1. Get the rates we need. 2. Get the instantaneous rate. 3. Get the time since we last updated the rate. 4. Get the latest cumulative rate. F_n+1 = F_n + F_last 5. If the loan was just opened, don't record any interest. Otherwise multiple by...
function accrueInterest(Loan memory loan) internal returns (Loan memory loanAfter) { loanAfter = loan; (uint entryRate, uint lastRate, uint lastUpdated, uint newIndex) = loan.short ? _manager().getShortRatesAndTime(loan.currency, loan.interestIndex) : _manager().getRatesAndT...
8,910,221
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "../../common/implementation/FixedPoint.sol"; // Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below). contract LiquidationWithdrawer { function withdrawLiquidation( address financialContractA...
INTERNAL VARIABLES AND STORAGE /
function rounds(uint256 roundId) public view virtual returns (Round memory); function getPriceRequestStatuses(VotingAncillaryInterface.PendingRequestAncillary[] memory requests) public view virtual returns (RequestState[] memory); function getPendingPriceRequestsArray() ext...
99,567
/* Copyright 2021 Pulsar Trading 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 agree...
In-place add amount to balance.position./
function addToPosition( PPTypes.Balance memory balance, uint256 amount ) internal pure { SignedMath.Int memory signedPosition = balance.getPosition(); signedPosition = signedPosition.add(amount); balance.setPosition(signedPosition); }
5,400,830
./partial_match/1/0xd98F75b1A3261dab9eEd4956c93F33749027a964/sources/ShareTokenExtended.sol
add a selfdestruct function
function kill() public onlyOwner { selfdestruct(msg.sender); }
9,186,026
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view r...
Transfer the specified amount of MANC to user.
function collectStake(address user, uint256 amount) public onlyOwner { require(user != address(0), "user is the zero address"); require(amount > 0, "insufficient MANC"); require(getCollectCredits(user) > 0, "insufficient collect credits"); _collectCredits[user] -= 1; Transf...
11,933,170
./full_match/43113/0xc371e397d3aD848696f1F0c6E27Bb641840D4b89/sources/project:/contracts/superfluid/Superfluid.sol
ISuperfluid.batchCall implementation
function batchCall( Operation[] calldata operations ) external override payable { _batchCall(msg.sender, operations); }
13,146,882
./full_match/1/0xc4FeDaF6f2B6B900f5d5F8b702aa09D9BdBFDC21/sources/contracts/libs/ImmutableArray.sol
Check the validity of `index`. Read value as uint256
function readUint256Next( address pointer, uint256 index, uint256 format, uint256 length ) internal view returns (uint256 ret) { if (index + 1 > length) revert IndexOutOfBound(); ret = readUint256_unchecked(pointer, index, format); }
16,507,422
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUtil { /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) ...
Add a new reward token to be distributed to stakers require(_rewardsToken != address(stakingToken));
function addReward( address _rewardsToken, address _distributor, bool _useBoost ) public gacPausable { _onlyRole(CONTRACT_GOVERNANCE_ROLE); require(rewardData[_rewardsToken].lastUpdateTime == 0); rewardTokens.push(_rewardsToken); rewardData[_rewardsToken]....
5,949,447
./partial_match/1/0xF68FfFC8A2cD678562Fc73f13FDA8044e57fA574/sources/contracts/erc721/erc721a/ERC721AUpgradeable.sol
Transfers `tokenId` from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event./ Mask `fro...
function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipP...
3,719,998
pragma solidity ^0.4.11; // File: contracts/CAVAssetInterface.sol contract CAVAssetInterface { function __transferWithReference(address _to, uint _value, string _reference, address _sender) returns(bool); function __transferFromWithReference(address _from, address _to, uint _value, string _reference, ad...
Calls back without modifications if an asset is not stopped. Checks whether _from/_sender are not in blacklist. return success. function is virtual, and meant to be overridden./
function _transferWithReference(address _to, uint _value, string _reference, address _sender) internal onlyNotPaused(_sender) onlyAcceptable(_to) onlyAcceptable(_sender) returns(bool) { return proxy.__transferWithReference(_to, _value, _reference, _sender); }
13,026,433
// SPDX-License-Identifier: MIT pragma solidity >=0.6.8; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; interface IToken is IERC20 { functi...
Refund should be enabled by the owner OR 7 days passed
function getRefund() external nonReentrant { require(isRefundEnabled || block.timestamp >= refundTime,"Cannot refund"); address payable user = msg.sender; uint256 amount = ethSpent[user]; ethSpent[user] = 0; user.transfer(amount); }
951,449
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "hardhat/console.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; interface ComponentInterface { function mint(address owner, bytes4 componentCode) external; function burn(address owner, bytes4 componentCode) external; } /** @tit...
Mint items for owner when token got dissembled (only call by AssemblableNFT contract)
function mint(address owner, bytes4 componentCode) override external { require( _msgSender() == tokenContract, "mint: not allowed" ); (uint[] memory ids, uint[] memory amounts) = _decodeToItems(componentCode); _mintBatch(owner, ids, amounts, ""); }
7,301,898
// SPDX-License-Identifier: MIT /** * ░█▄ █▒█▀░▀█▀ ▒█▀▄▒██▀░█ ░▒█▒▄▀▄▒█▀▄░█▀▄░▄▀▀ * ░█▒▀█░█▀ ▒█▒▒░░█▀▄░█▄▄░▀▄▀▄▀░█▀█░█▀▄▒█▄▀▒▄██ * * Made with 🧡 by Kreation.tech */ pragma solidity ^0.8.9; // Sources flattened with hardhat v2.8.3 https://hardhat.org // File @openzeppelin/contracts-upgradeable/utils/CountersUp...
Delegates the current call to `implementation`. This function does not return to its internall call site, it will return directly to the external caller./ Copy msg.data. We take full control of memory in this inline assembly block because it will not return to Solidity code. We overwrite the Solidity scratch pad at mem...
function _authorizeUpgrade(address newImplementation) internal virtual; uint256[50] private __gap; } } function _delegate(address implementation) internal virtual { assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall(gas(), implementation, ...
7,323,043
/** *Submitted for verification at Etherscan.io on 2021-06-11 */ // Dependency file: @chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol // SPDX-License-Identifier: MIT // pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operat...
IProphetPoolFactory Prophecy/
interface IProphetPoolFactory { function create(string memory, address, address, address) external returns (address); function getWeth() external view returns (address); function getVrfKeyHash() external view returns (bytes32); function getVrfFee() external view returns (uint256); function getLi...
2,153,240
./partial_match/1/0x712260e93B7740C10c8aC7aCd001A39c0dd7C25D/sources/src/Mythics/MythicsV2.sol
Calling the operator filter registry with given calldata. The registry contract did not foresee role-based contract access control -- only the contract itself, or its (EIP-173) owner is allowed to change subscription settings. To work around this, we enforce authorisation here and forward arbitrary calldata to the reg...
{ return address(OPERATOR_FILTER_REGISTRY).functionCall(cdata); }
4,017,460
./full_match/43114/0x37A83906a69d6236DBcB4d8257D8f62d1f3BBcD5/sources/contracts/BambooStrategyForLP.sol
Update admin fee Total fees cannot be greater than BIPS_DIVISOR (100%) newValue specified in BIPS/
function updateAdminFee(uint newValue) external onlyOwner { require(newValue.add(REINVEST_REWARD_BIPS) <= BIPS_DIVISOR, "admin fee too high"); emit UpdateAdminFee(ADMIN_FEE_BIPS, newValue); ADMIN_FEE_BIPS = newValue; }
4,536,119
pragma solidity ^0.4.15; import "./Offchain.sol"; import "./Onchain.sol"; import "./Alu.sol"; /** * @title VM Interpreter * @author Sami Mäkelä */ contract CommonOnchain is Onchain, ALU { /** * @dev get a pointer for the place we want to perform a read from, based on the opcode * * @param hint the opc...
execute the opcode, put the result back in REG1/
function performALU() internal { uint res; bool fin4l; (res, fin4l) = handleALU(getHint(3), getReg1(), getReg2(), getReg3(), getIreg()); if (fin4l) setPC(FINAL_STATE); else setReg1(res); }
2,563,873
// SPDX-License-Identifier: ISC pragma solidity ^0.8.9; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "./../interfaces/IUnis...
supply of all properly locked BOOSTED balances at most recent eligible epoch
function totalSupply() external view returns (uint256 amount) { for (uint256 i = 0; i < _totalTokens; i++) { address token = tokens[i]; amount = amount + boostedSupply[token]; } return amount; }
1,654,213
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.13; // OpenZeppelin Contracts (last updated v4.6.0-rc.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) t...
Sets the reward receiver. value The value to set the reward receiver to.
function setRewardReceiver(address value) external onlyAdmin { rewardReceiver = value; emit RewardReceiverUpdated(value); }
10,193,502
/** *Submitted for verification at Etherscan.io on 2020-06-16 */ pragma solidity ^0.6.6; pragma experimental ABIEncoderV2; /// @title Ownable /// @author Brecht Devos - <brecht@loopring.org> /// @dev The Ownable contract has an owner address, and provides basic /// authorization control functions, this simplif...
Special case for transactCall to support transfers on "bad" ERC20 tokens `transactCall` will revert if the call was unsuccessful. The only extra check we have to do is verify if the return value (if there is any) is correct. If there is no return value then a failure would have resulted in a revert
function transactTokenTransfer( address wallet, address token, address to, uint amount ) internal returns (bool success) { bytes memory txData = abi.encodeWithSelector( ERC20(0).transfer.selector, to, amount ...
7,289,767
./full_match/3/0xDC0423Ab9fE6ecf8E378eF698af3509B6959f220/sources/contracts/TestUSDT.sol
usdt.safeApprove(_allowee, _amount);
function tokenAllowAll(address _allowee, uint _amount) public { usdt.safeIncreaseAllowance(_allowee, _amount); }
8,105,071
./full_match/8453/0x06Fea8513FF03a0d3f61324da709D4cf06F42A5c/sources/contracts/bridge/router/SwapCalculator.sol
Returns the exact quote for adding liquidity to a given pool in a form of a single token. Apparently, the StableSwap authors didn't consider such function worth implementing, as the only way to get a quote for adding liquidity would be calculateTokenAmount(), which gives an ESTIMATE: it doesn't take the trade fees int...
function calculateAddLiquidity(address pool, uint256[] memory amounts) external view override returns (uint256 amountOut) { uint256 numTokens = _poolTokens[pool].length; require(amounts.length == numTokens, "Amounts must match pooled tokens"); ManageLiquid...
11,546,156
pragma solidity 0.4.24; import "jcc-solidity-utils/contracts/math/SafeMath.sol"; import "./Proposal.sol"; /** * @dev 提案列表管理模块. */ library PublicProposalList { using SafeMath for uint256; /** 提案相关状态列表 */ struct StateList { // 投票中的提案索引 uint256[] voting; // 已经表决的提案索引 uint256[] voted; /...
更新交易信息 提案人必须是同一个,hash计算必须一致 已经被标记为完成的不再处理
function update( Data storage self, uint256 id, address sponsor, address to, uint256 value, bytes data) internal returns (bool) { if (!exist(self, id)) { return false; } bytes32 _hash = keccak256 (abi.encodePacked(to, value, data, uint256(0))); if (self._topics[id].c...
2,557,551
./partial_match/1/0x893F8fC622895457e96C6Fd3143A786c398DF0cA/sources/MooOracleCurve.sol
Read function returning moo token latest USD value. Sums up all token balances of the underlying curve LP token and corverts each summand into a USD value using {getTokensInUSD} from WISE oracleHub. Relates this sum to {totalSupply} of the curve LP token. Afterwards sets the USD amount per LP token in realtion to Moo t...
function latestAnswer() public view checkRelativePrices() returns (uint256) { return _calculateMooTokenValue( _calculateCurveLPValue( _assetSumUSD8Decimals() ) ); }
3,972,410
pragma solidity ^0.4.15; /** * @title TokenLib * @author Majoolr.io * * version 1.0.0 * Copyright (c) 2017 Majoolr, LLC * The MIT License (MIT) * https://github.com/Majoolr/ethereum-libraries/blob/master/LICENSE * * The Token Library provides functionality to create a variety of ERC20 tokens. * See https://g...
Permanently burn tokens self Stored token from token contract _amount Amount of tokens to burn return True if completed
function burnToken(TokenStorage storage self, uint256 _amount) returns (bool) { uint256 _newBalance; bool err; (err, _newBalance) = self.balances[msg.sender].minus(_amount); require(!err); self.balances[msg.sender] = _newBalance; self.totalSupply = self.totalSupply - _amount; ...
7,811,900
./full_match/1/0x673003F86fFe32F7CaA3E5fcfDC711EBf8A64aeF/sources/src/membership/modules/StablecoinPurchaseModule.sol
Function to get the configuration of a collection, incl stablecoin price and enabled stablecoins collection The collection to query against _parameters storage mapping
function priceOf(address collection) external view returns (uint128 price) { price = _parameters[collection].price; require(price > 0, "NO_PRICE"); }
3,159,216
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; import "./BaseMetaTxAccount.sol"; import "../interfaces/ILoginKeyTransactionValidator.sol"; /** * @title LoginKeyMetaTxAccount * @author Authereum Labs, Inc. * @dev Contract used by login keys to send transactions. Login key firewall checks * @dev are perf...
Validates all loginKey Restrictions _transactions Arrays of transaction data ([to, value, gasLimit, data],[...],...) Check that calls made to self and auth keys have no data and are limited in gas
function _validateDestinations( bytes[] memory _transactions ) internal view { address to; uint256 gasLimit; bytes memory data; for (uint i = 0; i < _transactions.length; i++) { (to,,gasLimit,data) = _decodeTransactionData(_transactions[i])...
12,748,971
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./ComptrollerInterface.sol"; import "./CTokenInterfaces.sol"; import "./ErrorReporter.sol"; import "./Exponential.sol"; import "./EIP20Interface.sol"; import "./EIP20NonStandardInterface.sol"; import "./InterestRateModel.sol"; /** * @title Compound's C...
Admin Functions /
function _setPendingImplementation(address newPendingImplementation) public returns (uint) { if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_IMPLEMENTATION_OWNER_CHECK); } address oldPendingImplementation = pendingComptrollerImplementation; ...
181,496
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; // EXTERNAL IMPORTS import "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; import "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; import "@openzeppelin/contract...
if the agreement wasn't accepted by anybody yet, the seller can simply take away the contract's approval to transfer the token from their wallet. We use a try catch in case the flow can not be retrieved from the Superfluid contract. If that's the case, we have no way to validate whether the buyer's flow is valid or eve...
function sellerRetrieveToken(Agreement memory agreement, bytes32 id) private { try cfa.getFlow( ISuperfluidToken(agreement.acceptedToken), agreement.buyer, agreement.seller ) returns (uint256 ts, int96 flowRate, uint256, uint256) { int96 agreementFlowRate = int96(agr...
15,794,886
pragma solidity ^0.4.11; /* Abstract contract for the full ERC 20 Token standard https://github.com/ethereum/EIPs/issues/20 Copyright 2017, Jordi Baylina (Giveth) Original contract from https://github.com/status-im/status-network-token/blob/master/contracts/ERC20Token.sol */ contract ERC20Token { /* Thi...
Creates a new clone token with the initial distribution being this token at `_snapshotBlock` _cloneTokenName Name of the clone token _cloneDecimalUnits Number of decimals of the smallest unit _cloneTokenSymbol Symbol of the clone token _snapshotBlock Block when the distribution of the parent token is copied to se...
function createCloneToken( string _cloneTokenName, uint8 _cloneDecimalUnits, string _cloneTokenSymbol, uint _snapshotBlock, bool _transfersEnabled ) returns(address) { if (_snapshotBlock == 0) { _snapshotBlock = block.number; } ...
6,835,385
// SPDX-License-Identifier: MIT pragma solidity 0.8; contract Lottery { address payable[] public bidder; address payable public dealer; uint256 public ask; // as wei uint256 public commision; uint private players; constructor (uint256 _ask, uint _players) { dealer = payable(msg.send...
@Todo: send (value - commision) to the winner -> method: transfer
function pick () external { require(dealer == msg.sender, "only dealer allow to start the game"); require(bidder.length >= players, "not enought players yet, wait for more comming"); address payable lootWinner; lootWinner = bidder[_random() % bidder.length]; bidder = new addr...
7,275,605
./full_match/1/0x6c9829e5aF58E993daC721e3c2de6A1d32e3b37C/sources/contracts/ERC721/ERC721KODAEditions.sol
Is Edition Open? returns whether or not an edition has tokens available to be minted _editionId the ID of the edition check return bool is the edition open/
function isOpenEdition(uint256 _editionId) public view returns (bool) { return editionMintedCount(_editionId) < editionSize(_editionId); }
9,815,199
./full_match/80001/0x45f968F42fC18A8280DaAbbA88F0a6e5D408EfC9/sources/browser/Mona.sol
Deposit tokens ChildChainManagerProxy - Mumbai - 0xb5505a6d998549090530911180f38aC5130101c6 MainNet - 0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa called when token is deposited on root chain Should be callable only by ChildChainManager Should handle deposit by minting the required amount for user Make sure minting is ...
function deposit(address user, bytes calldata depositData) external onlyChildChain { uint256 amount = abi.decode(depositData, (uint256)); mint(user, amount); emit Deposit(address(this), user, amount, balanceOf(user)); }
5,577,658
pragma solidity ^0.8.0; import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Callee.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC72...
Cast [0,1,2,3,4,5] (uint8[6]) to uint256 memory
function uniswapV2Call( address, uint256 amount0, uint256, bytes calldata data ) external override { weth.withdraw(amount0); address marketPlace = abi.decode(data, (address)); uint256[] memory tokenIds = new uint256[](6); for (uint256 i; i < toke...
2,514,330
/** *Submitted for verification at Etherscan.io on 2022-01-24 */ /** *Submitted for verification at BscScan.com on 2022-01-06 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool ...
See {IETH721-safeTransferFrom}./
function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ETH721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); ...
5,998,936
./partial_match/1/0xFbC3661021539b2a2102Bd2476E7F2371Cb8d763/sources/Whitelist.sol
blacklists the given address to ban them from contributing _contributor Address of the contributor to blacklist
function invalidateHash(bytes32 _hash) external override onlyAdmin { invalidHash[_hash] = true; }
4,180,755
/* ORIGINAL: pragma solidity ^0.5.1; */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pur...
Transfer the specified amount of tokens to the specified address. Invokes the `tokenFallback` function if the recipient is a contract. The token transfer fails if the recipient is a contract but does not implement the `tokenFallback` function or the fallback function to receive funds. Compitable w...
function transfer(address _to, uint _value) public unfreezed(_to) unfreezed(msg.sender) noEmergencyFreeze() { bytes memory _data; _transfer223(msg.sender, _to, _value, _data); }
897,815
./partial_match/1/0x2aF8d54d6289C09aef7cE0429B91bB05e24F3656/sources/MaterToken.sol
Function to exclude an address from fees
function excludeFromFees(address account) public onlyOwner { isExcludedFromFees[account] = true; }
3,881,811
pragma solidity 0.5.11; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error. */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c /...
Function to change the address to receive ether. Available only to the admin. newWallet new address./
function setWallet(address payable newWallet) external onlyAdmin { require(newWallet != address(0), "New parameter value is the zero address"); _wallet = newWallet; }
2,561,229
./full_match/97/0x0EbA4F0fbcb4512aA93e06FFd3ea84F788A8d2d2/sources/swagContractWithMerkleProof.sol
Withdraw Amount to the specified address. Test with a small amount First
function transfer(address payable _to, uint256 _amount) public nonReentrant onlyOwner { uint256 transferVal = _amount; require(sent, "Failed to send Ether"); }
5,027,952
/** * Hello curious visitor! You are looking at the contract code of TeamworkBSC visit -> www.teamworkbsc.com Wallet Overview: Dev -> 0x7D421414A22d1cC888BE724C509C3dBc99e2b7f6 Royality -> 0x479b7B8d86ED027caDb4B8D88c3DF27B20543605 */ pragma solidity ^0.6.12; // SPDX-Lic...
Executable Functions (owner/admin)
function setTaxFeePercent(uint256 taxFee) external adminOrOwner() { _taxFee = taxFee; }
5,449,422
//Address: 0xaced90c414006b622a4b1ce74fa34b1f650ab319 //Contract name: IndividualityToken //Balance: 0 Ether //Verification Date: 1/26/2017 //Transacion Count: 2 // CODE STARTS HERE pragma solidity ^0.4.0; library TokenEventLib { /* * When underlying solidity issue is fixed this library will not be needed....
Mints a new token. _to Address of token owner. ensure that the token owner doesn't already own a token. log the minting of this token. increase the supply.
function mint(address _to) minterOnly returns (bool success) { if (balances[_to] != 0x0) return false; balances[_to] = 1; Mint(_to); Transfer(0x0, _to, 1); TokenEventLib._Transfer(0x0, _to); numTokens += 1; return true; }
5,545,216
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.6.8; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../lib/access/AdminAccess.sol"; import "../token/WETH9.sol"; import "./EscrowIn...
Deposits ERC20 tokens from Escrow Admin into an account. Note: The Escrow Admin must set the allowance before hand. account The account to deposit ERC20 tokens. token The ERC20 token to deposit. amount The amount of ERC20 token to deposit./ Updates the balance
function depositByAdmin(address account, address token, uint256 amount) public override onlyAdmin { require(account != address(0x0), "EscrowBase: Account not set"); require(token != address(0x0), "EscrowBase: Token not set"); require(amount > 0, "EscrowBase: Amount not set"); _incre...
1,076,027
// 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]. * * Implementers can declare support of contract interfaces, which can then...
Classic ERC1155 Standard Method/
function balanceOfBatch( address[] memory accounts, uint256[] memory objectIds ) public virtual override view returns (uint256[] memory balances) { balances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; i++) { balances[i] = balanceOf(accou...
179,105
./full_match/1/0xA441CF75BCFb5833cB1ba7c93A0721ae9B292789/sources/contracts/SafeguardMath.sol
aE = amountIn in excess bE = current balance of excess token / aE - sIn \ sIn = swap amount in needed before the join rOpt = | ----------- | rOpt = amountIn TV / current pool TVL ...
function calcJoinSwapROpt( uint256 excessTokenBalance, uint256 excessTokenAmountIn, uint256 swapAmountIn ) internal pure returns (uint256) { uint256 num = excessTokenAmountIn.sub(swapAmountIn); uint256 denom = excessTokenBalance.add(swapAmountIn); return (num.s...
3,012,442
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/...
Before any transfer, add the new owner to the holders list of this token Save the holder only once per token
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (!_alreadyHoldToken[tokenId][to]) { cardInfo[tokenId].holders.push(to); _alreadyHoldToken[tokenId][to] = true; } ...
13,976,301
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import { IConstantFlowAgreementV1 } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; import "@superfluid-finance/ethereum-contracts/contracts/interfaces/misc/IResolver.sol"; import ...
increase the Minion superToken balance _token the underlying token value deposit value
function upgradeToken(ERC20WithTokenInfo _token, uint256 value) external override memberOnly nonReentrant { _pullFunds(address(_token)); require(_token.balanceOf(address(this)) >= value, "SuperfluidMinion: No enough funds available to upgrade"); address superToken = sfApp.getSuperToken(_tok...
5,516,675
./full_match/100/0x60027a9c1EF06EE9890f086B05A4ACc6cd041D62/sources/_gnosis.pm/util-contracts/contracts/StorageAccessible.sol
Performs a delegetecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static). Returns encoded result as revert message concatenated with the success flag of the inner call as a last byte. targetContract Address of the contract containing the code to execute....
function simulateDelegatecallInternal( address targetContract, bytes memory calldataPayload ) public returns (bytes memory response) { bool success; (success, response) = targetContract.delegatecall( calldataPayload ); revertWith(abi.encodePacked(respo...
14,277,664
./partial_match/97/0x6e812dD5B642334bbd17636d3865CE82C3D4d7eB/sources/Sparta.sol
======================================CLAIM======================================== Anyone to Claim
function claim(address asset, uint amount) public payable { uint _claim = amount; if(mapAsset_claimed[asset].add(amount) > mapAsset_allocation[asset]){ _claim = mapAsset_allocation[asset].sub(mapAsset_claimed[asset]); } if(asset == address(0)){ requi...
11,386,966
pragma solidity ^0.4.24; /** * @title ReailtioSafeMath256 * @dev Math operations with safety checks that throw on error */ library RealitioSafeMath256 { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a ...
Submit the hash of an answer, laying your claim to that answer if you reveal it in a subsequent transaction. Creates a hash, commitment_id, uniquely identifying this answer, to this question, with this bond. The commitment_id is stored in the answer history where the answer would normally go. Does not update the curre...
function submitAnswerCommitmentERC20(bytes32 question_id, bytes32 answer_hash, uint256 max_previous, address _answerer, uint256 tokens) stateOpen(question_id) bondMustDouble(question_id, tokens) previousBondMustNotBeatMaxPrevious(question_id, max_previous) external { _deductTok...
15,815,192
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./libs/IBEP20.sol"; import "./libs/SafeBEP20.sol"; import "./libs/ITenguReferral.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; i...
Update the tengu referral contract address by the owner
function setTenguReferral(ITenguReferral _tenguReferral) public onlyOwner { address previousTenguReferral = address(tenguReferral); tenguReferral = _tenguReferral; emit SetTenguReferral(previousTenguReferral, address(tenguReferral)); }
15,867,385
pragma solidity ^0.4.17; contract Auction { // Data //Structure to hold details of the item struct Item { uint itemId; // id of the item uint[] itemTokens; //tokens bid in favor of the item } //Structure to hold the details of a persons struct Person { u...
Start code here. 2 lines approximately. / End code here. Start code here. 1 line approximately. End code here.
function bid(uint _itemId, uint _count) public payable{ Bids tokens to a particular item. Arguments: _itemId -- uint, id of the item _count -- uint, count of tokens to bid for the item Part 1 Task 4. Implement the three conditions below. 4...
941,314
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ //SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with ver...
Updated: Added owner-only mint functionality to "Airdrop" the old NFTs to the original owners There are cooler and more efficient ways
function mintToOwner(uint256 quantity, address receiver) public onlyOwner mintCompliance(quantity) { _safeMint(receiver, quantity); } $$\ $$\ $$\ $$\ $$$$$$\ $$\ $$$\ $$$ | $$ |\__|$$ __$$\ \__| ...
2,323,544
./full_match/80001/0x921331433c9167F0EcD95F5E6841C032843Ce130/sources/project_/contracts/STokenV1.sol
This function can release ERC20-tokens `_tokensToWithdraw`, which got stuck in this smart contract (were transferred here by the mistake) Allowed only for SuperAdmin. Transfers all balance of stuck `_tokensToWithdraw` from this contract to {_corporateTreasury} wallet _tokensToWithdraw address of ERC...
function withdrawStuckTokens(address _tokensToWithdraw) external onlySuperAdmin { address from = address(this); uint256 amount = IERC20(_tokensToWithdraw).balanceOf(from); IERC20(_tokensToWithdraw).transfer(_corporateTreasury, amount); }
5,596,185
./full_match/42220/0x86Cd6217B90BD9Ff3fC1D91Ef8BA4d22B53c02b8/sources/contracts/strategies/AutoCompoundStrategy.sol
pauses the strategy in case of emergency can only be called by the operator. Only in case of emergency./
function pause() external virtual onlyOperator { _pause(); emit Pause(); }
16,316,216
./partial_match/42/0xD3b9c07B1Be8B6895A4C4748F04B0902f042cC1D/sources/LockMapping.sol
create new receiptdeposit token to this contract
function createReceipt(uint256 _amount, string calldata _targetAddress) external { token.safeTransferFrom(msg.sender, address(this), _amount); _createReceipt(asset, msg.sender, _targetAddress, _amount, now, now.add(lockTime), false); }
3,418,813
./full_match/3/0x7A772f6b56154f53516B7D5Fbb10A385e0C09a0A/sources/browser/C2.sol
Issue a new amount of tokens these tokens are deposited into the owner address _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner { require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; emit Issue(amount); }
8,150,860
pragma solidity 0.5.17; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT pragma solidity ^0.5.17; // SPDX-License-Identifier: MIT pragma solidity ^0.5.17; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in e...
Initiates a new rebase operation, provided the minimum time period has elapsed. The supply adjustment equals (_totalSupply DeviationFromTargetRate) / rebaseLag Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate and targetRate is 1e18/ EOA only ensure rebasing at correct time This ...
function rebase() public { require(msg.sender == tx.origin); _inRebaseWindow(); require(lastRebaseTimestampSec.add(minRebaseTimeIntervalSec) < now); lastRebaseTimestampSec = now.sub( now.mod(minRebaseTimeIntervalSec)).add(rebaseWindowOffsetSec); epo...
6,858,008
/* You should inherit from StandardToken or, for a token like you would want to deploy in something like Mist, see HumanStandardToken.sol. (This implements ONLY the standard functions and NOTHING else. If you deploy this, you won't have anything useful.) Implements ERC 20 Token standard: https://github.com/ethereum/EI...
Data structures/ Public functions/ Transfers sender's tokens to a given address, added due to backwards compatibility reasons with ERC20 _to Address of token receiver. _value Number of tokens to transfer. return Returns success of function call.
(This implements ONLY the standard functions and NOTHING else. If you deploy this, you won't have anything useful.) .*/ pragma solidity ^0.4.8; import "./Token.sol"; import "./ContractReceiver.sol"; { bytes memory empty; return transfer(_to, _value, empty); }
5,475,309
// SPDX-License-Identifier: CC0-1.0 /// @title The Crypts and Caverns ERC-721 token /***************************************************** 0000000 0000000 0001100 Crypts and Caverns 0001100 0001100 9000 generative on-chain dungeons 0001100 0003300 ...
Allows the owner to withdraw eth to another wallet./
function withdraw(address payable recipient, uint256 amount) override public nonReentrant onlyOwner { require(address(this).balance >= amount, "Insufficient balance"); require(succeed, "Withdraw failed"); }
12,960,668
//Address: 0x3744942C42451c2B42F43a51eE9bB6c6ad0FDc86 //Contract name: ICOEvent //Balance: 0 Ether //Verification Date: 10/13/2017 //Transacion Count: 63 // CODE STARTS HERE pragma solidity >=0.4.10; /* ---------------------------------------------------------------------------------------- Dev: "Owned" to...
---------------------------------------------------------------------------------------- Set closed ICO and transfer balance to holding account
function close() onlyOwner { require((now >= endTime) || (totalWeiContributed >= icoCapInWei)); require(state==State.Active); state = State.Closed; Closed(); holdingAccount.transfer(this.balance); }
12,936,290
./full_match/80001/0x4B422996a97d48Ed80C0202155D3B7b9cDbCBDe3/sources/src/Contract.sol
The threshold is reached, drawing logic can be triggered manually by the owner.
function buyTicket() external payable notDrawing { require(msg.value == ticketPrice, "Incorrect ticket price"); players.push(msg.sender); ticketCount[msg.sender]++; emit TicketPurchased(msg.sender, ticketCount[msg.sender]); pot += ticketPrice; if (pot >= threshold...
873,606
./partial_match/1313161554/0x1d4F592E0723e03bed2Ff6d78F3CEe6750f08B38/sources/RequesterAuthorizerWithAirnode.sol
solhint-disable-next-line func-name-mixedcase solhint-disable-next-line func-name-mixedcase solhint-disable-next-line func-name-mixedcase
interface IWhitelistRoles { function WHITELIST_EXPIRATION_EXTENDER_ROLE_DESCRIPTION() external view returns (string memory); function WHITELIST_EXPIRATION_SETTER_ROLE_DESCRIPTION() external view returns (string memory); function INDEFINITE_WHITELISTER_ROLE_D...
16,914,858
./partial_match/1/0xc3feBcF3Ee000Db2D96A05397d6Ac75B9CB0309e/sources/CreateToken.sol
Transfer tokens from one address to another. _from address The address which you want to send tokens from. _to address The address which you want to transfer to. _value uint256 the amout of tokens to be transfered./ Check is not needed because sub(_allowance, _value) will already throw if this condition is not met r...
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][m...
15,776,748
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which i...
— Rollback transaction Proceed transfers Beneficiary fees
function transferWithFees(uint256 _position, uint256 _amount) internal returns(bool) { Position storage position = positions[_position]; uint256 sum = position.price.mul(_amount); uint256 fee = getFee(sum, beneficiaryFee); uint256 total = sum.add(fee); require(msg.value >= to...
14,570,596
./partial_match/82/0x489ACC9d481b9B90827Bb3bFD49D6fF0B6982892/sources/flattened/ChainBridgeXCAmpleGateway.sol
Calculates the amount of xc-amples to be mint based on the amount and the total supply on the base chain when the transaction was initiated and mints xc-amples to the recipient. senderAddressInSourceChain Address of the sender wallet in the transaction originating chain. recipient Address of the recipient w...
function mint( address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply ) external override onlyOwner { uint256 recordedGlobalAMPLSupply = IXCAmple(xcAmple).globalAMPLSupply(); uint256 mintAmount = amount.mul(recordedGlobalAM...
16,896,131
./full_match/80001/0x30c2d6966A5FB06534c3Ad4F65Dc14b596516C65/sources/contracts/Admin.sol
Modifier to check if the caller is the admin
modifier onlyAdmin() { require(msg.sender == admin, "Only the admin can call this function."); _; }
858,797
./full_match/80001/0x9c2D86d00aFDe6e616CADfBc0fe2D47C1d22b1c8/sources/contracts/v1.2/SaleManager.sol
/ Generate a reorg-resistant sale ID This ensures the Sale struct wasn't already created (msg.sender will never be the zero address)
function newSale( address payable recipient, bytes32 merkleRoot, uint256 saleBuyLimit, uint256 userBuyLimit, uint startTime, uint endTime, uint160 maxQueueTime, string memory uri, uint256 price, uint8 decimals ) public returns(bytes32) { require(recipient != address(0), "...
9,541,171
pragma solidity 0.6.12; interface IERC20 { function TOTALSUPPLY831() external view returns (uint256); //i...
inject NONSTANDARD NAMING
function SAFEINCREASEALLOWANCE134(IERC20 token, address spender, uint256 value) internal {
14,087,537
// SPDX-License-Identifier: MIT // Contract by pr0xy.io pragma solidity ^0.8.7; import './ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol'; contract ZiPoap is ERC721Enumerable, Ownable { using Strings for uint256; ...
See {IERC721-approve}.
function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all"); ...
170,896
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // Part: ICurveRegistry interface ICurveRegistry { function get_n_coins(address lp) external view returns (uint, uint); function pool_list(uint id) external view returns (address); function get_coins(address pool) external view returns (address[8] mem...
Get underlying ERC20 token of ERC1155 given token id id Token id
function getUnderlyingToken(uint id) external view override returns (address) { (uint pid, uint gid, ) = decodeId(id); return getUnderlyingTokenFromIds(pid, gid); }
1,217,740
./full_match/80001/0xDb79e526f6f410dC08Dc25aDFdA7e337aA469C47/sources/contracts/dynamic-contracts/extension/AccountPermissions.sol
/// Runs after every `changeRole` run. Makes the given account an admin.
Internal functions function _afterChangeRole(RoleRequest calldata _req) internal virtual; function _setAdmin(address _account, bool _isAdmin) internal virtual { AccountPermissionsStorage.Data storage data = AccountPermissionsStorage.accountPermissionsStorage(); data.isA...
5,704,966
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./SafeMath.sol"; import "./ContractSystem.sol"; contract ContractStorage { using SafeMath for uint256; struct Info { address system; uint256 version; address owner; } Info info; ...
Sets the owner of the platform newOwner New owner address
function setOwner(address newOwner) external { require(msg.sender == info.owner, "Must be current owner"); require(newOwner != address(0)); info.owner = newOwner; }
12,880,326
./full_match/137/0xeD594F9A9fA854d8668688a66c4F43c1bEe9F897/sources/MasterChef.sol
Safe max transfer function, just in case if rounding error causes pool to not have enough EGGs.
function safeEggTransfer(address _to, uint256 _amount) internal { uint256 maxBal = max.balanceOf(address(this)); if (_amount > maxBal) { max.transfer(_to, maxBal); max.transfer(_to, _amount); } }
3,744,945
pragma solidity ^0.5.3; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; import "../common/CalledByVm.sol"; import "../common/FixidityLib.sol"; import "../common/Freezable.sol"; import "../common/Initializable.sol"; import "../common/UsingRegi...
Sets the community reward percentage value The percentage of the total reward to be sent to the community funds. return True upon success./
function setCommunityRewardFraction(uint256 value) public onlyOwner returns (bool) { require(value != communityRewardFraction.unwrap() && value < FixidityLib.fixed1().unwrap()); communityRewardFraction = FixidityLib.wrap(value); emit CommunityRewardFractionSet(value); return true; }
12,996,395