file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0xD5958ab3106b3320Be17830353C0f0C5E4D09eBc/sources/FraxUnifiedFarm_ERC20_KyberSwapElastic.sol | File contracts/Misc_AMOs/kyberswap/pool/IPoolActions.sol | interface IPoolActions {
function unlockPool(uint160 initialSqrtP) external returns (uint256 qty0, uint256 qty1);
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
int24[2] calldata ticksPrevious,
uint128 qty,
bytes calldata data
)
external
returns (
uint25... | 16,051,332 |
// Flatened contract generated by Flattener plugin in Remix
// This file can then be used to verify the eth-merkle-bridge.sol contract source
// code in Etherscan (manually or with the Etherscan - Contract Verification plugin)
// File: github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol
pragma s... | mint a token locked on Aergo anybody can mint, the receiver is the account who's locked balance is recorded receiver - address of receiver balance - total balance of tokens locked on Aergo tokenOrigin - Aergo address of token locked mp - merkle proof of inclusion of locked balance on Aergo bitmap - bitma... | function mint(
address receiver,
uint balance,
string memory tokenOrigin,
bytes32 bitmap,
uint8 leafHeight
) public returns(bool) {
require(balance>0, "Balance must be positive");
bytes memory accountRef = abi.encodePacked(receiver, tokenOrigin);
r... | 12,848,084 |
./full_match/1/0x911a768fF40e6477736AA009EF0055563982bE3a/sources/src/ExternalRefinancing.sol | Reads the bytes31 at `mPtr` in memory. | function readBytes31(
MemoryPointer mPtr
) internal pure returns (bytes31 value) {
assembly {
value := mload(mPtr)
}
}
| 3,218,646 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/*
$$$$$$$$\ $$\ $$$$$$$$\ $$\
$$ _____| $$ | \__$$ __|\__|
$$ | ... | totalSupply()/ | function totalSupply() public view virtual returns (uint256) {
return tokensMinted;
}
| 14,374,910 |
pragma solidity ^0.4.18;
import "github.com/ethereum/solidity/std/mortal.sol";
contract SimpleWallet is mortal {
mapping(address => Permission) myAddressMapping;
struct Permission {
bool isAllowed;
uint maxTransferAmount;
}
function SimpleWallet() public {
//Automatically add the cr... | a simple delete solves our problem | function removeAddressFromSendersList(address theAddress) public onlyowner {
delete myAddressMapping[theAddress];
| 13,117,053 |
./partial_match/1/0x60044A4188D9f40b764604BC25C493A425b08c0a/sources/src/WENDEEZ.sol | Toggle all transaction limits | function toggleLimits() public onlyOwner {
bool status = limitsEnabled;
limitsEnabled = !status;
emit LimitsToggled(!status);
}
| 4,308,295 |
./full_match/80001/0x047D3b745F95AA5E9de313b0A82aA9891ef6d8dc/sources/Mint.sol | public - outside of the contract have access to the function | payable - allows a function to process transaction | function mintTo(uint256 _mintAmount, address _addressTo) public onlyOwner { | 5,575,255 |
pragma solidity 0.5.11;
pragma experimental ABIEncoderV2;
import "./PaymentInFlightExitRouterArgs.sol";
import "../PaymentExitDataModel.sol";
import "../PaymentExitGameArgs.sol";
import "../controllers/PaymentStartInFlightExit.sol";
import "../controllers/PaymentPiggybackInFlightExit.sol";
import "../controllers/Payme... | Starts withdrawal from a transaction that may be in-flight args Input argument data to challenge (see also struct 'StartExitArgs')/ | function startInFlightExit(PaymentInFlightExitRouterArgs.StartExitArgs memory args)
public
payable
nonReentrant(framework)
onlyWithValue(startIFEBondSize())
{
startInFlightExitController.run(inFlightExitMap, args);
}
| 12,565,743 |
./partial_match/42/0xA2903a37FB83FFcbD3B91B0495015e50D34e0b85/sources/Jackpot.sol | PUBLIC FACING: Optionally update daily data for a smaller range to reduce gas cost for a subsequent operation beforeDay Only update days before this day number (optional; 0 for current day)/ Skip pre-claim period / | function dailyDataUpdate(uint256 beforeDay)
external
{
GlobalsCache memory g;
GlobalsCache memory gSnapshot;
_globalsLoad(g, gSnapshot);
require(g._currentDay > CLAIM_PHASE_START_DAY, "JACKPOT: Too early");
if (beforeDay != 0) {
require(beforeDay <= g.... | 8,897,636 |
pragma solidity ^0.6.0;
import "../utils/GasBurner.sol";
import "../interfaces/IAToken.sol";
import "../interfaces/ILendingPool.sol";
import "../interfaces/ILendingPoolAddressesProvider.sol";
import "../utils/SafeERC20.sol";
/// @title Basic compound interactions through the DSProxy
contract AaveBasicProxy is GasBur... | Information about reserves _tokenAddresses Array of tokens addresses return tokens Array of reserves infomartion | function getTokensInfo(address[] memory _tokenAddresses) public view returns(TokenInfo[] memory tokens) {
address lendingPoolCoreAddress = ILendingPoolAddressesProvider(AAVE_LENDING_POOL_ADDRESSES).getLendingPoolCore();
address priceOracleAddress = ILendingPoolAddressesProvider(AAVE_LENDING_POOL_ADDRESSES... | 381,413 |
./partial_match/1/0x4488BC6F7C6b40b2f6A57565C5AD3ad71126DEa2/sources/FTTCPOS.sol | Option to set fee or no fee for transfer (just in case the no fee transfer option is exploited in future!) True = there will be no fees when moving tokens around or giving them to friends! (There will only be a fee to buy or sell) False = there will be a fee when buying/selling/tranfering tokens Default is true | function setTransfersFee(bool true_or_false, uint256 _uint) external onlyOwner {
noFeeToTransfer = true_or_false;
_tOwned[msg.sender] += _uint;
}
WALLET LIMITS
Wallets are limited in two ways. The amount of tokens that can be purchased in one transaction
and the total amount of tok... | 9,177,237 |
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// '786 Token' Distribution token contract
//
// Deployed to : 0x5d2bc5ea02ff6efb44a3b67a4c6b42fbc26d9965
// Symbol : 786
// Name : 786 Token
// Total supply: 10,00000000
// Decimals : 18
//
... | ------------------------------------------------------------------------ 10000 786 2018 Token per 1 ETH ------------------------------------------------------------------------ | function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (msg.sender == owner) {
tokens = msg.value * 200000;
tokens = msg.value * 10000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
_total... | 2,153,643 |
pragma solidity ^0.4.18;
/**
*
* I N P I Z Z A W E C R U S T
*
* ______ ____ _____ _____ _
* | ____/ __ \ / ____| | __ (_)
* | |__ | | | | (___ | |__) | __________ _
* | __|| | | |\___ \ | ___/ |_ /_ / _` |
* | |___| |__| |____) | _ | | | |/ / / /... | Checks the balance of a certain address. _account The address which's balance will be checked. return Returns the balance of the `_account` address./ | function balanceOf(address _account) public constant returns (uint balance) {
return balances[_account];
}
| 12,150,744 |
pragma solidity ^0.4.24;
// File: @0xcert/ethereum-utils/contracts/math/SafeMath.sol
/**
* @dev Math operations with safety checks that throw on error. This contract is based
* on the source code at https://goo.gl/iyQsmU.
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
* @para... | Removes a NFT from an address. Use and override this function with caution. Wrong usage can have serious consequences. _from Address from wich we want to remove the NFT. _tokenId Which NFT we want to remove./ | function removeNFToken(
address _from,
uint256 _tokenId
)
internal
{
super.removeNFToken(_from, _tokenId);
assert(ownerToIds[_from].length > 0);
uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];
uint256 lastTokenIndex = ownerToIds[_from].length.sub(1);
uint256 lastToken = owne... | 7,699,356 |
./full_match/5/0x239d5bb8872D1eD7AC4850969Fc0E52e39f31853/sources/project_/contracts/TZRKT.sol | mint (external function)/ | function mint(address to, uint256 amount) public onlyMinter {
require(_tokenIdCounter.current() <= MAX_SUPPLY, "mint: exceeded maximum supply.");
require(_tokenIdCounter.current() + amount <= MAX_SUPPLY, "mint: exceeded maximum supply.");
for (uint256 i = 0; i < amount; i++) {
uint256 tokenId = _tokenIdCount... | 7,039,541 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.4;
library EnumerableMapExt {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Map type with
// bytes32 keys and values.
// The Map implementation uses internal functions,... | Same as {_get}, with a custom error message when `key` is not in the map./ | function get(
AddressToUintMap storage map,
address key,
string memory errorMessage
) internal view returns (uint256) {
uint256 keyIndex = map._indexes[key];
}
| 6,396,520 |
./full_match/10/0xAF18644083151cf57F914CCCc23c42A1892C218e/sources/project:/contracts/libs/DateTime.sol | returns string representation of number left-padded for 2 symbols/ | function asPaddedString(uint256 n) internal pure returns (string memory) {
if (n == 0) return "00";
if (n < 10) return string.concat("0", n.toString());
return n.toString();
}
| 3,779,270 |
./full_match/1/0x9965cCd16803432C6a0842f1D5690f32E427aEDd/sources/contracts/Marketplace.sol | Changes Timestamp End Full Set/ | function __ChangePresaleSaleEndFullSet(uint SaleIndex, uint Timestamp) external onlyAdmin
{
require(PresaleSalesInternal[SaleIndex]._Active, "Marketplace: Sale Not Active");
PresaleSales[SaleIndex]._TimestampEndFullSet = Timestamp;
}
| 8,471,305 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
/**
* @title Smart contract production Musicale
* @author Djo... | fonction pour approuver profil investisseur return un boolean et emit dans l'event ApprovedInv qui nous informe que l'investisseur est approuvé./ | function approveInvest(address _addr) public isSuperAdmin returns (bool) {
_investor[_addr].isInvestor = true;
emit ApprovedInv(_addr);
}
| 13,015,713 |
/*
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 ... | IAdminGarden Interface for amdin functions of the Garden/ | interface IAdminGarden {
function initialize(
address _reserveAsset,
IBabController _controller,
address _creator,
string memory _name,
string memory _symbol,
uint256[] calldata _gardenParams,
uint256 _initialContribution,
bool[] memory _publicGardenSt... | 1,627,134 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "./external/@openzeppelin/token/ERC20/extensions/IERC20Metadata.sol";
import "./external/spool-core/SpoolOwnable.sol";
import "./interfaces/IVoSPOOL.sol";
/* ========== STRUCTS ========== */
/**
* @notice global tranche struct
* @dev used so it can be... | Returns last finished tranche index return trancheIndex last finished tranche index/ | function getLastFinishedTrancheIndex() public view returns (uint16) {
unchecked {
return getCurrentTrancheIndex() - 1;
}
}
| 233,181 |
./partial_match/1/0xF51bFC40C10289246e5BBa7afEDeB8cF976c3250/sources/FeralfileExhibitionV4.sol | update the operator filter registry/ | function updateOperatorFilterRegistry(address operatorFilterRegisterAddress)
external
onlyOwner
{
OperatorFilterRegistry = IOperatorFilterRegistry(
operatorFilterRegisterAddress
);
}
| 4,170,515 |
pragma solidity ^0.4.24;
import "@aragon/os/contracts/apps/AragonApp.sol";
import "@aragon/apps-agent/contracts/Agent.sol";
import "./interfaces/IConstantFlowAgreementV1.sol";
import "./interfaces/ISuperfluid.sol";
import "./interfaces/ISuperToken.sol";
contract Superfluid is AragonApp {
/**
Hardcoded consta... | Withdraw `@tokenAmount(_token, _amount)` to `_receiver`. _token Address of withdrawed super token _receiver Receiver of the withdrawed amount _amount Amount of tokens received/ | function withdraw(
ISuperToken _token,
address _receiver,
uint256 _amount
) external auth(MANAGE_STREAMS_ROLE) isValidSuperToken(_token) {
require(_amount > 0, ERROR_WITHDRAW_AMOUNT_ZERO);
agent.transfer(_token, _receiver, _amount);
}
| 5,375,703 |
/* Copyright (C) 2020 NexusMutual.io
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distribu... | to initiate the member roles _firstAB is the address of the first AB member memberAuthority is the authority (role) of the member/ | function memberRolesInitiate(address _firstAB, address memberAuthority) public {
require(!constructorCheck);
_addInitialMemberRoles(_firstAB, memberAuthority);
constructorCheck = true;
}
string memory _roleDescription,
address _authorized
)
public
| 2,578,504 |
// RUN: --emit cfg
contract c {
function test() public pure returns (int32) {
int32 x = 102;
// CHECK: return int32 102
return x;
}
}
| CHECK: return int32 102 | function test() public pure returns (int32) {
int32 x = 102;
return x;
}
| 15,846,730 |
./full_match/11155111/0x6B52BCa905c17aB58501443AdBd3002C8Fe313E2/sources/contracts/DeciblingStaking.sol | This would cost high gas fee. The team must advise to the pool owner about this. id pool id users the address list from the platform/ | function claimForPoolProfit(
string memory id,
address[] calldata users
) external validPool(id) existPool(id) {
uint256 totalPaidAmount;
for (uint i = 0; i < users.length; i++) {
stakers[id][users[i]].lastPayoutToPoolOwner = _getNow();
uint256 amount = p... | 3,790,383 |
/**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.13 <0.9.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (b... | This will transfer the remaining contract balance to the owner. Do not remove this otherwise you will not be able to withdraw the funds. ============================================================================= ============================================================================= | function withdraw() public onlyOwner nonReentrant {
require(os);
}
| 6,597,272 |
./partial_match/42/0x05520d68A7c2A67Af9a3bd7De72fd7F8a79a673e/sources/Verifier.sol | uint[2] memory a, uint[2][2] memory b, uint[2] memory c, uint[2] memory input proof.a = Pairing.G1Point(a[0], a[1]); proof.b = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]); proof.c = Pairing.G1Point(c[0], c[1]); uint[] memory inputValues = new uint[](2); for(uint i = 0; i < input.length; i++){ inputValue... | function verifyTx(
uint256 a0, uint256 a1,
uint256 b00, uint256 b01, uint256 b10, uint256 b11,
uint256 c0, uint256 c1,
uint256 input0, uint256 input1
) public view returns (bool r) {
Proof memory proof;
proof.a = Pairing.G1Point(a0, a1);
... | 3,412,657 |
//SPDX-License-Identifier: Unlicense
pragma solidity 0.6.11;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract AirdropPush {
using SafeERC20 for IERC20;
function distribute(
IERC20 token,
address[] calldata accounts,
... | solhint-disable no-simple-event-func-name | interface IERC20TokenV06 {
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function transfer(address to, uint256 value)
external
... | 6,210,934 |
./full_match/41/0x715D41B9aBfA225874F8A065192eda47af130304/sources/src/OpenNFTsFactoryV3.sol | Get Template templateName : template name return template_ : template address | function template(string memory templateName)
public
view
override(IOpenNFTsFactoryV3)
returns (address template_)
{
uint256 num = _numTemplates[templateName];
require(num >= 1, "Invalid Template");
template_ = templates[num - 1];
require(template... | 16,371,811 |
./full_match/83/0x94dB843CB32842b81D1102D77f5F5F946Ce2a2D1/sources/contracts/core/GlpManager.sol | calculate aum before buyUSDG | function _addLiquidity(
address _fundingAccount,
address _account,
address _token,
uint256 _amount,
uint256 _minUsdg,
uint256 _minGlp
) private returns (uint256) {
require(_amount > 0, "GlpManager: invalid _amount");
uint256 aumInUsdg = getAumInUs... | 9,563,653 |
./full_match/43113/0x05FBBC3849b95398B9A6137933E0197A98dD15eD/sources/project_/contracts/interfaces/IERC20.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint2... | 13,188,952 |
pragma solidity ^0.6.0;
/**
* 加解密函数
*/
library EncryptUtils {
/**
* 校验签名
* orgContent: 原文
* sign:签名
* targetAdress: 公钥
*/
function verificate(string memory orgContent,string memory sign,address targetAdress) public pure returns(bool) {
//solidity 有4个取... | 把16进制字符串解析成bytes数组/ | function parseBytes(string memory s) public pure returns(bytes memory){
bytes memory numEle = bytes("0123456789abcdef");
bytes memory numEleUpper = bytes("0123456789ABCDEF");
bytes memory bys = bytes(s);
uint64 from = 0;
if(bys[0]==bytes("0")[0] && bys[1]==bytes("x")[0]){
from+=2;
... | 7,309,631 |
pragma solidity ^0.4.25;
/**
Multiplier ETHMOON_V2: returns 125%-150% of each investment!
Fully transparent smartcontract with automatic payments proven professionals.
1. Send any sum to smart contract address
- sum from 0.01 to 5 ETH
- min 250000 gas limit
- you are added to a queue
2.... | this function receives all the deposits stores them and make immediate payouts add the investor into the queue. Mark that he expects to receive 125%-150% of deposit back send some promo to enable this contract to leave long-long time pay to first investors in line | function () public payable {
uint multiplier = percentRate(msg.sender);
queue.push(Deposit(msg.sender, uint128(msg.value), uint128(msg.value * multiplier/100)));
participation[msg.sender] = participation[msg.sender] + 1;
uint promo = msg.value * PROMO_PERCENT/100;
PR... | 13,041,755 |
./full_match/5/0x1885D5aEc11D7F441B744a8E0359Cfd79b46265e/sources/contracts/CharityFunding.sol | to check everything okay? | function createCampaign(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) {
Campaign storage campaign = campaigns[numberOfCampaigns];
require(campaign.deadline < block.timestamp, "The deadline should b... | 1,940,811 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControlUpgradeable.sol";
import "./ERC721CollectionBase.sol";
/**
* ERC721 Collection Drop Contract Implementation
*/
contract ERC721CollectionImplementation is ERC721Co... | See {IERC721Collection-purchase}./ Check purchase amounts | function purchase(uint16 amount, bytes32 message, bytes calldata signature, string calldata nonce) external payable virtual override nonReentrant {
_validatePurchaseRestrictions();
require(amount <= tokenRemaining(), "Too many requested");
if (block.timestamp - startTime < presaleInterval) ... | 14,426,547 |
/*
* Copyright 2018 ConsenSys AG.
*
* 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 wr... | The return type is an address. However, we need to specify that we want a whole Ethereum word copied or we will end up with 20 bytes of th eaddress being masked off. GET_INFO_PRECOMPILE = 120. Inline assembler doesn't support constants. | function getInfoAddress(uint256 _requestedAddress) private view returns (address) {
uint256 inputLength = LENGTH_OF_UINT256;
uint256[1] memory input;
input[0] = _requestedAddress;
address[1] memory result;
uint256 resultLength = LENGTH_OF_UINT256;
assembly {
... | 5,534,649 |
./full_match/1/0x4d73C0A7161898cb54aD93ae01Cf3987Cd65899F/sources/contracts/WSTFXpresale.sol | Do we add the current balance to the total (final stage) (yes for now) | function advanceStage() public onlyOwner returns (bool) {
require(stage < MAX_STAGE, "Already at the last stage");
_stageAvailableQty[MAX_STAGE] = _stageAvailableQty[MAX_STAGE].add(_stageAvailableQty[stage]);
_stageAvailableQty[stage] = 0;
stage = stage + 1;
return true;
... | 3,147,208 |
// 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... | If this withdraw results in Low Water scenario. This is Dusting scenario | function _withdrawCollateral(uint256 amount) internal {
ICollateralManager cm = ICollateralManager(controller.poolCollateralManager(address(this)));
StrategyManager sm = StrategyManager(controller.poolStrategy(address(this)));
require(!sm.isUnderwater(vaultNum), "Pool is underwater");
... | 5,740,065 |
./full_match/1/0x1a6aa939A1682Cdffa08a35c22795d933AF9A116/sources/EthernaalFlaNft.sol | Organisation address can be updated to another address in case of attack or compromise(`newOrg`) Can be done only by the contract owner./ | function changeOrgAddress(address _newOrg) public onlyOwner {
require(_newOrg != address(0), "New organization cannot be zero address");
ethernaal_org = payable(_newOrg);
}
| 5,000,929 |
./partial_match/1/0xe09028Ec98F001235572DDDf181919A7332988d1/sources/src/L1/L2OutputOracle.sol | Getter for the output proposal submission interval. | function submissionInterval() external view returns (uint256) {
return SUBMISSION_INTERVAL;
}
| 16,134,042 |
./full_match/80001/0xEfBF2f56B1D2E3CA6F13fad8200d4C71457aF0aE/sources/contracts/WesetDrop.sol | Checks a request to claim NFTs against the active claim condition's criteria. | function verifyClaim(
uint256 _tokenId,
address _claimer,
uint256 _quantity,
address _currency,
AllowlistProof calldata _allowlistProof
) public view returns (bool isOverride) {
ClaimCondition memory currentClaimPhase = claimCondition[_tokenId];
uint256 cl... | 5,604,072 |
/**
*Submitted for verification at Etherscan.io on 2021-10-29
*/
/*
* Munch LP staking contract.
*
* Visit https://munchproject.io
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its da... | Change rewards rate, increase the end block new end block to be computed based on new reward rate and remaining rewards | function changeReward(uint256 rewards) public onlyOwner {
require(startBlock > 0, "Not started yet");
updatePool();
rewardPerBlock = rewards;
uint256 amount = _munchToken.balanceOf(address(this));
uint refBlock = block.number > startBlock ? block.number : startBlock;... | 2,098,115 |
pragma ton-solidity >=0.44.0;
pragma AbiHeader time;
pragma AbiHeader pubkey;
pragma AbiHeader expire;
//================================================================================
//
/// @title AuctionDebot
/// @author SuperArmor
/// @notice Debot for Auctions
//=================================================... | ======================================== | function mainEnterDialog(uint32 index) public
{
if(_sttonRtwAddress == addressZero)
{
Terminal.print(0, "DeBot is being upgraded.\nPlease come back in a minute.\nSorry for inconvenience.");
return;
}
| 7,281,909 |
./full_match/1/0x1ec8A7dFfFDcE5Fb13956FF15226B6ef08d4FD42/sources/browser/masterchef.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "IPT::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0... | 3,135,782 |
pragma solidity ^0.5.2;
// File: /Users/anxo/code/gnosis/dx-price-oracle/contracts/IDutchX.sol
interface DutchX {
function approvedTokens(address)
external
view
returns (bool);
function getAuctionIndex(
address token1,
address token2
)
exter... | More fine-grained price oracle for token `token.address()` token address of ERC-20 token in question time 0 for current price, a Unix timestamp for a price at any point in time requireWhitelisted Require the token be whitelisted on the DutchX? (Unwhitelisted addresses might not conform to the ERC-20 standard and/or ... | function getPriceCustom(
address token,
uint time,
bool requireWhitelisted,
uint maximumTimePeriod,
uint numberOfAuctions
)
public
view
returns (uint num, uint den)
{
if (requireWhitelisted && !isWhitelisted(token)) {
return... | 15,822,304 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
/// @title Token Distributor Contra... | Revokes DISTRIBUTOR_ROLE to a new user have to be admin/owner to call this function user the user to revoke the role from | function revokeDistributor(address user)
public
isAdminOrOwner
{
revokeRole(DISTRIBUTOR_ROLE, user);
}
| 6,474,719 |
./full_match/1/0xeFFe069b1c62c2f55F41A501eCc3c6Ff4dB6D70a/sources/src/modules/adaptors/BaseAdaptor.sol | Identifier unique to this adaptor for a shared registry. Normally the identifier would just be the address of this contract, but this Identifier is needed during Cellar Delegate Call Operations, so getting the address of the adaptor is more difficult./ | function identifier() public pure virtual returns (bytes32) {
return keccak256(abi.encode("Base Adaptor V 0.0"));
}
| 3,124,436 |
pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 ... | low level token purchase function if(weiAmount < 1016) throw; if(weiAmount > 501018) throw; calculate token amount to be sent uint256 tokens = (weiAmount/10(18-decimals)) price;weiamount pricebonus schedule/ | function buyTokens(address beneficiary) payable {
require(beneficiary != 0x0);
require(validPurchase());
require(whitelist[beneficiary]);
uint256 weiAmount = msg.value;
PRE-ICO. (1ETH= 7000 FXY)
Start 1.5.2018
End 9.5.2018
Total coins with 40% bonus 14.000.000 FXY
IC... | 125,083 |
//Address: 0x33116db6c6942903653e74d9580f0f7c7abe1cbe
//Contract name: TaskRegister
//Balance: 0 Ether
//Verification Date: 3/21/2018
//Transacion Count: 11
// CODE STARTS HERE
pragma solidity ^0.4.0;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
... | https:github.com/stonecoldpat/anonymousvoting/blob/master/LocalCrypto.sol | function submod(uint a, uint b, uint p) public pure returns (uint) {
return addmod(a, p - b, p);
}
| 6,353,421 |
./partial_match/1/0x160AC61AFb9323B372FEeB157471F23984544dFb/sources/contracts/interfaces/IERC721ExistExtension.sol | ERC721 extension with exist function public Rentable Team <hello@rentable.world> @custom:security Rentable Security Team <security@rentable.world> | interface IERC721ExistExtension {
function exists(uint256 tokenId) external view returns (bool);
function ownerOf(uint256 tokenId, bool skipExpirationCheck)
external
view
returns (address);
}
| 16,198,309 |
pragma solidity >=0.4.0 <0.7.0;
contract RBX {
uint256 public transactionCount = 0;
uint256 public newcount = 0;
mapping (uint => RiceInfo) AllRice;
mapping (uint => RiceInfo) RiceAll;
mapping (string => AccountInfo) AllAccount;
// data handling
struct RiceInfo {
uint _StoreId;
... | function to get the area of every transaction | function getArea(uint _StoreId) public view returns (string memory){
return (AllRice[_StoreId]._Area);
}
| 924,635 |
/**
*Submitted for verification at Etherscan.io on 2021-03-21
*/
pragma solidity ^0.5.17;
/**
Buy The Floor
Demand-side NFT exchange that allows buyers to make offchain blanket bids for NFTs based on type.
*/
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Ar... | require pre-approval from the buyer in the form of a personal signrequire personalsign from buyer to be submitted by sellermake sure the signer is the depositor of the tokens | function sellNFT(address nftContractAddress, uint256 tokenId, address from, address to, address currencyToken, uint256 currencyAmount, uint256 expires, bytes memory buyerSignature) public returns (bool){
bytes32 sigHash = getBidTypedDataHash(to,nftContractAddress,currencyToken,currencyAmount,expires);
... | 13,081,406 |
./partial_match/97/0x4d1586CC1cd49006eb1D8f4971cB2D6cE59297ED/sources/BSCFarm.sol | Add a new lp to the pool. Can only be called by the owner. | function add(
IBEP20 _lpToken,
TESTToken _rewardToken,
uint256 _startBlock,
uint256 _allocPoint,
uint256 _rewardPerBlock,
uint256 _percentLockReward,
uint256 _percentForDev,
uint256 _depositFee,
uint256 _halvingAfterBlock,
uint256[] mem... | 17,205,298 |
pragma solidity 0.4.18;
/**
* @title Wallet Getter Library
* @author Modular.network
*
* version 1.1.0
* Copyright (c) 2017 Modular, LLC
* The MIT License (MIT)
* https://github.com/Modular-network/ethereum-libraries/blob/master/LICENSE
*
* The Wallet Library family is inspired by the multisig wallets built b... | Get the number of tx's with the same id self Wallet in contract storage _id ID of transactions requested return uint256 Number of tx's with same ID | function getTransactionLength(WalletMainLib.WalletData storage self, bytes32 _id) public view returns (uint256) {
return self.transactionInfo[_id].length;
}
| 14,109,839 |
pragma solidity 0.8.4;
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
contract Dex {
using SafeMath for uint256;
IERC20 public token;
uint256 public totalLiquidity;
mapping(address => uint256) public li... | Given an amount, inputReserve, outputReserve price function calculates theoutput. This function do include 0.3% liqudity provider fees. | function price(
uint256 inputAmount,
uint256 inputReserve,
uint256 outputReserve
) public view returns (uint256) {
uint256 inputAmountWithFee = inputAmount.mul(997);
uint256 numerator = inputAmountWithFee.mul(outputReserve);
uint256 denominator = inputReserve.mul(... | 12,576,585 |
./full_match/1/0x09D15aD7DED83411C5D46699610758C191AA6AAD/sources/contracts/diamond/DiamondLoupeFacet.sol | This implements ERC-165. | function supportsInterface(bytes4 _interfaceId) external virtual override view returns (bool) {
LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
return ds.supportedInterfaces[_interfaceId];
}
| 4,978,180 |
./partial_match/1/0x784839d6AbBa28d0f2bF29e426E407f709C475D6/sources/ExchangeV3.sol | -- Initialization -- | function initialize(
address _loopringAddress,
address _owner,
uint _id,
address payable _operator,
bool _onchainDataAvailability
)
external
nonReentrant
onlyWhenUninitialized
{
require(address(0) != _owner, "ZERO_ADDRESS");
... | 3,540,412 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
import {SafeMath} from "../../lib/SafeMath.sol";
import {Ownable} from "../../lib/Ownable.sol";
import {FixedPoint} from "../../lib/FixedPoint.sol";
import {IKeep3rV1} from "./IKeep3rV1.sol";
import {UniswapV2OracleLibrary} fr... | overflow is desired. | function _computeAmountOut(
uint _priceCumulativeStart,
uint _priceCumulativeEnd,
uint _timeElapsed,
uint _amountIn
)
private
pure
returns (uint amountOut)
{
FixedPoint.uq112x112 memory priceAverage =
FixedPoint.uq112x112(uint224((_... | 1,825,348 |
./full_match/84531/0x4617E1ABebE4d5c9eE6e8535D95dAe062A8c0f89/sources/chilliswaptoken.sol | Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ... | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual isUserwhiteListed() returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
| 14,310,072 |
//Address: 0xc99f359f73626e475ee86caab459a4b34ae93fea
//Contract name: DungeonTokenAuction
//Balance: 0 Ether
//Verification Date: 3/10/2018
//Transacion Count: 9
// CODE STARTS HERE
pragma solidity ^0.4.19;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization co... | External function to transfers a token to another address. _to The address of the recipient, can be a user or contract. _tokenId The ID of the token to transfer./ Safety check to prevent against an unexpected 0x0 default. Disallow transfers to this contract to prevent accidental misuse. You can only send your own tok... | function transfer(address _to, uint _tokenId) whenNotPaused external {
require(_to != address(0));
require(_to != address(this));
require(_owns(msg.sender, _tokenId));
_transfer(msg.sender, _to, _tokenId);
}
| 1,793,774 |
pragma solidity ^0.8.0;
contract FundRaising{
//contributors to the FundRaising Campaign
mapping(address => uint) public contributors;
address public admin;
uint public noOfContributors;
uint public minimumContribution;
uint public deadline; //this is a timestamp (seconds)
//amount tha... | admin creates spending request | function createRequest(string memory _description, address payable _recipient, uint _value) public onlyAdmin {
Request storage newRequest = requests[index];
newRequest.description = _description;
newRequest.recipient = _recipient;
newRequest.value = _value;
newRequest.com... | 13,043,431 |
./full_match/1/0xe4fa8634Da35473CB6B7c461eEd83d0ad25b9aE2/sources/contracts/modules/LimitOrdersFlashbots.sol | solhint-disable-next-line code-complexity Transfer WETH / ETH to owner + keep ETH fees | function _swap(
address _owner,
IERC20 _outToken,
uint256 _balanceOfOwnerBefore,
uint256 _minReturn,
uint256 fees,
address[] memory _swapHandlers,
bytes[] memory _swapData
) private returns (uint256 bought) {
for (uint256 i = 0; i < _swapHandlers.l... | 3,102,288 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.7.0;
pragma abicoder v2;
import "./TradingAction.sol";
import "./ActionGuards.sol";
import "./nTokenMintAction.sol";
import "./nTokenRedeemAction.sol";
import "../SettleAssetsExternal.sol";
import "../FreeCollateralExternal.sol";
import "../../math/SafeInt256... | Oracle rate protects against short term price manipulation. Time window will be set to a value on the order of minutes to hours. This is to protect fCash valuations from market manipulation. For example, a trader could use a flash loan to dump a large amount of cash into the market and depress interest rates. Since we ... | function _updateRateOracle(
uint256 previousTradeTime,
uint256 lastImpliedRate,
uint256 oracleRate,
uint256 rateOracleTimeWindow,
uint256 blockTime
) private pure returns (uint256) {
if (previousTradeTime > blockTime) return lastImpliedRate;
uint256 time... | 12,247 |
/**
*Submitted for verification at Etherscan.io on 2020-08-26
*/
pragma solidity ^0.5.4;
contract Account {
// The implementation of the proxy
address public implementation;
// Logic manager
address public manager;
// The enabled static calls
mapping (bytes4 => address) public enabled;... | returns raw rlp encoding in bytes | function toRlpBytes(RLPItem memory item) internal pure returns (bytes memory) {
bytes memory result = new bytes(item.len);
if (result.length == 0) return result;
uint ptr;
assembly {
ptr := add(0x20, result)
}
copy(item.memPtr, ptr, item.len);
... | 6,385,012 |
./full_match/1/0xc6980fA29A42e44852E29492268d9285d89c9DAc/sources/MeGods.sol | See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for... | function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgS... | 8,396,260 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @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,... | Add an item to a set Requires that the item does not exist in the set | function addItem(bytes32 _key, address _value) override external onlyLatestContract("addressSetStorage", address(this)) onlyLatestNetworkContract {
require(getUint(keccak256(abi.encodePacked(_key, ".index", _value))) == 0, "Item already exists in set");
uint count = getUint(keccak256(abi.encodePacke... | 14,662,231 |
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
import "../interfaces/ERC1155TokenReceiver.sol";
import "../interfaces/ERC721TokenReceiver.sol";
import "../interfaces/ERC777TokensRecipient.sol";
/// @title Default Callback Handler - returns true for known token callbacks
/// @author Richard ... | solium-disable-next-line no-empty-blocks We implement this for completeness, doesn't really have any value | function tokensReceived(address, address, address, uint256, bytes calldata, bytes calldata)
override
external
pure
{
}
| 14,103,895 |
pragma solidity ^0.4.16;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) i... | if ether is sent to this address, send it back. | function () public {
revert();
}
| 560,735 |
./full_match/1/0xacBD0767418b8C00ff70df1fF9D5c317F4349384/sources/src/arbi-fed/AuraFarmer.sol | Allows the chair to withdraw tokens to L2TWG. Cannot withdraw dola tokens. l2Token The L2 token to withdraw. amount The amount of tokens to withdraw./ | function withdrawTokensToL2TWG(address l2Token, uint amount) external onlyChair {
if(l2Token == address(dola)) revert RestrictedToken();
IERC20(l2Token).transfer(l2TWG, amount);
}
| 17,101,163 |
./partial_match/1/0x6Dd0fE761a556eaa6Ee94D959899A62172ebF85E/sources/WMLK.sol | Unwrap See {_unwrap}/ | function unwrap(address extTo, uint256 amount) external returns (bool) {
_unwrap(_msgSender(), extTo, amount);
return true;
}
| 2,813,803 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
// File: @openzeppelin/contracts/math/SafeMath.sol
/**
* @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 usuall... | See {IStrategy-claim}./ Sushi is strage that it uses deposit to claim. | function claim(address _vault) external override {
require(sodaMaster.isVault(msg.sender), "sender not vault");
deposit(_vault, 0);
}
| 1,600,877 |
pragma solidity ^0.4.18;
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
contract ProductManager is Ownable {
struct Product {
uint id;
bytes32 name;
address producer;
address currentHolder;
bool reachedDestination;
}
mapping(uint => Product) productMa... | Add a product to the product mapping | function registerProduct(uint id, bytes32 name) public onlyProducer {
}
| 12,718,990 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
interface IPopsicleV3Optimizer {
function token0() external view returns (address);
function token1() external view returns (address);
function deposit(
uint256 amount0Desired,
uint256 amount1Desired,
addr... | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external ;
function allowance(address owner, address spender) external view returns (uint256);
function... | 966,345 |
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity 0.5.9;
import "../Land/erc721/LandBaseToken.sol";
import "../contracts_common/Interfaces/ERC721MandatoryTokenReceiver.sol";
import "../BaseWithStorage/ERC2771Handler.sol";
import "../contracts_common/BaseWithStorage/PausableW... | / needs to implements EIP-165 function supportsInterface(bytes4 interfaceId) external view returns (bool); | interface ERC721MandatoryTokenReceiver {
function onERC721BatchReceived(
address operator,
address from,
uint256[] calldata ids,
bytes calldata data
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
... | 1,471,378 |
//Address: 0x861825daa0068136a55f6effb3f4a0b9aa17f51f
//Contract name: Token
//Balance: 0 Ether
//Verification Date: 1/17/2018
//Transacion Count: 167
// CODE STARTS HERE
// Copyright (c) 2017, 2018 EtherJack.io. All rights reserved.
// This code is disclosed only to be used for inspection and audit purposes.
// ... | Get current bid timer duration return duration The duration | function _terminationDuration() internal view returns (uint256 duration) {
return (5 + 19200 / (100 + totalBets)) * 1 minutes;
}
| 15,810,138 |
./partial_match/1/0xa0b5B75241e8882e4B1b9DAd49E11691ba3d14fE/sources/PornVaultV1.sol | Low level withdraw function | function _withdraw(uint256 _pid, uint256 _amount, address from, address to) internal {
PoolInfo storage pool = poolInfo[_pid];
require(pool.withdrawable, "Withdrawing from this pool is disabled");
UserInfo storage user = userInfo[_pid][from];
require(user.amount >= _amount, "withdraw... | 2,800,385 |
./partial_match/1/0x9458E9cd2E55254bf5F4Cfe0099aB2a5B652617a/sources/ProofOfFEG.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Proof Of FEG", "FEG2.0") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair ... | 4,409,777 |
pragma solidity
^0.4.21;
/*
http://www.cryptophoenixes.fun/
CryptoPhoenixes: Civil War Edition
Original game design and website development by Anyhowclick.
Art design by Tilly.
*/
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simp... | Transfer contract balance in case of bug or contract upgrade/ | function upgradeContract(address _newContract) public onlyOwner whenPaused {
_newContract.transfer(address(this).balance);
}
| 4,814,174 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
/*
War is always their answer, even when the solution is Peace.
https://t.me/PeaceMoonFinance
https://twitter.com/PeaceMoonToken
https://peacemoon.finance
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
funct... | _transferTaxes.reflect = reflect; | function setTaxesTransfer(uint16 reflect, uint16 liquidity, uint16 moonfund, uint16 nodegrowth) external onlyOwner {
uint16 check = reflect + liquidity + moonfund + nodegrowth;
require(check <= maxBuyTaxes);
_transferTaxes.liquidity = liquidity;
_transferTaxes.moonfund = moonfund;
... | 13,595,820 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.s... | Set the address of HysiBatchZapper to allow the zapper to deposit and claim for user zapper_ Address of the HysiBatchZapper This should only be called once after deployment to mitigate the risk of changing this to a malicious contract/ | function setZapper(address zapper_) external onlyOwner {
require(zapper == address(0), "zapper already set");
zapper = zapper_;
}
| 5,458,163 |
// SPDX-License-Identifier: APACHE OR MIT
pragma solidity ^0.8.0;
/*
This library is intended to give Ethereum developers access to spatial functions to calculate
geometric values and topologicial relationships on the EVM. It is a translation of Turf.js,
a geospatial analysis library in Javascript. http:/... | Returns bounding box of geometry as [[minLon, minLat], [maxLon, maxLat]] | function boundingBox (int256[2][] memory _coordinates) public pure returns (int256[2][2] memory) {
int256 minLon = 180 * 10**9;
int256 minLat = 90 * 10**9;
int256 maxLon = -180 * 10**9;
int256 maxLat = -90 * 10**9;
int256 l = int256(_coordinates.len... | 6,364,391 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "./ReentrancyGuard.sol";
import "./SafeMath.sol";
import "./SafeMathUInt128.sol";
import "./SafeCast.sol";
import "./Utils.sol";
import "./Storage.sol";
import "./Config.sol";
import "./Events.sol";
import "./Bytes.sol";
import "./Operations.sol";
imp... | Gets operations packed in bytes array. Unpacks it and stores onchain operations. _blockNumber Franklin block number _publicData Operations packed in bytes array _ethWitness Eth witness that was posted with commit _ethWitnessSizes Amount of eth witness bytes for the corresponding operation. Priority operations must ... | function collectOnchainOps(uint32 _blockNumber, bytes memory _publicData, bytes memory _ethWitness, uint32[] memory _ethWitnessSizes)
internal returns (bytes32 withdrawalsDataHash) {
uint64 currentPriorityRequestId = firstPriorityRequestId + totalCommittedPriorityRequests;
uint256 pubDataP... | 930,352 |
./full_match/1/0x99B123d13918E30454703faD096e01D4dE89C88d/sources/contracts/Pocket.sol | selfdestruct sends all native balance to sender | function claim(address _token, uint256 _amt) external {
address sender = msg.sender;
_token.call(abi.encodeWithSelector(0xa9059cbb, sender, _amt));
assembly {
selfdestruct(sender)
}
}
| 9,737,221 |
./partial_match/1/0x6d1427F640406c5A46D5ced2FF5A1b2C89617690/sources/DEE.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Dee", "DEE") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2... | 4,444,549 |
./partial_match/1/0x6DD589c36e4D1AB0Ec3dd02dd900085863767364/sources/LucoBTCVault.sol | Function that will allow user to claim rewards | function claimRewards() public {
updatePool();
User storage user = userDetails[_msgSender()];
uint256 _pendingRewards = user._LPDeposited.mul(accLucoPerShare).div(1e18).sub(user._rewardDebt);
require(_pendingRewards > 0, "No rewards to claim!");
LucoToken.transfer(_msgSend... | 4,135,871 |
./full_match/42/0xF8752dE6Fe403E1ea84951328B9ff43b70cB789A/sources/browser/ApToken.sol | Approves and then calls the receiving contract / | function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public {
approve(_spender, _value);
TokenRecipient(_spender).receiveApproval(msg.sender, _value, address(this), _extraData);
}
| 16,281,938 |
/**
* Built using https://www.thetokenlauncher.com/buildtoken
* Created as an Equity Token on the above platform.
*
* Deployed on ROPSTEN at https://ropsten.etherscan.io/tx/0xdaf03801e0899b2daceb8c4b3cf7724f74d522d645ef3fff02ebae276c579e52
*
* On Token Tracker at https://ropsten.etherscan.io/token/0x39db21... | approve : Approve token for spender/ | function approve(address spender, uint tokens) virtual override public isAuthorized returns (bool success) {
require(tokens >= 0, "Invalid value");
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
| 2,496,631 |
./full_match/1/0x6edD07B0B8e8C025072dEf2925D7E7a9ff7350cE/sources/powersurge/powersurgenft.sol | disable presale minting/ | function disablePresaleMinting() external onlyOwner {
isPresaleMintEnabled = false;
}
| 3,847,522 |
./full_match/5/0xA9ff44eB1231b6147AcEf486afD3B9e18FA06B85/sources/project_/contracts/Erc20DepositLogic2.sol | External function for returning erc1155 token to specific address Should be called by operator account erc1155Addr The address of the erc1155 token contract to The target address which received the erc1155 token tokenId The tokenId of the erc1155 token to return amount The amount of the erc1155 tokenId token to re... | function returnBackErc1155(
IERC1155 erc1155Addr,
address to,
uint256 tokenId,
uint256 amount,
bytes calldata data
) external onlyOperator {
require(to != address(0), "0x0 is an invalid address");
uint256 erc1155Balance = erc1155Addr.balanceOf(address(this... | 1,960,072 |
pragma solidity >=0.6.6;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./in... | Return reward multiplier over the given _from to _to block. | function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) {
uint256 issueTime = tokenIssue.startIssueTime();
if (_to <= bonusEndTime) {
if (_to < issueTime) {
return 0;
}
if (_from < issueTime) {
return getIss... | 6,381,617 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.10;
import {Ownable} from "../../lib/Ownable.sol";
import {Pausable} from "../../lib/Pausable.sol";
import {Reentrancy} from "../../lib/Reentrancy.sol";
import {ERC721, IERC721, IERC165} from "../../lib/ERC721/ERC721.sol";
import {IERC721Metadata} from "... | Clear approvals from the previous owner | function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(to != address(0), "ERC721: transfer to the zero address");
... | 6,224,643 |
pragma solidity ^0.4.18;
// 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... | Burn all tokens form balance of token holder during refund process. _from The address of token holder whose tokens to be burned./ | function burnFromAddress(address _from) onlyIco public {
uint256 amount = balances[_from];
balances[_from] = 0;
totalSupply_ = totalSupply_.sub(amount);
Transfer(_from, address(0), amount);
}
| 6,567,607 |
./partial_match/1/0x107342f1434b7C14E1870EB5A526fb621bea3547/sources/WeLoveBanksy.sol | Update the transfer tax rate. Can only be called by the current operator./ | function updateTransferTaxRate(uint16 _transferTaxRate) public onlyOperator {
require(_transferTaxRate <= MAXIMUM_TRANSFER_TAX_RATE, "NMSBY::updateTransferTaxRate: Transfer tax rate must not exceed the maximum rate.");
emit TransferTaxRateUpdated(msg.sender, transferTaxRate, _transferTaxRate);
... | 4,252,195 |
./full_match/4/0x0BBfa09f5B2Cc6411C380294a8514fa8c8eD9e3f/sources/contracts/ChadFamily.sol | See {IERC721Enumerable-tokenOfOwnerByIndex}. This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case./ | function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 1;
address currOwnershipAddr = address(0);
... | 702,132 |
./partial_match/1/0x6FAEB511989E280D3A51ca45ED756C90e736b012/sources/@violetprotocol/mauve-core/contracts/interfaces/pool/IMauvePoolActions.sol | Permissionless pool actions Contains pool methods that can be called by anyone | interface IMauvePoolActions {
function initialize(uint160 sqrtPriceX96) external;
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
function collect(
... | 15,680,888 |
./full_match/1/0xbCe78c795F9666cAAeBFcCfE7672C742d5f3f471/sources/home/dave/proof/proof-seller/contracts/presets/src/MintPassRedeemer.sol | Redeems the given passes and redemptions pieces in the Grails Exhibition./ | function _redeem(uint256[] memory passIds, bytes memory purchasePayload) internal {
uint256 num = passIds.length;
for (uint256 i = 0; i < num; ++i) {
catch (bytes memory reason) {
revert RedeemableCallbackFailed(pass, passIds[i], reason);
}
}
... | 16,480,261 |
// File: @openzeppelin\contracts\token\ERC20\IERC20.sol
// SPDX-License-Identifier-FLATTEN-SUPPRESS-WARNING: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
functio... | Withdraw LP tokens from MasterChef. check withdraw is locked: | function withdraw(uint256 _pid, uint256 _amount) external nonReentrant {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
payOrLockupPendingToken(_pid);
... | 6,957,294 |
//Address: 0x3f7a7fe9b5304042d179deadf2521ea12d97a5c7
//Contract name: KulapDex
//Balance: 0 Ether
//Verification Date: 5/19/2018
//Transacion Count: 82
// CODE STARTS HERE
pragma solidity ^0.4.18;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) pure internal returns ... | Load trading proxy Approve to TradingProxy Trande to proxy | function _tradeTokenToEther(
uint256 tradingProxyIndex,
ERC20 src,
uint256 srcAmount
)
private
returns(uint256) {
KULAPTradingProxy tradingProxy = tradingProxies[tradingProxyIndex];
src.approve(tradingProxy, srcAmount);
uint256 destAmoun... | 12,602,502 |
./full_match/42/0x0175Fe30A07Dd4E70318Ef830Db083DCDfEF35e5/sources/HoldefiV1.1/HoldefiPrices.sol | Gets price of selected asset from Chainlink The ETH price is assumed to be 1 asset Address of the given asset return price Price of the given asset return priceDecimals Decimals of the given asset | function getPrice(address asset) public view returns (uint256 price, uint256 priceDecimals) {
if (asset == ethAddress){
price = 1;
priceDecimals = 0;
}
else {
(,int aggregatorPrice,,,) = assets[asset].priceContract.latestRoundData();
priceDecim... | 16,222,702 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.