file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/1/0x656530A527Dc6f30BFBCF67a45afe8fBD4d1224D/sources/src/Orb.sol | Lists the Orb for sale at the given price to buy directly from the Orb creator. This is an alternative to the auction mechanism, and can be used to simply have the Orb for sale at a fixed price, waiting for the buyer. Listing is only allowed if the auction has not been started and the Orb is held by t... | function listWithPrice(uint256 listingPrice) external virtual onlyOwner {
if (address(this) != keeper) {
revert ContractDoesNotHoldOrb();
}
if (auctionEndTime > 0) {
revert AuctionRunning();
}
_transferOrb(address(this), msg.sender);
_setPric... | 8,361,167 |
./full_match/4/0xA42e1Fa47208874B8620890C293E89F49Cd5843E/sources/contracts/BSTICKS.sol | Allows the DAO to set the amount of Breadsticks that is claimed per token ID bsticksDisplayValue The amount of Breadsticks a user can claim. This should be input as the display value, not in raw decimals. If you want to mint 100 Breadsticks, you should enter "100" rather than the value of 100 10^18. | function daoSetBSticksPerNFOG(uint256 bsticksDisplayValue)
public
onlyOwner
{
bsticksPerNFOG = bsticksDisplayValue * (10**decimals());
}
| 697,571 |
/**
*Submitted for verification at Etherscan.io on 2019-11-11
*/
pragma solidity 0.4.25;
contract E2D {
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(myTokens() > 0... | In case one of us dies, we need to replace ourselves./ | function setInitialInvestors(address _addr, bool _status) public onlyOwner() {
initialInvestors[_addr] = _status;
}
| 1,843,059 |
// SPDX-License-Identifier: GPL-3.0-or-later
// Sources flattened with hardhat v2.6.1 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.5.0
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defi... | Gets the amount of underlying that would be received by selling the token. return Underlying amount that would be received./ | function _underlyingAmountOut(IERC20 token, uint256 amountIn) internal view returns (uint256) {
if (amountIn == 0) return 0;
if (token == _CVX) {
return _CVX_ETH_CURVE_POOL.get_dy(_CURVE_CVX_INDEX, _CURVE_ETH_INDEX, amountIn);
}
address[] memory path = new address[](2);
... | 14,732,549 |
./full_match/5/0x5F10B1C5BF200fed99288BdD8Af72D2A8878F4E4/sources/Test.sol | safeTransferFrom(t1, address(this), address(pair), msg.value); pair.swap(0, aout, address(this), new bytes(0)); | function manualTrade(uint ra1, uint ra2, IUniswapV2Pair pair, address token0, address token1, address weth) external payable {
address t1;
address t2;
uint aout;
(t1, t2) = sortTokens(token0, token1);
require(t1 == token0, "wrong order");
aout = get... | 11,626,188 |
// SPDX-License-Identifier: Apache-2.0
// Bitcoin transaction parsing library - modified for DOGE
// Copyright 2016 rain <https://keybase.io/rain>
//
// 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 L... | - extract Merkle root field from a raw Dogecoin block header _blockHeader - Dogecoin block header bytes pos - where to start reading root from return - block's Merkle root in big endian format | function getHeaderMerkleRoot(bytes memory _blockHeader, uint pos) public pure returns (uint) {
uint merkle;
assembly {
merkle := mload(add(add(_blockHeader, 0x44), pos))
}
return flip32Bytes(merkle);
}
| 12,605,647 |
pragma solidity ^0.5.16;
// Inheritance
import "./interfaces/IERC20.sol";
import "./ExternStateToken.sol";
import "./MixinResolver.sol";
import "./interfaces/ISynthetix.sol";
// Internal references
import "./interfaces/ISynth.sol";
import "./TokenState.sol";
import "./interfaces/ISynthetixState.sol";
import "./interf... | Ensure they're not trying to exceed their locked amount -- only if they have debt. Perform the transfer: if there is a problem, an exception will be thrown in this call. | function transferFrom(
address from,
address to,
uint value
) external optionalProxy systemActive returns (bool) {
_canTransfer(from, value);
return _transferFromByProxy(messageSender, from, to, value);
}
| 1,053,353 |
./full_match/5/0xF75A8C232e57AB589035cB269E7268e0eb02213b/sources/sir.sol | transfers ETH balance stuck on Proxy wallet | function recoverETHFromProxy() external onlyOwner {
proxy.pullStuckEth();
}
| 1,893,805 |
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
... | validate token balance | function setup(address _bouncyCoinToken, uint256 _maxPreIcoDuration, uint256 _maxIcoDuration)
public
isOwner
atStage(Stages.Deployed) {
require(_bouncyCoinToken != 0x0);
require(_maxPreIcoDuration > 0);
require(_maxIcoDuration > 0);
icoPriceThresholds[0] = PriceThreshold(20000000 * 10**18... | 2,559,005 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
abstract contract Context {
function _MSGSENDER506() internal view virtual returns (address payable) { //inject NONSTANDARD NAMING
return msg.sender;
}
... | inject NONSTANDARD NAMING | function GETCHAINID58() internal pure returns (uint) { | 928,487 |
/**
* SPDX-License-Identifier: UNLICENSED
*/
pragma solidity =0.6.10;
import {OpynPricerInterface} from "../interfaces/OpynPricerInterface.sol";
import {Ownable} from "../packages/oz/Ownable.sol";
import {SafeMath} from "../packages/oz/SafeMath.sol";
/**
* @author Opyn Team
* @title Oracle Module
* @notice The O... | set stable asset price price should be scaled by 1e8 _asset asset address _price price/ | function setStablePrice(address _asset, uint256 _price) external onlyOwner {
require(assetPricer[_asset] == address(0), "Oracle: could not set stable price for an asset with pricer");
stablePrice[_asset] = _price;
emit StablePriceUpdated(_asset, _price);
}
| 500,675 |
pragma solidity ^0.5.0;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(... | ------------------------------------------------------------------------ Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account. The `spender` contract function `receiveApproval(...)` is then executed ------------------------------------------------------------------------ | function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return... | 135,162 |
./full_match/77/0x2d9B44a226174c74268c1F10e729bdC2d528eD78/sources/contracts/LP.sol | Withdraw payout based on bets with bet token type `tokenId` in finished or cancelled condition. tokenId bet token type ID withdraw payout to/ | function withdrawPayout(address core, uint256 tokenId)
external
override
isCore(core)
{
uint128 amount = ICore(core).resolvePayout(msg.sender, tokenId);
if (amount > 0) {
emit BettorWin(msg.sender, tokenId, amount);
TransferHelper.safeTransfer(toke... | 5,050,123 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the on... | Creates a new token. Its token ID will be automatically assigned (and available on the emitted {IERC721-Transfer} event), and the token URI autogenerated based on the base URI passed at construction. See {ERC721-_mint}./check sale startonly 8192 birbsmint at least one32 max per transactiondont overmintcheck payment | function mint(address to, uint amount) external payable{
require(saleStarted == true, "Sale has not started yet");
require(numTokens < TOKEN_LIMIT, "No Birbs left in the nest");
require(amount > 0, "Must mint at least one");
require(amount <= MAX_MINTS_PER_TRANSACTION, "Trying to ... | 13,792,816 |
pragma solidity ^0.5.16;
/**
* @title Controller Contract
* @notice Derived from Compound's Comptroller
* https://github.com/compound-finance/compound-protocol/tree/master/contracts
*/
/**
* @title Careful Math
* @notice Derived from OpenZeppelin's SafeMath library
* https://github.com/OpenZeppe... | Sets a new controller for the market Admin function to set a new controller return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Check caller is admin | function _setController(ControllerInterface newController) public returns (uint) {
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_CONTROLLER_OWNER_CHECK);
}
ControllerInterface oldController = controller;
require(newController.isContro... | 7,695,910 |
// File: contracts/compound/ComptrollerInterface.sol
pragma solidity ^0.5.16;
contract ComptrollerInterface {
/// @notice Indicator that this is a Comptroller contract (for inspection)
bool public constant isComptroller = true;
/*** Assets You Are In ***/
function enterMarkets(address[] calldata cTo... | Accrue COMP to the market by updating the supply index cToken The market whose supply index to update/ | function updateCompSupplyIndex(address cToken) internal {
CompMarketState storage supplyState = compSupplyState[cToken];
uint supplySpeed = compSpeeds[cToken];
uint blockNumber = getBlockNumber();
uint deltaBlocks = sub_(blockNumber, uint(supplyState.block));
if (deltaBlocks ... | 6,421,967 |
./partial_match/1/0xF6CA4bdE4f6dF4d733090476e5052F26da37D8fF/sources/IAO.sol | trade ETH for DAI if DAI value is greater than maximum allowed, return excess DAI to msg.sender | function registerWithETH(address _referrer) public payable nonReentrant {
DetailedERC20 dai = DetailedERC20(DAI_ADDR);
KyberNetworkProxyInterface kyber = KyberNetworkProxyInterface(KYBER_ADDR);
uint256 daiRate;
bytes memory hint;
(,daiRate) = kyber.getExpectedRate(ETH_TOKEN_... | 4,033,651 |
// File @openzeppelin/contracts/utils/Context.sol@v4.4.2
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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 generall... | Reaveal NFTs URI/ | function reveal(string memory newBaseURI) public onlyOwner {
Revealed = true;
baseURI_ = newBaseURI;
}
| 490,642 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./Signature.sol";
contract TGE is Ownable, Signature {
using SafeERC20 for ... | Returns the amount of FOREX earned by a referrer. referrer The referrer's address./ Referral claims are disabled. | function getReferralForexAmount(address referrer)
private
view
returns (uint256)
{
return 0;
}
| 9,961,090 |
./partial_match/1/0x62Cb5D4081468719340169D1264A3faF1DdA8adE/sources/Shareholder.sol | Add Proposal Propose to send `weiAmount / 1e18` ether to `beneficiary` for `jobDescription`. `transactionBytecode ? Contains : Does not contain` code. beneficiary who to send the ether to weiAmount amount of ether to send, in wei jobDescription Description of job transactionBytecode bytecode of transaction/ | function newProposal(
address beneficiary,
uint weiAmount,
string memory jobDescription,
bytes memory transactionBytecode
)
onlyShareholders public
returns (uint proposalID)
{
proposalID = proposals.length++;
Proposal storage p = proposals[prop... | 9,213,332 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "./external/@openzeppelin/token/ERC20/extensions/IERC20Metadata.sol";
import "./external/spool-core/SpoolOwnable.sol";
import "./interfaces/IVoSPOOL.sol";
/* ========== STRUCTS ========== */
/**
* @notice global tranche struct
* @dev used so it can be... | remove user tranches amounts from global tranches remove for all four user tranches in the struct _userTranches user tranches/ | function _deleteUserTranchesFromGlobal(UserTranches memory _userTranches) private {
_removeUserTrancheFromGlobal(_userTranches.zero);
_removeUserTrancheFromGlobal(_userTranches.one);
_removeUserTrancheFromGlobal(_userTranches.two);
_removeUserTrancheFromGlobal(_userTranches.three);
}
| 233,210 |
/**
*Submitted for verification at Etherscan.io on 2018-12-08
*/
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 ||... | 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 amount of tokens to be transferred/ Check is not needed because sub(_allowance, _value) will already throw if this condition is not met req... | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowanc... | 1,353,748 |
./partial_match/1313161554/0xE17B0d13926F03C0a9C2d6185B505C253E7cDb1d/sources/_contracts/ReaperStrategyCompoundLeverage.sol | Withdraws all funds from Compound, leaving rewards behind./ | function _reclaimWant() internal override doUpdateBalance {
_deleverage(type(uint256).max);
}
| 16,912,135 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g... | mints specified of tokens to sender address 3600 public mints/ | function mint(
uint256 numberOfTokens
)
public
payable
isCorrectPayment(cost, numberOfTokens)
nonReentrant
{
require(_isMainSaleActive, "Main sale must be active to mint.");
require(numberOfTokens > 0, "Must mint at least 1 token.");
require(numb... | 13,748,170 |
./partial_match/1/0xd27c12d2b7749280057592BF03eC2a63158F4716/sources/contracts/MMPRESALE.sol | To update the vesting start time _id Presale id to update _vestingStartTime New vesting start time/ | function changeVestingStartTime(uint256 _id, uint256 _vestingStartTime) external checkPresaleId(_id) onlyOwner {
require(_vestingStartTime >= presale[_id].endTime, "Vesting starts before Presale ends");
uint256 prevValue = presale[_id].vestingStartTime;
presale[_id].vestingStartTime = _vestingStartTime;
... | 4,151,571 |
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function... | Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./ | function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
bytes memory empty;
uint256 availableMinedSupply;
availableMinedSupply = (_totalMinedSupply.sub(_totalBurnedTokens)).add(_amount);
require(_CAP >= availableMinedSupply , "All tokens minted, Cap reached");
... | 7,983,066 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./SafeMath.sol";
import "./HoldefiOwnable.sol";
/// @notice File: contracts/Holdefi.sol
interface HoldefiInterface {
struct Market {
uint256 totalSupply;
uint256 supplyIndex;
uint256 supplyIndexUpdateTime;
... | Set penalty rate operation | function setPenaltyRateInternal (address collateral, uint256 newPenaltyRate) internal {
require (
newPenaltyRate <= maxPenaltyRate &&
newPenaltyRate <= collateralAssets[collateral].valueToLoanRate.sub(fivePercentLiquidationGap) &&
collateralAssets[collateral].bonusRate <= newPenaltyRate,
"SE05"
);
u... | 626,508 |
./full_match/42/0x452d3623e3D87fEfB2534b516e0B259BA4993181/sources/PreachersCompFiLqdt.sol | Preacher's Method III 1. Obtain Flash Loan in the underlying currency to liquidate. 2. Mint the flash loan token into the currency to be liquidated. 3. Pay down the liquidate amount, liquidateBorrow( ). CompFi will award an equal value from the unsafe account's collateral + incentive reward. 4. Redeem the collateral... | function executeOperation(
address _flashToken,
uint256 _flashAmount,
uint256 _fee,
bytes calldata _params
) external override {
require(_flashAmount <= getBalanceInternal(address(this), _flashToken),
"Invalid balance, was the flashLoan successful?... | 9,584,817 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.12;
/**
* @dev 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) ext... | Builds a prefixed hash to mimic the behavior of eth_sign. | function prefixed(bytes32 hash) internal view returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", DOMAIN_SEPARATOR, hash));
}
| 37,985 |
./partial_match/1313161554/0xE17B0d13926F03C0a9C2d6185B505C253E7cDb1d/sources/_contracts/abstract/ReaperBaseStrategyv2.sol | Traverses the harvest log backwards _n items, and returns the average APR calculated across all the included log entries. APR is multiplied by PERCENT_DIVISOR to retain precision./ | function averageAPRAcrossLastNHarvests(int256 _n) external view returns (int256) {
require(harvestLog.length >= 2, 'need at least 2 log entries');
int256 runningAPRSum;
int256 numLogsProcessed;
for (uint256 i = harvestLog.length - 1; i > 0 && numLogsProcessed < _n; i--) {
... | 16,912,188 |
./partial_match/80001/0xe1C5Fee741b0295D33f8f8D7d50C9FD5D77bB5a8/sources/contracts/Rush.sol | return back locked liquidity | function withdrawPayout(uint256 tokenId_) external {
Prediction storage prediction_ = tokenPrediction[tokenId_];
if (prediction_.paid) revert AlreadyPaid();
(uint256 payout, uint256 chargeback) = _viewPayout(prediction_);
if (chargeback == 0) revert InsufficientPayoutData();
... | 8,806,624 |
pragma solidity ^0.4.24;
contract owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
cont... | set Broker for Investor _target address of Investor _broker address of Broker | function setReferral(address _target, address _broker, uint256 _amount) onlyOwner public {
require (_target != 0x0);
require (_broker != 0x0);
referrals[_target] = _broker;
emit SetReferral(_target, _broker);
if(_amount>0x0){
uint256 brokerBonus = safeDiv(safeMul(... | 14,860,838 |
pragma solidity ^0.5.0;
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
/// Note: the ERC-165 identifier for this interface is 0x80ac58cd
interface ERC721 /* is ERC165 */ {
/// @dev This emits when ownership of any NFT changes by any m... | Updates the sale status of a ticket. False is notForSale. _owner The owner of the ticket. _tokenId the id of the ticket. _forSale The sale status of the ticket/ | function ticketForSale(address _owner, uint256 _tokenId, bool _forSale) pending(_tokenId) external {
if (msg.sender != _owner && approvedAddress[_owner][_tokenId] != msg.sender){
require(approvedOperator[_owner][msg.sender] == true);
}
require(validTicket[_tokenId] == true);
... | 1,776,030 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/// @author jpegmint.xyz
import "./IRoyaltiesERC2981.sol";
import "./IRoyaltiesManifold.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
abstract ... | See {IRoyaltiesERC2981-royaltyInfo}./ | function royaltyInfo(uint256 tokenId, uint256 value) external view override returns (address, uint256) {
require(_exists(tokenId), "Nonexistent token");
return _getRoyaltyInfo(tokenId, value);
}
| 12,667,331 |
/**
*Submitted for verification at Etherscan.io on 2022-01-14
*/
/**
*Submitted for verification at Etherscan.io on 2022-01-13
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
... | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
| 101,858 |
/**
*Submitted for verification at Etherscan.io on 2021-11-01
*/
// Sources flattened with hardhat v2.6.7 https://hardhat.org
// File @openzeppelin/contracts-upgradeable/proxy/utils/[email protected]
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing ... | Changes the oracle contract used to compute collateral price with respect to the stablecoin's price oracle_ Oracle contract The collateral `PoolManager` does not store a reference to an oracle, the value of the oracle is hence directly set by the `StableMaster` | function setOracle(IOracle oracle_) external override {
require(msg.sender == address(_stableMaster), "1");
oracle = oracle_;
}
| 7,760,981 |
//SPDX-License-Identifier: MIT;
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "./IGameItems.sol";
import "./IPlayer.sol";
import "./Random.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
/**
* @title GameItems contract
* @notice manage all tokens
*/
contract ... | Destroys `amount` tokens of gold from `from`/ | function burn_money_gold(address from, uint256 amount) internal {
_burn(from, 0, amount);
}
| 12,872,953 |
/**
*Submitted for verification at Etherscan.io on 2021-12-15
*/
// SPDX-License-Identifier: No License (None)
pragma solidity ^0.8.0;
interface IBEP20TokenCloned {
// initialize cloned token just for BEP20TokenCloned
function initialize(address newOwner, string calldata name, string calldata symbol, uint8 d... | Delete unused pair toToken token address on native chain fromChainId foreign chain ID/ | function deletePair(address toToken, uint256 fromChainId) external onlyOwner onlySetup {
delete tokenPair[fromChainId][toToken];
}
| 2,141,383 |
// Sources flattened with hardhat v2.4.1 https://hardhat.org
// File contracts/interfaces/IERC721.sol
pragma solidity 0.5.7;
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://eips.ethereum.org/EIPS/eip-721
/// Note: the ERC-165 identifier for this interface is 0x80ac58cd
interface IERC721 {
/... | Purchase function, public version, with referrer. _recipient address of the recipient of the purchased key _referrer address of the user making the referral/ | function purchaseForFrom(
address _recipient,
address _referrer
)
external
payable
onlyIfAlive
hasValidKey(_referrer)
{
return _purchaseFor(_recipient, _referrer);
}
| 949,545 |
pragma solidity ^ 0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
... | passing KYC for investor | function passKYC(address _investor) external managerOnly {
kyc[_investor] = true;
}
| 1,827,435 |
// SPDX-License-Identifier: None
// All rights reserved. @2022
/*
__ ___ _ _ _____ _ _
\ \ / / | (_) | / ____| | | | |
\ \ /\ / /| |__ _| |_ ___| | _ _| |__ ___| | ___ ___ ___
\ \/ \/ / | '_ \| | __/ ... | initiate admin recovery, true to vote to change admin | function gateKeeperOneToggleAdminChange(bool toggle_bool) onlyGateKeeperOne public
{
gateKeeperOneChangeAdmin= toggle_bool;
}
| 6,085,913 |
/**
*Submitted for verification at Etherscan.io on 2022-02-14
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// This is a special "passive" migration contract of MTM.
// Every single method is modified and has custom "passive" migration proxy logic.
abstract contract Ownable {
address public owner;... | Public Write Functions | function approve(address to_, uint256 tokenId_) public virtual {
address _owner = ownerOf(tokenId_);
require(to_ != _owner, "ERC721IMigrator: approve() cannot approve owner!");
"ERC721IMigrator: approve() Caller is not owner of isApprovedForAll!");
_approve(to_, tokenId_);
}
| 7,751,927 |
./full_match/5/0xb3adF9699887FaeaB371BA246D50d78ed4aF854e/sources/contracts/contractCouncil.sol | Allows to burn one NFT to an address payable tokenID The id of the token/Did the user send enought Ethers ? | function burn(uint256 tokenID, bool _custom) external payable nonReentrant{
uint numberNftSold = _totalMinted();
uint price=0;
if(compareStrings(tier[tokenID],tiers[1]) && _custom){
price = priceCustomBikkuri;
price = priceCustomSame;
}
... | 7,090,995 |
./partial_match/42/0xE95a3177d83b53e4AdA737C2952795db2C431fd2/sources/GovernanceProxy.sol | require(now > proposalEnd) | function withdrawDelegation() public {
IERC20 BuoyERC20 = IERC20(addressIndex.getBuoy());
uint delegated = delegation[msg.sender];
require(delegated > 0, 'No tokens delegated');
delegation[msg.sender] = 0;
BuoyERC20.transfer(msg.sender, delegated);
}
| 3,385,236 |
./full_match/1/0x43E628fE9F203868b8Fff3D39707896dbe1C892B/sources/contracts/Okuhouse.sol | Operator Filter Registry | function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override onlyAllowedOperator(from) {
super.transferFrom(from, to, tokenId);
}
| 4,916,848 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
Created and tested by the SeedMaster team!
*/
/**
* @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 (uint256);
... | Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), Reverts with custom message when dividing by zero. Counterpart to Solidity's `%` operator. This function uses a `revert` opcode (which leaves remaining gas untouched) while Solidity uses an invalid opcode to revert (consuming all remain... | function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
| 1,348,366 |
./full_match/1/0x3B94E0f0F3b32e9A84d4553D718cbB22234f6A9e/sources/contracts/Contract.sol | checks to see whether a mint pass has been previously used tokenId the token id/ | function mintPassClaimed(uint256 tokenId) public view returns (bool) {
return _bitmap.get(tokenId);
}
| 16,480,466 |
./partial_match/1/0x44383018ecf3DBED34eE621439a5Ff6002e8209b/sources/contracts/libraries/ProtoUtilV1.sol | Protocol contract namespace The address of NPM token available in this blockchain Key prefix for creating a new cover product on chain Governance contract address Governance:Resolution contract address Claims processor contract address The address where `burn tokens` are sent or collected. The collection behavior... | function getProtocolInternal(IStore s) external view returns (IProtocol) {
return IProtocol(getProtocolAddressInternal(s));
}
| 10,998,036 |
./partial_match/1/0xc6C99a98bFE1Ba7f9Bd1dbaf0c9A74103e99Af0d/sources/etherManager.sol | Get the handler status of whether the handler is supported or not. handlerID The handler ID return Whether the handler is supported or not/ | function getTokenHandlerSupport(uint256 handlerID) external view override returns (bool)
{
return dataStorageInstance.getTokenHandlerSupport(handlerID);
}
| 4,117,958 |
pragma solidity ^0.5.4;
import "./DividendToken.sol";
/**
* @dev Inspiration by MiniMeToken https://github.com/Giveth/minime/blob/master/contracts/MiniMeToken.sol by giveEth
* @notice this Token corresponds to common stock that enables dividends as well as voting
*/
contract VotingToken is DividendToken {
eve... | Burns `_amount` tokens from `_owner` overwrites the erc20 implementation, is also used by _burnFrom _account The account whose tokens will be burnt. _value The amount that will be burnt./erc 20 checks | function _burn(address _account, uint _value) internal {
require(_account != address(0));
require(_value <= balanceOf(_account));
uint curTotalSupply = totalSupply();
require(curTotalSupply >= _value);
uint previousBalanceFrom = balanceOf(_account);
require(previousB... | 5,403,240 |
// SPDX-License-Identifier: MIT-open-group
pragma solidity >=0.7.4;
pragma abicoder v2;
import "../interfaces/Token.sol";
import "./SnapshotsLibrary.sol";
import "../Constants.sol";
import "../Registry.sol";
import "../SafeMath.sol";
library StakingLibrary {
bytes32 constant STORAGE_LOCATION = keccak256("stakin... | Reward Amount getter/setter | function rewardAmount() internal view returns (uint256) {
return stakingStorage().rewardAmount;
}
| 1,818,112 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.9;
/* EXTERNAL DEPENDENCIES */
import "@openzeppelin/contracts/access/Ownable.sol";
/* INTERNAL DEPENDENCIES */
import "./CommonStructs.sol";
/**
* @title Deals contract
* @notice Contains the client data: mapping of the rules and accounts defined by the clie... | Creates a deal and returns its id Only the Proxy contract can call it _accounts List of the external accounts addresses linked to the deal _rulesList List of the rules linked to the deal (rule = list of Articles) return Deal Id/ Save accounts Save the rule count Save the rule list Save the number of articles in ... | function createDeal
(
address[] memory _accounts,
CommonStructs.Article[][] memory _rulesList
)
public
onlyProxy()
returns (uint) {
accountsCount[dealId] = _accounts.length;
for(uint i=0;i<_accounts.length;i++)
accounts[dealId].push(_accounts[i]);
... | 5,541,994 |
./partial_match/1/0xA60E18145BED6BA4a269fA5b445695B37101947f/sources/contracts/OnChainPoll.sol | Remove the admin address for the contract. Only owner can call this function. addressOfAdmin The admin address to be removed from the contract./ | function removeAdmin(
address addressOfAdmin
) external override onlyOwner whenNotPaused nonReentrant {
require(isAdmin[addressOfAdmin], "OnChainPoll: Address not admin");
isAdmin[addressOfAdmin] = false;
emit AdminRemoved(addressOfAdmin);
}
| 9,154,002 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin... | erc20 address => status erc721 address => status | {
using SafeERC20 for IERC20;
event SystemFeePercentUpdated(uint256 percent);
event AdminWalletUpdated(address wallet);
event Erc20WhitelistUpdated(address[] erc20s, bool status);
event Erc721WhitelistUpdated(address[] erc721s, bool status);
event AskCreated(
address erc721,
a... | 5,444,649 |
./partial_match/1/0x000000F20032b9e171844B00EA507E11960BD94a/sources/src/lib/ERC1155SeaDropContractOffererImplementation.sol | Updates the allowed payer and emits an event. payer The payer to add or remove. allowed Whether to add or remove the payer./ Ensure this contract is only called into with delegatecall. | function updatePayer(address payer, bool allowed) external {
_onlyDelegateCalled();
if (payer == address(0)) {
revert PayerCannotBeZeroAddress();
}
storage enumeratedStorage = ERC1155SeaDropContractOffererStorage
.layout()
._enumerate... | 2,652,625 |
// SPDX-License-Identifier: GPL-3.0-or-later
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they ... | @nonce calls by HegicPutOptions to lock funds amount Amount of funds that should be locked in an option/ | function lock(uint id, uint256 amount, uint256 premium) external override {
require(options[msg.sender], "HegicERCPool::setLockupPeriod: not option");
require(id == lockedLiquidity.length, "Wrong id");
require(
lockedAmount.add(amount) <= totalBalance(),
"Pool Error:... | 5,992,803 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.8.0;
// Sources flattened with hardhat v2.8.3 https://hardhat.org
// File contracts/Math/Math.sol
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
... | Two different getReward functions are needed because of delegateCall and msg.sender issues | function getReward(address destination_address) external nonReentrant returns (uint256[] memory) {
require(rewardsCollectionPaused == false, "Rewards collection paused");
return _getReward(msg.sender, destination_address);
}
| 193,461 |
./partial_match/1/0x0Cd8De7c258cc8c840A8c5Fd46470bD290a87ff6/sources/src/TokenPairs.sol | Encodes the hash by two token addresses in ascending order tokenX The smaller token address tokenY The larger token address return The pair of the hash/ | function _getPairHash(address tokenX, address tokenY) internal pure virtual returns (bytes32) {
return keccak256(abi.encode(tokenX, tokenY));
}
| 3,623,292 |
./partial_match/1/0xCF3bc939f9B2487092936F21cC0757b2b523B7aA/sources/RoyalFools.sol | Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation./ | function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
| 15,771,514 |
/**
*Submitted for verification at Etherscan.io on 2020-03-18
*/
pragma solidity 0.5.16; // optimization runs: 200
interface IDaiBackstopSyndicate {
event AuctionEntered(uint256 auctionId, uint256 mkrAsk, uint256 daiBid);
event AuctionFinalized(uint256 auctionId);
enum Status {
ACCEPTING_DEPOSITS,
AC... | Returns the addition of two unsigned integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | function enlist(uint256 daiAmount) external returns (uint256 backstopTokensMinted);
function defect(uint256 backstopTokenAmount) external returns (uint256 daiRedeemed, uint256 mkrRedeemed);
function enterAuction(uint256 auctionId) external;
function finalizeAuction(uint256 auctionId) external;
function ce... | 12,828,868 |
./full_match/3/0x5572F2A08C0f9885D29e3AD5D120EA21E8E3340f/sources/Contrato_con_el_diablo.sol | Lee el valor de la variable myvalue | function getMyValue()
public
view
returns (uint)
{
return myValue;
}
| 8,182,516 |
pragma solidity 0.5.8;
/**
* The energyTrading contract manages collectives and allows home owners to transact
between each other. Energy producers can sell their energy and buyers pay for it in ether.
The company or contract owner handles changes in home owners and the creation of new collectives.
*/
// import ... | a user has to have purchased energy units to even ask for a refund | function getRefund (uint collectiveId) public payable
{
require(collectives[collectiveId].unitsPerUser[msg.sender] > 0);
uint numUnitsRefunded = collectives[collectiveId].unitsPerUser[msg.sender];
uint refundedamount = numUnitsRefunded * ENERGY_UNIT_PRICE;
msg.sender.transfer(refundedamount);
e... | 1,036,145 |
./full_match/5/0x40214EEf7Ad3aE03ea92Dbf26680340f4fe4CBe2/sources/contracts/CrowdFunding.sol | is everything okay? | function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns(uint256) {
Campaign storage campaign = campaigns[numberOfCampaigns];
require(campaign.deadline <block.timestamp, "The deadline should be... | 11,595,692 |
/**
*Submitted for verification at Etherscan.io on 2021-11-14
*/
// Sources flattened with hardhat v2.6.3 https://hardhat.org
// File @openzeppelin/contracts/utils/introspection/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in th... | 10% to promoter the rest to owner | function withdraw() public nonReentrant {
payable(0x1f562c3259b5266a1a934a4d20d22b7135D3600d).transfer(
address(this).balance / 10
);
payable(0x68FF5cB5F3D1bB0E162978449Cd410E04BF752d7).transfer(
address(this).balance
);
}
| 1,992,959 |
./full_match/4/0xACcEfe44b73e6517fCCbF8f8961AD0257Ebd8b81/sources/Visitors.sol | Returns the total cost in WETH for numberOfTokens/ | function calculatePrice(uint256 numberOfTokens)
internal
view
returns (uint256)
{
return mintPrice.mul(numberOfTokens);
}
| 670,505 |
// ------------------------------------------------------------
// /test/samples/solidity/latest_06.sol
// ------------------------------------------------------------
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
pragma experimental SMTChecker;
enum GlobalEnum { A, B, C }
struct GlobalStruct {
int a;... | Sample interface Contains infFunc() that returns `bytes memory` | interface SampleInterface {
function infFunc(string calldata x) external returns (bytes memory);
}
| 5,462,986 |
/**
*Submitted for verification at Etherscan.io on 2021-07-01
*/
/*
---------------------------------------------------------------------------------------------------
#GAPE
Giant Ape
4% Transaction fee goes to liquidity
2% Tax for ongoing development and community efforts
--------------------... | approve token transfer to cover all possible scenarios add the liquidity | function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
address(this),
tokenAmount,
lockedLiquidity(),
block.timestamp
);
}
| 2,147,489 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Get the deposited balance of the given currency currencyCt The address of the concerned currency contract (address(0) == ETH) currencyId The ID of the concerned currency (0 for ETH and ERC20) return The deposited balance | function depositedBalance(address currencyCt, uint256 currencyId)
public
view
returns (int256)
{
return deposited.get(currencyCt, currencyId);
}
| 12,574,649 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
import "./utils/Context.sol";
import "./interfaces/IERC721.sol";
import "./interfaces/IERC721Metadata.sol";
import "./interfaces/IERC721Enumerable.sol";
import "./interfaces/IERC721Receiver.sol";
import "./utils/ERC165.sol";
import "./utils/SafeMath.sol";
import... | Returns whether `spender` is allowed to manage `tokenId`. Requirements: - `tokenId` must exist./ | function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
require(_exists(tokenId), "Anoncats: operator query for nonexistent token");
address owner = Anoncats.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || Anoncats.isAppro... | 10,180,134 |
./partial_match/288/0xc71c3C179B0552065dBbCE26B391d42a742145ef/sources/contracts/Ola/Peripheral/PriceOracle/open-oracle/Uniswap/UniswapConfig.sol | Get the config for the symbolHash symbolHash The keccack256 of the symbol of the config to get return The config object/ | function getTokenConfigBySymbolHash(bytes32 symbolHash) public view returns (TokenConfig memory) {
uint index = getSymbolHashIndex(symbolHash);
if (index != uint(-1)) {
return getTokenConfig(index);
}
revert("token config by symbol hash not found");
}
| 16,906,411 |
//SPDX-License-Identifier: MIT
//Deploy Wallet Factory instead of Wallet following the factory design pattern
pragma solidity ^0.8.0;
import "./MultiSigWallet.sol";
contract MultiSigWalletFactory {
MultiSigWallet[] public wallets;
address[] public walletCreators;
function getWallets() public view retur... | Expose wallet interfaces | function addOwner(MultiSigWallet wallet, address newOwner) external {
wallet.addOwner(newOwner, msg.sender);
}
| 15,883,420 |
contract ERC20Token {
/* This is a slight change to the ERC20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public g... | the first stage 15% + community operation 15%the second stage 15%the third stage 20%team 15%community incentives and developer ecosystem 20% | function Winchain(){
totalSupply = INITIAL_SUPPLY;
deadlineToFreedTeamPool = INTERVAL_TIME.add(block.timestamp);
uint256 peerSupply = totalSupply.div(100);
balances[msg.sender] = peerSupply.mul(30);
winPoolForSecondStage = peerSupply.mul(15);
winPoolForThirdStage = p... | 5,906,662 |
./partial_match/1/0xE8005BF400C59c99867F8EF7efef65c1BDE2C399/sources/contracts/AvoDepositManager.sol | Sets new system withdraw limit. Only callable by owner. systemWithdrawLimit_ new value | function setSystemWithdrawLimit(uint96 systemWithdrawLimit_) external onlyOwner {
systemWithdrawLimit = systemWithdrawLimit_;
emit SetSystemWithdrawLimit(systemWithdrawLimit_);
}
| 2,629,012 |
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./Cryptography.sol";
contract PBT is Ownable {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
mapping(address => bytes32) internal senderLock;
mapping(bytes32 => address) inte... | if there is any pending tx, just finalize it to resolve avoidable conflictsfinalize(from); | function verifyPoi(address from, address to, uint256 value, uint256 t0, uint256 t1, bytes alpha, bytes beta) internal {
bytes32 alphaData = Cryptography.alphaData(from, to, value, t0, t1);
if (senderLock[from] == alphaData) return;
bytes32 betaData = Cryptography.betaData(alpha);
... | 5,472,498 |
./full_match/3/0x37ff2Dab3fc4323b304fD894D1e8df57E2CaD152/sources/browser/ERC721Beers.sol | Transfers `nftIndex` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `nftIndex` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner | function _transfer(address from, address to, uint256 nftIndex) internal virtual {
require(ownerOf(nftIndex) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, nftIndex);
_approve(a... | 14,133,212 |
// SPDX-License-Identifier: WTFPL
pragma solidity >=0.8.0;
import "./PRBMathCommon.sol";
/// @title PRBMathUD60x18
/// @author Paul Razvan Berg
/// @notice Smart contract library for advanced fixed-point math. It works with uint256 numbers considered to have 18
/// trailing decimals. We call this number representatio... | Calculates the binary exponent of x using the binary fraction method. See https://ethereum.stackexchange.com/q/79903/24693. Requirements: - x must be 128e18 or less. - The result must fit within MAX_UD60x18. x The exponent as an unsigned 60.18-decimal fixed-point number. return result The result as an unsigned 60.18-... | function exp2(uint256 x) internal pure returns (uint256 result) {
require(x < 128e18);
unchecked {
uint256 x128x128 = (x << 128) / SCALE;
result = PRBMathCommon.exp2(x128x128);
}
}
| 1,773,737 |
./full_match/1/0xED7CF75E1190f6E5Fb300c1be6606359f29252EC/sources/contracts/modules/KresusRelayer.sol | Removes an element at index from the array queue of a user _vault The target vault. _actionHash Hash of the action to be checked. return false if the index is invalid./ | function removeQueue(address _vault, bytes32 _actionHash) internal returns(bool) {
RelayerConfig storage _relayer = relayer[_vault];
_relayer.queuedTransactions[_actionHash] = 0;
uint256 index = _relayer.arrayIndex[_actionHash];
uint256 len = _relayer.queue.length;
if(index ... | 17,122,669 |
./full_match/1/0x512C8C57C97905134b12a8Ab8479b57a327AA6eC/sources/contracts/token/IERC2981Royalties.sol | IERC2981Royalties Interface for the ERC2981 - Token Royalty standard | interface IERC2981Royalties {
function royaltyInfo(uint256 _tokenId, uint256 _value)
external
view
returns (address _receiver, uint256 _royaltyAmount);
pragma solidity ^0.8.9;
}
| 3,001,172 |
./partial_match/3/0x7fDD39B5eB1c384D9cc342d38B7BF6FCDfA4f7eF/sources/CraneMasterFarmer.sol | Add a new lp to the pool. Can only be called by the owner. | function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwner {
require(poolId1[address(_lpToken)] == 0, "CraneMasterFarmer::add: lp is already in pool");
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardBlock = block.number > START_BLOCK ... | 5,089,667 |
./partial_match/1/0x53466a575fE1beba1F49F557d9817a6996f25694/sources/Pool.sol | claimRevenue is private function, called on updatePool for transaction caller | function claimRevenue(address userAddress) private {
UserInfo storage user = userInfo[userAddress];
for(uint i = 0; i < revenues.length; i++) {
if(!revenuesClaimed[userAddress][i]) {
revenuesClaimed[userAddress][i] = true;
uint userRevenue = revenues[i].amount.mul(user.amount).div(revenues[i].totalSupp... | 9,344,320 |
pragma solidity ^0.4.17;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original... | Allows anyone to transfer the Reporter tokens once trading has started _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint the amout of tokens to be transfered/ | function transferFrom(address _from, address _to, uint _value) hasStartedTrading whenNotPaused public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
| 640,069 |
./full_match/80001/0xFeDC137538408f74AA6Eb5d349345e8bf146A7bb/sources/project_/contracts/laCollection-Anna-Ridler-Static.sol | emit DbgPrint("nonce", nonce); One modif every 100 blocksuint8 nMutationsLeft = deltaBlocks() / 100; WARNING: OFF-BY-ONE -> LAST PIXEL NEVER MUTATED uint16 b32Index = uint16(nonce % image.length); emit DbgPrint("b32Index", b32Index); uint256 newByteValue = (nonce >> 10) % 256; emit DbgPrint("byte val", newByteValue); u... | function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
uint8 nMutationsLeft = 3;
while (nMutationsLeft > 0) {
uint16 iWord = uint16(nonce % image.length);
emit DbgPrint("iWord", iWord);
uint8 ... | 5,682,854 |
pragma solidity ^0.6.6;
// SPDX-License-Identifier: MIT
/*
* @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 d... | See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address./ | function balanceOf(address account, uint256 id) public view override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
| 13,849,536 |
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function add(uint256 a, uint256 ... | function that sells available tokens/ Calculate tokens to sell Increment raised amount Send tokens to buyer Send money to owner | function buyTokens() payable whenSaleIsActive {
uint256 weiAmount = msg.value;
uint256 tokens = weiAmount.mul(RATE);
BoughtTokens(msg.sender, tokens);
raisedAmount = raisedAmount.add(msg.value);
token.transfer(msg.sender, tokens);
owner.transfer(msg.value);
}
| 1,541,430 |
./partial_match/1/0xCd7c8b15dB83d123441eC34Bf0fa49da04CCEf86/sources/Mint_Yeti.sol | require(msg.sender == server_address, "Address mismatch"); | function add_to_max_tokenID(uint256 quantity) public {
max_quantity = max_quantity + quantity;
}
| 9,416,374 |
pragma solidity =0.6.6;
pragma experimental ABIEncoderV2;
import "./interfaces/IRouter02.sol";
import "./interfaces/IPoolToken.sol";
import "./interfaces/IBorrowable.sol";
import "./interfaces/ICollateral.sol";
import "./interfaces/IImpermaxCallee.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IStakedLPT... | refund surpluss eth, if any | function liquidateETH(
address borrowable,
address borrower,
address to,
uint deadline
) external virtual override payable ensure(deadline) checkETH(borrowable) returns (uint amountETH, uint seizeTokens) {
amountETH = _repayAmount(borrowable, msg.value, borrower);
assert(IWETH(WETH).transfer(borrowable, ... | 1,090,268 |
./partial_match/1/0xcc2f7B16fcdCF62A989AbEa89Db5ecB468E339D4/sources/ERC721Impl.sol | Set Token URI for a specific Token ID Requirements: - the caller must have the `URI_SETTER_ROLE`./ | function setTokenURI(uint256 tokenId, string memory _tokenURI) public {
require(hasRole(URI_SETTER_ROLE, _msgSender()), "Must have uri_setter role to set Token URI");
_setTokenURI(tokenId, _tokenURI);
}
| 4,263,787 |
pragma solidity ^0.5.3;
pragma experimental ABIEncoderV2;
import "./IPoMain.sol";
import "./IPoTypes.sol";
import "./IErc20.sol";
import "./IPoStorage.sol";
import "./IProductStorage.sol";
import "./IBusinessPartnerStorage.sol";
import "./IFunding.sol";
import "./IWalletBuyer.sol";
import "./IWalletSeller.sol";
import... | pass-through to po storage | function getSalesOrderNumberByBuyerPoNumber(bytes32 buyerSystemId, bytes32 buyerPoNumber)
public view returns (bytes32 sellerSysId, bytes32 sellerSalesOrderNumber)
{
IPoTypes.Po memory po = poStorage.getPoByBuyerPoNumber(buyerSystemId, buyerPoNumber);
return (po.sellerSysId, po.sellerSal... | 12,594,551 |
./full_match/4/0xc94dC08Ba320666CdB23D420bcDEbD10B197B5CA/sources/contracts/BladeRewards.sol | transfer from the sender to the recipient | function doTransfer(address recipient, uint amount) public {
doTransfer(recipient, amount);
}
| 12,391,923 |
./partial_match/1/0x2D1168C621394Af360155a7ca908cdE88Ab3744a/sources/BASKMakerHelpers.sol | Checks if a token is cToken _ctoken Token address return Boolean value indicating if token is a cToken | function _isCToken(address _ctoken) public pure returns (bool) {
return (_ctoken == CCOMP || _ctoken == CUNI);
}
| 3,734,875 |
./full_match/42220/0x3559bf3199a9f4e3b64313A96078838c076B26EF/sources/contracts/staking/StakingImplementation.sol | Claim all unstakes until _lastUnstakeId/ | function claimPartial(uint256 _lastUnstakeId) external override nonReentrant {
require(
_lastUnstakeId < _holders[msg.sender].unstakes.length,
"Stake::claimPartial: lastUnstakeId too big"
);
emit ClaimedPartial(msg.sender, _claim(_lastUnstakeId), _lastUnstakeId);
... | 16,323,978 |
// SPDX-License-Identifier: GPL-3.0-or-later
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they ... | Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address./ | function increaseAllowance(address spender, uint addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
| 6,768,997 |
/* $$\ $$\
$$ | $$ |
$$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$\ ... | Transfers the ownership of an NFT from one address to another address This works identically to the other function with an extra data parameter, except this function just sets data to "". _from The current owner of the NFT _to The new owner _orderID The NFT to transfer | function safeTransferFrom(
address _from,
address _to,
uint256 _orderID
) external {
address sender = LibMeta.msgSender();
internalTransferFrom(sender, _from, _to, _orderID);
LibERC721.checkOnERC721Received(sender, _from, _to, _orderID, "");
}
| 5,432,052 |
/**
*Submitted for verification at Etherscan.io on 2020-06-23
*/
// File: @onchain-id/solidity/contracts/IERC734.sol
pragma solidity ^0.6.2;
/**
* @dev Interface of the ERC734 (Key Holder) standard as defined in the EIP.
*/
interface IERC734 {
/**
* @dev Definition of the structure of a Key.
*
... | See {ITrustedIssuersRegistry-hasClaimTopic}./ | function hasClaimTopic(address _issuer, uint _claimTopic) external override view returns (bool) {
uint length = trustedIssuerClaimTopics[_issuer].length;
uint[] memory claimTopics = trustedIssuerClaimTopics[_issuer];
for (uint i = 0; i < length; i++) {
return true;
... | 12,610,208 |
pragma solidity ^0.4.24;
contract F3Devents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
... | calculates how many keys would exist with given an amount of eth _eth eth "in contract" return number of keys that would exist/ one thound | function keys(uint256 _eth)
internal
pure
returns(uint256)
{
if (_eth < 2000000000000000000000) {
return ((((((_eth).mul(1000000000000000000)).mul(31250000000000000000000000)).add(5624988281256103515625000000000000000000000000000000000000000000)).sqrt()).sub(749999218... | 14,847,429 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
/// @title MixDAO Alpha Pass
/// @author MilkyTaste @ Ao Collaboration Ltd.
/// https://mixdao.club
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "./Payable.sol";
contrac... | Set the presale Merkle root. The Merkle root is calculated from [address, allowance] pairs. merkleRoot_ The new merkle roo/ | function setMerkleRoot(bytes32 merkleRoot_) external onlyOwner {
merkleRoot = merkleRoot_;
}
| 1,615,570 |
./full_match/1/0x6E86583588D1b4c073A8b857D7388f67A3DC5f8F/sources/contracts/CyberAssassins.sol | Set the sale active for Ultimate/ | function setUltimatePause(bool _pause) external onlyOwner {
ULTIMATEMINTPAUSE = _pause;
emit PauseEvent(ULTIMATEMINTPAUSE);
}
| 9,804,402 |
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
import "../openzeppelin/ERC20.sol";
import "../openzeppelin/SafeERC20.sol";
import "../openzeppelin/SafeMath.sol";
import "./LiquidityMiningStorage.sol";
import "./ILiquidityMining.sol";
contract LiquidityMining is ILiquidityMining, LiquidityMiningStorage {
... | returns list of [amount, accumulatedReward] for the given user for each pool token _user the address of the user/ | function getUserBalanceList(address _user) external view returns (uint256[2][] memory) {
uint256 length = poolInfoList.length;
uint256[2][] memory userBalanceList = new uint256[2][](length);
for (uint256 i = 0; i < length; i++) {
userBalanceList[i][0] = userInfoMap[i][_user].amou... | 6,391,026 |
// SPDX-License-Identifier: MIT
import "./Cause.sol";
pragma solidity 0.5.16;
/// @title Factory Contract for management of Cause Contract
/// @author Ashutosh Singh Parmar
/// @notice Enables to create Cause
contract CauseFactory {
/// @notice Status of Cause Factory
/// @return true if Contract operat... | Gets all the Cause Contract Addresses created by supplied Creator return causeAddresses All the Cause Contract Addresses created till now | function GetAllCauses()
public
view
returns(address[] memory causeAddresses) {
return Causes;
}
| 15,796,176 |
pragma solidity ^0.8.0;
// SPDX-License-Identifier: SimPL-2.0
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts@4.4.1/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts@4.4.1/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts@4.4.1/utils/math/SafeMath.sol";
import "@openzepp... | 2021-1-18 when the collateral is to be cleared and transferred to auction, repayment can be carried out require(!isBorrowOverdue(bid), 'borrow is overdue'); | function userReturn(uint256 bid,uint256 repayAmount) public authContractAccessChecker nonReentrant whenNotPaused{
BorrowInfo storage _borrowInfo = borrowInfo[bid];
require(_borrowInfo.user == msg.sender, 'not owner');
CompoundBorrowPool memory _borrowPool = borrowPoolInfo[_borrowInf... | 5,409,480 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.