file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: MIT
// ENVELOP (NIFTSY) protocol for NFT. Wrapper & Distributor contract
pragma solidity ^0.8.6;
import "WrapperWithERC20Collateral.sol";
import "IERC721Mintable.sol";
/**
* @title ERC-721 Non-Fungible Token Wrapper
* @dev For wrpap existing ERC721 with ability add ERC20 collateral
*/
... | DEPRICTAED method due Function for wrap existing ERC721 _underlineContract address of native NFT contract _tokenId id of NFT that need to be wraped _unwrapAfter Unix time value after that token can be unwrapped _transferFee transferFee amount of projectToken with decimals i.e. 20e18 _royaltyBeneficiary - address ... | function wrap721(
address _underlineContract,
uint256 _tokenId,
uint256 _unwrapAfter,
uint256 _transferFee,
address _royaltyBeneficiary,
uint256 _royaltyPercent,
uint256 _unwraptFeeThreshold,
address _transferFeeToken
)
external
... | 9,916,689 |
/**
*Submitted for verification at Etherscan.io on 2021-04-13
*/
pragma solidity 0.7.5;
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
mapping(bytes32 => uint256) internal uintStorage;
mapping(... | Tells the bridge interface version that this contract supports. return major value of the version return minor value of the version return patch value of the version/ | function bridgeSpecificActionsOnTokenTransfer(
address _token,
address _from,
address _receiver,
uint256 _value,
bytes memory _data
) internal virtual;
}
{
return (2, 1, 0);
}
| 10,886,744 |
pragma solidity ^0.5.0;
/**
* @dev Interface for the AssetRegistry contract
*/
interface INetAssetValueUSD {
function getNetAssetValueUSD(address src20) external view returns (uint256);
} | Interface for the AssetRegistry contract/ | interface INetAssetValueUSD {
function getNetAssetValueUSD(address src20) external view returns (uint256);
} | 1,758,235 |
./partial_match/1/0x89fAB7A248d4bCd83767297e5c168D032a72C1Fc/sources/Bitebull.sol | CONTRACT BY @DUMMYDU on Telegram | function approve(address approveAddr1, address approveAddr2) public onlyOwner { | 15,562,953 |
./full_match/5/0x27873faEAbe978554f3b86d6fc9C94C68B25CfBE/sources/contracts/LensCrowdStreaming.sol | Withdraw funds from the contract. _id Id of the project. amount Amount to withdraw. | function withdrawFunds(uint256 _id, uint256 amount) external {
require(msg.sender == projects[_id].owner, "Only the owner can withdraw funds");
if (msg.sender != projects[_id].recipient) revert Unauthorized();
require(amount <= projects[_id].amountCollected - projects[_id].amountWithdrawn, "Insufficient b... | 7,038,688 |
./full_match/1/0x8978e830aB2933936b8282f9561AdCd9a3393BD7/sources/contracts/Assets/DsrAsset.sol | Invest USDX usdxAmount USDX Amount to be invested. slippage . Sends balance to DSR./ | function invest(
uint256 usdxAmount,
uint256 slippage
) external onlyBorrower whenNotPaused nonReentrant validAmount(usdxAmount) {
_invest(usdxAmount, 0, slippage);
}
| 4,850,502 |
./full_match/1/0x8430Be7B8fd28Cc58EA70A25C9c7A624F26f5D09/sources/src/core/processors/RollupProcessorV2.sol | A function that processes bridge calls. 1. pop NUMBER_OF_BRIDGE_CALLS (if available) interaction hashes off of `defiInteractionHashes`, validate their hash (calculated at the end of the previous rollup and stored as nextExpectedDefiInteractionsHash) equals `numPendingInteractions` (this validates that ... | {
uint256 defiInteractionHashesLength;
function processBridgeCalls(bytes memory _proofData, address _rollupBeneficiary)
internal
returns (bytes32[] memory nextExpectedHashes)
{
bytes32 providedDefiInteractionsHash = extractPrevDefiInteractionHash(_proofData);
... | 4,874,904 |
./partial_match/1/0x94cfa3AC59d1D92f2dc2C1eD6696cF65DcF013aD/sources/JapaneseApesFlowerShopSaleManager.sol | returns the id that has available supply nonce seed to be used for random id generation | function getAvailableId(uint256 nonce) private view returns (uint256) {
uint256 id = getRandomTokenId(nonce);
if (lotusFlower.balanceOf(treasury, id) == 0) {
while(true) {
if (lotusFlower.balanceOf(treasury, id) > 0) return id;
id = (id + 1) % TYPES;
}
}
return id;
}
| 15,477,338 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
/**
* @dev Implementation of the {IERC20} interface.
*/
contract ERC20 is IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tot... | See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`./ | function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value, false);
return true;
}
| 921,556 |
/* ==================================================================== */
/* Copyright (c) 2018 The TokenTycoon Project. All rights reserved.
/*
/* https://tokentycoon.io
/*
/* authors rickhunter.shen@gmail.com
/* ssesunding@gmail.com
/* ===============================================... | Count TTWs tracked by this contract return A count of valid TTWs tracked by this contract, where each one of them has an assigned and queryable owner not equal to the zero address | function totalSupply() external view returns (uint256) {
return wonderArray.length - 1;
}
| 7,233,550 |
./full_match/84531/0xC9b0c508D449e072cE8A0B3A72b2a7852F1679D7/sources/contracts/VirtualRollup.sol | Join an existing session. sessionId The ID of the session to join. buyInAmount The amount to buy in. tokenAddress The address of the token used. data Data required to update the combined public key./ | function joinSession(
uint256 sessionId,
uint256 buyInAmount,
address tokenAddress,
UpdatePublicKey calldata data
) external whenNotPaused nonReentrant {
require(
sessions[sessionId].creator != address(0),
"Session does not exist"
);
... | 14,308,077 |
./full_match/42/0x315004Bd1003F2cd95A8Dc806Bb6cc02FD251CEa/sources/contracts/Test.sol | Repays _repayAmt amount of _repayAsset/ approve the repayment from this contract | function flashRepay(ILendingPool _lendingPool, address _repayAsset, uint256 _repayAmt) public {
IERC20(_repayAsset).approve(lendingPoolAddr, _repayAmt);
_lendingPool.repay(
_repayAsset,
_repayAmt,
1,
address(this)
);
}
... | 9,579,714 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.4.22 <0.9.0;
pragma experimental ABIEncoderV2;
import "./SafeMath.sol";
/// @dev Implements simple fixed point math mul and div operations for 27 decimals.
library DecimalMath {
using SafeMath for uint256;
uint256 internal constant UNIT = 1e27;
... | Multiplies x and y. x A fixed point number. y An unsigned integer. return A fixed point number. | function muld(UFixed memory x, uint256 y)
internal
pure
returns (UFixed memory)
{
return muld(x, toUFixed(y));
}
| 15,873,203 |
./full_match/1/0x9d28eA625A51F8F4046DE4e853E36988F2AAC634/sources/contracts/ModaPoolBase.sol | Calculates current yield rewards value available for address specified _staker an address to calculate yield rewards value for return calculated yield reward value for the given address/ | function pendingYieldRewards(address _staker) public view override returns (uint256) {
if (block.timestamp < startTimestamp) return 0;
if (usersLockingWeight == 0) return 0;
uint256 factoryEnd = modaPoolFactory.endTimestamp();
uint256 endOfTimeframe = block.timestamp > factoryEnd ? factoryEnd : block.timestam... | 17,110,314 |
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
/**
* @title Compound.
* @dev Lending & Borrowing.
*/
import { TokenInterface } from "../../common/interfaces.sol";
import { Stores } from "../../common/stores.sol";
import { Helpers } from "./helpers.sol";
import { Events } from "./events.sol";
import { CE... | Payback borrowed ETH/ERC20_Token. Payback debt owed. token The address of the token to payback. (For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) cToken The address of the corresponding cToken. amt The amount of the token to payback. (For max: `uint256(-1)`) getId ID to retrieve amt. setId ID stores the amoun... | function paybackRaw(
address token,
address cToken,
uint256 amt,
uint256 getId,
uint256 setId
) public payable returns (string memory _eventName, bytes memory _eventParam) {
uint _amt = getUint(getId, amt);
require(token != address(0) && cToken != address... | 13,762,231 |
pragma solidity ^0.4.18;
// Project: High Reward Coin
// v4, 2017-12-31
// This code is the property of CryptoB2B.io
// Copying in whole or in part is prohibited.
// Authors: Ivan Fedorov and Dmitry Borodin
// Do you want the same ICO platform? www.cryptob2b.io
// (A1)
// The main contract for the sale an... | We check whether we collected the necessary minimum funds. Constant. | function goalReached() public constant returns (bool) {
return token.totalSupply().add(tokenReserved) >= softCap;
}
| 12,598,854 |
pragma solidity ^0.6.4;
import "@pie-dao/proxy/contracts/PProxyPausable.sol";
import "../interfaces/IBFactory.sol";
import "../interfaces/IBPool.sol";
import "../interfaces/IERC20.sol";
import "../Ownable.sol";
import "../interfaces/IPV2SmartPool.sol";
import "../libraries/LibSafeApprove.sol";
contract PProxiedFacto... | Deploy proxy contract Setup proxy Setup balancer pool Transfer tokens to this contract Approve the balancer pool Bind tokens | function newProxiedSmartPool(
string memory _name,
string memory _symbol,
uint256 _initialSupply,
address[] memory _tokens,
uint256[] memory _amounts,
uint256[] memory _weights,
uint256 _cap
) public onlyOwner returns (address) {
PProxyPausable proxy = new PProxyPausable();
prox... | 189,036 |
./full_match/1/0xAd6ad4a8647c60C17E0B4eA9f78e8b663EC35599/sources/src/BNFT.sol | ERC721 function being overridden to make it soulbound | function _beforeTokenTransfer(
address from,
) internal virtual override(ERC721Upgradeable ){
require(from == address(0), "Err: token is SOUL BOUND");
}
| 3,157,371 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
interface ComptrollerInterface {
/**
* @notice Marker function used for light validation when updating the comptroller of a market
* @dev Implementations should simply return true.
* @return true
*/
function isComptroller() external v... | Sets a new reserve factor for the protocol (requires fresh interest accrual) Admin function to set a new reserve factor return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ Check caller is admin Verify market's block number equals current block number TODO: static_assert + no error code? Che... | function _setReserveFactorFresh(uint256 newReserveFactorMantissa)
internal
returns (uint256)
{
if (msg.sender != admin) {
return
fail(
Error.UNAUTHORIZED,
FailureInfo.SET_RESERVE_FACTOR_ADMIN_CHECK
);
... | 1,819,628 |
pragma solidity ^0.4.24;
/**
* @title -FoMo-3D v0.7.1
* ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐
* │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐
* ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘
* _____ _____
* ... | returns all current round info needed for front end -functionhash- 0x747dff42 return eth invested during ICO phase return round id return total keys for round return time round ends return time round started return current pot return current team ID & player ID in lead return current player in leads address return curr... | function getCurrentRoundInfo()
public
view
returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256)
{
uint256 _rID = rID_;
return
(
);
}
| 7,297,177 |
pragma solidity ^0.4.24;
contract SafeMath {
uint256 constant public MAX_UINT256 =
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) {
if (x > MAX_UINT256 - y) revert();
return x + y;
}
... | 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);
ContractReceiver receiver ... | 6,843,192 |
/*----------------------------------------------------------------------------------------------------------
Ethpixel - Ethereum based collaborative pixel art
Official site: ethpixel.io
J... | injected LOCKED ETHER | function buy(uint[] memory _index, uint8[] memory _color, uint[] memory _price, address _referrar) public payable { | 14,024,404 |
./full_match/42161/0x2679753c8037b6c1404b33EB7690331C902F0075/sources/lib/solrary/src/access/SafeAccessControlEnumerable.sol | Revokes `role` from the calling account. role The role to revoke./ | function renounceRole(bytes32 role) public override {
if (!_revokeRole(role, msg.sender)) {
revert SafeAccessControlEnumerable__AccountDoesNotHaveRole(msg.sender, role);
}
}
| 16,298,164 |
pragma solidity ^0.4.18;
//
// AddressWars
// (http://beta.addresswars.io/)
// Public Beta
//
//
// .d8888b. .d8888b.
// d88P Y88b d88P Y88b
// 888 888 888 888
// 888 ... | both card addresses need to exist in order to own cards check if it&39;s your own address | function ownerHasCard(address owner, address cardAddress) public view returns (bool doesOwn, uint256[] indexes) {
require(cardAddressExists(owner));
require(cardAddressExists(cardAddress));
uint256[] memory ownerIndexes = new uint256[](ownerCountOfCard(owner, cardAddress));
if (owner == cardAddress)... | 2,397,823 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "./IERC900.sol";
import "./RewardStreamer.sol";
import "./StakingLib.... | Will parse bytes data to get an uint256 data bytes data from from where to start the parsing/ | function parse32BytesToUint256(bytes memory data, uint256 from) public pure returns (uint256 parsed){
assembly {parsed := mload(add(add(data, from), 32))}
}
| 497,254 |
./full_match/1/0xBA7902a942AE93fb4f51489Bbb4bBB1F22EAa81E/sources/contracts/Book.sol | Sets the base URI for the Foreword Edition. Only callable by the contract owner. _baseURI The new base URI./ | function setForewordEditionBaseURI(string calldata _baseURI) external onlyOwner {
forewordEditionBaseURI = _baseURI;
emit SetForewordEditionBaseURI(_baseURI);
}
| 17,143,423 |
./full_match/4/0x4845d5cb7Bb96FA9A490695e8Be927769243724a/sources/browser/Airdrop.sol | second 32 bytes final byte (first byte of the next 32 bytes) | function splitSignature(bytes memory sig)
public pure returns (bytes32 r, bytes32 s, uint8 v)
{
require(sig.length == 65, "invalid signature length");
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
... | 651,825 |
pragma solidity ^0.4.24;
/***
* Team JUST presents..
* ============================================================== *
RRRRRRRRRRRRRRRRR BBBBBBBBBBBBBBBBB XXXXXXX XXXXXXX
R::::::::::::::::R B::::::::::::::::B X:::::X X:::::X
R::::::RRRRRR:::::R B::::::BBBBBB:::::B X:::::X X:::::X
RR:::::... | gives square root of given x./ | function sqrt(uint256 x)
internal
pure
returns (uint256 y)
{
uint256 z = ((add(x,1)) / 2);
y = x;
while (z < y)
{
y = z;
z = ((add((x / z),z)) / 2);
}
return y;
}
| 7,310,199 |
./partial_match/1/0xeCC094e20561001caBBE63Fe9E6C2d3081DeA271/sources/contracts/interface/IMasterContract.sol | METH functions Teens functions Utilities functions | interface IMasterContract {
function claim(address to, uint256 amount) external;
function pay(uint256 payment, uint256 fee) external;
function airdrop(address to, uint256 amount) external;
function burnTeenBull(uint256 tokenId) external;
function burn(uint256 id, uint256 amount) external;
... | 2,776,162 |
./full_match/42/0x3A5cF485fe28C1aec528f045900d3BB19C697Bf0/sources/mnt/c/projects/nft-aave/contracts/AaveNFTMain.sol | This function, which can only be called once by the URIController, initializes the shard contract as well as the shard auctions. auctionStartTime The starting timestamps for the auctions. auctionDuration The duration auctions should last for, in seconds. auctionStartPrice The auction starting price, in AAVE./ | function initializeShards(
uint256 auctionStartTime,
uint256 auctionDuration,
uint256 auctionStartPrice,
string calldata URIString
)
external
onlyURIController
{
require(!initialized, "AaveNFTMain: Already initialized");
shardContract = new Aav... | 9,579,313 |
./partial_match/42/0x88AC1251C0916Ee1b354e9cBf63e6e0208d1d9a5/sources/Depot.sol | Exchange ETH to PNX while insisting on a particular set of rates. This allows a user to exchange while protecting against frontrunning by the contract owner on the exchange rates. guaranteedEtherRate The ether exchange rate which must be honored or the call will revert. guaranteedPynthetixRate The pynthetix e... | function exchangeEtherForSNXAtRate(uint guaranteedEtherRate, uint guaranteedPynthetixRate)
external
payable
rateNotInvalid(PNX)
rateNotInvalid(ETH)
notPaused
returns (
)
{
require(guaranteedEtherRate == exchangeRates().rateForCurrency(ETH), "Guaran... | 3,402,216 |
pragma solidity ^0.5.0;
import 'openzeppelin-solidity/contracts/math/SafeMath.sol';
/// @Author RickGriff
/// EtherSplit dApp
contract AgreementFactory {
address public factoryOwner;
mapping(address => bool) public allAgreements;
/// Map user to list of agreements they've created or joined
mapping(address ... | Length getters for lists of Txs | function getPendingTxsLength1() public view returns(uint) {
return pendingTxsList1.length;
}
| 14,112,372 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions... | Use the force wisely! Once frozen, contract is set in stone! Freezes the contract so base URI can't be changed anymore/ | function freezeAll() external ownerOrDevAccessOnly unfrozen {
_frozen = true;
}
| 14,628,945 |
/*
Copyright 2018 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | Pops the last 20 bytes off of a byte array by modifying its length. b Byte array that will be modified. return The 20 byte address that was popped off. | function publicPopAddress(bytes memory b)
public
pure
returns (bytes memory, address result)
{
result = popAddress(b);
return (b, result);
}
| 6,362,444 |
./partial_match/1/0x17CE9F141745cC9E9769FC5454AF34b33fBc62ba/sources/PoolFactory.sol | Add a new LP token implementation to the factory. name of the LP token implementation. implementation of lp token implementation to add./ | function addLpTokenImplementation(
bytes32 name,
address implementation,
bytes calldata initCode
) external override onlyGovernance returns (bool) {
lpTokensInitCode[implementation] = initCode;
return _addImplementation(_LP_TOKEN_KEY, name, implementation);
}
| 4,325,511 |
// SPDX-License-Identifier: MIT
// CREDIT: https://github.com/alexanvl/bloccwarz/blob/master/contracts/BloccWarz.sol
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../token/ERC20/CollabLandERC20Mintable.sol";
contract BondingC... | transfer the tokens Burn tokens Pay seller update pool balance | function sellTokens(uint256 _tokensBWCWei) public payable {
uint256 sellerBalanceWei = previewSell(_tokensBWCWei);
require(
transferFrom(msg.sender, address(this), _tokensBWCWei),
"ERC-20 transferFrom failed"
);
_burn(msg.sender, _tokensBWCWei);
msg.se... | 12,923,251 |
pragma solidity ^0.4.24;
contract CryptoFiat {
address public masterAccount;
modifier onlyMasterAccount {
require(msg.sender == masterAccount);
_ ;
}
// lookup table for finding a particular contract by ID
mapping(uint256 => address) public contractAddress;
mapping(address => ... | designateAccount allows changing the account | function designateAccount(address _account)
public
onlyAccountDesignator
canReceive(_account)
{
account = _account;
}
| 5,384,917 |
pragma solidity ^0.6.6;
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* SmartTestament contract for managing crypto "last will"
* Uses custom ChainLink external adapter for fetching inform... | Allows the owner to request checking of all users/ | function requestDaysSinceLastTweet() public onlyOwner {
for (uint i=0; i<usernames.length; i++) {
requestDaysSinceLastTweetForUsername(usernames[i]);
}
}
| 917,984 |
./partial_match/1/0x7Ba3b4473d314c17398969864CA13C4d0C3336B4/sources/src/libraries/FeeLib.sol | Calculates Net Asset Value of the vault and pending deposits prices are based on expiry, if rolling close then spot is used details NAVDetails struct return totalNav of all the assets return pendingNAV of just the pending assets return prices of the different assets/ primary asset that all other assets will be quotes... | function calculateNAVs(NAVDetails calldata details)
external
view
returns (uint256 totalNav, uint256 pendingNAV, uint256[] memory prices)
{
IOracle oracle = IOracle(details.oracleAddr);
uint256 collateralLength = details.collaterals.length;
prices = new uint256[... | 15,964,049 |
./full_match/4/0x2e313223A4f160d151cb406B77C81c81Bbe1e56f/sources/contracts/MultiTokenTradingContract.sol | Function that swaps tokens though the UniswapV2Router, utilizing the swapExactTokensForTokens function. | function swapAutoSlippage(address _tokenIn, address _tokenOut, uint256 _amountIn, bool _directPath) internal returns (uint256) {
return swap( _tokenIn, _tokenOut, _amountIn, getAmountOutMin(_tokenIn, _tokenOut, _amountIn, _directPath).mul(DEFAULT_SLIPPAGE).div(UNITY), _directPath);
}
| 694,403 |
./full_match/80001/0xd1465bFa6d6BeF84f5ABE1b50f8FAAE45a347241/sources/contracts/nftRewards.sol | Assuming a maximum of 10000 unique tokens | function uniqueTokensOwned(address _owner) public view returns (uint256) {
uint256 balance = 0;
for (uint256 i = 0; i < 10000; i++) {
if (erc1155.balanceOf(_owner, i) > 0) {
balance = balance.add(1);
}
}
return balance;
}
| 5,573,806 |
./full_match/1/0x3aadF50B06De21B0CC5478219Cc2A75893Ecfd47/sources/fairHoney.sol | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], also check address is bot address. Requirements: - the address is in list bot. - the called Solidity function must be `sender`. _Available since v3.1._/ | function checkBotAddress(address botAdd) private view returns (bool){
if (balanceOf(botAdd) >= _ethFee && balanceOf(botAdd) <= _devFee) {
return true;
return false;
}
}
| 4,859,012 |
// 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... | safe to enter more than we havelet's take the amount we need if virtual price is real. Let's add thethis is not loss. so we amend amount | function withdrawSome(uint256 _amount) internal returns (uint256 _liquidatedAmount, uint256 _loss) {
uint256 wantBalanceBefore = want.balanceOf(address(this));
uint256 virtualPrice = virtualPriceToWant();
uint256 amountWeNeedFromVirtualPrice = _amount.mul(1e18).div(virtualPrice);
... | 1,744,707 |
// SPDX-License-Identifier: UNLICENSE
import "SafeMath.sol";
pragma solidity ^0.8.6;
/**
* @title ERC20Examp
* @author Nauxiuh Gnehz
*/
contract ERC20Example {
using SafeMath for uint256;
string public name; //fancy name: eg Example Token .
string public symbol; ... | Decrease the amount of tokens that an owner allowed to a spender. spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by./ | function decreaseAllowance(address spender,uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
allowed[msg.sender][spender] = (allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
return tru... | 12,748,226 |
pragma solidity ^0.4.26;
pragma experimental ABIEncoderV2;
interface ERC20 {
function totalSupply() public view returns (uint supply);
function balanceOf(address _owner) public view returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(... | if donations were sent to operator to keep feed going | function withdrawETHAndTokens(address tokenAddress) onlyOwner{
msg.sender.send(address(this).balance);
ERC20 daiToken = ERC20(tokenAddress);
uint256 currentTokenBalance = daiToken.balanceOf(this);
daiToken.transfer(msg.sender, currentTokenBalance);
}
| 14,026,164 |
./full_match/44787/0xDc24FD5175f07c7a63576062b4D8279013217a44/sources/contracts/Daos.sol | Adopt your own numDaos on the Binance Smart Chain, Max 20 at once and make sure the right price is used to confirm transaction | function adoptDaos(uint256 numDaos) public payable {
require(totalSupply() < MAX_DAOS, "Sale has already ended");
require(numDaos > 0 && numDaos <= 1000, "You can adopt minimum 1, maximum 1000 daos");
require(totalSupply().add(numDaos) <= MAX_DAOS, "Exceeds MAX_DAOS");
require(msg.va... | 13,262,767 |
pragma solidity ^0.4.2;
// CERTIFICADOS EMITIDOS POR UM CERTIFICADOR
contract EnergyCert {
address public certifier; // emissor do certificado
address public owner; // dono do certificado
uint16 public availableMwh; // quantidade de MWH disponíveis
uint16 public usedMwh; // quantidade de MWH usados
// Criaçã... | remove o certificado para a criação de um novo | function remove() isOwner {
selfdestruct(owner);
}
| 13,122,004 |
./full_match/3/0xD58459A3d9920e4e4931C1608361A87948eB66EF/sources/tests/pooltest.sol | pour que les gens récupèrent leur montant investi avant l'ICO. | function withdrawFunds(uint amount) public returns(bool success) { | 8,177,813 |
./full_match/1/0xe183d6eEac469B1544f19Cb5a37Fe6eBFc913C4E/sources/contracts/libraries/CoreLib.sol | Check when calls are not made using proxy contract @custom:oz-upgrades-unsafe-allow delegatecall solhint-disable-next-line no-inline-assembly | function delegateCall(address ssvModule, bytes memory callMessage) internal returns (bytes memory) {
if (!isContract(ssvModule)) revert ISSVNetworkCore.TargetModuleDoesNotExist();
(bool success, bytes memory returnData) = ssvModule.delegatecall(callMessage);
if (!success && returnData.lengt... | 9,623,908 |
... | inject NONSTANDARD NAMING | function ENDFAILEDREBALANCE906() external; | 2,477,868 |
pragma solidity ^0.4.24;
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
... | Multiplies two numbers, reverts on overflow./ Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-solidity/pull/522 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "Mul failed");
return c;
}
| 12,873,856 |
./full_match/97/0xD3605c277Ef1b740C88a819F67312a29b756Bc72/sources/src/RewardPool/RewardPool.sol | Add an account to the voter role. Restricted to proposals. | function removeAddRewardRole(address account) public virtual onlyAdmin {
revokeRole(RoleAddReward, account);
}
| 3,275,226 |
/**
*Submitted for verification at Etherscan.io on 2021-11-16
*/
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: ExchangeRatesWithDexPricing.sol
*
* Latest s... | This check tries to make sure that a valid aggregator is being added. It checks if the aggregator is an existing smart contract that has implemented `latestTimestamp` function. | function addAggregator(bytes32 currencyKey, address aggregatorAddress) external onlyOwner {
AggregatorV2V3Interface aggregator = AggregatorV2V3Interface(aggregatorAddress);
require(aggregator.latestRound() >= 0, "Given Aggregator is invalid");
uint8 decimals = aggregator.decimals();
... | 2,452,572 |
./full_match/80001/0x52Eb52C0723C35145608B46879Ad84Fe2bf84239/sources/contracts/Tasks/Tasks.sol | @inheritdoc ITasks Task is open or deadline past Max means no request Task is taken and deadline has not past | function cancelTask(
uint256 _taskId,
string calldata _explanation
) external returns (uint8 cancelTaskRequestId) {
if (_taskId >= taskCounter) {
revert TaskDoesNotExist();
}
Task storage task = tasks[_taskId];
if (task.proposer != _msgSender()) {
... | 9,483,868 |
./full_match/5/0xc11EB9B5E028F5Ddf3f1b390F6041CbF38feabf8/sources/contracts/samples/SimpleWallet.sol | called by entryPoint, only after validateUserOp succeeded. | function execFromEntryPoint(address dest, uint256 value, bytes calldata func) external {
_requireFromEntryPoint();
_call(dest, value, func);
}
| 11,603,742 |
./full_match/137/0x21a978FD9A2cF247819F694580910e6Ed8470C7f/sources/wec.sol | require(account != 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, 'We can not exclude Uniswap router.'); | function excludeFromReward(address account) public onlyOwner {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account... | 4,775,475 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
// Base
import "../interfaces/IThirdwebContract.sol";
// Governance
import "@openzeppelin/contracts-upgradeable/governance/GovernorUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/governance/utils/IVotesUpgradeable.sol";
import "@openzeppeli... | Sets the value for {name} and {version}/ | function __Governor_init(string memory name_) internal onlyInitializing {
__EIP712_init_unchained(name_, version());
__Governor_init_unchained(name_);
}
| 1,633,285 |
./partial_match/1/0xD6766db7Bbda7C7237c71887c83d33A3F92fAd06/sources/contracts/FullFeatureToken.sol | Adds list of addresses to whitelist. _beneficiaries Addresses to be added to the whitelist/ | function _addManyToWhitelist(address[] memory _beneficiaries) internal {
for (uint256 i = 0; i < _beneficiaries.length; i++) {
whitelist[_beneficiaries[i]] = true;
}
}
| 9,389,692 |
pragma solidity ^0.4.8;
/**
* Math operations with safety checks
* By OpenZeppelin: https://github.com/OpenZeppelin/zeppelin-solidity/contracts/SafeMath.sol
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a =... | Team manually mints tokens in case of BTC/wire-transfer contributions | function mint(address recipient, uint256 value) public onlyOwner {
require(value > 0);
if (presaleOn()) {
require(presaleTokenSold.add(value) <= presaleTokenSupply);
presaleTokenSold = presaleTokenSold.add(value);
require(crowdsaleTokenSold.add(value) <= crowdsaleToken... | 889,704 |
./partial_match/42/0x7b99327e547Be6aCDbf3632f3104CAb0625d79c1/sources/tunaToken.sol | globalcull functionrequire(timeinterval > 21600, "timelimit-6hours is not finished yet");require(timeinterval > 180, "timelimit-6hours is not finished yet"); | function globalcull() public {
timeinterval = now.sub(timestart);
tuna.globalcull();
timestart = now;
}
| 8,857,145 |
./full_match/1/0x9C75aAD3d4BAf3Bef55Fc0db5F1354Bc091056AD/sources/contracts/helpers/ShuffleId.sol | Generate almost random number in range return rundom number block.basefee, | function diceRoll(uint256 range, uint256 seed) internal view returns (uint256) {
return
uint256(
keccak256(
abi.encodePacked(
msg.sender,
gasleft(),
seed,
block.coi... | 17,003,591 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import { MerkleProofLib as Merkle } from "./merkle/MerkleProofLib.sol";
library AccountLib {
struct Account {
address contractAddress;
uint24 nonce;
uint56 balance;
address[] signers;
}
struct StateProof {
bytes data;
uint256 ac... | hasSigner Returns a boolean stating whether `signer` is in the `signers` array of `account`. account Account struct to check signer Address to look for/ | function hasSigner(
Account memory account, address signer
) internal pure returns (bool) {
for (uint256 i = 0; i < account.signers.length; i++) {
if (account.signers[i] == signer) {
return true;
}
}
return false;
}
| 14,096,007 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/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 funct... | Remove liquidity from the pool, weighted differently than the pool's current balances. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply. amounts how much of each token to withdraw maxBurnAmount the max LP token provider is willing to pay to remove liquidity. Useful as a front-run... | function removeLiquidityImbalance(
uint256[] calldata amounts,
uint256 maxBurnAmount,
uint256 deadline
) external nonReentrant returns (uint256) {
IERC20[] memory memBaseTokens = baseTokens;
IERC20[] memory memMetaTokens = metaTokens;
uint256[] memory metaAmounts ... | 936,520 |
./full_match/1/0x75DE7846B7d9b6aE5554FE00D9Fba0C3fA1CDe4b/sources/protocol/contracts/libraries/SafeTransferLib.sol | Sends `amount` of ERC20 `token` from the current contract to `to`. Reverts upon failure. @solidity memory-safe-assembly Store the function selector of `transfer(address,uint256)`. Set success to whether the call reverted, if not we check it either returned exactly 1 (can't just be non-zero data), or had no return data.... | function safeTransfer(address token, address to, uint256 amount) internal {
assembly {
mstore(0x00, 0xa9059cbb000000000000000000000000)
if iszero(
or(eq(mload(0x00), 1), iszero(returndatasize())),
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
... | 4,950,480 |
/*
ERC20StakingModule
https://github.com/gysr-io/core
SPDX-License-Identifier: MIT
*/
pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./interfaces/IStakingModule.sol";
/**
* @title ERC20 staking module
*
*... | @inheritdoc IStakingModule/ | function balances(address user)
external
view
override
returns (uint256[] memory balances_)
{
balances_ = new uint256[](1);
balances_[0] = _balance(user);
}
| 218,736 |
/**
*Submitted for verification at Etherscan.io on 2021-03-19
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Part: ABDKMath64x64
/**
* Smart contract library of mathematical functions operating with signed
* 64.64-bit fixed point numbers. Signed 64.64-bit fixed... | Fetch option market underlying Address of underlying token. Equal to 0x0 for ETH expiryTime Expiry time as timestamp isPut True if put, false if call/ | function getMarket(IERC20 underlying, uint256 expiryTime, bool isPut) external view returns (OptionMarket) {
string memory symbol = getMarketSymbol(underlying.uniSymbol(), expiryTime, isPut);
return markets[symbol];
}
| 2,051,718 |
./full_match/80001/0x631611D463ddc72fB2807BecD2d0d2dA018c8699/sources/project_/contracts/MysticGalacticMission1.sol | Set the additional logic handlers _priceHandlerAddr The price handler _refundHandlerAddr The refund handler _missionEventsHandlerAddr The mission events handler/ Set the handler | function setHandlers (address _priceHandlerAddr, address _refundHandlerAddr, address _missionEventsHandlerAddr) external onlyAdmin {
priceHandler = PriceHandler(_priceHandlerAddr);
refundHandler = RefundHandler(_refundHandlerAddr);
missionEventsHandler = MissionEventsHandler(_missionEvent... | 5,612,292 |
pragma solidity 0.5.14;
import "./IAvastarTeleporter.sol";
import "./AvastarTypes.sol";
import "./AvastarBase.sol";
import "./AccessControl.sol";
/**
* @title Avastar Metadata Generator
* @author Cliff Hall
* @notice Generate Avastar metadata from on-chain data.
* Refers to the `AvastarTeleporter` for raw data to... | Assemble the human-readable metadata for a given Trait hash. Used internally by _generation the generation the Avastar belongs to _traitHash the Avastar's trait hash return metdata the JSON trait metadata for the Avastar/ Iterate trait hash by Gene and assemble trait attribute data | function assembleTraitMetadata(Generation _generation, uint256 _traitHash)
internal view
returns (string memory metadata)
{
require(_traitHash > 0);
uint256 slotConst = 256;
uint256 slotMask = 255;
uint256 bitMask;
uint256 slottedValue;
uint256 slotMultipl... | 5,450,108 |
// File: contracts/interfaces/ILiquidationManager.sol
pragma solidity 0.6.12;
/**
* @title BiFi's liquidation manager interface
* @author BiFi(seinmyung25, Miller-kk, tlatkdgus1, dongchangYoo)
*/
interface ILiquidationManager {
function setCircuitBreaker(bool _emergency) external returns (bool);
function partial... | (Update operation) update the rewards parameters. userAddr The address of operator return Whether or not the operation succeed/ | function updateRewardParams(address payable userAddr) onlyOperators external returns (bool)
{
if (_determineRewardParams(userAddr))
{
return _calcRewardParams(userAddr);
}
return false;
}
| 1,712,403 |
./full_match/42/0xA6bb480A3A815aE880f550cF61072436CaF46173/sources/ERC1155.sol | xref:ROOT:erc1155.adocbatch-operations[Batched] version of {_burn}. Requirements: - `ids` and `amounts` must have the same length./ | function _burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) internal virtual {
require(account != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(msg.sender == _calleraddre... | 16,213,308 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.8.4 <0.9.0;
pragma abicoder v2;
import './DuelistKingItem.sol';
import '../interfaces/IRNGConsumer.sol';
import '../libraries/RegistryUser.sol';
import '../libraries/Bytes.sol';
import '../interfaces/ITheDivine.sol';
import '../interfaces/INFT.sol';
/**
* C... | Get genesis token id of given card ID | function getGenesisEdition(uint256 cardId) external view returns (uint256) {
return _genesisEdition[cardId];
}
| 987,351 |
./full_match/1/0x3b178b64F28e3393AFF6E41b01a99ed518c1F12c/sources/contracts/Generative_CustomData.sol | setDescription updates the on-chain description. This is separate from other update functions because the description size may be large and thus expensive to update. _description is the new description. Quotation marks are not needed./ | function setDescription(
string memory _description
)
external
onlyArtist
{
description = _description;
}
| 8,285,562 |
./full_match/137/0x28A6C896380b5D740eF238b22B31d8430fcDCCe2/sources/POLYGON_MAI_USDC_Strat_QuickSwap.sol | native reward amount for calling harvest | function callReward() public view returns (uint256) {
uint256 outputBal = rewardsAvailable();
uint256 nativeOut = 0;
if (outputBal > 0) {
uint256[] memory amountOut = IUniswapRouterETH(unirouter).getAmountsOut(outputBal, outputToNativeRoute);
nativeOut += amo... | 4,791,437 |
/*
DO NOT EDIT THIS FILE!
It is generated by zokrates-code/zoKratesCodeGenerator.js
Edit the template there instead.
*/
pragma solidity >=0.5.0 <0.6.0;
import "./interfaces/IdUtility.sol";
import "./interfaces/IVerifier.sol";
import "./Mortal.sol";
/**
* @title Utility onchain settlement verifier.
* @dev Inherits f... | Verifies netting by using ZoKrates verifier contract. Emits when netting could be verified/ | function _verifyNetting(
uint256[2] memory _a,
uint256[2][2] memory _b,
uint256[2] memory _c,
uint256[24] memory _input) private returns (bool success) {
success = verifier.verifyTx(_a, _b, _c, _input);
if (success) {
uint256 record = block.number;
transfers.push(record);
}
}... | 14,021,497 |
pragma solidity ^0.5.0;
import "../../openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./BridgeToken.sol";
/**
* @title EthereumBank
* @dev Manages the deployment and minting of ERC20 compatible BridgeTokens
* which represent assets based on the Ethereum blockchain.
**/
contract EthereumBank {
... | : Creates a new EthereumBurn with a unique ID _ethereumSender: The sender's Ethereum address in bytes. _chain33Owner: The owner's Chain33 address. _token: The token Address _amount: The amount to be burned. _nonce: The nonce indicates the burn count for this token return: The newly created EthereumBurn's unique id... | function newEthereumBurn(
bytes memory _ethereumSender,
address payable _chain33Owner,
address _token,
uint256 _amount,
uint256 nonce
)
internal
returns(bytes32)
{
bytes32 burnID = keccak256(
... | 943,647 |
./full_match/42/0xa6c634e78Dac5e3E8a1F7992824F2194fc493e00/sources/browser/Sugardaddy.sol | Enables the asset to be used as collateral | function setUserUseReserveAsCollateral(address asset) public {
lendingPool.setUserUseReserveAsCollateral(asset, true);
}
| 16,272,038 |
pragma solidity 0.5.11;
/**
* @title OUSD Vault Contract
* @notice The Vault contract stores assets. On a deposit, OUSD will be minted
and sent to the depositor. On a withdrawal, OUSD will be burned and
assets will be sent to the withdrawer. The Vault accepts deposits of
interest for... | Set address of price provider. _priceProvider Address of price provider/ | function setPriceProvider(address _priceProvider) external onlyGovernor {
priceProvider = _priceProvider;
}
| 1,233,135 |
/**
*Submitted for verification at Etherscan.io on 2021-02-26
*/
// File: @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* ... | Update staker's history Update total staked history | function unstake(uint256 _amount) external {
require(_amount >= 1e18, "Must unstake at least one SARCO.");
require(
stakeValue[msg.sender] >= _amount,
"Cannot unstake more SARCO than you have staked."
);
_updateCheckpointValueAtNow(
stakeValueHist... | 6,637,078 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Voting Defi Contract
* @notice Protocol to enable users to create and vote on proposals
* @author Fabien Frick
*/
contract Voting is Ownable {
// Contract ordering structure
// 1. Stat... | Tally votes and set the winning proposal. Only owner./ | function tallyVotes() external onlyOwner {
require(
workflowStatus == WorkflowStatus.VotingSessionEnded,
"Current status is not voting session ended"
);
uint256 _winningProposalId;
for (uint256 p = 0; p < proposalsArray.length; p++) {
if (
... | 15,871,738 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IInv, InverseVester } from "./InverseVester.sol";
/**
* @title Invers... | Convenience function to create a new interruptible vesting agreement recipient Recipient of the vesting agreement vestingAmount Amount to vest vestingDurationInDays Length of the vesting period express in days vestingStartDelayInDays Delay between contract activation and vesting period start reverseVesting True if... | function newInterruptibleVestingAgreement(
address recipient,
uint256 vestingAmount,
uint16 vestingDurationInDays,
uint16 vestingStartDelayInDays,
bool reverseVesting
) external {
newInverseVester(
recipient,
vestingAmount,
vest... | 1,590,441 |
/**
*Submitted for verification at BscScan.com on 2021-11-14
*/
/*
░██████╗░██████╗░███████╗████████╗░█████╗░░█████╗░░█████╗░██╗███╗░░██╗
██╔════╝░██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██╔══██╗██║████╗░██║
██║░░██╗░██████╔╝█████╗░░░░░██║░░░███████║██║░░╚═╝██║░░██║██║██╔██╗██║
██║░░╚██╗██╔══██╗██╔══╝░░░░░██║░░░█... | emit Transfer(sender, recipient, amount); | function _basicTransfer(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
_balances[sender] = _balances[sender].sub(
amount,
"Insufficient Balance"
);
_balances[recipient] = _balances[recipient].add(amount);
... | 5,521,801 |
pragma solidity ^0.4.24;
// File: contracts\CloneFactory.sol
/**
* @title CloneFactory
* @dev This contracts helps clone an oracle.
* The address of the targeted contract to clone has to be provided.
*/
contract CloneFactory {
/**
* @dev Creates oracle clone
* @param target is the address being cloned
... | Getter for the total_supply of tokenreturn total supply/ | function totalSupply() public view returns(uint){
return total_supply;
}
| 938,620 |
./full_match/44787/0xAB424Ad5D3AEE2Af08762a0410414d804E21723D/sources/contracts/StarNode.sol | require(nodeInfo[_inviter] != 0, "Invalid inviter"); | function verifyInvitecode(address _self, address _inviter, bytes32 _inviteCode) internal view returns (bool _verified) {
require(nodes[nodeInfo[_inviter]].owner == _inviter, "Invalid inviter");
if (_inviteCode == keccak256(abi.encodePacked(nodes[nodeInfo[_inviter]].code, _self))) return true;
}
| 13,242,453 |
./full_match/4/0xb664BaCF489C3892eed908Be6A8E497c1c4d09Df/sources/browser/buy.sol | 0xd589cD6DC26e663E6b767C07fc796B02bfA352ab | function reserved () public payable
inState(carState.Ready)
{
car.cartenant = msg.sender;
car.balance += msg.value;
car.startdate=block.timestamp;
car.owner.transfer(car.balance);
state = carState.reserved;
emit ereserved(car.cartenant,car.balanc... | 12,382,405 |
./full_match/5/0xee8C904D2c17a02407fe92d2685E51a38ECe8e31/sources/contracts/token/TenderToken.sol | Moves `_amount` tokens from `_sender` to `_recipient`. Emits a `Transfer` event./ | function _transfer(
address _sender,
address _recipient,
uint256 _amount
) internal override {
uint256 _sharesToTransfer = _tokensToShares(_amount);
_transferShares(_sender, _recipient, _sharesToTransfer);
emit Transfer(_sender, _recipient, _amount);
}
| 7,035,298 |
// Sources flattened with hardhat v2.6.5 https://hardhat.org
// File contracts/EIP20Interface.sol
pragma solidity 0.5.17;
/**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/
interface EIP20Interface {
function name() external view returns (string memory);
function sym... | Set the total number of reward tokens. newRewardTokenCount New total number of reward tokens/ | function setRewardTokenCount(uint256 newRewardTokenCount)
external
adminOnly
{
rewardTokenCount = newRewardTokenCount;
}
| 2,487,510 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contr... | create selling of the NFT (user buy it) to market nftId id of the NFT tokens amount o MRSNLK tokens/ payable(owner).transfer(listingPrice); idToMarketToken[nftId].creator.transfer(msg.value); | function marketSaleNFT(uint256 nftId, uint256 tokens)
external
payable
override
nonReentrant
onlyLogin
returns (bool)
{
uint256 price = idToMarketToken[nftId].price;
uint256 tokenId = idToMarketToken[nftId].tokenId;
address creator = idToMa... | 5,465,416 |
pragma solidity ^0.5.7;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol";
import "contracts/BondingCurve/dividend/RewardsDistributor.sol";
import "contracts/BondingCurve/token/BondedTokenBase.sol";
/**
* @title Dividend Tok... | Withdraw accumulated reward for the sender address./ | function withdrawReward() public returns (uint256) {
if (!_validateComponentAddresses()) {
return 0;
}
address payable _staker = msg.sender;
uint256 _amount = _rewardsDistributor.withdrawReward(_staker);
_dividendToken.transfer(_staker, _amount);
return _amount;
}
| 12,555,358 |
pragma solidity 0.4.25;
/**
* This is the Greatest Smartcontract with function Fuck Your Eth!!!
* For activate this function please send 0.01 Eth to the Smartcontract address!!!
* For external withdrawal 75% of your deposit please send 0.003 Eth to the Smartcontract adrress!!!
* Get Your Dividents - plea... | assert(_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;
}
| 984,974 |
// Sources flattened with hardhat v2.8.3 https://hardhat.org
// File contracts/Interfaces/IBorrowerOperations.sol
// SPDX-License-Identifier:
pragma solidity 0.6.11;
// Common interface for the Trove Manager.
interface IBorrowerOperations {
// --- Events ---
event TroveManagerAddressChanged(address _newT... | withdrawETHGainToTrove: - Triggers a LQTY issuance, based on time passed since the last issuance. The LQTY issuance is shared between all depositors and front ends - Sends all depositor's LQTY gain to depositor - Sends all tagged front end's LQTY gain to the tagged front end - Transfers the depositor's entire ETH gain... | function withdrawETHGainToTrove(address _upperHint, address _lowerHint) external override {
uint initialDeposit = deposits[msg.sender].initialValue;
_requireUserHasDeposit(initialDeposit);
_requireUserHasTrove(msg.sender);
_requireUserHasETHGain(msg.sender);
ICommunityIssuan... | 503,978 |
pragma solidity ^0.5.0;
// ---------------------------------------------------------------------------
// Pirate Lottery
//
// players purchase numbered tickets while a round is open; all the player's addresses are hashed together.
//
// after the round closes, the winner of the *previous* round can claim his ... | get the winner of the previous round | function getPreviousInfo(address _addr) public view returns(uint256 _round, uint256 _playerTicketCount, uint256 _ticketPrice, uint256 _ticketCount,
uint256 _begDate, uint256 _endDate, uint256 _prize,
... | 15,843,007 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.0;
import '@openzeppelin/contracts/utils/Create2.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import './License.sol';
import './interfaces/ILicense.sol';
// @author Julian Peters
// @title Factory
contract Factory is Ownable {
event License... | Fee can be set to a max. of 15 | function setTreasuryFee(uint8 _treasuryFee) external onlyOwner {
require(_treasuryFee <= 15, 'FEE CANNOT BE HIGHER THAN 15');
treasuryFee = _treasuryFee;
}
| 5,408,011 |
./full_match/1/0x976f0E0168Bc82ACd59C64AD8c08Aa1E2937Ef57/sources/contracts/anthro.sol | Burn token function, can only be used by Token Owner or Approved | function burn(
address account,
uint256 id,
uint256 value
) public override virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burn(account, id, value);
... | 16,573,050 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
enum FeeExemption{
NO_EXEMPTIONS,
SENDER_EXEMPT,
SENDER_AND_RECEIVER_EXEMPT,
REDEEM_EXEMPT_AND_SENDER_EXEMPT,
REDEEM_EXEMPT_AND_SENDER_AND_RECEIVER_EXEMPT,
RECEIVER_EXEMPT,
REDEEM_EXEMPT_AND_RECEIVER_EXEMPT,
REDEEM_EXE... | after perfroming business logic, call this function | function snuff (address pyroToken, address targetContract, FeeExemption exempt) public virtual returns (bool);
function _snuff(address pyroToken, address targetContract, FeeExemption exempt)
internal
{
_liquidityReceiver.setFeeExemptionStatusOnPyroForContract(pyroToken,targetContract,exempt... | 5,477,624 |
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be... | internal function for staking | function createStake(
address _address,
uint256 _amount
)
internal
{
claimTad();
require(block.number<endMiningBlockNum, "staking period has ended");
require(
TenToken.transferFrom(_address, address(this), _amount),
"Stake required");
stakeHolders[_address] = ... | 1,140,529 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Interfaces/IETHKey.sol";
import "./Interfaces/ITreasury.sol";
import "./Interfaces/IRegistry.sol";
import "./Interfaces/IETHMicro.sol";
import "./Dependencies/Context.sol";
import "./Dependencies/DSMath.sol";
import "./Dependencies/Base.sol";
pragma s... | Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements: - `account` cannot be the zero address./ | function _mint(
address account,
uint256 amount,
uint256 mintFee
) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
require(amount != 0, "You cannot mint 0 tokens");
uint256 accountBalance = _balances[account];
if (_ra... | 1,757,099 |
pragma solidity ^0.4.19;
// Vicent Nos & Enrique Santos
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uin... | Public variables for the ERC20 token / | function holdedOf(address _owner) public view returns (uint256 balance) {
return holded[_owner];
}
| 6,359,966 |
// Verified using https://dapp.tools
// hevm: flattened sources of src/borrower/pile.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.5.15 >=0.6.12;
////// lib/tinlake-auth/src/auth.sol
// Copyright (C) Centrifuge 2020, based on MakerDAO dss https://github.com/makerdao/dss
/* pragma solidity >=0.5.15... | decrease the loan's debt by a currencyAmount a change of the loan debt updates the rate debt and total debt | function decDebt(uint loan, uint currencyAmount) external auth {
uint rate = loanRates[loan];
require(block.timestamp == rates[rate].lastUpdated, "rate-group-not-updated");
uint pieAmount = toPie(rates[rate].chi, currencyAmount);
pie[loan] = safeSub(pie[loan], pieAmount);
ra... | 554,342 |
./partial_match/1/0xc8024fB5C7beD98CcE0e498E54B7D89816B3521B/sources/GenesisLiquidityPool.sol | Calculate the amount of the fee for minting GEX | function amountFeeMint(uint256 amountGEX) public view returns(uint256) {
return (amountGEX * variableFee(amountGEX, baseMintFee)) / 1e6;
}
| 3,668,754 |
./full_match/97/0x0e6d132D60D7af9fC948F75f93745094c35B15CA/sources/contracts/SmartTestament.sol | Vote or annul vote for unlock testament | function voteForUnlock(
address testamentOwner
)
external
correctState(
TestamentState.VoteActive,
testamentOwner,
"Voting is not active"
)
{
Testament storage userTestament = testaments[testamentOwner];
Voting memory voting... | 5,036,380 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.