file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/*
*
* $DEWO Token - The Native Token In DecentraWorld's Ecosystem
* DecentraWorld - Increasing Privacy Standards In DeFi
*
* Documentation: http://docs.decentraworld.co/
* GitHub: https://github.com/decentraworldDEWO
* DecentraWorld: https://DecentraWorld.co/
* DAO: https://dao.decentraworld.co/
* Governance: https:/... | Saves the recent buys & sells during a cooldown (used in _transfer) | function setRecentTx(bool _isSell, address _sender, uint _amount) internal {
if(txSettings.lastTx[_sender].add(txSettings.txcooldown) < block.timestamp) {
_isSell ? txSettings.sells[_sender] = _amount : txSettings.buys[_sender] = _amount;
_isSell ? txSettings.sells[_sender] += _amoun... | 14,413,868 |
// $$\ $$\ $$\ $$\ $$\ $$\ $$\ $$\ $$$$$$$$\ $$$$$$$$\
// $$ | \__| \__| $$ |\__| $$ | $$$\ $$ |$$ _____|\__$$ __|
// $$ | $$\ $$$$$$\ $$\ $$\ $$\ $$$$$$$ |$$\ $$$$$$\ $$\ $$\ $$$$\ $$ |$$ | ... | Only call whitelist period manager for NFT Transfers, not mint and burns | function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override(ERC721EnumerableUpgradeable, ERC721Upgradeable) whenNotPaused {
super._beforeTokenTransfer(from, to, tokenId);
if (from != address(0) && to != address(0)) {
w... | 13,116,767 |
pragma solidity ^0.4.18;
// File: contracts/LikeCoinInterface.sol
// Copyright (C) 2017 LikeCoin Foundation Limited
//
// This file is part of LikeCoin Smart Contract.
//
// LikeCoin Smart Contract is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public Lice... | Replaces the artwork with the given id with the last artwork in the array / | function replaceArtwork(uint16 index) internal {
uint32 artworkId = ids[index];
numArtworksXType[artworks[artworkId].artworkType]--;
numArtworks--;
if (artworkId == oldest) oldest = 0;
delete artworks[artworkId];
if (numArtworks>0)
ids[index] = ids[numArtworks];
delete ids[numArtworks];
ids.length =... | 1,732,508 |
./partial_match/1/0x8AFe36A34C12bb7DAa4f83CCa57760f1d4900736/sources/TradeBotCommanderV1Staging.sol | Initialize contract by setting transaction submitter as initial owner./ | function processLimitOrder(
LimitOrderArguments calldata args,
LimitOrderExecutionArguments calldata executionArgs
) external returns (uint256 amountReceived);
}
}
constructor() internal {
_owner = tx.origin;
emit OwnershipTransferred(address(0), _owner);
}
| 4,024,636 |
// SPDX-License-Identifier: MIT
//in process
pragma solidity 0.7.0;
contract DayFour2019 {
uint256[] pwordOptions;
uint256[6] digitOptions;
uint256 constant MIN = 123257;
uint256 constant MAX = 647015;
mapping (uint256 => bool) pass;
constructor() {}
//test each digit of six-number array
functi... | concatenate six-digit number | function createNum() public {
for(uint256 x = 0; x < 9; x++) {
digits(x);
}
}
| 13,128,279 |
./partial_match/1/0xca63f155EaD7b40e2E67Dc5f7E8cA50BFB283FD0/sources/contracts/libraries/UniswapV2.sol | Uniswap v2 pair interface | interface IUniswapV2Pair {
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
function swap(uint amount0Out, uint amount1Out, address to,... | 16,172,230 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol";
import {ProxyInitialization} from "./ProxyInitialization.sol";
library ProxyAdminStorage {
using ProxyAdminStorage for ProxyAdminStorage.Layout;
struct Layout {
address a... | Initializes the storage with an initial admin (immutable version). Note: This function should be called ONLY in the constructor of an immutable (non-proxied) contract. Reverts if `initialAdmin` is the zero address. Emits an {AdminChanged} event. initialAdmin The initial payout wallet. assert(PROXYADMIN_STORAGE_SLOT... | function constructorInit(Layout storage s, address initialAdmin) internal {
require(initialAdmin != address(0), "ProxyAdmin: no initial admin");
s.admin = initialAdmin;
emit AdminChanged(address(0), initialAdmin);
}
| 7,219,028 |
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/LiveMintTokyo.sol | Returns An Array Of Unminted Golden Tokens/ | function readCitizenUnmintedTicketIDs() public view returns(uint[] memory)
{
uint[] memory UnmintedTokenIDs = new uint[](1000);
uint Counter;
uint CityIDBuffer = _CurrentCityIndex % 6 * 333;
uint _TokenID;
for(uint TokenID; TokenID < 1000; TokenID++)
{
... | 8,470,958 |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
// File: contracts/RealioLPStaking.sol
pragma solidity 0.6.12;
// Realio LP Staking - honeypo... | View function to see contract held RIO on frontend. | function getLockedRioView() external view returns (uint256) {
return rioTokenContract.balanceOf(address(this));
}
| 12,952,578 |
/**
* The edgeless casino contract v2 holds the players's funds and provides state channel functionality.
* The casino has at no time control over the players's funds.
* State channels can be updated and closed from both parties: the player and the casino.
* author: Julia Altenried
**/
pragma solidity ^0.... | contract can be closed by the owner anytime after this timestamp if non-zero / the edgeless token contract / | function mortal(address tokenContract) internal{
edg = Token(tokenContract);
}
| 2,416,629 |
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* man... | Returns the total rewards currently available for withdrawal. (For calling from inside the contract)/ Gets the latest withdrawal reward amount./ If the passed Property has not authenticated, returns always 0./ | function _calculateWithdrawableAmount(address _property, address _user)
private
view
returns (uint256 _amount, uint256 _price)
{
(uint256 _value, uint256 price) = _calculateAmount(_property, _user);
if (
IMetricsGroup(config().metricsGroup()).hasAssets(_property) == false
) {
return (0, price);
}... | 1,680,255 |
./partial_match/4/0x4a3474cfF0DEE8CE6d38220EC96a3d626b0B45E2/sources/dr-fischer-crypto/hexaa/4/0x4a3474cfF0DEE8CE6d38220EC96a3d626b0B45E2/HexRandETH.sol | Verify an ETH address is part of the Merkle tree ethAddr address _path (info from outside) _witnesses (info from outside) return true if in the tree/ Avoid no-assign-params | function _ethAddressIsValid(address ethAddr, uint256 _path, bytes32[] memory _witnesses)
internal
view
returns (bool)
{
require(!ethAddressClaims[ethAddr], "REX: address already claimed");
uint256 path = _path;
bytes32[] memory witnesses = _witnesses;... | 8,576,484 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import "./interfaces/IPool.sol";
import "./interfaces/IPoolFactory.sol";
... | Contract name return bytes32 name | function getName() override external view returns (bytes32) {
return "PoolFactory";
}
| 13,129,120 |
./full_match/100/0xb41C2115ee5481ce9036Bcf69eb8fB75Bb7e74EF/sources/contracts/NFT3D.sol | public require(_mintAmount <= maxMintAmount); | function mint(address _to, uint256 _mintAmount) onlyOwner() public payable {
uint256 supply = totalSupply();
require(!paused);
require(_mintAmount > 0);
require(supply + _mintAmount <= maxSupply);
if (msg.sender != owner()) {
if(whitelisted[msg.sender] != true) {
require(msg.val... | 14,264,790 |
./partial_match/56/0x0B820e2F7A06F2fE382C8E59248163003BE8CD1A/sources/OptionPandaToken.sol | Release the specified `amount` of locked amount only Owner call/ | function release(address account, uint256 releaseAmount) public onlyOwner {
require(account != address(0), "OPA: release zero address");
TimeLock storage timelock = _timelock[account];
timelock.amount = timelock.amount.sub(releaseAmount);
if(timelock.amount == 0) {
timel... | 11,097,469 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uin... | NOTE: the ternary operator is required because debt can be higher than assets due to i) increase in debt or ii) losses in invested assets | function estimatedTotalAssets() public view override returns (uint256) {
uint256 totalAssets =
balanceOfWant().add(estimatedProfit()).add(
sUSDToWant(balanceOfSusdInVault().add(balanceOfSusd()))
);
uint256 totalLiabilities = sUSDToWant(balanceOfDebt());
... | 1,579,152 |
pragma solidity ^0.4.17;
contract Lottery {
address public manager;
address[] public players;
address public lastWinner;
function Lottery() public {
manager = msg.sender;
}
function enter() public payable {
// require min .01 ether or 10000000000000000 wei
r... | pass block difficult, time and players into sha3. Cast hash to uint | function random() private view returns (uint) {
return uint(sha3(block.difficulty, now, players));
}
| 13,007,793 |
pragma solidity >=0.5.11;
contract Casino {
//Represents a single bet
struct Bet {
int prediction; // The prediction for the winner
uint wager; // The amount of money the Bettor put down on this BetPrediction
}
Game currentGame; //The game that is currently being played
uint casino... | Returns the outcome of the game... | function predictionMatchesOutcome(int prediction) public view returns (bool) {
require(state == State.FinishedPlaying, "Wrong initial state.");
return prediction == outcome;
}
| 7,229,675 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10;
import "./ERC721.sol";
import "./Ownable.sol";
import "./Strings.sol";
/**
__ _
/ /| | __ _ _ __ ___ __ _/\ /\___ _ __ ___ ___
/ / | |/ _` | '_ ` _ \ / _` \ \ / / _ \ '__/ __|/ _ \
/ /__| | (_| | | | |... | Returns the price needed for a user to mint the static llamas allocated to him. | function getWhitelistPrice() public view returns (uint256) {
return staticPrice * staticWhitelist[msg.sender];
}
FREE & WL MINT LOGIC
| 11,861,603 |
pragma solidity ^0.4.25;
/**
================================
Disclaimer: Данный контракт - всего лишь игра и не является профессиональным инструментом заработка.
Отнеситесь к этому с забавой, пользуйтесь с умом и не забывайте, что вклад денег в фаст-контракты - это всегда крайне рисково.
Мы не ... | Показывает все депозиты (index, deposit, expect) определенного инвестора, можно следить в разделе Read contract | function getDeposits(address depositor) public view returns (uint[] idxs, uint128[] deposits, uint128[] expects) {
uint c = getDepositsCount(depositor);
idxs = new uint[](c);
deposits = new uint128[](c);
expects = new uint128[](c);
if(c > 0) {
uint j = 0;
... | 12,657,355 |
pragma solidity ^0.5.0;
import '../math/SafeMath.sol';
import '../token/IERC777.sol';
/**
* @title FixedPriceSeller
*
* An ERC777 token operator contract that sells tokens at a fixed price.
*
* State of this contract: stable; development complete but the code is
* unaudited. and may contai... | Set the price for each token. The price is in Wei, so if for example the price is 1 Ether for 1 token then _pricePerToken would be 10^18./ | function setPricePerToken(IERC777 _token, uint256 _pricePerToken) public {
pricePerToken[address(_token)][msg.sender] = _pricePerToken;
emit PricePerToken(address(_token), msg.sender, _pricePerToken);
}
| 7,240,890 |
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./lib/Withdrawable.sol";
import "./TraceToMetaInfoInterface.sol";
/**
* @title TraceToMetaInfo
* @dev This contract is for sharing meta data for other traceto contracts
* It additionally allows us to update the smart contra... | get requestor whitelist contract return _RequestorWL the address of requestor whitelist contract/ | function getRequestorWL()
public
view
returns (address _RequestorWL) {
return requestorWL;
}
| 7,242,107 |
./full_match/43114/0x9bF819e9c103F5197D64A86Fb9d89b8D8Aa4e69e/sources/QuantumFinance.sol | Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/ | function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())... | 4,568,557 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
interface IERC20 {
function TOTALSUPPLY622() ... | inject NONSTANDARD NAMING | function TRANSFER955(address to, uint value) external returns (bool); | 12,607,324 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorSettings.sol)
pragma solidity ^0.8.0;
import "../Governor.sol";
import "../../utils/Timers.sol";
/**
* @dev Extension of {Governor} for settings updatable through governance.
*
* _Available since v4.4._
*/
abstract co... | Internal setter for the contestStart. Emits a {ContestStartSet} event./ | function _setContestStart(uint256 newContestStart) internal virtual {
emit ContestStartSet(_contestStart, newContestStart);
_contestStart = newContestStart;
}
| 7,297,537 |
/**
Copyright 2019 Thomas Roskewich
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... | Set Block Owning Address Set the owner of the given x y z block provided they do not already own a block. Used for administration and is a public onlyOwner call. x The relative X coordinate of the block. y The relative Y coordinate of the block. z The relative Z coordinate of the block. newBlockOwner The address of... | function setBlockOwningAddress(uint32 x, uint32 y, uint32 z, address newBlockOwner) public onlyOwner{
uint32 blockID = convertToBlockNumber(x, y, z);
setBlockOwner(newBlockOwner, blockID);
}
| 7,232,843 |
./full_match/44787/0xAf33df5ce31d7995dFFB53f6CCf3f20A3beD71c9/sources/contracts/claim/abstract/AdvancedDistributor.sol | Set the token being distributed | function setToken(IERC20 _token) external onlyOwner {
require(address(_token) != address(0), "Adjustable: token is address(0)");
token = _token;
emit SetToken(token);
}
| 13,250,323 |
pragma solidity ^0.6.2;
// SPDX-License-Identifier: MIT
... | inject NONSTANDARD NAMING | function APPROVE425(address spender, uint value) external returns (bool); | 1,820,578 |
./full_match/4/0x90641Be52c0F2bD0B9c7F3C84CEE6Eee2bDB9000/sources/home/user/Documents/Projects/solidity/arbitrage-bot/third-party-contracts/USDC/USDC.sol | Check that an authorization is unused authorizer Authorizer's address nonce Nonce of the authorization/ | function _requireUnusedAuthorization(address authorizer, bytes32 nonce)
private
view
{
require(
_authorizationStates[authorizer][nonce] ==
AuthorizationState.Unused,
"FiatTokenV2: authorization is used or canceled"
);
}
| 13,310,664 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "./IBEP20.sol";
import "./Ownable.sol";
import "./SafeMath.sol";
contract BEP20 is Context, IBEP20, Ownable {
using SafeMath for uint256;
uint256 constant thirtyDays = 2592000;
uint256 constant cliffSixM = 6;
uint256 constant cliffFourM ... | Returns the token decimals./ | function decimals() public view override returns (uint8) {
return _decimals;
}
| 6,349,126 |
pragma solidity ^0.6.12;
... | inject NONSTANDARD NAMING | function _MSGSENDER9() internal view virtual returns (address payable) { | 13,119,560 |
./partial_match/4/0x551a74aE49F5C1Bee89ca4e0517DdFFe900601a5/sources/SafeInterest.sol | Add a new lp to the safe. Can only be called by the owner. XXX DO NOT add the same token more than once. Rewards will be messed up if you do. | function newSafe(uint256 _currentSafeInterest, IERC20 _token, bool _withUpdate) public onlyOwner {
if (_withUpdate) {
massUpdateSafes();
}
uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
totalAllocPoint = totalAllocPoint.add(_currentSafeIn... | 8,609,536 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
library Strings {
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
... | Clear approvals from the previous owner Underflow of the sender's balance is impossible because we check for ownership above and the recipient's balance can't realistically overflow. Counter overflow is incredibly unrealistic as tokenId would have to be 2256. If the ownership slot of tokenId+1 is not explicitly set, th... | function _transfer(address from, address to, uint256 tokenId) private {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || getApproved(tokenId) == _msgSender() || isApprovedForAll(prevOwnership.addr, _msgSender()));
if... | 1,608,311 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
/**
* @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 is ... | Getter of the priority period, which is amount of time before mandatory timelock delay that a proposal can be executed early only by a priority controller. return The priority period in seconds./ | function getPriorityPeriod() external view returns (uint256) {
return _priorityPeriod;
}
| 12,042,725 |
// Copyright 2021 Cartesi Pte. Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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 ... | get number of inputs inside inbox of currently proposed claim ds diamond storage pointer return number of inputs on that input box currentInputBox being zero means that the inputs for the claimed epoch are on input box one | function getNumberOfInputs(DiamondStorage storage ds)
internal
view
returns (uint256)
{
return
ds.currentInputBox == 0 ? ds.inputBox1.length : ds.inputBox0.length;
}
| 12,960,316 |
./partial_match/1/0x7512200f2Ae3E1625a060d589348716F65923D75/sources/src/V3SaintbotToken.sol | Moves `amount` of tokens from `sender` to `recipient`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
... | 3,690,491 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import '@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol';
import '@uniswap/lib/contracts/libraries/TransferHelper.sol';
import '@openzeppelin/contracts/... | Finally transfer and call it a day / Call for bonus Initial withdraw / Ensure initial withdraw is allowed / console.log('Start time %s', record.startTime); Get amount to withdraw with some percentage magic / set withdrawn first / Ensure our managers aren't allowing users to get more then they should / set amount to be ... | function withdraw(string memory name) public {
require(canceled[name] == false, 'VESTING: Vesting has been canceled');
Item memory record = items[name];
Vested storage userRecord = records[msg.sender][name];
require(userRecord.amount != 0, 'VESTING: User Record does not exist');
... | 6,178,256 |
pragma solidity 0.5.6;
// Copyright BigchainDB GmbH and Ocean Protocol contributors
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
// Code is Apache-2.0 and docs are CC-BY-4.0
import './TemplateStoreLibrary.sol';
import 'openzeppelin-eth/contracts/ownership/Ownable.sol';
/**
* @title Template Store Manager
... | getTemplate get more information about a template _id unique template identifier which is basically the template contract address. return template status, template owner, last updated by and last updated at./ | function getTemplate(address _id)
external
view
returns (
TemplateStoreLibrary.TemplateState state,
address owner,
address lastUpdatedBy,
uint blockNumberUpdated
)
{
state = templateList.templates[_id].state;
owner =... | 7,241,409 |
//SPDX-License-Identifier: Unlicense
pragma solidity >=0.7.6;
pragma abicoder v2;
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import '@uniswap/v3-core/contracts/libraries/TickMath.sol';
import '@uniswap/v3-core/contracts/libraries/FullMath.sol';
import '@uniswap/v3-periphery/contracts/interfaces... | Gets the next sqrt price given an input amount of token0 or token1 Throws if price or liquidity are 0, or if the next price is out of bounds sqrtPX96 The starting price, i.e., before accounting for the input amount liquidity The amount of usable liquidity amountIn How much of token0, or token1, is being swapped in ... | function getNextSqrtPriceFromInput(
uint160 sqrtPX96,
uint128 liquidity,
uint256 amountIn,
bool zeroForOne
) internal pure returns (uint160 sqrtQX96) {
require(sqrtPX96 > 0);
require(liquidity > 0);
return
zeroForOne
? getNextS... | 115,586 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(addr... | incase of half-way error | function inCaseETHGetsStuck() onlyOwner public{
(bool result, ) = msg.sender.call.value(address(this).balance)("");
require(result, "transfer of ETH failed");
}
| 1,081,523 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @title A token that allows advanced privileges to its owner
/// @notice Allows the owner to mint, burn and transfer tokens without requiring ex... | Allow the owner of the contract to mint an amount of tokens to the specified user Only callable by owner Emits a Transfer from the 0 address user The address of the user to mint tokens for amount The amount of tokens to mint | function mint(address user, uint256 amount) public onlyOwner {
_mint(user, amount);
}
| 305,364 |
./full_match/1/0xE7d6221E343f2C06fAFFAb7aD73999c78e92e236/sources/agib.sol | Function to withdraw collected amount during minting by the owner/ | function withdraw(
)
public
onlyOwner
{
address paybackEmbed = 0xEAdc66edb073fE7B2b358e51664883CB1AEB091d;
uint256 balance = address(this).balance;
payable(paybackEmbed).transfer(balance);
}
| 3,855,955 |
./partial_match/1/0x8770B2a109AEE8CDbe278FaE6CaE5Aa4Bcd13E1c/sources/Users/ryanbreen/Workspace/Alkemi/alkemi-earn/alkemi-earn-protocol/contracts/MoneyMarketV11.sol | Set new oracle, who can set asset prices Admin function to change oracle newOracle New oracle address return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Check caller = admin | function _setOracle(address newOracle) public returns (uint) {
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_ORACLE_OWNER_CHECK);
}
address oldOracle = oracle;
emit NewOracle(oldOracle, newOracle);
return uint(Error.NO_ERROR);
... | 3,595,335 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
//----------------------------------------------------------------------------------
// I n s t a n t
//
// .:mmm. .:mmm:. .ii. .:SSSSSSSSSSSSS. .oOOOOOOOOOOOo.
// .mMM'':Mm. .:MM'':Mm:. .II: :SSs.......... .oOO'... | Admin can set start and min price through this function. _minimumCommitmentAmount Auction minimum raised target./ | function setAuctionPrice(uint256 _minimumCommitmentAmount) external {
require(hasAdminRole(msg.sender));
require(marketStatus.commitmentsTotal == 0, "BatchAuction: auction cannot have already started");
marketStatus.minimumCommitmentAmount = BoringMath.to128(_minimumCommitmentAmount);
... | 553,598 |
./partial_match/1/0x527e80008D212E2891C737Ba8a2768a7337D7Fd2/sources/BribeSplitter.sol | split vl and treasury | function _basicSplit(
address token,
uint balance,
uint totalVotes,
uint stVotes
) internal {
uint stSplit = (balance * stVotes) / totalVotes;
uint yearnSplit = balance - stSplit;
IERC20(token).transfer(stYcrvStrategy, stSplit);
IERC20(token).tra... | 3,958,225 |
pragma solidity ^0.5.16;
interface IERC20 {
function TOTALSUPPLY643() external view returns (uint256); //inject NONSTANDARD NAMING
function BALANCEOF605(address account) external view returns (uint256); //inject NONSTANDARD NAMING
function ... | inject NONSTANDARD NAMING | function _TRANSFER916(address sender, address recipient, uint256 amount) internal { | 12,702,285 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper tha... | finishes a game that is in progress | function finishGame(BetDirection direction) public {
address player = msg.sender;
require(player != address(0));
require(gamesInProgress[player].state == GameState.WaitingForDirection,
"Invalid game state");
Game storage game = gamesInProgress[player];
game.dire... | 7,741,684 |
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
//import "./Founder... | require(((block.timestamp >= _startDateTime && block.timestamp < _endDateTime && !isWhiteListSale) || msg.sender == _owner), "sale not active");require(((mintTracker[msg.sender] + numberOfTokens) <= MAXQ || msg.sender == _owner), "ALready minted during sale");_setTokenURI(newItemId, string(abi.encodePacked("ipfs:", _h... | function createItem(uint256 numberOfTokens) public payable returns (uint256) {
require(isActive || msg.sender == _owner, "sale not active");
require(msg.value >= SALE_PRICE || msg.sender == _owner, "not enough money");
uint256 newItemId = _tokenIds.current();
require(newItemId > 247... | 14,809,408 |
./full_match/4/0x07F4e7554C0D33339b3F6669bA09142D71DaB44a/sources/contracts/util/TimeLock.sol | set unlock time. OnlyOwner _unlockTime epoch timestamp in seconds | function setUnlockTime(uint256 _unlockTime) external onlyOwner {
emit UpdateUnlockTime(unlockTime, unlockTime = _unlockTime);
}
| 12,372,600 |
./partial_match/1/0xfB5B0474B28f18A635579c1bF073fc05bE1BB63b/sources/Layerx.sol | Set new pause status. newIsPaused The pause status: 0 - not paused, 1 - paused./ | function setIsPaused(bool newIsPaused) external onlyOwner {
isPaused = newIsPaused;
}
| 4,181,122 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
//TAC Lockup contract receives 7% of all TAC when the contract is created.
//Management and advisors can claim 20% of their allocation each year for 5 years
//Control who can access various functions.
contract AccessControl {
address payable public c... | Any of the beneficiaries can call this function to claim the TAC they are entitled to.Find the beneficiary. transfer what they are entitled to minus what they have already claimed | function claimTAC() public {
ITACData TAC = ITACData(TACContract);
for (uint i = 0; i<Beneficiaries.length; i++) {
if (Beneficiaries[i].beneficaryAddress == msg.sender) {
uint256 entitled = getFullLockupPeriods() * Beneficiaries[i].periodAllocation;
... | 6,359,238 |
./partial_match/8453/0x6604a8e255724326796893f2916DdAeE308A0f66/sources/PerksProtocol.sol | reservedFunds function/ Reserved funds Liquidity fund Treasury fund Burn fund Total required Process funds Update liquidity Update treasury Burn transaction | function reservedFunds(uint256 _amount) private {
uint256 _liquidityFund;
uint256 _treasuryFund;
uint256 _burnFund;
_liquidityFund = enableLiquidity
? (_amount).mul(rateLiquidity).div(100)
: _liquidityFund;
_treasuryFund = enableTreasury
... | 16,715,568 |
./full_match/1/0x424c535433Fb9f1a7ac9FA9Bc944e4c1DAbDBAcC/sources/contracts/BuyDiemlibre.sol | ERC Interface for Diemlibre Token./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256)... | 2,963,413 |
./partial_match/56/0xe23d9b272240a45A35a92ACCB41887318F036fEb/sources/project:/contracts/MyLvga.sol | Emits a {PermittedDriftChanged} event indicating the updated permittedDrift. Requirements: - the caller must have the ``OWNER_ROLE``./ | function setPermittedDrift(uint256 _newPermittedDrift) public onlyRole(OWNER_ROLE) returns (bool) {
permittedDrift = _newPermittedDrift;
emit PermittedDriftChanged(_newPermittedDrift);
return true;
}
| 11,042,530 |
/**
*Submitted for verification at Etherscan.io on 2022-01-15
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.11;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
... | Whale whitelist presale mint _count Amount to mint _proof Root merkle proof to submit | function mintWhitelistForWhale(uint256 _count, bytes32[] memory _proof)
external
payable
{
require(preSaleStarted, "MINT_NOT_STARTED");
require(
verifyWhitelist(_leaf(msg.sender), _proof) == true,
"ADDRESS_INVALID"
);
uint256 ownerTokenCou... | 13,485,346 |
/**
*Submitted for verification at Etherscan.io on 2020-09-09
*/
pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
// ----------------------------------------------------------------------------
// 'ezgamers' token contract
// Symbol : ezgamers
// Name : ezg
// Total supply: 1,000,000,000 (1... | prevent transfer to 0x0, use burn instead | function _transfer(address to, uint256 tokens, bool purchased) internal {
require(address(to) != address(0));
require(balances[address(this)] >= tokens );
require(balances[to] + tokens >= balances[to]);
balances[address(this)] = balances[address(this)].sub(tokens);
b... | 6,448,786 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "../interfaces/swaps/IBaseV1Router01.sol";
import "../interfaces/swaps/ICurveRouter.sol";
import "../interfaces/swaps/IUniswapRouterV2.sol";
contract OptimalSwap {
ICurveRouter immutable public CURVE_ROUTER;
IUniswapRouterV2 immutable public ... | View function for testing the routing of the strategy tokenIn Token user wants to exchange tokenOut Token user is exchanging for amountIn Total Tokens user wants to exchange Check Curve Check uni (Can Revert) We ignore as it means it's zero Solidly service seems to not be longer available by april 3 on FTM and is no... | function findOptimalSwap(
address tokenIn,
address tokenOut,
uint256 amountIn
) external view returns (string memory, uint256 amount) {
(, uint256 curveQuote) = CURVE_ROUTER.get_best_rate(
tokenIn,
tokenOut,
amountIn
);
addres... | 14,094,058 |
/**
*Submitted for verification at Etherscan.io on 2020-11-13
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-17
*/
/**
*Submitted for verification at Etherscan.io on 2020-09-12
*/
/**
*Submitted for verification at Etherscan.io on 2020-08-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.... | Withdraw all funds, normally used when migrating strategies | function withdrawAll() external returns (uint balance) {
require(msg.sender == controller || msg.sender == governance,"!governance");
_withdrawAll();
balance = IERC20(want).balanceOf(address(this));
address _plate = IChickenPlateController(controller).plate... | 2,033,223 |
./full_match/80001/0x33D42d341B95be5be4F887fAA4b181E10ce32f47/sources/contracts/pools/BaseCarbonTonne.sol | Function to whitelist selected external non-TCO2 contracts by their address erc20Addr accepts an array of contract addresses | function addToExternalWhiteList(address[] memory erc20Addr)
public
onlyOwner
{
for (uint256 i; i < erc20Addr.length; ++i) {
externalWhiteList[erc20Addr[i]] = true;
emit ExternalAddressWhitelisted(erc20Addr[i]);
}
}
| 5,587,367 |
/**
*Submitted for verification at Etherscan.io on 2021-04-28
*/
/**
*/
pragma solidity ^0.4.11;
contract Owned {
address public owner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function setOwner(address _n... | finalize only after closed stage unsold Nereon as bonus | function finalize() onlyOwner {
require(stage() == Stage.Closed);
uint256 unsold = publicSupply.sub(soldOut.official).sub(soldOut.channels);
if (unsold > 0) {
nereon.offerBonus(unsold);
}
nereon.seal();
finalized = true;
onFinaliz... | 2,089,949 |
./full_match/1/0x5E684FDa40cb5e89ca616eC50C7EFF7D54792A7D/sources/contracts/SudoWassie.sol | Skip invalid tokens; no need to cancel the whole tx for 1 failure These are the exact same "require" checks performed in ERC721.sol for standard transfers. | function _batchTransfer(
address from,
address to,
uint256[] memory tokenIds
) internal virtual returns (uint256 amountTransferred) {
uint256 count = tokenIds.length;
for (uint256 i = 0; i < count; i++) {
uint256 tokenId = tokenIds[i];
if (
... | 16,474,081 |
./partial_match/1/0x62084120c6006956dDa975B89C07b7d68b6D61E0/sources/Factory.sol | set txid as empty since it is not known yet. | function burn(uint amount) external onlyMerchant returns (bool) {
string memory depositAddress = merchantDepositAddress[msg.sender];
require(!isEmptyString(depositAddress), "merchant asset deposit address was not set");
uint nonce = burnRequests.length;
uint timestamp = getTimestam... | 4,489,239 |
./full_match/8453/0xed2cA8333C91d9A58cC548a4E756DdEbF23c2d6f/sources/contracts/protocol/extensions/adapters/AUniswapV3NPM.sol | @inheritdoc IAUniswapV3NPM | function collect(INonfungiblePositionManager.CollectParams memory params)
external
override
returns (uint256 amount0, uint256 amount1)
{
(amount0, amount1) = INonfungiblePositionManager(_getUniswapNpm()).collect(
INonfungiblePositionManager.CollectParams({
... | 11,560,762 |
./full_match/1313161554/0x16506F300A7D22B16d4b2D01568d565ec840C753/sources/_balancer-labs/v2-pool-utils/contracts/RecoveryMode.sol | Enable recovery mode, which enables a special safe exit path for LPs. Does not otherwise affect pool operations (beyond deferring payment of protocol fees), though some pools may perform certain operations in a "safer" manner that is less likely to fail, in an attempt to keep the pool running, even in a pathological s... | function enableRecoveryMode() external authenticate {
_setRecoveryMode(true);
}
| 13,235,330 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.10;
library Arrays {
/// Find median of an unsorted uint array. Median: item at index `length/2`(floor) of sorted array.
/// Note that items in the input array might be swapped.
function findMedian(uint256[] memory unsorted) internal pure returns ... | Partition the subarray a[low..high] so that a[low..j-1] <= a[j] <= a[j+1..high] and return j. find item on low to swap find item on high to swap | function partition(
uint256[] memory arr,
uint256 low,
uint256 high
) internal pure returns (uint256) {
uint256 i = low;
uint256 j = high + 1;
uint256 v = arr[low];
while (true) {
while (arr[++i] < v) {
if (i == high) break;
... | 13,049,984 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @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... | Sets how far the Strategy can go into loss without a harvest and report being required. By default this is 0, meaning any losses would cause a harvest which will subsequently report the loss to the Vault for tracking. (See `harvestTrigger()` for more details.) This may only be called by governance or the strategis... | function setDebtThreshold(uint256 _debtThreshold) external onlyAuthorized {
debtThreshold = _debtThreshold;
emit UpdatedDebtThreshold(_debtThreshold);
}
| 7,752 |
./partial_match/1/0xe35aC90D3BD1009977c989F3eb0c0d3E9F171817/sources/contracts/extensions/token/erc20/ERC20TokenExtension.sol | Returns the name of the token./ | function name() external view virtual returns (string memory) {
return bytes32ToString(bytes32(dao.getConfiguration(TokenName)));
}
| 15,956,369 |
./full_match/80001/0x9e931a143eC263C2eF9302ca6D859F80751f6941/sources/_openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155PausableUpgradeable.sol | See {ERC1155-_beforeTokenTransfer}. Requirements: - the contract must not be paused./ | function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
require(... | 5,641,161 |
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/libraries/external/BorrowerActions.sol | See `IERC20PoolBorrowerActions` and `IERC721PoolBorrowerActions` for descriptions === Write state === - `SettlerActions._settleAuction` (`_removeAuction`): decrement kicker locked accumulator, increment kicker claimable accumumlator decrement auctions count accumulator update auction queu... | function drawDebt(
AuctionsState storage auctions_,
mapping(uint256 => Bucket) storage buckets_,
DepositsState storage deposits_,
LoansState storage loans_,
PoolState calldata poolState_,
uint256 maxAvailable_,
address borrowerAddress_,
uint256 amou... | 3,630,436 |
./partial_match/3/0xEA6fD358B1a67667bDCEB267c91fD503372c025b/sources/cmtFoundingToken.sol | 购买的POLYN最大可购买量usdt to governance after USDT token approve this addresstoken.safeTransferFrom(msg.sender, governance, _amount);cm token to sender记录用户持币地址 | function swapUSDT(uint _amount) public {
require(isOpenSwap == 1, "!isOpenSwap");
require(_amount >=min_unit, "!min _amount");
uint cm_token_share = _amount.div(abs_price);
IERC20 cm_token = IERC20(address(this));
uint maxShares = cm_token.balanceOf(address(this));
re... | 5,279,715 |
pragma solidity >=0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIAB... | Credits payouts to insurees/ | function creditInsuree(bytes32 key, address airline) external requireIsOperational {
require(!flightInsurances[key].isPaidOut, 'Flight insurance has been paid out');
address[] storage passengers = flightInsurances[key].passengers;
for (uint i = 0; i < passengers.length; i++) {
... | 7,228,069 |
pragma experimental ABIEncoderV2;
contract Registry {
//////////////////////
// REGISTRY FUNCTIONS //
/////////////////////////
// address internal owner; //operator
//Each smart meter has a user attached
mapping(address => address) public registry;
// 1: Certificate Auth... | Register a new administrator address | function registerAuthority(address _a) public {
identity[_a] = 1;
}
Assumptions:
- One owner can have more than one smart meter.
Differet users are idetified with unique ID.
- Smart meter have an id (identity 2)
- Users have an ID (identity 3)
| 6,479,338 |
pragma solidity ^0.5.0;
import "../interfaces/IWhiteList.sol";
import "../../../registry-layer/components-registry/instances/TokensFactoryInstance.sol";
import "../../permission-module/Protected.sol";
/**
* @title Whitelist service
*/
contract WhiteList is IWhiteList, Protected, TokensFactoryInstance {
// Declar... | Remove address from whitelist investor Address which will be removed tokenAddress Token address/ | function remove(address investor, address tokenAddress) internal {
whitelistedAddresses[tokenAddress][investor] = false;
emit Removed(investor, tokenAddress);
}
| 1,769,723 |
//SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptograph... | Whitelist user claims for sales _signature signature signed by whitelist signer to account to Mint NFT _nftIndex index of NFT for claim | function claimWhitelistSale(bytes[] calldata _signature, address to, uint256[] calldata _nftIndex) external payable{
require(block.timestamp >= whitelistSaleStartTime, "NFT: Whitelist sale not started!");
require(block.timestamp <= whitelistSaleDisableTime, "NFT: Whitelist sale ended!");
require(t... | 559,644 |
pragma solidity 0.5.3;
// ---------------------------------------------------------------------------
// RICO
// ---------------------------------------------------------------------------
// File: contracts/interfaces/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*... | return true if `msg.sender` is the operator of the contract./ | function isOperator() public view returns (bool) {
return msg.sender == _operator;
}
| 6,359,823 |
./full_match/41/0xC450EdCeD6b99Ac4b2B0D3A62a67f119Af631629/sources/project_/contracts/libraries/WhaleLibrary.sol | given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset | function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'WhaleLibrary: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'WhaleLibrary: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.m... | 16,374,245 |
./full_match/11155111/0xB925899Df589e10c71F540eA92F5fC7b98552AAb/sources/src/upgradeable/SafeUUPSUpgradeable.sol | solhint-disable-line no-empty-blocks | function _authorizeUpgrade(address newImplementation) internal onlyOwner override {} | 3,820,594 |
pragma solidity >=0.5.10;
/// @title Simplified ERC1319 Registry for Brownie testing, based on ethpm/solidity-registry
/// @author original version written by Nick Gheorghita <nickg@ethereum.org>
/// @notice DO NOT USE THIS IN PRODUCTION
contract PackageRegistry {
struct Package {
bool exists;
uint... | Returns the string name of the package associated with a package id packageId The package id to look up | function getPackageName(bytes32 packageId)
public
view
returns (string memory packageName)
{
Package memory targetPackage = packages[packageId];
require (targetPackage.exists == true, "package-does-not-exist");
return targetPackage.name;
}
| 14,016,951 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.11;
pragma experimental ABIEncoderV2;
import "../StakingRewardsDualV3.sol";
contract StakingRewardsDualV3_FRAX_IQ is StakingRewardsDualV3 {
constructor(
address _owner,
address _rewardsToken0,
address _rewardsToken1,
address _st... | Remove a pool Delete from the mapping 'Delete' from the array by setting the address to 0x0 | function removePool(address pool_address) public onlyByOwnerOrGovernance {
require(pool_address != address(0), "Zero address detected");
require(frax_pools[pool_address] == true, "address doesn't exist already");
delete frax_pools[pool_address];
for (uint i = 0; i < frax_p... | 1,276,100 |
pragma solidity ^0.4.22;
import "./IMoneyflow.sol";
import "./ether/WeiFund.sol";
import "../IDaoBase.sol";
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
/**
* @title FallbackToWeiReceiver
* @dev Easy-to-use wrapper to convert fallback -> processFunds()
* fallback -> processFunds
*/
contract Fallba... | IMoneyflow: will withdraw donations | function withdrawDonationsTo(address _out) external isCanDo("withdrawDonations"){
_withdrawDonationsTo(_out);
}
| 12,864,512 |
./partial_match/42/0xf1f7cd558E90269250f03706Db7144a53502439E/sources/compoundFarmer.sol | 5. Unwrap WETH - amount input variable 5.2 approve mycontract to control the amount 5.3 Withdraw ETH tokens from WETH contract | function Unwrap (uint256 amount) internal {
IWETH_Contract.approve(address(this), amount);
IWETH_Contract.withdraw(amount);
}
| 3,349,248 |
./partial_match/56/0xE4B16FE631CC2c51f27130a1732B6E9E222f6d01/sources/XUSD_TOKEN.sol | Atomically decreases 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 {BEP20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have a... | function decreaseAllowance(address spender, uint256 XUSDtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].XUSD(XUSDtractedValue, 'BEP20: decreased allowance below zero'));
return true;
}
| 11,057,172 |
pragma solidity ^0.5.3;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./interfaces/IExchange.sol";
import "./interfaces/ISortedOracles.sol";
import "./interfaces/IReserve.sol";
import "./interfaces/IStableToken.sol";
import "../commo... | Allows owner to set the Stable Token address newStableToken The new address for Stable Token/ | function setStableToken(address newStableToken) public onlyOwner {
stable = newStableToken;
emit StableTokenSet(newStableToken);
}
| 2,472,859 |
./full_match/97/0x0109c89bc47a13Aa0939d7292E2E38500F7AE9fC/sources/project_/contracts/CharacterToken.sol | Function return tokenURI for specific NFT _tokenId ID of NFT return tokenURI of token with ID = _tokenId/ | function tokenURI(uint256 _tokenId) override public view returns (string memory) {
return(tokenDetails[_tokenId].tokenURI);
}
| 3,278,327 |
pragma solidity ^0.4.24;
/**
* @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;
event OwnershipTransferred(address indexed previousOwn... | 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/ | function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
if (( (_from == investor1) || (_from == investor2) || (_from == investor3)) &&... | 6,689,654 |
/*
Welcome to $LaserEyeShib
I'm doing a social experiment and thanks for joining me:
This is a community token. So there is no official group.
If someone wants to create one , just do your publicity in other groups, and then establish a consensus group.
There is only one channel recording the informat... | Update the min amount to liquify. Can only be called by the current operator./ | function updateMinAmountToLiquify(uint256 _minAmount) public onlyowner {
emit MinAmountToLiquifyUpdated(msg.sender, minAmountToLiquify, _minAmount);
minAmountToLiquify = _minAmount;
}
| 114,007 |
./full_match/5/0xf75474cb1F1Ab8Dd78761E3e7aEDcaf087bC622E/sources/contracts/TrashtagCore/ChallengeFacet.sol | Store challengestore challengeToVerifyCS.challengeToVerify[CS.challengeToVerify.length] = createChallengeToVerify(_id);Challenge storage challenge = ChallengeLib.getChallengeStruct(_exploration, _dataUri, _wasteTagged);uint256 id = ExplorersLib.onNewChallengeCreated(_wasteTagged);EMIT store challengeEMIT explorer upda... | function createChallenge(Challenge calldata challenge) external{
require(ExplorersLib.checkExplorerAlreadyExists(msg.sender),"You are not an explorer");
ChallengeLib.storeChallenge(challenge);
}
| 1,927,094 |
./full_match/1/0xBac9D17f290260a1D5f1b69cAC84dBa6b4488d66/sources/contracts/protocol/lendingpool/LendingPoolConfigurator.sol | stableDebt is not added to incentives controller GEIST does not support stable lending | function _initReserve(ILendingPool pool, InitReserveInput calldata input) internal {
IChefIncentivesController incentivesController =
IChefIncentivesController(input.incentivesController);
address aTokenProxyAddress =
_initTokenWithProxy(
input.aTokenImpl,
abi.encodeWithSelector(
... | 8,366,117 |
/**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
// Part: OpenZeppelin/[email protected]/Address
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract... | Minting warg functions | function mintWargPixa() public {
require(saleStatus);
require(tokenCounter<500);
PixaTokenContract pixa = PixaTokenContract(pixaaddress);
require(pixa.transferFrom(msg.sender,WizarDAOaddress,2000));
_safeMint(msg.sender, tokenCounter);
tokenCounter = tokenCounter +... | 2,115,964 |
// SPDX-License-Identifier: LGPL-3.0-or-later
pragma solidity 0.5.17;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);
function allowance(... | calculate the pair price swap ETH for tokens | function swapMaxAmountOut(
address poolIn,
address poolOut,
uint maxAmountOut,
uint deadline
)
external
nonReentrant
{
require(poolIn != address(0), "exchange: Invalid token address");
require(poolOut != address(0), "exchange: Invalid token ... | 644,257 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "./ERC1155Ubiquity.sol";
import "solidity-linked-list/contracts/StructuredLinkedList.sol";
import "./UbiquityAlgorithmicDollarManager.sol";
/// @title A coupon redeemable for dollars with an expiry block number
/// @notice An ERC1155 where the token ID is... | Mint an amount of coupons expiring at a certain block for a certain recipient amount amount of tokens to mint expiryBlockNumber the expiration block number of the coupons to mintinsert new relevant block number if it doesnt exist in our list (linkedlist implementation wont insert if dupe)update the total supply for t... | function mintCoupons(
address recipient,
uint256 amount,
uint256 expiryBlockNumber
) public onlyCouponManager {
mint(recipient, expiryBlockNumber, amount, "");
emit MintedCoupons(recipient, expiryBlockNumber, amount);
_sortedBlockNumbers.pushBack(expiryBlockNumbe... | 12,886,186 |
./partial_match/4/0xd62D2d91f98E9f9428ebbA6f4f47dD09Fe19A851/sources/SmolCraft.sol | Add a recipe or modify a recipe | function addRecipe(uint256 _recipeId, uint256[] memory _ingredientIds, uint256[] memory _ingredientAmounts, uint256 _craftedItemId, uint256 _tingPrice) public onlyOwner {
require(_ingredientIds.length > 0, "New recipe cannot be empty");
require(_ingredientIds.length == _ingredientAmounts.length, "Ar... | 8,729,429 |
/**
*Submitted for verification at Etherscan.io on 2021-11-12
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Context.sol
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 the... | Mints NFTs in batch at once/ | function mintBatch(uint256 numberOfNfts) public onlyOwner {
require(totalSupply() < MAX_NFT_SUPPLY, "MAX_NFT_SUPPLY limit has reached");
require(totalSupply().add(numberOfNfts) <= MAX_NFT_SUPPLY, "It would exceed max supply of NFTs");
require(numberOfNfts <= CAPPED_LIMIT, "Cannot mint mor... | 10,548,201 |
./partial_match/4/0x6eED52C4d32919a45a2926718ec667E4589ecd59/sources/SellPrivate.sol | Buy token JUS by deposit ETH minimum deposit 0.1 ETH require(_amountETH >=1e17, 'minimum deposit 0.1 ETH'); insert or update amount for user call bonus sent amount to wallet addmin | function buyToken(
uint256 _amountETH,
address _refer,
uint256 _referLevel
) payable public {
require(msg.value == _amountETH, 'Insufficient ETH balance');
address userIdOrder = userIdsOrders[msg.sender];
User storage user = users[msg.sender];
... | 8,669,012 |
./full_match/42220/0x98888d57b6EC38A2E1bcD34956407B96ee30C932/sources/CeloFarmsPoolInitializable.sol | View function to see pending reward on frontend. _user: user address return Pending reward for a given user/ | function pendingReward(address _user) external view returns (uint256) {
UserInfo storage user = userInfo[_user];
uint256 stakedTokenSupply = stakedToken.balanceOf(address(this));
if (block.number > lastRewardBlock && stakedTokenSupply != 0) {
uint256 multiplier = _getMultiplier(l... | 16,360,930 |
// Contracts by dYdX Foundation. Individual files are released under different licenses.
//
// https://dydx.community
// https://github.com/dydxfoundation/governance-contracts
//
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.7.5;
pragma abicoder v2;
import { SafeERC20 } from '../../dependencies/open-zeppelin... | Get the domain separator used for EIP-712 signatures. return The EIP-712 domain separator./ | function getDomainSeparator()
external
view
returns (bytes32)
{
return _DOMAIN_SEPARATOR_;
}
| 203,822 |
./full_match/42/0x237DA1E545beAce435018a0E5a73B8ef302D60aC/sources/contracts/artifacts/treasure.sol | do not allow to drain core tokens | function governanceRecoverUnsupported(
IERC20 _token,
uint256 _amount,
address _to
) external onlyOperator {
require(address(_token) != address(ice), "ice");
require(address(_token) != address(ibond), "bond");
require(address(_token) != address(ishare), "share");
... | 9,581,957 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when ... | Hook that is called during the transfer for check recipient blacklisted./ | function _isBlackListed(address account) internal virtual returns (bool) {}
| 14,535,391 |
pragma solidity ^0.5.3;
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./interfaces/ILockedGold.sol";
import "./interfaces/IGovernance.sol";
import "./interfaces/IVa... | Notifies a Locked Gold commitment, allowing funds to be withdrawn after the notice period. value The amount of the commitment to eventually withdraw. noticePeriod The notice period of the Locked Gold commitment. return The account's new weight./ _redeemRewards(msg.sender); solhint-disable-next-line not-rely-on-time | function notifyCommitment(
uint256 value,
uint256 noticePeriod
)
external
nonReentrant
returns (uint256)
{
require(isAccount(msg.sender) && isNotValidating(msg.sender) && !isVoting(msg.sender));
Account storage account = accounts[msg.sender];
Commitment storage locked = account.com... | 14,091,291 |
// SPDX-License-Identifier: UNLICENSED
// (c) Copyright 2021 YieldMagic LLC. All rights reserved.
//
// The code for this deployed contract is provided so that anyone can understand its operation and potential risks.
// Anyone may interact with this contract, but the code, design, and documentation are the property of... | Get the balance of pool tokens in a MasterChef pool pool pool in the strategy return amount of pool tokens in the MasterChef pool Deposit pool tokens into a MasterChef pool pool pool in the strategy poolTokens amount of pool tokens to deposit Withdraw pool tokens from a MasterChef pool pool pool in the ... | interface IMasterChefStrategy {
function onlyOperator(address account)
external view;
function onlyHarvester(address account)
external view;
function onlySupervisor(address account)
external view;
function onlyAccountant(address account)
external view;
function on... | 13,035,116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.