file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
pragma solidity 0.7.6;
import "./complifi-amm/libs/complifi/tokens/IERC20Metadata.sol";
import "./ILiquidityMining.sol";
//import "hardhat/console.sol";
contract ProxyActionsLiquidityMining {
/// @notice Direct liquidity mining method deposit
function deposit(
address _liquidityMining,
addre... | Direct liquidity mining method claim | function claim(
address _liquidityMining
) external {
ILiquidityMining liquidityMining = ILiquidityMining(_liquidityMining);
liquidityMining.claim();
uint rewardClaimedBalance = IERC20(liquidityMining.rewardToken()).balanceOf(address(this));
if(rewardClaimedBalance > 0)... | 6,290,732 |
pragma solidity ^0.4.20;
import "Userbase.sol";
contract Rental {
/* DECLARING VARIABLES */
address public owner;
int public idCount;
/* MAPPING */
mapping (uint => Apartment) public apartments;
mapping (address => bool) public isRenter;
mapping (address => uint) internal balances;
... | enable seller to delete rental do something | function removeApartment(uint _id)
public
returns ()
{
}
| 1,035,543 |
pragma solidity >=0.4.24 < 0.6.4;
// Import the library 'Roles'
import "./Roles.sol";
// Define a contract 'ConsumerRole' to manage this role - add, remove, check
contract ConsumerRole {
using Roles for Roles.Role;
// Define 2 events, one for Adding, and other for Removing
event ConsumerAdded(address i... | Function to check caller `msg.sender` if he has Consumer role return boolean for caller address state in `_Consumers` Role | function amIConsumer() public view returns (bool) {
return Consumers.has(msg.sender);
}
| 12,752,007 |
./full_match/42/0xb057200dd85E514AE170135f43902640c0941F77/sources/DecimalMath.sol | Multiplies x and y. x A fixed point number. y An unsigned integer. return A fixed point number. | function muld(UFixed memory x, uint y) internal pure returns (UFixed memory) {
return muld(x, toUFixed(y));
}
| 16,263,486 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.2;
///
/// @title Combines Uniswap V2 Protocol functions with Primitive V1.
/// @notice Primitive V1 UniswapConnector03 - @primitivefi/v1-connectors@v1.2.2
/// @author Primitive
///
// Uniswap V2 & Primitive V1
import {
IUniswapV2Callee
} from "@uniswap/v2-c... | Gets the total premium payout to sell long option tokens proportional to `quantity` of `shortOptionToken`s. Also gets the cost, a negative payout, which will be 0 unless the reserve ratio is incorrectly set. optionToken The option to get the close premium of. quantityShort The quantity of short option tokens that ... | function getClosePremium(IOption optionToken, uint256 quantityShort)
external
view
returns (uint256, uint256)
{
return
UniswapConnectorLib03.getClosePremium(
router,
optionToken,
quantityShort
);
}
| 6,365,041 |
./full_match/97/0x2044fe7a7Ea6a7E5ADd86506d61da9078586f746/sources/contracts/MasterHonorV2.sol | Update the given pool's HONOR allocation point. Can only be called by the owner. _pid The id of the pool. See `poolInfo`. _allocPoint New number of allocation points for the pool. _withUpdate Whether call "massUpdatePools" operation. No matter _withUpdate is true or false, we need to execute updatePool once before s... | function set(
uint256 _pid,
uint256 _allocPoint,
bool _withUpdate
) external onlyOwner {
updatePool(_pid);
if (_withUpdate) {
massUpdatePools();
}
if (poolInfo[_pid].isRegular) {
totalRegularAllocPoint = totalRegularAllocPoint.sub... | 5,030,590 |
./full_match/1/0x6f9140097Ab6278B41Cf9597a597030207b8D75d/sources/lib/seaport-core/src/lib/BasicOrderFulfiller.sol | Internal function to transfer ERC20 tokens to a given recipient as part of basic order fulfillment. Note that this function may only be safely called as part of basic orders, as it assumes a specific calldata encoding structure that must first be validated. Also note that basic order parameters are ... | function _transferERC20AndFinalize(bool fromOfferer, bytes memory accumulator) internal {
address from;
address to;
address token;
uint256 amount;
{
uint256 identifier;
if (fromOfferer) {
assembly {
from := callda... | 9,676,232 |
pragma solidity ^0.4.18;
import './IRegistry.sol';
import './Upgradeable.sol';
import './UpgradeabilityProxy.sol';
/**
* @title Registry
* @dev This contract works as a registry of versions, it holds the implementations for the registered versions.
*/
contract Registry is IRegistry {
// Mapping of versions to im... | Tells the address of the function implementation for a given version version representing the version of the function implementation to be queried func representing the signature of the function to be queried return address of the function implementation registered for the given version/ | function getFunction(string version, bytes4 func) public view returns (address) {
return versions[version][func];
}
| 951,890 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../event/EventEmitter.sol";
import "../treasury/Treasury.sol";
import "../voting/Voting.sol";
/** @title ValidatorRegistry
@... | Removes the listing by key and shortens the array | function _removeListingKey(bytes32 key) internal {
for (uint i = 0; i < _listingKeys.length; i++) {
if (_listingKeys[i] == key) {
_listingKeys[i] = _listingKeys[_listingKeys.length - 1];
_listingKeys.length--;
break;
}
}
... | 13,030,722 |
./full_match/1/0x1D0977e86c70EAbb5c8fD98DB1B08C6d60caa0C1/sources/contracts/engine/GenArt721CoreV2_ENGINE_FLEX.sol | Returns project details for project `_projectId`. _projectId Project to be queried. return projectName Name of project return artist Artist of project return description Project description return website Project website return license Project license/ | function projectDetails(
uint256 _projectId
)
public
view
returns (
string memory projectName,
string memory artist,
string memory description,
string memory website,
string memory license
)
{
project... | 9,648,749 |
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
import "../core/DaoConstants.sol";
import "../core/DaoRegistry.sol";
import "../guards/MemberGuard.sol";
import "./interfaces/IGuildKick.sol";
import "../helpers/GuildKickHelper.sol";
import "../adapters/interfaces/IVoting.sol";
import "../helpers/FairShareHelpe... | Process the guild kick proposal Only active members can be kicked out. dao The dao address. proposalId The guild kick proposal id./ Checks if the proposal has passed. | function processProposal(DaoRegistry dao, bytes32 proposalId)
external
override
{
dao.processProposal(proposalId);
IVoting votingContract = IVoting(dao.votingAdapter(proposalId));
require(address(votingContract) != address(0), "adapter not found");
require(
... | 12,790,093 |
pragma solidity ^0.4.18;
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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 ... | Set an upgrade agent that handles/ The token is not yet in a state that we could think upgrading | function setUpgradeAgent(address agent) external {
if (!canUpgrade()) {
revert();
}
if (agent == 0x0) revert();
upgradeAgent = UpgradeAgent(agent);
UpgradeAgentSet(upgradeAgent);
}
| 8,018,470 |
./partial_match/1/0xDDc04DB44C14E69db7fF124A998CD96c60d9565f/sources/EthaVerse_PreSale.sol | Buys the tokens given the price of the tier one and the wei paid weiPaid The amount of wei paid that will be used to buy tokens tierSelected The tier that you'll use for thir purchase return calculatedTokens Returns how many tokens you've bought for that wei paid | function calculateTokensTier(uint256 weiPaid, uint256 tierSelected)
internal view returns(uint256 calculatedTokens)
{
require(weiPaid > 0);
require(tierSelected >= 1 && tierSelected <= 3);
if(tierSelected == 1)
calculatedTokens = weiPaid.mul(rate);
else if(tierSelected ==... | 2,867,088 |
pragma solidity 0.4.24;
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the s... | require(b > 0); Solidity automatically throws when dividing by 0 require(a == b c + a % b); There is no case in which this doesn't hold | function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
| 1,731,958 |
pragma solidity ^0.5.10;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../interfaces/IUniswap.sol";
import "../interfaces/IPriceUSD.sol";
import "../interfaces/IIssuerS... | Add an element to the sorted (ascending) linked list of elements We make available two functions that can do this, _addToList1() and _addToList2() Only one is actually used If we are smaller or equal than the current element, insert us before it | function _addToList2(address provider)
public returns (bool) {
if(head == address(0)) {
head = provider;
return true;
}
while(i != address(0)) {
if (providerList[provider].markup <= providerList[i].markup) {
providerList[head].p... | 12,827,741 |
pragma solidity ^0.4.0;
import "./ERC223Receiver.sol";
import "./SafeMath.sol";
contract ERC223 {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, b... | function that is called when transaction target is a contract | function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = safeSub(balanceOf(msg.sender), _value);
balances[_to] = safeAdd(balanceOf(_to), _value);
ERC223Receiver receiver = ... | 12,937,973 |
pragma solidity 0.4.24;
import "./Register.sol";
contract Authorization {
address registerContract;
constructor(address register) public {
registerContract = register;
}
//mapping to check the authorization for the provider
mapping(address => address[]) private authorizationProvider;
... | provider add authorizationget ipfs hash for patient and provider to check if they are already registeredcheck if relationship doesnt existadd mapping in both directions patient - provider and provider - patient | function addAuthorization(address _patientAddress) public {
Register register = Register(registerContract);
string memory _ipfsHashPatient = register.getPersonalIPFSHashForProvider(_patientAddress);
string memory _ipfsHashProvider = register.getPersonalIPFSHashForProvider(msg.sender);
... | 7,237,184 |
pragma solidity ^0.4.13;
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); //Call the underlying function to prevent overflow
return c;
}
function div(uint256 a, uint256 b) internal p... | Decrease the amount of tokens that an owner allowed to a spender. approve should be called when allowed[_spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) _spender The address which will spend the funds. _subtractedValue The amoun... | function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg... | 14,474,374 |
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright 2017 Loopring Technology Limited.
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "../../thirdparty/SafeERC20.sol";
import "../../lib/ERC20.sol";
import "../../lib/MathUint.sol";
import "../../lib/AddressUtil.sol";
import "../../iface/PriceOrac... | Returns 0 to indiciate unlimited quota | function currentQuota(Wallet storage wallet)
internal
view
returns (uint)
{
return _currentQuota(wallet.quota);
}
| 11,845,042 |
./full_match/1/0xC383AAc4B3dC18D9ce08AB7F63B4632716F1e626/sources/src/contracts/dependencies/EIP712Base.sol | Get the domain separator for the token Return cached value if chainId matches cache, otherwise recomputes separator return The domain separator of the token at current chain/ | function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return _domainSeparatorV4();
}
| 3,095,151 |
pragma solidity =0.6.6;
interface IAtariswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) exter... | 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, 'AtariswapLibrary: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'AtariswapLibrary: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = am... | 11,977,435 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 functio... | Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless thi... | function decimals() public view override returns (uint8) {
return token.decimals;
}
| 9,850,116 |
/**
*Submitted for verification at Etherscan.io on 2021-04-16
*/
// File: contracts/interfaces/IBridgeValidators.sol
pragma solidity 0.4.24;
interface IBridgeValidators {
function isValidator(address _validator) external view returns (bool);
function requiredSignatures() external view returns (uint256);
... | Internal function for retrieving chain id length for the destination network return chain id for the destination network/ | function _destinationChainIdLength() internal view returns (uint256) {
return uintStorage[DESTINATION_CHAIN_ID_LENGTH];
}
| 2,188,909 |
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
// Sources flattened with hardhat v2.8.2 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/[email protected]
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev ... | Withdraw all stake from BaseRewardPool, get the reward out and convert one asset to another. minAmountReceived The minimum amount of token0 or token1 received when removing liquidity | function exitWithLP(uint256 minAmountReceived, uint256 minAmountBCNTReceived) external {
withdrawWithLP(_balances[msg.sender]);
getReward(minAmountReceived, minAmountBCNTReceived);
}
| 10,510,046 |
pragma solidity ^0.6.0;
/**
* @title StaticConnectBasic.
* @dev Static Connector to withdraw assets.
*/
interface TokenInterface {
function balanceOf(address) external view returns (uint);
function transfer(address, uint) external returns (bool);
}
interface AccountInterface {
function isAuth(address)... | Return InstaEvent Address./ | function getEventAddr() internal pure returns (address) {
return 0x2af7ea6Cb911035f3eb1ED895Cb6692C39ecbA97;
}
| 13,321 |
./partial_match/1/0xbA2E6be629d1514914576a77d0a88C2695f718C0/sources/MASUMI.sol | Moves `amount` of tokens from `from` to `to`. This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token voice, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `from` must have a balanc... | function metal(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
... | 3,554,375 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.6;
import "@openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol";
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/co... | Withdraw LP tokens without caring about rewards. EMERGENCY ONLY _pid Id of the pool to be emergency withdrawn from/ | function emergencyWithdraw(uint256 _pid) external nonReentrant() {
address _account = _msgSender();
Pool storage pool_ = pool[_pid];
User storage user_ = user[_pid][_account];
uint256 amount = user_.lpAmount;
user_.lpAmount = 0;
pool_.lpSupply = pool_.lpSupply.sub(am... | 1,488,058 |
/*
Copyright 2021 Babylon Finance
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 ... | IPriceOracle Babylon Finance Interface for interacting with PriceOracle/ | interface IPriceOracle {
function getPrice(address _assetOne, address _assetTwo) external view returns (uint256);
function getPriceNAV(address _assetOne, address _assetTwo) external view returns (uint256);
function updateReserves(address[] memory list) external;
function updateMaxTwapDeviation(int24... | 1,627,148 |
// SPDX-License-Identifier: UNLICENSED
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "../token/ERC1155/ERC1155.sol";
import "../security/Pausable.sol";
import "../access/AccessControlEnumerable.sol";
contract JumpMultiToken is Context, AccessControlEnumerable, ERC1155, P... | Indicates whether any token exist with a given id, or not./ | function exists(uint256 id) public view virtual returns (bool) {
return JumpMultiToken.totalSupply(id) > 0;
}
| 6,486,805 |
./partial_match/42/0x485D1feE073898dC877315ae25E0F27ae53af267/sources/RewardPool.sol | Fee collection for any other token / | function seize(IERC20 _token, uint256 amount) external onlyOwner{
require(_token != tops, "tops");
require(_token != eye, "eye");
_token.safeTransfer(msg.sender, amount);
}
uint256 public constant DURATION = 7 days;
uint256 public periodFinish = 0;
uint256 public rewardRat... | 8,964,947 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import "./MultiRewardsLiquidityMiningManager.sol";
import "./TimeLockPool.sol";
import "./MultiRewardsTimeLockPool.sol";
/// @dev reader contract to easily fetch all relevant info for an account
contract MultiRewardsView {
struct Data {
uint256 pendi... | Distributes rewards to token holders. It reverts if the total shares is 0. It emits the `RewardsDistributed` event if the amount to distribute is greater than 0. About undistributed rewards: In each distribution, there is a small amount which does not get distributed, which is `(amount POINTS_MULTIPLIER) % totalS... | function _distributeRewards(uint256 _amount) internal {
uint256 shares = getTotalShares();
require(shares > 0, "AbstractRewards._distributeRewards: total share supply is zero");
if (_amount > 0) {
pointsPerShare = pointsPerShare + (_amount * POINTS_MULTIPLIER / shares);
emit RewardsDistribute... | 7,398 |
pragma solidity ^0.4.24;
// File: contracts/interface/PlayerBookInterface.sol
interface PlayerBookInterface {
function getPlayerID(address _addr) external returns(uint256);
function getPlayerName(uint256 _pID) external view returns(bytes32);
function getPlayerLAff(uint256 _pID) external view return... | return the price buyer will pay for next 1 individual key. -functionhash- 0x018a25e8 return price for next key bought (in wei format)/ | function getBuyPrice() public view returns(uint256)
{
return keyPrice;
}
| 12,862,786 |
/**
*Submitted for verification at Etherscan.io on 2021-02-12
*/
pragma solidity 0.8.0;
pragma abicoder v2;
interface MassetStructs {
struct BassetPersonal {
// Address of the bAsset
address addr;
// Address of the bAsset
address integrator;
// An ERC20 can charge transfe... | Set the maximum weight for a given bAsset _min Weight where 100% = 1e18 _max Weight where 100% = 1e18/ | function setWeightLimits(uint128 _min, uint128 _max) external onlyGovernor {
require(_min <= 1e18 / (bAssetData.length * 2), "Min weight oob");
require(_max >= 1e18 / (bAssetData.length - 1), "Max weight oob");
weightLimits = WeightLimits(_min, _max);
emit WeightLimitsChanged(_min,... | 2,378,809 |
pragma solidity ^0.4.18;
import "./SafeMath.sol";
import "./Ownable.sol";
contract Supervisor {
using SafeMath for uint256;
/*STORAGE*/
Job[] public jobList;
Task[] public taskList;
Audit[] public auditList;
Close[] public closeList;
//test storage vars
string[] public testString;
... | set up pay variable, threshold requiresfill out Close structif remitPay true, K sends to Acceptor, else, to taskCreator | function closeOutTask (uint256 _taskID,
bool _returnBond,
bool _remitPay)
public
returns (uint256) {
uint256 applicablePay;
address taskAcceptor = taskList[_taskID].taskAcceptor;
require(msg.sender == taskList[_taskID].taskCreator);
r... | 1,818,875 |
./full_match/42/0x76b352997B9223C9F65BDd245856C8C5BD3f6283/sources/contracts/FundMe.sol | getRoundData and latestRoundData should both raise "No data present" if they do not have data to report, instead of returning unset values which could be misinterpreted as actual reported values. | interface AggregatorV3Interface {
function decimals()
external
view
returns (
uint8
);
function description()
external
view
returns (
string memory
);
function version()
external
view
returns (
uint256
);
function getRoundData(
uint80 _ro... | 16,237,024 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
// Part: IBasicRewards
interface IBasicRewards {
function stakeFor(address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
function earned(address) external view returns (uint256);
function wit... | Zap function to withdraw all shares to another token _to - address to send cvxCrv to option - what to swap to minAmountOut - minimum desired amount of output token | function withdrawAllAs(
address _to,
Option option,
uint256 minAmountOut
) external notToZeroAddress(_to) {
uint256 _withdrawn = _withdraw(balanceOf(msg.sender));
_claimAs(_to, _withdrawn, option, minAmountOut);
}
| 1,768,612 |
./partial_match/1/0xe699177F556C4ca286afbF3D087ad2599ED18f67/sources/BabyFlokiInu.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Baby Floki Inu", "BabyFlokiInu") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswa... | 2,844,528 |
/**
██████ █████ ██ █████ ██ ██ ██ ██ ██ ███ ███
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ████
██ ███ ███████ ██ ███████ ███ ██ ██ ██ ██ ████ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██ ██ ███████ ██ ██ ██ ██ ██ ██████ ██... | See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address recipient, uint256 amount) public whenNotPaused virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
| 14,392,131 |
./full_match/5/0xB4aCa98AfF38435B26464B164a3e92d68B3f480B/sources/contracts/ERC721CDrop.sol | See ERC165: https://eips.ethereum.org/EIPS/eip-165 | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721C, IERC165) returns (bool) {
return
}
Overriden ERC 721 logic
| 1,889,783 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @notice Transition guard functions
*
* - Machine: StopWatch
* - Guards: Paused/Enter, Ready/Enter
*/
contract StopWatchGuards {
// Events
event StopWatchReset(address indexed user);
event StopWatchRunning(address indexed user, uint256 elap... | Compare two strings/ | function compare(string memory _a, string memory _b)
internal
pure
returns
(bool)
{
return keccak256(abi.encodePacked(_a)) == keccak256(abi.encodePacked(_b));
}
| 12,771,590 |
pragma solidity ^0.4.21;
// Redenom 2.9.0023
// The GNU General Public License v3
// © Musqogees Tech 2018, Redenom ™
// -------------------- SAFE MATH ----------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
req... | Activates voting Clears projects | function enableVoting() public onlyAdmin returns(uint ballotId){
require(votingActive == false);
require(frozen == false);
curentBallotId++;
votingActive = true;
delete projects;
emit VotingOn(curentBallotId);
return curentBallotId;
}
| 11,983,467 |
pragma solidity ^0.4.25;
contract RunAway {
using SafeMath for uint256;
using SafeMathInt for int256;
/*=================================
= MODIFIERS =
=================================*/
// only people with tokens
modifier onlyBagholders() {
require(... | Withdraws all of the caller's dividends in previous round./ setup data update dividend tracker Add dividends to income. fire event | function acquireDividends()
isActivated()
onlyHuman()
checkRoundStatus()
public
{
address _customerAddress = msg.sender;
Round storage round = rounds_[currentRoundID_.sub(1)];
round.payoutsTo[_customerAddress] = round.payoutsTo[_customerAddress].add(_divi... | 7,280,858 |
./full_match/1/0xCFFEbe2381327AE285E4FD55d042dE8c09d91050/sources/src/BailMuney/BailMuney.sol | once enabled, can never be turned off setup the approvals add the liquidity set the params and emit | function enableTrading() external payable onlyOwner {
require(!tradingActive, "Trading is already enabled, cannot relaunch.");
require(msg.value > 0, "Send liquidity eth");
require(liquidityTokens > 0, "No tokens!");
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswa... | 16,548,526 |
/**
*Submitted for verification at Etherscan.io on 2020-11-07
*/
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 o... | core function for calculate deposit and withdraw and managerWithdraw return data from Oracle return latest data from Oracle | function calculateFundValue() public view returns (uint256) {
return fundValueOracle.getFundValueByID(latestOracleRequestID);
latestOracleCallOnTime = now;
emit OracleUpdate(latestOracleCaller, latestOracleCallOnTime, latestOracleRequestID);
}
| 12,712,193 |
// SPDX-License-Identifier: MIT
pragma solidity 0.5.6;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../libraries/SignedSafeMath.sol";
import "../libraries/SafeCast.sol";
import "./ClaimToken.sol";
import "../i... | Update multiplier address. Can only be called by the owner or previous multiplier address multiple_ Address of multiplier address | function setMultiple(address multiple_) public {
require(
(owner() == msg.sender) || (multiple == msg.sender),
"multiple: wut?"
);
multiple = multiple_;
}
| 12,538,932 |
// SPDX-License-Identifier: GPL-3.0
/**
░░░░░░░░▒░░░░░░░░░░░░░░░░▒▒▒▒▒░░░░░░░░░░▒░░░░░░░░░
░░░░░░▒▓███░░░░░░░░▒▒▒▒▒░░▒▒███░░░░░░░▓▒██░░░░░░░░
░░░░▓█░░░▓█▒░░░░▒▓▒░░░░░░░░░░██░░░░░░██▒░██░░░░░░░
░░░░▒██░░▒▒░░░░▓█░░░░░░░░░░░░██▓░░░░░▓█▓░▒█▒░░░░░░
░░░░░▒██░░░░░░██░░░░░░░░░░░░▒░██▒░░░░▓█▓▒▒░░░░░░░░
░░░░░░▓██░░░░▓█▒░░░░░░░░... | End an auction, finalizing the bid on Zora if applicable and paying out the respective parties. If for some reason the auction cannot be finalized (invalid token recipient, for example), The auction is reset and the NFT is transferred back to the auction creator./ If the auction is running on zora, settle it on the pr... | function endAuction(uint256 auctionId) external override auctionExists(auctionId) nonReentrant {
require(
uint256(auctions[auctionId].firstBidTime) != 0,
"Auction hasn't begun"
);
require(
block.timestamp >=
auctions[auctionId].firstBidTime.add... | 1,157,525 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
import "./interfaces/ITokenFactory.sol";
import "./ERC1155ERC721Metadata.sol";
import "./ERC1155ERC721WithAdapter.sol";
import "./GSN/BaseRelayRecipient.sol";
contract TokenFactory is
ITokenFactory,
ERC1155ERC721Metadata,
ERC1155ERC721WithAdapter,
... | Query if a contract implements an interface _interfaceId The interface identifier, as specified in ERC-165 Interface identification is specified in ERC-165. This function uses less than 30,000 gas. return `true` if the contract implements `_interfaceId`, `false` otherwise | function supportsInterface(
bytes4 _interfaceId
)
public
pure
virtual
override
returns (bool)
{
if (_interfaceId == INTERFACE_SIGNATURE_ERC165 ||
_interfaceId == INTERFACE_SIGNATURE_ERC1155 ||
_interfaceId == INTERFACE_SIGNATUR... | 12,255,091 |
./full_match/5/0xA13E43d299dd822677f3Cc62d3E77b84DC3665c3/sources/project_/contracts/base/MetawinMinterProxy.sol | Get current price./ | function price_current() external view virtual returns (uint256 price) {
price = _currentAuctionPrice();
}
| 1,942,879 |
/**
*Submitted for verification at Etherscan.io on 2021-11-14
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens... | 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,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external {
bytes32 domainSeparator =
keccak256(
abi.encode(
keccak256(bytes(name())),
... | 15,358,323 |
./full_match/100/0x4849c61B39360bbB3c8682Aea652b23aE8c0c09f/sources/test.sol | Submits membership proposal to `DAO` and wraps native asset to `wETH9`. details Membership details. | function submitMembershipProposal(string memory details) public payable {
dao.submitProposal(
msg.sender,
sharesForTribute,
0,
tributeForShares,
address(wETH9),
0,
address(wETH9),
details
);
... | 14,266,854 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import "../erc721a/ERC721AUpgradeable.sol";
import "../interface/IGenesisKey.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/... | mint leftover for DAO | function mintLeftOver(uint256 quantityToClaim, uint256 quantityToTreasury) external onlyOwner {
require(quantityToClaim != 0 && quantityToTreasury != 0);
require(remainingTeamAdvisorGrant == 0);
require(quantityToClaim + quantityToTreasury + remainingTeamAdvisorGrant + totalSupply() == MAX_S... | 14,727,186 |
./full_match/1/0x1E061ac5099620148BD64867997F35e0e148C277/sources/contracts/AuctionV1.sol | / returns the winning bidder's address for a given listing listing the listingID to get the winning bidder for will revert if the auction has not yet been won | function winningBidder(uint256 listing) external view returns (address) {
require(_listings[listing].poster != address(0), "AuctionV1: listing does not exist");
require(isClosed(listing), "AuctionV1: listing is not closed");
require(_bids[listing].bidder != address(0), "AuctionV1: listing ha... | 17,155,384 |
// File contracts/library/SeedRand.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
library SeedRand {
function rand(
uint256 _seed,
uint256 _index
) internal pure returns (uint256 val) {
unchecked {
val = uint256(keccak256(abi.encodePacked(
_seed, _index
)));
}
}... | Internal method to generate an attribute according to a probability table./ | function _generateAttribute(
GenerationData memory _gd,
uint256 _attributeIndex,
uint256 _tablesIndex
) internal pure returns (bytes1) {
uint256 soulShard = uint256(keccak256(
abi.encodePacked(_gd.soulEssence, _attributeIndex)
));
uint256 pIndex = SeedRand.randUint256(
soulShard,... | 12,082,349 |
./partial_match/1/0x84810bcF08744d5862B8181f12d17bfd57d3b078/sources/SGT.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) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, ... | 4,389,173 |
// 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 decimals) external;
function mint(address user, uint256 amount) ... | initialize cloned token just for BEP20TokenCloned | interface IBEP20TokenCloned {
function initialize(address newOwner, string calldata name, string calldata symbol, uint8 decimals) external;
function mint(address user, uint256 amount) external;
function burnFrom(address account, uint256 amount) external returns(bool);
function burn(uint256 amount) exter... | 9,875,849 |
/**
* https://contributing.kleros.io/smart-contract-workflow
* @reviewers: [@clesaege, @unknownunknown1,@remedcu, @shalzz]
* @auditors: []
* @bounties: [{ duration: 128 days, link: https://github.com/kleros/kleros-interaction/issues/244, maxPayout: 50 ETH }]
* @deployments: [ https://etherscan.io/address/0xd4... | Raise a dispute from a specified question. UNTRUSTED. _questionID The ID of the question. _maxPrevious If specified, reverts if a bond higher than this was submitted after you sent your transaction./ | function requestArbitration(bytes32 _questionID, uint _maxPrevious) external payable {
uint disputeID = arbitrator.createDispute.value(msg.value)(NUMBER_OF_CHOICES_FOR_ARBITRATOR, arbitratorExtraData);
disputeIDToQuestionID[disputeID] = _questionID;
questionIDToDisputer[_questionID] = msg.se... | 6,363,870 |
/*
Copyright 2020 Swap Holdings Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writ... | Authorize a delegated sender Emits an AuthorizeSender event authorizedSender address Address to authorize/ | function authorizeSender(address authorizedSender) external {
require(msg.sender != authorizedSender, "SELF_AUTH_INVALID");
if (!senderAuthorizations[msg.sender][authorizedSender]) {
senderAuthorizations[msg.sender][authorizedSender] = true;
emit AuthorizeSender(msg.sender, authorizedSender);
... | 12,605,930 |
// 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... | Destoys `amount` tokens from `account`, reducing the total supply. Emits a `Transfer` event with `to` set to the zero address. Requirements - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 value) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
| 415,049 |
./full_match/1/0xDB77d0d3d9bf850E38282eD8B5Fb410D02E75d2D/sources/contracts/external/openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol | External interface of AccessControlEnumerable declared to support ERC165 detection./ | interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {
function getRoleMember(bytes32 role, uint256 index)
external
view
returns (address);
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}
| 3,024,992 |
/**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
/*
https://powerpool.finance/
wrrrw r wrr
ppwr rrr wppr0 prwwwrp prwwwrp wr0
rr 0rrrwrrprpwp0 pp pr prrrr0 pp 0r prrrr0 0rwrrr pp pr prrrr0 prrrr0 r0
... | Deposits underlying ERC20 token to the piToken(piERC20). _depositAmount The amount to deposit in underlying ERC20 tokens./ | function deposit(uint256 _depositAmount) public payable override nonReentrant returns (uint256) {
if (noFeeWhitelist[msg.sender]) {
require(msg.value == 0, "NO_FEE_FOR_WL");
require(msg.value >= ethFee, "FEE");
}
require(_depositAmount > 0, "ZERO_DEPOSIT");
uint256 mintAmount = getPiEqui... | 2,309,242 |
./partial_match/1/0x5A9D49679319FCF3AcFe5559602Dbf31A221BaD6/sources/Strategy.sol | want is protected automatically | function protectedTokens() internal override view returns (address[] memory) {
address[] memory protected = new address[](2);
protected[0] = comp;
protected[1] = address(cToken);
return protected;
}
| 4,014,404 |
./partial_match/1/0xaA6b98b74793aa9938cF8c6acB9f504801061c3F/sources/Aggregator.sol | SWAP (supporting fee-on-transfer tokens) requires the initial amount to have already been sent to the first pair scope to avoid stack too deep errors | function _swapSupportingFeeOnTransferTokens(address[] memory path, address[] memory pairs, address _to, bool feeTaken) internal virtual {
bool needToTakeFee = false;
if(activeFeeTokens[path[path.length - 1]] && takeFee && !feeTaken){
needToTakeFee = true;
}
for (uint256 i... | 3,969,161 |
./full_match/3/0x6973165307F00f39AbC1d910286bd15f7fa347bb/sources/BDK.sol | trx兑换代币并加入的流动池判断是否为流动性提供者 | function _swapAndLiquify(address user,uint256 amountT) internal virtual {
require(amountT > 0,"swap number is zore");
if(users[user].lastLiquidityTime == 0){
totalPoolUser ++;
poolUsers[totalPoolUser] = user;
}
... | 8,100,923 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleI... | This is the function that Chainlink VRF node calls to send the money to the random winner./ | function fulfillRandomWords(
uint256, /* requestId */
uint256[] memory randomWords
) internal override {
uint256 index = randomWords[0] % s_players.length;
address payable recentWinner = s_players[index];
s_recentWinner = recentWinner;
s_players = new address paya... | 13,104,068 |
./full_match/5/0x116312269e1d8B4562Ce1b45b7e49d1FCD548531/sources/StolenMemes.sol | time after transfer before tokens can be stolen require( _timeFromTransfer >= 3600, "_timeFromTransfer must be more than an hour" ); require( _timeFromExpose < _timeFromTransfer, "_timeFromExpose must be less than _timeFromTransfer" ); require( _timeFromExpose >= 1800, "_timeFromExpose must be m... | function setParameters(
uint256 _timeFromTransfer,
uint256 _timeFromExpose,
uint256 _stealCooldown
) external onlyOwner {
timeFromExpose = _timeFromExpose;
timeFromTransfer = _timeFromTransfer;
stealCooldown = _stealCooldown;
}
| 1,935,795 |
pragma solidity 0.4.24;
import "../libraries/Address.sol";
contract RevertFallback {
function() public payable {
revert();
}
function receiveEth() public payable {
// solhint-disable-previous-line no-empty-blocks
}
function sendEth(address _receiver, uint256 _value) public {
... | solhint-disable-previous-line no-empty-blocks | function receiveEth() public payable {
}
| 12,854,665 |
./full_match/1/0xf28af1858b35580274d4aA4229BB294e905EC0bf/sources/contracts/v2/721ALib/ERC721A.sol | See {IERC721Metadata-tokenURI}./ | function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return
bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ... | 4,947,192 |
// Altura - NFT Pool contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeER... | Update the given pool's reward per block. Can only be called by the owner. | function setRewardPerBlock(uint256 _reward) external virtual override onlyOwner {
updatePool();
rewardPerBlock = _reward;
}
| 1,018,623 |
pragma solidity 0.4.25;
// File: contracts/sogur/interfaces/ISGRTokenManager.sol
/**
* @title SGR Token Manager Interface.
*/
interface ISGRTokenManager {
/**
* @dev Exchange ETH for SGR.
* @param _sender The address of the sender.
* @param _ethAmount The amount of ETH received.
* @return Th... | Handle the operation of ETH deposit into the SGRToken contract. _sender The address of the account which has issued the operation. _balance The amount of ETH in the SGRToken contract. _amount The deposited ETH amount. return Fixed zero as not in use./ | function uponDeposit(address _sender, uint256 _balance, uint256 _amount) external only(_ISGRToken_) returns (address, uint256) {
require(_sender != address(0), "sender is illegal");
uint256 ethBalancePriorToDeposit = _balance.sub(_amount);
emit DepositCompleted(_sender, ethBalancePriorToDep... | 1,729,514 |
pragma solidity ^0.5.11;
// Public-Sale for #3277-12000 stage of Voken2.0
//
// More info:
// https://vision.network
// https://voken.io
//
// Contact us:
// support@vision.network
// support@voken.io
/**
* @dev Uint256 wrappers over Solidity's arithmetic operations with added overflow checks.
*/
library S... | Mint Voken bonus./ Global Account Stage Season Mint with allocation | function _mintVokenBonus(uint256 amount) private {
_vokenBonus = _vokenBonus.add(amount);
_vokenBonusTxs = _vokenBonusTxs.add(1);
_accountVokenBonus[msg.sender] = _accountVokenBonus[msg.sender].add(amount);
_stageVokenBonus[_stage] = _stageVokenBonus[_stage].add(amount);
_... | 14,102,061 |
pragma solidity 0.4.21;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
... | Cancel an already published order can only be canceled by seller or the contract owner. assetId - ID of the published NFT/ | function cancelOrder(uint256 assetId) public whenNotPaused {
require(auctionByAssetId[assetId].seller == msg.sender || msg.sender == owner);
bytes32 auctionId = auctionByAssetId[assetId].id;
address auctionSeller = auctionByAssetId[assetId].seller;
delete auctionByAssetId[assetId];
... | 397,509 |
/**
*Submitted for verification at Etherscan.io on 2022-03-05
*/
/**
* WEBSITE: https://basara.finance
* TWITTER: https://twitter.com/BasaraETH
* TELEGRAM: https://t.me/BasaraETH
*
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() inter... | generate the uniswap pair path of token -> weth make the swap | function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _dexRouter.WETH();
_approve(address(this), address(_dexRouter), tokenAmount);
_dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens... | 6,612,458 |
/**
▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓
▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐... | AuthorityDelegator An operator contract can delegate authority to other operator contracts by implementing the AuthorityDelegator interface. To delegate authority, the recipient of delegated authority must call `claimDelegatedAuthority`, specifying the contract it wants delegated authority from. The staking contract c... | interface AuthorityDelegator {
function __isRecognized(address delegatedAuthorityRecipient)
external
returns (bool);
▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
}
| 12,936,615 |
./full_match/1/0xD8262F646Cd001430cea2eEcDfe3536547A1E95C/sources/NieuxCollective.sol | Airdrops a token to a given address to address to receive the token/ | function airdropOne(address to) external onlyOwner {
_safeMint(to, nextTokenId);
nextTokenId += 1;
}
| 3,193,370 |
./full_match/84531/0xcd0C4438b705C7536367A501fd246682B1B1C543/sources/contracts/N2MERC721.sol | Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST Throws unless `msg.sender` is the current owner, an authorized operator, or the approved address for this NFT. Throws if `from` is not the current owner. Throws if `to` i... | function transferFrom(
address from,
address to,
uint256 tokenId
) public override onlyAllowedOperator() {
super.transferFrom(from, to, tokenId);
}
| 11,497,978 |
./partial_match/44787/0xED9F717ad775223aEdf226724d7813B4e3E7e808/sources/contracts/BCFactory.sol | allows to update the root, if no genesis has been minted yet | function setRoot(bytes32 root_) external onlyOwner {
if (genesisToken.totalSupply() > 0) revert RootAlreadySet();
merkleRoot = root_;
emit RootSet(root_);
}
| 16,956,606 |
/**
*Submitted for verification at Etherscan.io on 2021-06-28
*/
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
interface TrueFiPool {
function join(uint256 amount) external;
function balanceOf(address user) view external returns (uint256 amount);
function liquidExit(uint256 amount) external;... | Collects reward(TRU) tokens | function harvest() public override onlyBenignCallers {
TrueFarm(stakingFarm).claim(trueFiTokens);
uint256 _reward = IERC20(rewardToken).balanceOf(address(this));
if (_reward > 0) {
uint256 _wantAmount = IERC20(want).balanceOf(address(this));
uint256 _buybackLpAm... | 9,979,789 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
contract AtomicTypes{
struct SwapParams{
Token sellToken;
uint256 input;
Token buyToken;
uint minOutput;
}
struct DistributionParams{
IAtomicExchange[] exchangeModules;
bytes[] exchangeData;
... | perform a distributed swap, send outcome to _receipient and burn optimal gastoken amount afterwards | function swapAndSendWithGasTokens(
SwapParams calldata _swap,
DistributionParams calldata _distribution,
address payable _receipient,
IGasToken _gasToken,
uint _gasQtyPerToken
) public payable returns (uint _output){
uint startGas = gasleft();
_output = sw... | 136,651 |
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2021 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by a... | Transfers tokens to recipients. context Context information. return success The success bytes (`LibERC20Transformer.TRANSFORMER_SUCCESS`). | function transform(TransformContext calldata context)
external
override
returns (bytes4 success)
{
TokenFee memory fee = abi.decode(context.data, (TokenFee));
uint256 transformerAmount = LibERC20Transformer.getTokenBalanceOf(fee.token, address(this));
if (transformer... | 5,527,379 |
./full_match/80001/0xd3cFB1CE690B52006c90d8425D4EbAa9c86aBC77/sources/contracts/TMHC-Reborn-Stake.sol | /// Stakes the specified team leader and boosts for the caller. _leaderId The ID of the team leader to be staked. _boostIds An array of IDs of the boosts to be staked./ | function stakeTeam(uint16 _leaderId ,uint16[] calldata _boostIds) external nonReentrant{
require(!PauseStake, "Stacking pool is currently paused.");
_stakeTeam(_leaderId, _boostIds);
}
| 5,581,667 |
/**
*Submitted for verification at Etherscan.io on 2021-04-21
*/
pragma solidity ^0.7.6;
// SPDX-License-Identifier: MIT
// Source code: https://github.com/DeCash-Official/smart-contracts
interface ERC20 {
function balanceOf(address _owner) external view returns (uint256);
function allowance(address _owner... | Used to delete cancelled or performed operation operation defines which operation to delete/ Not last | function _deleteOperation(bytes32 operation) internal {
uint256 index = allOperationsIndicies[operation];
if (index < allOperations.length - 1) {
allOperations[index] = allOperations[allOperations.length - 1];
allOperationsIndicies[allOperations[index]] = index;
}
... | 2,007,164 |
./partial_match/1/0x89Bf8FC4c3f26b115361283C8Fe9615A433f9848/sources/YOKAI.sol | YOU CAN SET HERE THE BUY FEES YOU CAN SET HERE THE SELL FEES | constructor() ERC20("Yokai", "YOKAI") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUnisw... | 2,730,354 |
/**
*Submitted for verification at Etherscan.io on 2020-11-24
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
functi... | View function to see pending MUTANTs on frontend. | function pendingMutant(address _user) public view returns (uint256) {
uint256 userPoints = getPointsOfAddress(_user);
uint256 totalPoints = getTotalPoints();
uint256 accMutantPerShareLoc = accMutantPerShare;
if (block.number > lastRewardBlock && totalPoints != 0) {
uint2... | 2,156,368 |
./full_match/97/0x16eBb9090f7A5Abe6375bb33cDD99d0076c01027/sources/project_/contracts/Learning.sol | / RobotData memory robotData = RobotJoinGameOfUser[user]; uint256 tokenId = robotData.TokenId; | allows the user who called the function to start their robot's learning process
function ForRobotNFTToLearn() public whenNotPaused isHeroNFTJoinGame
{
address user = msg.sender;
(,uint256 tokenId) = GameCotrollerContract.RobotNFTJoinGameOfUser(user);
require(tokenId != 0, "Error Sta... | 3,291,813 |
./full_match/1/0xa213C344D14e9aE9DA2b70a8f9A0122131d59274/sources/contracts/FutureQuest.sol | Returns the total quantity for a type of token typeId uint256 ID of the token type to query return amount of token of type typeId in existence/ | function totalSupply(uint256 typeId) public view returns (uint256) {
return _tokenSupply[typeId];
}
| 8,357,603 |
pragma solidity ^0.6.6;
contract Anti_Deepfake {
address public owner;
// the video offline on the IPFS
Video public thisVideo;
// authorization license for the video
bytes32 public license;
struct Video {
address owner;
string info; // additional informatio... | default: deepfake for original owner is true | function requestPermission(bool antideepfake_result, bytes32 IPFS_hash) NotOwner public {
address artist = msg.sender;
emit ArtistRequestingPermission(address(msg.sender));
if (antideepfake_result && !Not_Trusted_Artist[msg.sender]) {
Granted_Permissions[IPFS_hash].EA = artis... | 14,081,283 |
./partial_match/1/0x508efB44A06a64Bd4020e8c5e8Ecf1A9236C75aE/sources/licence.sol | This locks the TKN address so that it can no longer be updated | function lockTKNContractAddress() external onlyAdmin {
_lockedTKNContractAddress = true;
}
| 3,598,029 |
./full_match/5/0xe2A8acC6D641b7D2b5922cB90969D0B6B76d689E/sources/contracts/tiered-drop/plugin/TieredDropLogic.sol | Returns whether lazy minting can be done in the given execution context. | function _canLazyMint() internal view virtual override returns (bool) {
return Permissions(address(this)).hasRole(minterRole, _msgSender());
}
| 7,089,102 |
pragma solidity 0.6.2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./LoomDai.sol";
contract Fyghters is ERC721 {
using SafeMath for uint256;
uint256 constant ONE = 1 * 10**18;
uint256 constant MIN_DEPOSIT = ONE * 5;
uint256 co... | Note: This function should be sync with the same from app | function calculateGainAndLoss(uint256 _winProbability) public pure returns (uint256 gainIfWin, uint256 lossIfLose) {
gainIfWin = BET_VALUE.mul(ONE.sub(_winProbability)).div(ONE);
lossIfLose = BET_VALUE.mul(_winProbability).div(ONE);
}
| 13,061,893 |
./full_match/1/0x1C391228B59D5436D9febfeC030c9466c180558d/sources/src/SYLSafe/SYLSafe.sol | Deposit amount of ERC20. Needs approve of ERC20 allowance from user./ | function deposit(uint256 depositAmount) external {
if (!_cancellable) {
require(_safeStart >= block.timestamp, "safe already started");
}
require(_safeEnd >= block.timestamp, "safe already matured");
require(!_deposited[msg.sender], "already deposited");
require(d... | 4,867,277 |
pragma solidity >=0.5.0 <0.7.0;
//import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.0.0/contracts/token/ERC20/ERC20.sol";
interface stablecoin {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
functi... | compay get back expired vouchers for optimization we can write a function to test if there are expired vouchers the company will check employees for expired token | function getexpired() public payable returns(bool){
employee[] memory employees;
Voucher[] memory vouchers;
uint total;
uint totalparemp;
total=0;
employees=companies[msg.sender].employees;
for(uint cindex=0; cindex<employees.leng... | 12,660,592 |
./full_match/42/0x6ED04ADC503b274193F7c3B5A54F5270fCfB6A03/sources/browser/DODO/UniswapArbitrageur1.sol | transfer token0 into uniswap transfer token1 into uniswap | function _arbitrage(
bool isDODOBuy,
uint256 baseAmount,
uint256 quoteAmount
) internal {
(uint112 _reserve0, uint112 _reserve1, ) = IUniswapV2Pair(_UNISWAP_).getReserves();
uint256 token0Balance = uint256(_reserve0);
uint256 token1Balance = uint256(_reserve1);
... | 16,204,000 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
// File: @chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol
/*
* @dev Provides o consume price data, this smart contract references
* AggregatorV3Interface, which defines the external functions implemented by
* the ETH/USD Price Feed.
... | See {IERC777-operatorSend}. Emits {Sent} and {IERC20-Transfer} events./ | function operatorSend(
address sender,
address recipient,
uint256 amount,
bytes memory data,
bytes memory operatorData
) public virtual override {
require(
isOperatorFor(_msgSender(), sender),
'ERC777: caller is not an operator for holder'
);
_send(sender, recipient, amou... | 12,574,064 |
pragma solidity ^0.5.13;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./interfaces/IAccounts.sol";
import "../common/Initializable.sol";
import "../common/interfaces/ICeloVersionedContract.sol";
import "../common/Signatures.sol";
... | Remove one of the Validator, Attestation or Vote signers from an account. Should only be called from methods that check the role is a legacy signer. role The role that has been authorized./ | function removeLegacySigner(bytes32 role) private {
Account storage account = accounts[msg.sender];
address signer;
if (role == ValidatorSigner) {
signer = account.signers.validator;
account.signers.validator = address(0);
signer = account.signers.attestation;
account.signers.atte... | 1,012,294 |
// SPDX-License-Identifier: ISC
pragma solidity 0.7.5;
import "../../lib/uniswapv2/NewUniswapV2.sol";
import "../../lib/uniswapv3/UniswapV3.sol";
import "../../lib/zeroxv4/ZeroxV4.sol";
import "../../lib/balancer/Balancer.sol";
import "../../lib/makerpsm/MakerPsm.sol";
import "../IBuyAdapter.sol";
/**
* @dev This c... | solhint-disable var-name-mixedcase/solhint-enable var-name-mixedcase/ | function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);
}
pragma solidity 0.7.5;
constructor(address weth) public {
WETH = weth... | 13,620,513 |
//! The KeyServerSet contract. Owned version with migration support.
//!
//! Copyright 2017 Svyatoslav Nikolsky, Parity Technologies Ltd.
//!
//! Licensed under the Apache License, Version 2.0 (the "License");
//! you may not use this file except in compliance with the License.
//! You may obtain a copy of the License ... | Append new key serer to set. we do not support > 256 key servers in the list | function appendToSet(Set storage set, bytes keyServerPublic, string keyServerIp) private returns (address) {
require(set.list.length < 256);
address keyServer = computeAddress(keyServerPublic);
set.map[keyServer].index = uint8(set.list.length);
set.map[keyServer].publicKey = keyServerPublic;
set.map[keyServ... | 5,401,843 |
// SPDX-License-Identifier: LGPL-3.0-or-later
/**
* @title obscurityDAO
* @email [email protected]
* @dev Nov 3, 2020
* ERC-20
* obscurityDAO Copyright and Disclaimer Notice:
*/
pragma solidity ^0.8.7 <0.9.0;
import "./founders.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";... | Founder Functions - Addr/ | function completeAddrTransferProposal(uint256 proposalID)
public
virtual onlyRole(PAUSER_ROLE) {
addressSwapExecution(proposalID);
}
| 11,823,065 |
./full_match/97/0x6BAFf9029Dd4C0d7bfb982363C6CD094f7338DC2/sources/project:/contracts/proportionCountContract.sol | require(_total > 0, "Total must be greater than 0");require(_value <= _total, "Value must be less than or equal to total"); | function calculatePercentage(uint256 _value, uint256 _total, uint256 _precision) public pure returns (uint256) {
uint256 factor = 10 ** _precision;
uint256 percentage = (_value * factor * 100) / _total;
return percentage;
}
| 3,293,412 |
./partial_match/1/0xfBFAa6141EEd993d3999688672cb6453d7C246d5/sources/DxPoolStakingFeePool.sol | Compute a Reward by adding pending reward to user totalRewards | function computeReward(address depositor) internal {
uint256 userValidatorCount = users[depositor].validatorCount;
if (userValidatorCount > 0) {
uint256 pending = userValidatorCount * getAccRewardPerValidator() - users[depositor].debit;
users[depositor].totalReward += uint128... | 4,228,883 |
./full_match/5/0x5038cbACF4b1EdF7DBF8740602B069a29CDAF9A4/sources/contracts/GenericBridge.sol | Get hash to be signed by the user signature is set to bytes(0) because it isnt being used here _to address of the contract to be called _value value to be sent to the contract _data data to be sent to the contract | function getMessageHash(
address _to,
uint _value,
bytes memory _data
) public pure returns (bytes32) {
BridgeLib.BridgeTransaction memory transaction = BridgeLib
.BridgeTransaction({
to: _to,
value: _value,
data: _data,
signature: new bytes(0)
});
ret... | 1,896,306 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.