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/5/0xd32718Fdb54e482C5Aa8eb7007cC898d798B3185/sources/contracts/L1/messaging/L1CrossDomainMessenger.sol | Sends a cross domain message to the target messenger. _target Target contract address. _message Message to send to the target. _gasLimit Gas limit for the provided message./ Use the CTC queue length as nonce | function sendMessage(
address _target,
bytes memory _message,
uint32 _gasLimit
)
public
{
address ovmCanonicalTransactionChain = resolve("CanonicalTransactionChain");
uint40 nonce =
ICanonicalTransactionChain(ovmCanonicalTransactionChain).getQueueL... | 16,830,047 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
*
*
* | | o
* |--- |---. ,---. ,---. ,---. . ,---.
* | | | |---' | | ... | Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is forwarded in {IERC721Receiver-onERC721Received} to contract recipients./ | function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
_mint(to, tokenId);
require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
| 1,429,153 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
library SafeMathUint {
function toInt256Safe(uint256 a) internal pure returns (int256) {
int256 b = int256(a);
require(b >= 0);
return b;
}
}
library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int... | used for owner and pre sale addresses | function allowPreTrading(address account, bool allowed) public onlyOwner {
require(
canTransferBeforeTradingIsEnabled[account] != allowed,
"JPOPDOGE: Pre trading is already the value of 'excluded'"
);
canTransferBeforeTradingIsEnabled[account] = allowed;
}
| 414,386 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "openzeppelin-solidity/contracts/utils/math/SafeMath.sol";
/*
DESIGN NOTES:
- We assume Class 0 is common!
- Because this is a library we use a state struct rather than member
variables. This struct is passes as the first argument to any functi... | Set up the fields of the state that should have initial values./ | function initState(
LootBoxRandomnessState storage _state,
address _factoryAddress,
uint256 _numOptions,
uint256 _numClasses,
uint256 _seed
) public {
_state.factoryAddress = _factoryAddress;
_state.numOptions = _numOptions;
_state.numClasses = _numClasses;
_state.seed = ... | 881,281 |
./partial_match/3/0x90454278dcE3De6A773ECFd33daed490b08FedeC/sources/RCCOToken.sol | ------------------------------------------------------------------------ Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account https:github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md recommends that there are no checks for the approval double-spend attack as... | function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
| 16,614,840 |
./full_match/56/0xD803719B1a6Aac1dcB2c815d987f0CB5E8f4cCAf/sources/happy.sol | manual swap of fee tokens to BNB no dumping | function manualSwap(uint256 amount) public onlyAdmin {
require(amount < _balances[address(this)], "Try less");
require(lastManualSwapTime < block.timestamp, "Not yet.");
if (amount > threshold.swap) {
amount = threshold.swap;
}
_swap(amount);
lastManualSwa... | 3,238,573 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "./QuicMasterStorage.sol";
// QuicMasterFarmer is the master of Quic. He can make Quic and he is a fair guy.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once Quic i... | Set the migrator contract. Can only be called by the owner. | function setMigrator(IMigratorToQuicSwap _migrator) public onlyOwner {
migrator = _migrator;
}
| 6,407,682 |
// Copyright (C) 2020 Zerion Inc. <https://zerion.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 ... | Execute one action via external call. action Action struct. Can be called only by this contract. This function is used to create cross-protocol adapters./ | function executeExternal(Action calldata action) external returns (address[] memory) {
require(msg.sender == address(this), "C: only address(this)");
return executeAction(action);
}
| 1,043,710 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
... | inject NONSTANDARD NAMING | function BALANCEOF781(address account) external view returns (uint256); | 2,514,466 |
./partial_match/1/0xD7FbFF0fd48dE02901E19b192cc59b1c31198526/sources/MintPassDummy.sol | Internal function to remove a token ID from the list of a given address _from address representing the previous owner of the given token ID _tokenId uint256 ID of the token to be removed from the tokens list of the given address/ Note that this will handle single-element arrays. In that case, both tokenIndex and last... | function removeTokenFrom(address _from, uint256 _tokenId) internal {
require(
ownerOf(_tokenId) == _from,
"Asset does not belong to given owmer"
);
ownedTokensCount[_from] = ownedTokensCount[_from] - 1;
tokenOwner[_tokenId] = address(0);
uint256 tokenI... | 15,630,742 |
pragma solidity 0.4.24;
interface ITokenContract {
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(
address _to,
uint256 _amount
)
external
returns (bool success);
function transferFrom(
address _fr... | This method will check whether given address was a beneficiary of transaction execution or not scriptHash script hash of the transaction beneficiary Beneficiary address to be checked/ | function checkBeneficiary(
bytes32 scriptHash,
address beneficiary
)
external
view
returns (bool)
{
return transactions[scriptHash].beneficiaries[beneficiary];
}
| 12,619,081 |
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
import "./LibEIP712.sol";
import "./LibOrder.sol";
contract LibRequest is
LibEIP712, LibOrder
{
// solhint-disable max-line-length
string private constant REQUEST_TYPE = "CancelRequest(Order order,uint256 nonce)Order(address userAddress,uint256 amo... | Calculates Keccak-256 hash of the request. request The request structure. return Keccak-256 EIP712 hash of the request. | function getRequestHash(CancelRequest memory request)
public
view
returns (bytes32 requestHash)
{
requestHash = hashEIP712Message(hashRequest(request));
return requestHash;
}
| 7,327,031 |
/**
*Submitted for verification at Etherscan.io on 2021-12-05
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external... | ------------------------------ onlyTimelock ------------------------------ | function addTokenList(address _token) external onlyTimelock {
require(_token != address(0), "address invalid");
tokenList[_token] = true;
emit AddTokenList(_token);
}
| 2,213,160 |
./full_match/1313161554/0x51e20134b7c11D9e868E0EE227BAbc429CA1c2e8/sources/contracts/libraries/LibInterchain.sol | Performs a WETH.deposit operation _amount The amount of input token return ok Indicates that the swap operation was success or fail return amountOut If ok = true, amountOut is the output amount of the swap revert("Non-WETH tokens unwrapped"); | function _handleUnwrap(
address _token,
uint _amount,
LibSwapper.BaseSwapperStorage storage baseStorage
) private returns (bool ok, uint256 amountOut, address outToken) {
if (_token != baseStorage.WETH)
return (false, _amount, _token);
IWETH(baseStorage.WETH)... | 13,230,276 |
// SPDX-License-Identifier: GPL-3.0
/// @title The YQC ERC-721 token
pragma solidity ^0.8.6;
import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol';
import { ERC721Checkpointable } from './base/ERC721Checkpointable.sol';
import { IYQCToken } from './interfaces/IYQCToken.sol';
import { ERC721 } from './... | Set the queeners DAO. Only callable by the queeners DAO when not locked./ | function setQueenersDAO(address _queenersDAO) external override onlyQueenersDAO {
queenersDAO = _queenersDAO;
emit QueenersDAOUpdated(_queenersDAO);
}
| 1,393,969 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
// import "hardhat/console.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract CCML is ERC721, ERC721Enumera... | require(numTokens > 0, "CCML: Must supply positive number for tokens to mint"); require(totalSupply() + numTokens <= maxNftSupply, "CCML: Purchase would exceed max supply of tokens"); for (uint256 i = 0; i < numTokens; i++) { mints a new token right off the top of the supply _minted[totalSupply()] = true; ... | function presaleMint(uint256[] memory _ids) external payable {
uint256 numTokens = _ids.length;
require(_whitelist[msg.sender] == true, "CCML: sender is not whitelisted for presale");
require(tokenPrice * numTokens <= msg.value, "CCML: Insufficient funds sent for purchase");
require(... | 1,572,089 |
./partial_match/1/0x79f21C5611F4788708FE80f1154AbF99d3d98451/sources/AA.sol | Disables auto liquidity add./ | function disableAutoLiq() public onlyOwner {
autoLiqStatus = false;
}
| 2,653,544 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
contract Music{
// List of Song titles
string [] public songTitles;
string [] public songHashes;
string [] public artists;
string [] public bestSongs;
songLikes [] public song_likes;
artistLikes [] public artist_lik... | string memory genre; | function getSongsGenre(string memory songName) view public validSong(songName)
returns(string memory genre){
for(uint i=0;i<artists.length;i++){
for(uint j=0;j<artist_song_mapping[artists[i]].length;j++){
if(keccak256(bytes(artist_song_mapping[artists[i]][j].songTitle)) == ke... | 12,669,779 |
./full_match/1/0xA8C6B0d3a06E834A8F0F70603625a475b87703a0/sources/contracts/token/oft/v2/OFTCoreV2.sol | public functions/ send call | function callOnOFTReceived(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes32 _from, address _to, uint _amount, bytes calldata _payload, uint _gasForCall) public virtual {
require(_msgSender() == address(this), "OFTCore: caller must be OFTCore");
_amount = _transferFrom(address(... | 4,998,513 |
//SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
/// @title MultisigControl Interface
/// @author Vega Protocol
/// @notice Implementations of this interface are used by the Vega network to control smart contracts without the need for Vega to have any Ethereum of its own.
/// @notice To do this, the Vega validato... | Verifies a signature bundle and returns true only if the threshold of valid signers is met, this is a function that any function controlled by Vega MUST call to be securely controlled by the Vega network message to hash to sign follows this pattern: abi.encode( abi.encode(param1, param2, param3, ... , nonce, functio... | function verify_signatures(bytes memory signatures, bytes memory message, uint256 nonce) public override returns(bool) {
require(signatures.length % 65 == 0, "bad sig length");
require(!used_nonces[nonce], "nonce already used");
uint8 sig_count = 0;
bytes32 message_hash = keccak256(... | 11,829,916 |
./partial_match/1/0xb5e69c122e2B430C133bBB0CDC59d88A5bb08F62/sources/MBTCcontract.sol | enable token transferability | function enableTokenTransferability() external onlyOwner {
token.unpause();
}
| 4,352,326 |
./partial_match/1313161554/0x97A3d559d62E8668e1b4644C2A6F4E4147898552/sources/BeefyFeeConfigurator.sol | set values for a fee category using the relative split for call and strategist i.e. call = 0.01 ether == 1% of total fee _adjust == true: input call and strat fee as % of total harvest | function setFeeCategory(
uint256 _id,
uint256 _total,
uint256 _call,
uint256 _strategist,
string memory _label,
bool _active,
bool _adjust
) external onlyOwner {
require(_total <= totalLimit, ">totalLimit");
if (_adjust) {
_call... | 16,928,380 |
pragma solidity >=0.5.0;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
... | Returns the confirmation status of a transaction. transactionId Transaction ID. return Confirmation status. | {
uint count = 0;
function isConfirmed(uint transactionId)
public
view
returns (bool)
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true... | 12,950,496 |
./partial_match/42/0x603794bB9C84569CbD9e71754f86A35d51530eAb/sources/SHOPPINGmodX3.sol | Return burn mode state./ | function TransactionsWithBurnMode() public view returns (bool) {
return _transactionsWithBurnMode;
}
| 9,042,769 |
./full_match/1/0x288f4ad8723f297b584a1643B99b17F73B896B6a/sources/contracts/ethregistrar/BaseRegistrarImplementation.sol | Returns true iff the specified name is available for registration. Not available if it's registered here | function available(uint256 id) public view returns(bool) {
return !_exists(id);
}
| 9,798,757 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
Created and tested by the SeedMaster team!
*/
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
... | calculates the CREATE2 address for a pair without making any external calls | function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, t... | 1,348,384 |
pragma solidity 0.5.11;
interface GemLike {
function approve(address, uint) external;
function transfer(address, uint) external;
function transferFrom(address, address, uint) external;
function deposit() external payable;
function withdraw(uint) external;
}
interface ManagerLike {
function cdp... | For those collaterals that have less than 18 decimals precision we need to do the conversion before passing to frob function Adapters will automatically handle the difference of precision | function convertTo18(address gemJoin, uint256 amt) internal returns (uint256 wad) {
wad = mul(
amt,
10 ** (18 - GemJoinLike(gemJoin).dec())
);
}
| 958,681 |
./partial_match/4/0x7137d98d3B7DF4735be4cBBe1f02Aa0B7351b653/sources/InstantSwap.sol | uint256 amount = users[loanId[i]].amount; 1% penalty for not paying the interest in one year | function liquidateAfterYear(uint256[] memory loanId)
public
onlyOwner {
for(uint i = 0; i < loanId.length; i++) {
( , uint256 interest) = viewInterest(loanId[i], 1);
interest = interest.add(interest.mul(1).div(100));
interest = toAsset(interest);
... | 8,625,699 |
./full_match/4/0x9E6b55789c9B980DabC2567A69AE933bfF61BE82/sources/packages/contracts/contracts/core/erc165/ERC165.sol | Query if a contract implements a certain interface _interfaceId The interface identifier being queried, as specified in ERC-165 return True if the contract implements the requested interface and if its not 0xffffffff, false otherwise/ | function supportsInterface(bytes4 _interfaceId) virtual public view returns (bool) {
return _interfaceId == ERC165_INTERFACE_ID;
}
| 754,731 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
import './KeyPurchaser.sol';
import './utils/Clone2Factory.sol';
import './utils/Clone2Probe.sol';
import '@unlock-protocol/contracts/dist/PublicLock/IPublicLockV8sol8.sol';
/**
* @notice A factory for creating keyPurchasers.
* @dev This contract acts as a regi... | Returns the number of available keyPurchasers for a given lock./ | function getKeyPurchaserCount(
address _lock
) public view
returns (uint)
{
return lockToKeyPurchasers[_lock].length;
}
| 1,827,024 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.13;
/// ============ Imports ============
import "./utils/MultiRaffleTest.t.sol"; // MultiRaffle ds-test
/// ============ Libraries ============
library Errors {
string constant RaffleNotActive = "Raffle not active";
string constant RaffleEnded = "... | Prevent enterring before raffle active | function testCannotEnterEarly() public {
setTimePreRaffleStart();
assertErrorWithMessagePayable(
ALICE.enterRaffle,
1,
1e17 wei,
Errors.RaffleNotActive
);
}
| 993,966 |
./partial_match/42/0x8e6421497B1522233Ae013819649121ae947E0C6/sources/Rewards.sol | bulk distribution is release % of total amount on particular day this day is also calculated by % eg: if we have 10 days and bulk = 20, then release will be 20% on day 2, 40% on day 4, 60% on day 6 etc | function bulkProgress(uint256 _totalAmount, uint256 _duration, uint8 _bulk) internal view returns (uint256) {
uint bulks = block.timestamp.sub(distributionStartTime).mul(100).div(_duration * _bulk);
uint256 result = _totalAmount.mul(_bulk).mul(bulks) / 100;
return result > _totalAmount ? _to... | 8,982,749 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "../openzeppelin/Safemath.sol";
import "./User.sol";
import {PriceConsumerV3} from "../chainlink/AggregatorV3Interface.sol";
import "./DealStorage.sol";
import "../openzeppelin/IERC20.sol";
import "hardhat/console.sol";
import "../opengsn/BaseRela... | This confirmation is sent by freelancer upon being picked to work on a certain job. This is to make sure the deal is confirmed by both parties before work can begin. dealId The unique identity of the job/ | function secondConfirmation(bytes32 dealId)
external
onlyFreelancer(dealId)
{
dealIdToDeal[dealId].confirmed = true;
dealIdToDeadline[dealId].completionDeadline =
block.timestamp +
(dealIdToDeal[dealId].completionDays * 1 days);
userMetadata.initi... | 12,726,314 |
./full_match/1/0xbBaf40e637835A1EE3B62760e3C9911DD3811e84/sources/browser/hashelot_rings.sol | 2% of the total stack goes to the owner The rest goes to the winner | function closeBet() public payable {
uint _block = block.number;
enough blocks mined */
require (_block > stackTime+stackWait && stackPlayers.length >= 1, "Bet closing error: no bet to claim.");
uint currentKey;
uint _ownerShare;
uint _winnerShare;
address ... | 17,126,440 |
./partial_match/1/0x7d1bA2c18CbDE0D790Cc1d626F0c70b3c13C9eec/sources/src/Curve.sol | view deposits and curves minted a given deposit would return _deposit the full amount of stablecoins you want to deposit. Divided evenly according to the prevailing proportions of the numeraire assets of the pool return (the amount of curves you receive in return for your deposit, the amount d... | function viewDeposit(uint256 _deposit)
external
view
globallyTransactable
transactable
returns (uint256, uint256[] memory)
{
return ProportionalLiquidity.viewProportionalDeposit(curve, _deposit);
}
| 4,158,768 |
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Strings.sol
//------------------------------------------------------------------------------
/*
░██████╗░██╗░░░██╗░█████╗░██╗░░░░░██╗███████╗██╗███████╗██████╗░ ██████╗░███████╗██╗░░░██╗░██████╗
██╔═══██╗██║░░░██║██╔══██╗██║░░░░░██║██╔════╝██║██╔═... | Returns the hashMessage of that the code are expecting./ | function _senderMessageHash() internal view returns (bytes32) {
bytes32 message = keccak256(
abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
keccak256(abi.encodePacked(address(this), msg.sender))
)
);
return message;
}
| 10,144,937 |
pragma solidity ^0.4.18;
import "./ERC20.sol";
contract AtomicSwapEtherToERC20 {
struct Swap {
uint256 value;
address ethTrader;
uint256 erc20Value;
address erc20Trader;
address erc20ContractAddress;
}
enum States {
INVALID,
OPEN,
CLOSED,
EXPIRED
}
mapping (bytes32 => ... | Expire the swap. Transfer the ETH value from this contract back to the ETH trader. | function expire(bytes32 _swapID) public onlyOpenSwaps(_swapID) {
Swap memory swap = swaps[_swapID];
swapStates[_swapID] = States.EXPIRED;
swap.ethTrader.transfer(swap.value);
Expire(_swapID);
}
| 12,913,052 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IDCACore} from "./interfaces/IDCAC... | solhint-disable-next-line avoid-low-level-calls, | function _transfer(
address payable _to,
address _token,
uint256 _amount
) internal {
if (_token == weth) {
IWETH(weth).withdraw(_amount);
require(success, "ETH transfer failed");
IERC20(_token).safeTransfer(_to, _amount);
}
}
| 15,855,967 |
/**
*Submitted for verification at BscScan.com on 2022-01-12
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Stakeable {
constructor() { }
function initStakeable() internal {
stakeholders.push();
rewardPerHour = 36500;
}
struct Stake{
address user;
... | Make sure spender is allowed the amount | function transferFrom(address spender, address recipient, uint256 amount) external returns(bool){
require(_allowances[spender][msg.sender] >= amount, "DevToken: You cannot spend that much on this account");
_transfer(spender, recipient, amount);
_approve(spender, msg.sender, _allowances[spender][m... | 1,425,221 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@rari-capital/solmate/src/utils/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
import "./SignedAllowance.sol";
import "./MultisigOwnable.sol";
import "./BatchOffsets.sol";
/// @title Mar... | simple predictable generator of randomness based on on-chain data, given a seed | function _getPredictableRandom(uint256 _seed) internal view returns (uint256){
return uint256(keccak256(abi.encodePacked( blockhash(block.number-1), _seed, msg.sender, address(this) )));
}
| 12,764,936 |
/*
The Hunt to capture all six infinity stones has begun! After snapping
his fingers and removing half of the world's population, Thanos has
gone to the Garden, to live out the rest of his life in peace.
Unfortunately for him, a bunch of Degens have banded together to
steal the infinity stones and use their power ... | exclude from paying fees or having max transaction amount | constructor() ERC20("Infinity Gauntlet", "GAUNTLET") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswap... | 14,825,680 |
pragma solidity 0.4.24;
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/ERC20.sol
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/... | A user has redeemed a top-up voucher for phone credit. This is executed by the owner as it is an internal process to convert a voucher to phone credit via VOX Tokens. voucherCode The code on the e.g. scratch card that is to be redeemed for call credit. voucherOwner The wallet id of the user redeeming the voucher.... | function redeemVoucher(uint256 voucherCode, address voucherOwner, address tokenSeller, uint256 quantity) public onlyOwner payable {
buy(tokenSeller, quantity, orderBook[tokenSeller].price);
emit VoucherRedeemed(voucherCode, voucherOwner, tokenSeller, quantity);
}
| 5,409,128 |
./full_match/4/0x6f4B113B72dC6470e858855Bfd9aA995E4A2dFa0/sources/contracts/ExpandedNFT.sol | returns the number of minted tokens within the drop | function totalSupply() public view returns (uint256) {
return _claimCount;
}
| 672,042 |
./full_match/1/0xbf5A7F3629fB325E2a8453D595AB103465F75E62/sources/src/portals/router/RouterBase.sol | Transfers tokens or the network token from the sender to the Portals multicall contract sender The address of the owner of the tokens token The address of the token to transfer (address(0) if network token) quantity The quantity of tokens to transfer from the caller return value The quantity of network tokens to be ... | function _transferFromSender(
address sender,
address token,
uint256 quantity
) internal returns (uint256) {
if (token == address(0)) {
require(
msg.value != 0, "PortalsRouter: Invalid msg.value"
);
return msg.value;
}
... | 9,619,749 |
// SPDX-License-Identifier: GPL-2.0-or-later
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Holdings, 2021
pragma solidity ^0.7.4;
pragma abicoder v2;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import {ERC2... | Counts how many credit accounts are in stock | function countCreditAccountsInStock()
external
view
override
returns (uint256)
{
uint256 count = 0;
address pointer = head;
while (pointer != address(0)) {
pointer = _nextCreditAccount[pointer];
count++;
}
return cou... | 5,894,669 |
// Copyright (C) 2018 Argent Labs Ltd. <https://argent.xyz>
// 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... | inject NONSTANDARD NAMING | function ADDGUARDIAN190(BaseWallet _wallet, address _guardian) external; | 2,513,373 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/interfaces/IERC721Rece... | Burns the token ids passed to the function, provided the contract is approved to access them. Then, the user is returned the conversion in ROOLAH. tokenIds - the token ids to pull in and burn/ RIP, sweet prince | function burnRoos(uint256[] calldata tokenIds) external {
for (uint256 i; i < tokenIds.length; i++) {
rooTroopContract.transferFrom(
msg.sender,
address(this),
tokenIds[i]
);
rooTroopContract.burn(tokenIds[i]);
}
... | 40,798 |
./partial_match/1/0x107126Ab4219C804f0C668Ceeff1aD9Ae0928c32/sources/swimskin.sol | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but also transferring `value` wei to `target`. Requirements: - the calling contract must have an ETH balance of at least `value`. - the called Solidity function must be `payable`. _Available since v3.1._/ | function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "e9");
}
| 3,546,801 |
./full_match/1/0x4BbE6f904d9748a1Af14d5f4bF0EfC73738A2E6D/sources/@1inch/solidity-utils/contracts/libraries/SafeERC20.sol | Executes a low level call to a token contract, making it resistant to reversion and erroneous boolean returns. token The IERC20 token contract on which the call will be made. selector The function signature that is to be called on the token contract. to The address to which the token amount will be transferred. amo... | ) private returns (bool success) {
let data := mload(0x40)
mstore(data, selector)
mstore(add(data, 0x04), to)
mstore(add(data, 0x24), amount)
success := call(gas(), token, 0, data, 0x44, 0x0, 0x20)
function _makeCall(
IERC20 token,
byt... | 17,115,828 |
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 constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function ... | Disable the hot wallets for transfers. _address address Address in fundingWallets[] | function disableFundingWallets(address _address) external onlyOwner {
require(fundingEnabled);
require(fundingWallet != _address);
require(fundingWallets[_address]);
fundingWallets[_address] = false;
}
| 13,125,738 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
import "../interfaces/IBentoBoxMinimal.sol";
import "../interfaces/IMasterDeployer.sol";
import "../interfaces/IPool.sol";
import "../interfaces/ITridentCallee.sol";
import "../libraries/MathUtils.sol";
import "./TridentERC20.sol";
import... | Burns LP tokens sent to this contract. The router must ensure that the user gets sufficient output tokens. | function burn(bytes calldata data) public override lock returns (IPool.TokenAmount[] memory withdrawnAmounts) {
(address recipient, bool unwrapBento) = abi.decode(data, (address, bool));
(uint256 balance0, uint256 balance1) = _balance();
uint256 liquidity = balanceOf[address(this)];
... | 12,972,538 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Pausable.sol";
import "./Ownable.sol";
import "./ReentrancyGuard.sol";
import "./AggregatorV3Interface.sol";
contract ZebrangoPriceGuess is Pausable , ReentrancyGuard, Ownable{
AggregatorV3Interface public oracle;
//genesisRound
boo... | bet the Price will go down.update round dataupdate userData | function betDown(uint256 episode) external payable whenNotPaused nonReentrant {
require(episode == currentRound , "bet is too early/late.");
require(_bettable(episode) , "round is not bettable.");
require(msg.value >= minBet, "bet is too low.");
require(docs[episode][msg.sen... | 1,067,933 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./Bytes.sol";
/**
* @title typed ERC721
* @notice every token has a type with optional data
*/
abstract contract ERC721Typed is ERC721 {
// Structure to defined a type
struct Type {
... | Mint a batch of ERC721 typed token from a type id throw if type does not exist throw if there is not enough tokens to minted for this type to address of reception typeId id of the type data extra information return minted tokens id/ skip the token already minted Revert if all tokens have been minted for the alloca... | function _safeBatchMintByType(
address[] calldata to,
uint256 typeId,
bytes memory data
) internal virtual returns (uint256[] memory) {
Type memory requestedType = _types[typeId];
require(requestedType.to != 0, "e10");
uint256[] memory tokensMinted = new uint256[... | 1,777,152 |
./partial_match/1/0xb00381dCAf378664b32596a612c2C83de4A81DC0/sources/FlamingFarm.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0) {
pool.lastRewardBlock = block.number;... | 4,034,540 |
//SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
import "./NftBase.sol";
import "../auctions/IHub.sol";
import "../registry/Registry.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
contract OpenNFT is NftBase, Ownable {
using SafeMath for uint25... | _owner The address of the address to check return uint256 The number of tokens the user owns/ | function balanceOf(address _owner) public override view returns(uint256) {
return ownerBalances_[_owner];
}
| 11,753,039 |
//In dedication to my wife and family
pragma solidity ^0.4.23;
contract _0xBabylon{
// scaleFactor is used to convert Ether into tokens and vice-versa: they're of different
// orders of magnitude, hence the need to bridge between the two.
uint256 constant scaleFactor = 0x10000000000000000;// 2^64
int constant ... | Don&39;t allow for funding if the amount of Ether sent is less than 1 szabo. | function fund_color( address _reff, address forWho,uint256 cR,uint256 cG,uint256 cB) payable public {
reffUp(_reff);
if (msg.value > 0.000001 ether){
investSum += msg.value;
cR=rgbLimit(cR);
cG=rgbLimit(cG);
cB=rgbLimit(cB);
buy( forWho ,cR,cG,cB);
lastGateway = msg.sender;
revert();
}
... | 8,061,356 |
./full_match/1/0x675D7ee2B31E4B47C0D3F3E7FdAcF7Dede4904FF/sources/contracts/DarwinLiquidityBundles.sol | How much TOKEN and ETH is being holded in the bundle | function holdings(address _user, address _token) external view returns(uint256 eth, uint256 token) {
User memory user = userInfo[_user][_token];
(uint reserve0, uint reserve1,) = IDarwinSwapPair(darwinFactory.getPair(_token, WETH)).getReserves();
uint reserveEth = IDarwinSwapPair(darwinFacto... | 8,288,886 |
./partial_match/1/0x79e6059BcBEE63b26E602830148584Fd71b5e2fD/sources/EIP20Gateway.sol | Complete revert stake by providing the merkle proof. This method will return stake amount to staker and burn facilitator bounty. Message bus ensures correct execution sequence of methods and also provides safety mechanism for any possible re-entrancy attack. _messageHash Message hash. _blockHeig... | function progressRevertStake(
bytes32 _messageHash,
uint256 _blockHeight,
bytes calldata _rlpParentNodes
)
external
returns (
address staker_,
uint256 stakerNonce_,
uint256 amount_
)
{
require(
_messageHa... | 15,657,178 |
./partial_match/1/0x44383018ecf3DBED34eE621439a5Ff6002e8209b/sources/contracts/libraries/ValidationLibV1.sol | Reverts if the key does not resolve in a valid product of a cover contract. coverKey Enter the cover key to check productKey Enter the cover key to check/ | function mustBeValidProduct(
IStore s,
bytes32 coverKey,
bytes32 productKey
) public view {
require(s.isValidProductInternal(coverKey, productKey), "Product does not exist");
}
| 10,998,141 |
pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owne... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ | function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_to != address(this));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg... | 437,570 |
pragma solidity 0.5.12;
/**
* (c) 2021 Akiva Capital Holdings, LLC. All Rights Reserved.
*
* For LICENSE details, please visit:
* https://github.com/akiva-capital-holdings/pairwyse-smart-contracts/blob/master/LICENSE
*
*/
import "./McdAddressesR17main.sol";
import "../interfaces/IMcd.sol";
import "../interfac... | Build proxy for current caller (msg.sender address)/ | function _buildProxy() internal {
if (proxyAddress == address(0)) {
proxyAddress = ProxyRegistryLike(proxyRegistryAddr).build();
}
}
| 14,070,096 |
./full_match/4/0x6BE60E29FBb7559A5aF18D1e8F840767dd315359/sources/usingtellor/contracts/TellorPlayground.sol | Gets the timestamp for the value based on their index _requestId is the requestId to look up index is the value index to look up return uint timestamp/ | function getTimestampbyRequestIDandIndex(uint256 _requestId, uint256 index)
public
view
returns (uint256)
{
uint256 len = timestamps[_requestId].length;
if (len == 0 || len <= index) return 0;
return timestamps[_requestId][index];
}
| 817,587 |
pragma solidity ^0.4.24;
import "./EtherFairyBase.sol";
import "./ERC/ERC721.sol";
import "./ERC/ERC721TokenReceiver.sol";
import "./Util/SafeMath.sol";
// 요정 소유권 관련 기능
contract FairyOwnership is EtherFairyBase, ERC721 {
using SafeMath for uint256;
// 요정의 소유주 정보
mapping(uint256 => address) public fairyIdToMaster... | ERC721: 요정의 소유주 지갑 주소를 가져옵니다. | function ownerOf(uint256 fairyId) view public returns (address) {
address master = fairyIdToMaster[fairyId];
require(checkAddressMisused(master) != true);
return master;
}
| 7,308,884 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
import './Context.sol';
import './Strings.sol';
import './ERC165.sol';
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
function hasRole(bytes32 role, address account) external view ... | Get the number of shortfalls that have occurred. return The number of shortfalls that have occurred./ | function getShortfallCount()
external
view
returns (uint256)
{
return _SHORTFALLS_.length;
}
| 5,860,352 |
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint25... | ======= FREEMINT STUFF ======= | function flipFreeMintState() public onlyOwner {
freeMintIsActive = !freeMintIsActive;
}
| 14,586,644 |
// SPDX-License-Identifier: MIT
pragma solidity >0.7.0 <0.9.0;
import "./MaterialBase.sol";
import "./utils/CompanyOwnable.sol";
import "./utils/CertificateAuthorityManagerReferencer.sol";
contract Material is MaterialBase, CompanyOwnable {
constructor(address _masterAddress, address _factoryContractAddress)
... | Mints a compound material _tokenID The material token id to be minted _batchesId The id of the batches used _batchesMaterialsUuid The amount of mateirals associated with the batch ids/ specified pairs must be of the same length the material token that we want to mint is a compound token specified batches must be at ... | function mint(
uint256[] memory _batchesId,
uint256[][] memory _batchesMaterialsUuid
) public senderIsTokenCreator(_tokenID) {
require(
_batchesId.length == _batchesMaterialsUuid.length,
"Arrays must be the same length"
);
require(
mate... | 12,963,348 |
./partial_match/1/0x019Ab29ba78129cA35d08Ea76277f991e58B677e/sources/Unik_Claim.sol | The buyer confirms the receipt of the watch in person before actually receiving it. Only the buyer can call this function. It is considered as a receipt signature. The date of receipt, therefore, serves as the starting point for the warranty period. tokenId The ID of the token./ Update delivered date. | function deliverWatchDate(uint256 tokenId) public {
require(exists(tokenId), "Token ID does not exist");
require(claimStatus[tokenId], "Token ID is not claimed");
require(ownerOf(tokenId) == msg.sender, "Caller is not the owner of the token");
watchDeliveredDate[tokenId] = b... | 4,118,452 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceO... | Mint vault shares to receiver by transferring exact amount of underlying asset tokens from the caller. Credit amount is calculated as a ratio of deposit amount and exchange rate: credits = underlying / exchangeRate We will first update the internal exchange rate by collecting any interest g... | function deposit(uint256 assets, address receiver) external override returns (uint256 shares) {
shares = _transferAndMint(assets, receiver, true);
}
| 11,800,868 |
./full_match/69/0x8EB5A8B9732022F20ab4d3128DDf3a50a6dAa7A2/sources/contracts/OptionMarket.sol | Opens a position, which may be long call, long put, short call or short put. _listingId The id of the relevant OptionListing. tradeType Is the trade long or short? amount The amount the user has requested to trade./ Note: call will fail here if it is an invalid boardId (expiry will be 0) | function openPosition(
uint _listingId,
TradeType tradeType,
uint amount
) external returns (uint totalCost) {
_require(int(amount) > 0 && uint(TradeType.SHORT_PUT) >= uint(tradeType), Error.ZeroAmountOrInvalidTradeType);
bool isLong = tradeType == TradeType.LONG_CALL || tradeType == TradeType.... | 13,238,272 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.4;
import {IBToken} from "../interfaces/IBToken.sol";
import {IDebtToken} from "../interfaces/IDebtToken.sol";
import {ILendPoolLoan} from "../interfaces/ILendPoolLoan.sol";
import {ILendPool} from "../interfaces/ILendPool.sol";
import {IReserveOracleGetter} fro... | Sets the configuration bitmap of the NFT as a whole - Only callable by the LendPoolConfigurator contract asset The address of the asset of the NFT configuration The new configuration bitmap/ | function setNftConfiguration(address asset, uint256 configuration) external override onlyLendPoolConfigurator {
_nfts[asset].configuration.data = configuration;
}
| 503,074 |
./full_match/62320/0xdc1513f80929568088d402955559CB7f374494ba/sources/lib/mento-core/contracts/SortedOracles.sol | Used in place of the constructor to allow the contract to be upgradable via proxy. _reportExpirySeconds The number of seconds before a report is considered expired./ | function initialize(uint256 _reportExpirySeconds) external initializer {
_transferOwnership(msg.sender);
setReportExpiry(_reportExpirySeconds);
}
| 3,225,415 |
/**
*Submitted for verification at Etherscan.io on 2020-09-23
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() e... | Add a new lp to the pool. Can only be called by the owner. XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. | function add(uint256 _allocPoint, IERC20 _lpToken, bool _stakeable, address _stakeableContract, IERC20 _stakedHoldableToken, bool _withUpdate) public onlyOwner {
if (_withUpdate) {
massUpdatePools();
}
uint256 lastRewardCalcBlock = block.number > startBlock ? block.number : start... | 6,363,186 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contrac... | Triggers stopped state./ | function stop() external onlyOwner {
_stop();
}
| 1,332,835 |
./partial_match/1/0x013F7A6b98010E85FD4c8887d30F48c409b5643d/sources/PrivateSale.sol | Returns the max value in an array. self Storage array containing uint256 type variables return maxValue The highest value in the array | function getMax(uint256[] storage self) public view returns(uint256 maxValue) {
assembly {
mstore(0x60,self_slot)
maxValue := sload(sha3(0x60,0x20))
switch gt(sload(add(sha3(0x60,0x20),i)), maxValue)
case 1 {
maxValue := sload(add(sha3(0x60,0x20),i))
}
}
... | 2,854,954 |
./full_match/5/0x1668f50d703eAa5C1Cf15B98b8C08CF82bdc8a32/sources/project_/contracts/ERC721A.sol | Gives permission to `to` to transfer `tokenId` token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - `tokenId` must exist. Emits an {Approval} event./ | function _approve(
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
address owner = ownerOf(tokenId);
if (approvalCheck)
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
... | 1,928,925 |
./full_match/1/0x04aBEb82f41b318eAecbe0A46152F089DcB9Cfa4/sources/src/Gateways/MintGateway.sol | burn is a convenience function that is equivalent to calling `burnWithPayload` with an empty payload and chain, releasing the asset to the native chain. | function burn(string calldata recipient, uint256 amount) external virtual override returns (uint256) {
return _burnWithPayload(recipient, "", "", amount, _msgSender());
}
| 2,943,184 |
pragma solidity 0.4.24;
import "../../lib/ownership/Claimable.sol";
import "../interfaces/TokenInterface.sol";
import "../interfaces/ProxySupportedERC20Interface.sol";
import "../interfaces/ProxyInterface.sol";
/**
* @title Contains admin functions for interactor.
*
* @notice
* - Set token and proxy contracts
* ... | Set balance module of attached token. _moduleAddress Address of balance module./ | function setBalanceModule(address _moduleAddress) public onlyOwner returns (bool) {
return TokenInterface(token).setBalanceModule(_moduleAddress);
}
| 12,877,180 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.8.12;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppel... | See `VRFConsumerBase` documentation. Handle case when no more NFT left in the pool Terminate the game and give back the NFT put at stake Give back the NFT put at stake by user Handle win Give back the NFT put at stake by user Transfer the won NFT to the winner | function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
Game storage game = games[requestId];
if (game.initialized && !game.completed) {
if (knsPool.length < 1) {
_komorebiNoSekaiNFT.safeTransferFrom(_msgSender(), address(this), game.nftStake... | 13,112,684 |
./full_match/3/0x4F7b47B972598ae54d405C4Faac05268A9247913/sources/contracts/ERC2981.sol | ERC1155 NFT Batch Create | function mintBatch(uint256[] memory ids, uint256[] memory amounts,string memory newUri) public onlyOwner{
for(uint256 i = 0; i < ids.length; i++){
uint256 result = balanceOf(nftOwner,ids[i]);
require(result == 0,"There must be only one NFT.");
}
_setURI(newUri);
... | 8,112,153 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
import "./VanillaV1Token02.sol";
import "./VanillaV1Uniswap02.sol";
import "./VanillaV1Migration01.sol";
import "./VanillaV1Safelist01.sol";
import "./interfaces/v1/VanillaV1API01.sol";
import "./interfaces/IVanillaV1Router02.sol";
import "@uniswap... | Price data, indexed as [owner][token] Emitted when tokens are sold. seller The owner of tokens. token The address of the sold token. amount Number of sold tokens. eth The received ether from the trade. profit The calculated profit from the trade. reward The amount of VanillaGovernanceToken reward tokens transfer... | function tokenPriceData(address owner, address token) external view returns (
uint256 weightedBlockSum,
uint112 ethSum,
uint112 tokenSum,
uint32 latestBlock);
event TokensSold(
address indexed seller,
address indexed token,
uint256 amount,
uint256... | 15,827,226 |
./full_match/80001/0x7f75b29f6b4927028f58320F09800d0E8eD07Ace/sources/DSpaceMarketplace.sol | ==== SET USER WALLET TO APPROVED FOR ALL ==== run approvals initialize NEW player. Referral cannot change after set. UPDATE REFERRAL COUNT UPDATE RANK IF ANY | function setAuthorizedUser(
address _player,
address _referral
) public whenNotPaused {
unchecked {
require(_referral != _player, "Cannot refer yourself");
require(players[_referral].wallet != address(0) || _referral == address(0), "Referral not exist");
... | 5,571,089 |
/*
Copyright 2019 Sean Thoman
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, s... | Reveal the salt used to hash each bid as well as the actual bid amount after the auction is closed. This is analogous to opening a sealed envelope containing each bidders' bid amount.onlyOwner() Revealing a commitment to a previous bid requires the sender to provide their random salt and the actual bid amount. Reveal t... | function reveal(uint256 revealAmount, string salt)
public
{
bytes32 revealHash = keccak256(abi.encodePacked(revealAmount, salt));
require(
bids[revealHash].signerAddr != address(0),
"REVEAL_HASH_FAILED"
);
bids[revealHash].revealHash = revealHash;
bids[r... | 5,491,403 |
./partial_match/42220/0x040D6De6F26ECeec2489EB132Cb3f11fbe97E33c/sources/src/SpiralsCeloVault.sol | Deposit CELO into stCELO Manager./ TODO-slither might be no-op, but slither doesn't like this https:github.com/crytic/slither/wiki/Detector-Documentationfunctions-that-send-ether-to-arbitrary-destinations | function stake(uint256 assets) internal virtual override {
}
| 3,495,986 |
./full_match/1/0x9349c1b3997d2feb27C3315D4C335e619B36046D/sources/Users/enamakel/Work/mahadao/arthcoin/arthcoin-v2/contracts/distribution/ARTHDSDPool.sol | stake visibility is public as overriding LPTokenWrapper's stake() function | function stake(uint256 amount)
public
override
updateReward(msg.sender)
checkStart
{
require(amount > 0, 'MICBACPool: Cannot stake 0');
uint256 newDeposit = deposits[msg.sender].add(amount);
deposits[msg.sender] = newDeposit;
super.stake(amount);
... | 8,305,051 |
./full_match/100/0x048DC80e3A072914dA7c8bB77C97309a69E3B206/sources/contracts/FreeBetV2.sol | Owner: sets 'lp' as LP address lp LP address/ | function setLp(address lp) external onlyOwner {
LP = ILP(lp);
emit LpChanged(lp);
}
| 14,270,823 |
pragma solidity ^0.4.24;
import 'openzeppelin-solidity/contracts/ownership/Ownable.sol';
import 'openzeppelin-solidity/contracts/math/SafeMath.sol';
import '../../crowdsale/FundsRegistryWalletConnector.sol';
import '../../crowdsale/SimpleCrowdsaleBase.sol';
import '../../crowdsale/FundsRegistry.sol';
import '../../cro... | minimum amount of funding to consider preSale as successful | function getMinimumFunds() internal view returns (uint256) {
return 200 finney;
}
| 6,456,763 |
./partial_match/1/0xd558f0C903CcAC458495F0Dc776Dbcc78F1adf79/sources/BatchPreOrder.sol | /Enforce that address is indeed a preorder | sellCar function
function attachPreOrder(address dst) public onlyOwner {
require(preOrderAddress == address(0));
require(dst != address(0));
PreOrder preOrder = PreOrder(dst);
preOrderAddress = address(preOrder);
}
| 4,436,087 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
import "./VanillaV1Token02.sol";
import "./VanillaV1Uniswap02.sol";
import "./VanillaV1Migration01.sol";
import "./VanillaV1Safelist01.sol";
import "./interfaces/v1/VanillaV1API01.sol";
import "./interfaces/IVanillaV1Router02.sol";
import "@uniswap... | @inheritdoc IVanillaV1Router02 | function buy( OrderData calldata buyOrder ) external override payable beforeDeadline(buyOrder.blockTimeDeadline) {
address wethSource = verifyWETHAccount(buyOrder);
validateTradeOrderSafety(buyOrder);
_executeBuy(msg.sender, wethSource, buyOrder);
}
| 15,827,113 |
pragma solidity ^0.4.17;
// File: contracts/iERC20Token.sol
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ConsenSys/Tokens
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.17;
/// @title iERC20Token contract
contract iERC20Token {
// FIELDS
... | set blockchain action data in struct _blockchainActionId the blockchain action id currency the token currency symbol accountId the clientId to the blockchain address or smart contract address used in the transaction amount the amount of tokens in the transaction return success true/false denoting successful functi... | function setBlockchainActionData(
bytes32 _blockchainActionId, bytes32 currency,
uint amount, bytes32 accountId, address to, uint pptFee)
public
onlyServerOrOnlyPopulous
returns (bool success)
{
require(actionStatus[_blockchainActionId] == false);
block... | 5,475,835 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
function hasRole(bytes32 role, address account) external view returns... | Adds addresses to the token transfer allowlist. Reverts if any of the addresses already exist in the allowlist. Only callable by owner. addressesToAdd Addresses to add to the token transfer allowlist./ | function addToTokenTransferAllowlist(address[] calldata addressesToAdd)
external
onlyOwner
{
for (uint256 i = 0; i < addressesToAdd.length; i++) {
require(
!_tokenTransferAllowlist[addressesToAdd[i]],
'ADDRESS_EXISTS_IN_TRANSFER_ALLOWLIST'
);
_tokenTransferAllowlist[add... | 13,946,846 |
./full_match/80001/0x7166B2C05F0E5011CE85c360Ad5cf09E487791C1/sources/contracts/base/ERC1155DelayedReveal.sol | Checks whether NFTs can be revealed in the given execution context. | function _canReveal() internal view virtual returns (bool) {
return msg.sender == owner();
}
| 859,981 |
./full_match/1/0x65f92852b7429990302AEb869C9746E2E19e8742/sources/src/HoneyJarPortal.sol | burns the token that is bridged. Contract needs BURNER role | function _debitFrom(address _from, uint16, bytes memory, uint256 _tokenId) internal override {
if (_from != _msgSender()) revert OwnerNotCaller();
if (honeyJar.ownerOf(_tokenId) != _from) revert OwnerNotCaller();
honeyJar.burn(_tokenId);
}
| 16,409,457 |
./partial_match/1/0xAbb62cEEBB0BFBe6D1e1A3F7e43ea8e66B022d49/sources/VestingManager.sol | Retrieves token claim data for a vestor address. _address The vestor address for which to retrieve the token claim data. return An array of TokenClaimInfo containing token claim data for the./ | function getTokenClaimData(
address _address
) public view returns (TokenClaimInfo[] memory) {
return tokenClaimInfo[_address];
}
| 3,629,131 |
./full_match/1/0x45702cc7Be370AB20A817189fEefe3b2E5DF36a4/sources/browser/Oracle_v2.sol | Add a new Liquidity Pool. _lpPool Address of Liquidity Pool./ | function addPool (address _lpPool) public isOwner {
Pools.push(DEX(_lpPool));
}
| 4,872,939 |
pragma solidity 0.4.20;
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including ... | Returns true if betting is allowed within time frame | function canBet() public constant returns(bool) {
return (now >= BETTING_OPENS && now < BETTING_CLOSES);
}
| 583,755 |
pragma solidity 0.6.4;
import "./IERC20.sol";
interface aaRouter{
function setHXYAddress(address _hxyAddress) external;
function setHXBAddress(address _hxbAddress) external;
function setHXPAddress(address _hxpAddress) external;
function setSplitter(address _splitter) external;
... | sends inputValue as ETH to destination | function sendEth(uint transactionId)
public
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction memory _tx = transactions[transactionId];
_tx.executed = true;
require(address(this).balance >= _tx.inputValue, "eth balance too low"... | 562,463 |
/**
*Submitted for verification at Etherscan.io on 2021-12-29
*/
/*
Alpha Coin ($ALPHA)
Website: www.alphacoin.co
Twitter: https://twitter.com/alphacoin22
Instagram: https://bit.ly/33tc47q
*/
pragma solidity 0.8.9;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view re... | SPDX-License-Identifier: Unlicensed | 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)
exte... | 1,999,392 |
./full_match/80001/0x12e14F1FA63c77106326A4b07690a4fDcF64384B/sources/_openzeppelin/contracts_2.5.0/crowdsale/Crowdsale.sol | Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met. beneficiary Address performing the token purchase weiAmount Value in wei involved in the purchase/ solhint-disable-previous-line no-empty-blocks | function _postValidatePurchase(address beneficiary, uint256 weiAmount) internal view virtual {
}
| 865,787 |
./full_match/5/0xC89511CFB3e8cbAA9470a9fE50184EAF7204c175/sources/contracts/TFOP.sol | Returns a list of NFT token IDs owned by a given address/ | function tokensOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_ow... | 1,899,971 |
./full_match/97/0xC6b761a8f6D2c8167Dfac3CEccd34afF7a459A2d/sources/project:/contracts/SaleFactory/saleContracts/PrivateSale.sol | Exclude multiple address from Whitelisting accounts whitelisting address Emits {AccountsWhitelistUpdated} event./ | function excludeAllFromWhitelist(address[] memory accounts)
external
onlyOwner
{
for (uint256 account; account < accounts.length; ++account) {
if (whitelisted[accounts[account]]) {
whitelisted[accounts[account]] = false;
}
}
emit Ac... | 3,272,574 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.