file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./full_match/137/0x1689eF902B72068Ba1E18b3831fDeFf71aD2137D/sources/UniArtsSouvenirs.sol | increments the value of _currentTokenID/ | function _incrementTokenTypeId() private {
_currentTokenID++;
}
| 4,751,134 |
pragma solidity ^0.4.25;
// It's important to avoid vulnerabilities due to numeric overflow bugs
// OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs
// More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/
impo... | Returns array of three non-duplicating integers from 0-9 Pseudo random number...the incrementing nonce adds variation | function getRandomIndex
(
address account
)
internal
returns (uint8)
{
uint8 maxValue = 10;
uint8 random = uint8(uint256(keccak256(abi.encodePacked(blo... | 5,537,389 |
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2; // causes high gas usage, so only use for view functions
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
contract NetEmissionsTokenNetwor... | returns the token name for the given token as a string value tokenId token to check/ | function getTokenType(uint256 tokenId)
external
view
returns (string memory)
{
require(tokenExists(tokenId), "tokenId does not exist");
string memory tokenType =
_TOKEN_TYPES[(_tokenDetails[tokenId].tokenTypeId - 1)];
return tokenType;
}
| 5,390,242 |
//Address: 0xbdb686ac471b374bdc844615c768c2595c2ff2fe
//Contract name: BoostContainer
//Balance: 0.313997738110354442 Ether
//Verification Date: 2/7/2018
//Transacion Count: 123
// CODE STARTS HERE
pragma solidity ^0.4.17;
/**
* Math operations with safety checks
*/
library SafeMathForBoost {
function mul(uint... | Withdraw dividendEther get withdrawAmount that msg.sender can withdraw set the arrayInfoForDeposit.length to mapCompletionNumberForWithdraw execute transfer send event | function withdraw() public isNotCompletedForWithdrawal(msg.sender) whenNotPaused {
uint256 withdrawAmount = getWithdrawValue(msg.sender);
require(withdrawAmount > 0);
mapCompletionNumberForWithdraw[msg.sender] = arrayInfoForDeposit.length;
msg.sender.transfer(withdrawAmount);
... | 5,430,169 |
./full_match/1/0x20Ee1c052e2726Da0DD8774b1CCBc38803A90e9a/sources/YYY.sol | Operator Filter Registry https:github.com/ProjectOpenSea/operator-filter-registry | function setApprovalForAll(address operator, bool approved) public override (ERC721, IERC721) onlyAllowedOperatorApproval(operator) {
super.setApprovalForAll(operator, approved);
}
| 3,170,826 |
/**
*Submitted for verification at Etherscan.io on 2020-08-22
*/
pragma solidity ^0.4.11;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) i... | deprecate current contract if favour of a new one | function totalSupply() constant returns (uint){
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
return _totalSupply;
}
}
| 2,057,916 |
./partial_match/1/0x33Dbb0593D394b84bad7EBC49acacd2c5D12CABe/sources/contracts/opensea/ERC1155Tradable.sol | Will update the base URL of token's URI _newBaseMetadataURI New base URL of token's URI/ | function setBaseMetadataURI(
string memory _newBaseMetadataURI
) public onlyRole(DEFAULT_ADMIN_ROLE) {
_setBaseMetadataURI(_newBaseMetadataURI);
}
| 4,440,100 |
pragma solidity >=0.5.4 <0.6.0;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; }
contract TheAO {
address public theAO;
address public nameTAOPositionAddress;
// Check whether an address is whitelisted and granted a... | Pool's Admin Only Methods / Start/Stop a Pool _poolId The ID of the Pool _status The status to set. true = start. false = stop/ Check pool existence by requiring price > 0 | function updatePoolStatus(uint256 _poolId, bool _status) public {
require (pools[_poolId].price > 0 && (pools[_poolId].adminAddress == msg.sender || AOLibrary.isTheAO(msg.sender, theAO, nameTAOPositionAddress)));
pools[_poolId].status = _status;
emit UpdatePoolStatus(_poolId, _status);
}
| 985,736 |
./full_match/1/0x49c29feb858eae45FeE9866Ec0Dd5f0326E998C5/sources/contracts/Quick721.sol | Mint a single nft/ | function safeMint(address to, uint256 tokenId) external {
_safeMint(to, tokenId);
}
| 9,712,529 |
// SPDX-License-Identifier: UNLICENSED
/**
โฉ~~~~โฉ
ฮพ ๏ฝฅร๏ฝฅ ฮพ
ฮพใ~ใฮพ
ฮพใใ ฮพ
ฮพใใ โ~๏ฝ~๏ฝใ
ฮพใใใใใใ ฮพ
ฮพ ฮพ ฮพ~๏ฝ~ฮพ ฮพ ฮพ
ใ ฮพ_ฮพฮพ_ฮพใฮพ_ฮพฮพ_ฮพ
Alpaca Fin Corporation
*/
pragma solidity 0.6.6;
pragma experimental ABIEncoderV2;
import "../Vault.sol";
contract Actions {
/// @dev The next position ID to be assigned.
... | 1. Decode data 2. Sanity check - If new position, then set ownerOf to be msg.sender - else check that msg.sender is the one who altering the position | function _doWork(
bytes memory _data,
uint256 _msgValue,
uint256 _surrogateID
) internal {
(
address payable _vault,
uint256 _posId,
address _worker,
uint256 _principalAmount,
uint256 _borrowAmount,
uint256 _maxReturn,
bytes memory _workData
) = abi.deco... | 6,435,827 |
pragma solidity >=0.4.22 <0.6.0;
//-----------------------------------------------------------------------------
/// @title Ownable
/// @dev The Ownable contract has an owner address, and provides basic
/// authorization control functions, this simplifies the implementation of
/// "user permissions".
//-----... | ------------------------------------------------------------------------- Deposit VIP-180 tokens from '_to' to approved AAC This contract address must be an authorized spender for '_from'. Throws if tokens to deposit is zero. Throws if sender is not an approved operator for AAC `toUid`. Throws if this contract addr... | function depositTokensFrom (
address _tokenAddress,
address _from,
uint _toUid,
uint _tokens
) external canOperate(_toUid) notZero(_tokens) {
if (isTracking[_tokenAddress] == false) {
trackedVip180s.push(_tokenAddress);
isTracking[_tokenAddress] = ... | 6,383,976 |
pragma solidity 0.4.23;
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
*/
contract Ownable {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
... | Deposit ether to smart-contract and create transfer. Transit address is assigned to transfer by sender. Recipient should sign withrawal address with the transit private key _transitAddress transit address assigned to transfer. return True if success./ can not override existing transfer saving transfer details accrue v... | function deposit(address _transitAddress)
public
whenNotPaused
whenNotStopped
payable
returns(bool)
{
require(transferDct[_transitAddress].amount == 0);
require(msg.value > commissionFee);
... | 1,098,890 |
./partial_match/1/0xbb963750b4e02e044E9b91A68Ef1Fb0d35787654/sources/Pauseable.sol | Enable pause by setting {_paused} to true, then emit the related event | function pause()
public virtual whenNotPaused() onlyOwner() {
_paused = true;
emit Paused(msg.sender);
}
| 4,163,276 |
./full_match/11155111/0x9587EA65C1a544348dA0eF8B964ab0f0ee3579E7/sources/contracts/Contract.sol | utility to create a creator profile when new profile is created, profileId is returned todo implement displaying offering under profile create place for the newProfile inside createdProfiles state variable emit event return the index of the new profile | function createNewProfile(address _owner, string memory _email, string memory _username, string memory _firstname, string memory _lastname, string memory _profileDescription, string memory _profilePic, string memory _bannerPic) public returns (uint256) {
Profile storage newProfile = createdProfiles.pu... | 3,814,068 |
/*
B.PROTOCOL TERMS OF USE
=======================
THE TERMS OF USE CONTAINED HEREIN (THESE โTERMSโ) GOVERN YOUR USE OF B.PROTOCOL, WHICH IS A DECENTRALIZED PROTOCOL ON THE ETHEREUM BLOCKCHAIN (the โPROTOCOLโ) THAT enables a backstop liquidity mechanism FOR DECENTRALIZED LENDING PLATFORMSย (โDLPsโ).
PLEASE READ THESE... | 1. Is toppedUp OR partially liquidated CEther CErc20 take tokens from pool contract | function _doLiquidateBorrow(
ICToken debtCToken,
uint256 underlyingAmtToLiquidate,
uint256 amtToDeductFromTopup,
ICToken collCToken
)
internal
onlyPool
returns (uint256)
{
address payable poolContract = pool();
bool partiallyLiquidated... | 1,244,226 |
pragma solidity ^0.5.3;
library Strings {
// via https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory) {
bytes memory _ba = bytes(_a);
... | Approves another address to transfer the given token ID The zero address indicates there is no approved address. There can only be one approved address per token at a given time. Can only be called by the token owner or an approved operator. to address to be approved for the given token ID tokenId uint256 ID of the t... | function approve(address to, uint256 tokenId) public {
address owner = ownerOf(tokenId);
require(to != owner);
require(msg.sender == owner || isApprovedForAll(owner, msg.sender));
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
| 5,403,953 |
./full_match/5/0xd0F20b37E450bBcf8ac2566FA42Ab1A0E42aB8F1/sources/StolenMemes.sol | when this address can be stolen from can never steal from uni pair or empty wallet | function wenStealFrom(address _address)
public
view
returns (uint256)
{
if (_address == uniPair || balanceOf(_address) == 0) {
return type(uint256).max;
}
return memeStealers[_address].lastTransferTime + timeFromTransfer;
}
| 1,871,218 |
pragma solidity 0.5.10;
contract Context {
constructor () internal { }
function _MSGSENDER793() internal view returns (address payable) { //inject NONSTANDARD NAMING
return msg.sender;
}
function _MSGDATA330() ... | inject NONSTANDARD NAMING | function ALLOWANCE643(address owner, address spender) public view returns (uint256) { | 1,784,033 |
pragma solidity 0.5.15;
// YAM v3 Token Proxy
... | inject NONSTANDARD NAMING | function DIV50(uint256 a, uint256 b) internal pure returns (uint256) { | 5,400,612 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/EnumerableMap.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@open... | returns number of NFTs on user's account | function balanceOf(address user) public view override returns (uint256) {
return _nftHolderTokens[user].length();
}
| 1,056,602 |
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ... | swap to intermediate divide to swap in amountsif no reserve or a new pair is createdif no reserve or a new pair is created | function _performZapIn(
address _toWhomToIssue,
address _FromTokenContractAddress,
address _ToUnipoolToken0,
address _ToUnipoolToken1,
uint256 _amount
) internal returns (uint256) {
address intermediate = _getIntermediate(
_FromTokenContractAddress,
... | 7,662,734 |
./full_match/1/0x85979c90D53E20E4505C83d9408b8A61Beb8db1F/sources/contracts/Aladdin.sol | Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event./indicates if fee should be deducted from transferif any account belongs to _isExcludedFro... | function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool){
uint256 currentAllowance=_allowances[sender][msg.sender];
require(currentAllowance>=amount,"ERC20:transfer amount exceeds allowance");
bool takeFee = true;... | 9,732,638 |
./partial_match/1/0xb9516057dC40C92F91B6EbB2E3d04288cd0446F1/sources/TellorSender.sol | Gets the 5 miners who mined the value for the specified requestId/_timestamp _requestId to looku p _timestamp is the timestamp to look up miners for return bool true if requestId/timestamp is under dispute/ | function isInDispute(uint256 _requestId, uint256 _timestamp) public view returns(bool){
return tellor.isInDispute(_requestId, _timestamp);
}
| 2,700,195 |
./full_match/137/0xE1e46C14F9E400e928b0ead380B98a9309a2307B/sources/contracts/stability-pool-base.sol | to withdraw collateral rewards earned after liquidations this function does not provide an opportunity for a reentrancy attack | function redeemReward() public override {
Snapshots memory snapshots = depositSnapshots[msg.sender];
uint256 contributorDeposit = deposits[msg.sender];
uint256 compoundedDeposit = _getCompoundedDepositFromSnapshots(contributorDeposit, snapshots);
_redeemReward();
_updateDepositAndSnapshots(msg.se... | 4,684,673 |
./partial_match/1/0x242d6E16653b30c830C1918b5Cc23d27253B2d26/sources/ProxyERC20.sol | mock the payload for sendFrom() | function estimateSendFee(uint16 _dstChainId, bytes calldata _toAddress, uint _amount, bool _useZro, bytes calldata _adapterParams) public view virtual override returns (uint nativeFee, uint zroFee) {
bytes memory payload = abi.encode(PT_SEND, abi.encodePacked(msg.sender), _toAddress, _amount);
retur... | 15,547,706 |
./partial_match/1/0x04cB5d4d4F2F33380A30C7720A0710e2F22E1D8F/sources/WandBot.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Wand Bot", "WAND") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUni... | 15,628,561 |
pragma solidity ^0.4.24;
/**
* Audited by VZ Chains (vzchains.com)
* HashRushICO.sol creates the client's token for crowdsale and allows for subsequent token sales and minting of tokens
* Crowdsale contracts edited from original contract code at https://www.ethereum.org/crowdsale#crowdfund-your-idea
* Addition... | Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amount of tokens to be transferred/ | function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) public returns (bool) {
require(_to != address(0));
require(_value <= balance[_from]);
require(_value <= allowed[_from][msg.sender]);
if ((balance[_from] >= _value) && (allowed[_from][msg.sender... | 14,075,563 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./CVNXGovernance.sol";
import "./ICVNX.sol";
/// @notice CVNX token contract.
contrac... | Checks if a user address has voted for a specific poll. _pollNum Poll number _voter Voter address return True if address voted in poll | function getIfUserHasVoted(uint256 _pollNum, address _voter) external view override returns (bool) {
return voted[_pollNum][_voter].voteWeight > 0;
}
| 367,356 |
./partial_match/1/0xB74430E51604957b47D010a20bB78f09Cd4E4330/sources/Gou.sol | maxTransactionAmount exclude from paying fees or having max transaction amount | constructor() ERC20("Gou", "GOU") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswa... | 9,177,182 |
pragma solidity ^0.5.3;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "./SlasherUtil.sol";
contract DowntimeSlasher is SlasherUtil {
using SafeMath for uint256;
// For each address, associate each epoch with the last block that... | Test if a validator has been down. startBlock First block of the downtime. startSignerIndex Validator index at the first block. endSignerIndex Validator index at the last block./ We want to check signers for block n, so we get the parent seal bitmap for the next block | function isDown(uint256 startBlock, uint256 startSignerIndex, uint256 endSignerIndex)
public
view
returns (bool)
{
uint256 endBlock = getEndBlock(startBlock);
require(endBlock < block.number - 1, "end block must be smaller than current block");
require(
startSignerIndex < numberValidat... | 1,820,930 |
// SPDX-License-Identifier: GPL-3.0-or-later
// 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 dis... | Returns the sharedCash shared field, given the current balances for token A and token B./ Both balances are assigned the same block Since it is possible a single one of them has changed (for example, in an Asset Manager update), we keep the latest (largest) one. | function toSharedCash(bytes32 tokenABalance, bytes32 tokenBBalance) internal pure returns (bytes32) {
uint32 newLastChangeBlock = uint32(Math.max(lastChangeBlock(tokenABalance), lastChangeBlock(tokenBBalance)));
return _pack(cash(tokenABalance), cash(tokenBBalance), newLastChangeBlock);
}
| 642,199 |
./partial_match/5/0x2a24c0010A0FF581D85eD1ECC6BDb7eb71c525FE/sources/BlockChainedElite.sol | get price and require this payment to be sent split ETH 70% owner 30% stays in BCE add to flips emit purchase of tokenrequire this ID to be valid -- min if correct ETHmint | function purchase(uint256 tokenId) payable public whileSale{
if(_exists(tokenId)){
require(msg.value == getPrice(tokenId), "BCE: Invalid Price");
address prevOwner = ownerOf(tokenId);
_transfer(prevOwner, _msgSender(), tokenId);
flips[tokenId] ... | 16,863,102 |
./full_match/1/0x0000000000aec84F5BFc2af15EAfb943bf4e3522/sources/lib/solady/src/utils/SignatureCheckerLib.sol | @solidity memory-safe-assembly Clean the upper 96 bits of `signer` in case they are dirty. `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. | function isValidSignatureNow(address signer, bytes32 hash, uint8 v, bytes32 r, bytes32 s)
internal
view
returns (bool isValid)
assembly {
let m := mload(0x40)
mstore(0x00, hash)
let t :=
staticcall(
... | 4,875,417 |
./full_match/4/0x9AC3EE2283e7EB9eeD68Ee7f5d313D96d3Eb5039/sources/Contract.sol | function burn( uint256 value) external returns (bool success); | interface ERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool... | 705,406 |
./full_match/137/0x0a49EbdC20DfBcD90A53b4BA4C74a5DBfb42BECa/sources/contracts/libraries/PrimexPricingLibrary.sol | Decodes an encoded path and returns an array of addresses. encodedPath The encoded path to be decoded. dexRouter The address of the DEX router. dexAdapter The address of the DEX adapter. return path An array of addresses representing the decoded path./ | function decodePath(
bytes memory encodedPath,
address dexRouter,
address dexAdapter
) public view returns (address[] memory path) {
IDexAdapter.DexType type_ = IDexAdapter(dexAdapter).dexType(dexRouter);
if (type_ == IDexAdapter.DexType.UniswapV2 || type_ == IDexAdapter... | 4,795,810 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol';
impo... | Queue the proposal (If Proposal Succeeded), only for Binary proposals proposalId id of the proposal to queue/ generic proposal does not have Succeeded state | function queue(uint256 proposalId) external override {
require(proposalId < _proposalsCount, 'invalid proposal id');
require(
getProposalState(proposalId) == ProposalState.Succeeded,
'invalid state to queue'
);
ProposalWithoutVote storage proposal = _proposals[proposalId].proposalData;
... | 5,428,141 |
pragma solidity ^0.5.2;
// It's important to avoid vulnerabilities due to numeric overflow bugs
// OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs
// More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/
import... | Get airline registration state Can only be called from authorized contract airlineAddress Ethereum address of airline to check return Current registration of airline as `AirlineRegisterationState` enumeration | function getAirlineState(address airlineAddress)
external
view
requireIsOperational
requireCallerAuthorized
requireExistAirline(airlineAddress)
returns(AirlineRegisterationState)
{
return (airlines[airlineAddress].state);
}
| 12,960,000 |
./full_match/1/0x873847b829a33C87c1fb227367D7b28a7DF979b4/sources/contracts/radiant/staking/ChefIncentivesController.sol | Vest tokens to MFD. _user address to receive _amount to vest/ | function _vestTokens(address _user, uint256 _amount) internal {
if (_amount == 0) revert NothingToVest();
IMultiFeeDistribution mfd = _getMfd();
_sendRadiant(address(mfd), _amount);
mfd.vestTokens(_user, _amount, true);
}
| 3,223,443 |
// SPDX-License-Identifier: MIT
/*
* Plug.sol
*
* Author: Jack Kasbeer
* Created: August 3, 2021
*
* Price: 0.0888 ETH
* Rinkeby: 0xf9d798514eb5eA645C90D8633FcC3DA17da8288e
*
* Description: An ERC-721 token that will change based on (1) time held by a single owner and
* (2) trades between owners; the dif... | List the owners of a category of the Plug (Nomad, Chicago, or St. Louis)nomadchicagost. louis | function listPlugOwnersForType(uint8 group)
groupInRange(group) public view returns (address[] memory)
{
address[] memory typeOwners = new address[](MAX_NUM_TOKENS);
uint16 tokenId;
uint16 counter;
if (group == 0) {
for (tokenId = 177; tokenId <= MAX_NUM_TOKENS; tokenId++) {
if (tokenId % 88 != 0 &&... | 12,630,931 |
// SPDX-License-Identifier: MIT @GoPocketStudio
pragma solidity ^0.7.5;
pragma abicoder v2;
interface IERC1155 {
function balanceOf(address account, uint256 id) external view returns (uint256);
}
interface IERC721 {
function ownerOf(uint256 tokenId) external view returns (address owner);
}
contract NFTBalanc... | check if token is actually a contract | function isContract(address token) public view returns(bool){
uint256 tokenCode;
return tokenCode > 0;
}
| 1,463,690 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./OpenZeppelin/access/Ownable.sol";
import "./OpenZeppelin/utils/Pausable.sol";
import "./OpenZeppelin/token/ERC721/ERC721.sol";
import "./OpenZeppelin/token/ERC721/ERC721Holder.sol";
import "./Settings.sol";
import "./ERC721TokenVault.sol";
contract ER... | the function to mint a new vault _name the desired name of the vault _symbol the desired sumbol of the vault _token the ERC721 token address fo the NFT _id the uint256 ID of the token _listPrice the initial price of the NFT return the ID of the vault | function mint(string memory _name, string memory _symbol, address _token, uint256 _id, uint256 _supply, uint256 _listPrice, uint256 _fee) external whenNotPaused returns(uint256) {
TokenVault vault = new TokenVault(settings, msg.sender, _token, _id, _supply, _listPrice, _fee, _name, _symbol);
emit Mint(_token... | 11,686,977 |
./full_match/1/0x42E1bA48137cf3f91A84d8C81AEeBbCaeA44F40f/sources/ZooToken.sol | Gets the current votes balance for `account` account The address to get votes balance return The number of current votes for `account`/ | function getCurrentVotes(address account)
external
view
returns (uint256)
{
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
| 16,462,673 |
pragma solidity ^0.5.2;
contract IERC223 {
/* IERC20 */
function approve(address spender, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function totalSupply() public view returns (uint256);
function balanceOf(address who)... | return the token being held./ | function token() public view returns (IERC223) {
return _token;
}
| 983,774 |
// 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,... | Gets the string representation of the contract version (fulfills interface) return versionString_ The version string | function versionPaymaster() external view override returns (string memory versionString_) {
return "2.2.3+opengsn.enzymefund.ipaymaster";
}
| 355,563 |
./partial_match/1/0x6b9e434b3e164EBc88c1f3cfAB8361C2d00a016e/sources/CTSellOffer.sol | Allows acceptance of sell offer contract by the buyer. Can only be called from GT Token contract/ | function acceptOffer() external onlyTokenContract {
offer.completed = true;
offer.active = false;
}
| 16,039,146 |
./partial_match/4/0x40B4d33637e7b50c08D5AfC6499F49f6DBb4caaC/sources/REVVInventory.sol | Transfers multiple tokens to another address Reverts if `ids` and `values` have inconsistent lengths. Reverts if `to` is the zero address. Reverts if the sender is not approved. Reverts if one of `ids` represents a non-fungible collection. Reverts if one of `ids` represents a non-fungible token and its paired `val... | function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal virtual {
require(to != address(0), "Inventory: transfer to zero");
uint256 length = ids.length;
require(length =... | 8,519,783 |
pragma solidity ^0.4.24;
/*
* gibmireinbier - Full Stack Blockchain Developer
* 0xA4a799086aE18D7db6C4b57f496B081b44888888
* gibmireinbier@gmail.com
*/
/*
CHANGELOGS:
. GrandPot : 2 rewards per round
5% pot with winner rate 100%,
no dividends, no fund to F2M contract
... | used to draw grandpot results weightRange = roundWeight grandpot / (grandpot - initGrandPot) grandPot = initGrandPot + round investedSum(for grandPot) | function getWeightRange(uint256 initGrandPot)
public
pure
returns(uint256)
{
uint256 avgMul = 30;
return ((initGrandPot * 2 * 100 / 68) * avgMul / SLP) + 1000;
}
| 887,379 |
pragma solidity ^0.5.11;
pragma experimental ABIEncoderV2;
contract STOEscrowBox {
address public authCertVoucherLedgerAddress;
address public userCertVoucherLedgerAddress;
struct Vote {
bool _created;
bool _passed;
bool _executed;
bool _cancelled;
uint256 _voteNum... | anyone holds userCert proposes | function mode_0 (address _ledger, uint256 _value, address _from, bytes memory _data) private returns (bool) {
require(
getLedgerBalanceHumanNumber(userCertVoucherLedgerAddress, _from) > 0 ||
getLedgerBalanceHumanNumber(authCertVoucherLedgerAddress, _from) > 0);
(bytes32 _vot... | 7,281,352 |
./partial_match/42/0x1714642791bca216fd5A46f5F7F908558DA093b3/sources/STYK_I.sol | Alias of sell() and withdraw()./ get token count for caller & sell them all | function exit() public {
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
withdraw();
userAdded[_customerAddress] = false;
uint256 index = getUserAddressIndex(_customerAddress);
... | 3,453,128 |
./partial_match/1/0x3CF90663216378760b3f841b20cA19C5c39795cc/sources/FadedArcade.sol | Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`, consuming from one or the other at each step according to the instructions given by `proofFlags`. _Available since v4.7._/ This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by consum... | function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(
leavesLen + proof... | 2,678,337 |
./full_match/5/0xA0E69f8Cf9f8F8555e1Bd0983214871e674ac30F/sources/contracts/tenderswap/TenderSwap.sol | @inheritdoc ITenderSwap | function removeLiquidityImbalance(
uint256[2] calldata _amounts,
uint256 _maxBurnAmount,
uint256 _deadline
) external override nonReentrant deadlineCheck(_deadline) returns (uint256) {
SwapUtils.PooledToken[2] memory tokens_ = [token0, token1];
return
SwapUti... | 7,038,727 |
./full_match/11155111/0x5d78a75E1adaBe80AC410D4b4aEAF68c9D78B6d2/sources/contracts/interfaces/IDiamondLoupe.sol | A loupe is a small magnifying glass used to look at diamonds. These functions look at diamonds | interface IDiamondLoupe {
pragma solidity ^0.8.21;
struct Facet {
address facetAddress;
bytes4[] functionSelectors;
}
}
| 3,806,441 |
// Sources flattened with hardhat v2.8.3 https://hardhat.org
// File @openzeppelin/contracts/utils/cryptography/MerkleProof.sol@v4.4.2
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of M... | Required interface of an ERC721 compliant contract./ | interface IERC721 is IERC165 {
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
event ApprovalForAll(
address indexed owner,
address indexed operato... | 1,102,762 |
pragma solidity 0.5.7;
import 'openzeppelin-eth/contracts/ownership/Ownable.sol';
import './MixinKeys.sol';
import './MixinLockCore.sol';
import 'openzeppelin-solidity/contracts/math/SafeMath.sol';
import './MixinFunds.sol';
contract MixinRefunds is
Ownable,
MixinFunds,
MixinLockCore,
MixinKeys
{
using Saf... | CancelAndRefund will return funds based on time remaining minus this penalty. This is calculated as `proRatedRefund refundPenaltyNumerator / refundPenaltyDenominator`. | {
using SafeMath for uint;
uint public refundPenaltyNumerator = 1;
uint public refundPenaltyDenominator = 10;
event CancelKey(
uint indexed tokenId,
address indexed owner,
uint refund
);
event RefundPenaltyChanged(
uint oldRefundPenaltyNumerator,
uint oldRefundPenaltyDenominator,
... | 1,761,061 |
./full_match/9001/0x9142f0e8dA6C6798b207536567B883269bf0A9E3/sources/contracts/StarFarmLib.sol | Harvest execution method | function harvest(uint256 _pid, address _user, uint256 _amount, bool isNFT) external onlyStarFarm {
PoolInfo storage pool = poolInfo[_pid];
UserInfo memory user;
SlotInfo memory slot;
(user.amount, user.rewardDebt, user.lastDeposit, user.nftAmount, user.nftRewardDebt, ) = starFarm.use... | 11,534,106 |
/*
Utility functions for safe math operations. See link below for more information:
https://ethereum.stackexchange.com/questions/15258/safemath-safe-add-function-assertions-against-overflows
*/
pragma solidity ^0.4.19;
contract SafeMath {
function safeAdd(uint256 x, uint256 y) pure internal returns (ui... | Function of transferring tokens from a delegated account Regular transfer. Not to verification address Check if the transfer initiator has permissions to move funds from the sender's account If yes - perform transfer Decrease the total amount that initiator has permissions to access | function transferFrom(address _from, address _to, uint256 _value) external isTransactionsOn( _from ) returns ( bool success )
{
require( verificationAddressNumberMap[ _to ]==0 );
if ( allowed[_from][msg.sender] >= _value )
{
if ( _transfer( _from, _to, _value ) )
{
allowed[_from][msg.sender] = safeSub... | 6,396,232 |
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
import { ContractUpgradeableSigner } from './contract-upgradeable-signer.sol';
import { DataStructures } from './data-structures.sol';
contract Network is ContractUpgradeableSigner {
uint constant public maxTransfersInProgress = 10;
uint constant public tr... | isAcceptableTransfer checks to see if this transfer may submitted to the network | function isAcceptableTransfer(
DataStructures.Quote memory quote
)
public
view
returns (bool)
{
if(quote.blockNumberMin > block.number){
return false;
}
if(quote.blockNumberMax < block.number && quote.blockNumberMax != 0){
return false;
}
if(maxTransfersInProgress >... | 14,104,368 |
pragma solidity >0.8.0;
import "./FlightSuretyData.sol";
import "./FlightSuretyGovernance.sol";
import "./FlightSuretyWallet.sol";
//solidity >0.8.x integrates safe math
/************************************************** */
/* FlightSurety Smart Contract */
/**************************************... | Called by oracle when a response is available to an outstanding request For the response to be accepted, there must be a pending request that is open and matches one of the three Indexes randomly assigned to the oracle at the time of registration (i.e. uninvited oracles are not welcome) Information isn't considered ver... | function submitOracleResponse
(
uint8 index,
address airline,
string memory flight,
uint256 timestamp,
uint8 statusCode
)
... | 2,545,735 |
./partial_match/1/0xD034b96388C2919c0a1BdcAC5ad34c3e5F8a99EA/sources/ERC20ByMetadropV1.sol | function {_autoSwap} Automate the swap of accumulated tax fees to native token from_ The sender of the token/ Store that a swap back is in progress: Perform the auto swap to native token: Flag that the autoswap is complete: | function _autoSwap(address from_, address to_) internal {
if (tokenHasTax) {
uint256 taxBalance = balanceOf(address(this));
if (_eligibleForSwap(from_, to_, taxBalance)) {
autoSwapEnabled = false;
_swapTaxForNative(taxBalance);
autoSwapEnabled = true;
}
}
}
| 4,221,087 |
./full_match/8453/0x7D691e6b03b46B5A5769299fC9a32EaC690B7abc/sources/contracts/libraries/Locations.sol | Decodes the lower bytes of a location as an address. This assumes location type is an address. loc The location to convert. return addr The location as an address./ | function locationToAddress(bytes32 loc) internal pure returns (address addr) {
bytes32 lower31 = loc & MASK_POOL_ID;
if(lower31 > MASK_ADDRESS) revert Errors.HydrogenInvalidLocationToAddressCast();
return address(uint160(uint256(lower31)));
}
| 11,557,815 |
./partial_match/1/0x52dAb11c6029862eBF1E65A4d5c30641f5FbD957/sources/AccountLogic.sol | called from 'enter' | function changeAllOperationKeys(address payable _account, address[] calldata _pks) external allowSelfCallsOnly {
uint256 keyCount = accountStorage.getOperationKeyCount(_account);
require(_pks.length == keyCount, "invalid number of keys");
require(accountStorage.getDelayDataHash(_account, CHANGE_ALL_OPERATION_KEY... | 16,014,809 |
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
... | Overrides parent to increase the number of tokensSold. _beneficiary Address receiving the tokens _tokenAmount Number of tokens to be purchased/ | function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
tokensSold = tokensSold.add(_tokenAmount);
super._processPurchase(_beneficiary, _tokenAmount);
}
| 2,334,225 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
imp... | Claim a specific amount of tokens. index Unique idendifier of tree record. Records with same index are not allowed account Air-droped tokens owner amountUSDC Amount of USDC tokens to claim amountBUMP Amount of BUMP tokens to claim merkleProof Proof of data accuracy Verify the merkle proof. Mark it claimed and sen... | function _claim(
uint256 index,
address account,
uint256 amountUSDC,
uint256 amountBUMP,
bytes32[] memory merkleProof
) internal {
require(merkleRoot != bytes32(0), "Merkle root not set");
require(!isClaimed(index), "Drop already claimed");
bytes3... | 14,578,451 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
// IMPORTS //
/**
* @dev ERC721 token standard
*/
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
/**
* @dev Modifier 'onlyOwner' becomes available, where owner is the contract deployer
*/
import "@openzeppelin/contracts/a... | Set the status of claim minitng _status boolean where true = live/ | function setClaimStatus(bool _status) external onlyOwner {
claimStatus = _status;
}
| 2,511,098 |
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: 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.
*/
function totalSupply() external ... | File: contracts/handlers/furucombo/IStaking.sol | interface IStaking {
function stakingToken() external view returns (address);
function redeemable() external view returns (address);
function stakeFor(address, uint256) external;
function unstakeFor(address, uint256) external;
function claimWeeks(address, IMerkleRedeem.Claim[] calldata) external;
}
| 1,559,520 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.4;
import "../../openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "./module/PerpetualModule.sol";
import "./Type.sol";
import "./Storage.sol";
// @title Goovernance is the contract to maintain liquidityPool parameters.
contract Governanc... | Use in a two phase operator transfer design: 1. transfer operator to new operator; 2. new operator claim to finish transfer. Before claimOperator is called, operator wil remain to be the previous address. There are condition when calling transferring operator: 1. when ... | function transferOperator(address newOperator) public {
require(newOperator != address(0), "new operator is zero address");
address operator = _liquidityPool.getOperator();
if (operator != address(0)) {
require(_msgSender() == operator, "can only be initiated by operator");
... | 6,426,374 |
./partial_match/5/0x8dF9D355873b1cf8E9b05CEBF685f711f8Bc9f4D/sources/contracts/mixins/NFT721Metadata.sol | Contract constructor. When implementing this contract don't forget to set nftName and nftSymbol./ | function _updateTokenNameAndSymbol(string memory _name, string memory _symbol) internal {
nftName = _name;
nftSymbol = _symbol;
}
| 16,857,310 |
./full_match/4/0xB47d13DD287d0Da4E6A01C745b395890200262BA/sources/contracts/VRFAnimalLoot.sol | _safeMint(owner(), tokenId); | function ownerClaim(uint256 tokenId) public nonReentrant onlyOwner {
require(tokenId > 8788 && tokenId < 8889, "Token ID invalid");
requestRandomness(keyHash, fee);
}
| 12,282,850 |
./full_match/1/0xa213C344D14e9aE9DA2b70a8f9A0122131d59274/sources/contracts/FutureQuest.sol | Verify Coupon Verify that the coupon sent was signed by the coupon signer and is a valid coupon Valid coupons will include coupon signer, address, and allotted mints Returns a boolean value digest The digest coupon The coupon/ | function _isVerifiedCoupon(bytes32 digest, Coupon calldata coupon)
private
view
returns (bool)
{
address signer = ecrecover(digest, coupon.v, coupon.r, coupon.s);
require(signer != address(0), "Zero Address");
return signer == _couponSigner;
}
| 8,357,605 |
pragma solidity ^0.4.18;
// <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... | validate roll dice request, and log the bet info number player choosen, from [2,99] user address/ map bet id to this oraclize query / map user lucky number to this oraclize query / map value of wager to this oraclize query / map user address to this oraclize query / safely map user profit to this oraclize query / | function userRollDice(uint rollUnder, address userAddr) public
payable
gameIsActive
betIsValid(msg.value, rollUnder)
{
require((msg.value == 100000000000000000 && rollUnder == 76) || (msg.value == 200000000000000000 && rollUnder == 51) || (msg.value == 1000000000000000000... | 12,184,478 |
/**
*Submitted for verification at Etherscan.io on 2022-01-19
*/
// Sources flattened with hardhat v2.8.2 https://hardhat.org
// File contracts/solidity/interface/INFTXEligibility.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface INFTXEligibility {
// Read functions.
function name() ex... | Cryptokitties. data = abi.encodeWithSignature("approve(address,uint256)", to, tokenId); No longer needed to approve with pushing. CryptoPunks. No longer needed to approve with pushing. | function approveERC721(address assetAddr, address to, uint256 tokenId) internal virtual {
address kitties = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d;
address punks = 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB;
bytes memory data;
if (assetAddr == kitties) {
return;
data = abi.encodeWi... | 6,707,653 |
./full_match/1/0x5C1Dbcb680f19b66907effD9F291880a4776d592/sources/contracts/diamond/abstracts/AccessControl.sol | Grants `role` to `account`. Internal function without access restriction. May emit a {RoleGranted} event./ | function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
s.roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
| 4,974,017 |
/**
* Source Code first verified at https://etherscan.io on Friday, April 26, 2019
(UTC) */
pragma solidity >=0.4.22 <0.6.0;
/**
* @title SafeMath
* Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a,... | send userBalance[msg.sender] ethers to msg.sender if mgs.sender is a contract, it will call its fallback function | function withdrawBalance_re_ent19() public{
if( ! (msg.sender.send(userBalance_re_ent19[msg.sender]) ) ){
revert();
}
userBalance_re_ent19[msg.sender] = 0;
}
uint256 public cap;
| 951,843 |
./full_match/80001/0xF9db858E9958dDd5795571558C5c585E2683FB75/sources/contracts/ParagonsDAOPlayerID.sol | Returns Base64 encoded JSON for ERC721 Token URI. | function tokenURI(uint256 tokenId) public view override returns (string memory) {
if (!_exists(tokenId)) revert NoPDP();
return constructTokenURI(tokenId);
}
OWNER FUNCTIONS
| 843,785 |
/**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
/**
โโโโโ โโ โโโโโ โโโ โโโโโ โ โโ โ โ โโ โโ โ โโโโโ
โ โโ โ โ โ โโ โโ โโ โ โ โ โ โ โ โ โ โโ โ โ โโ
โ โโโโโ โโโโ โโโโ โ โ โ โ โโโโ โโโโโ โโโโ โ โโ โ โ โ โโโโโ
โโโโโโ โ โ โ โ... | Decreases internal data structure which tracks free bond per archaeologist data the system's data struct instance archAddress the archaeologist's address to operate on amount the amount to decrease free bond by/ load up the archaeologist decrease the free bond variable by amount, reverting if necessary | function decreaseFreeBond(
Datas.Data storage data,
address archAddress,
uint256 amount
) private {
Types.Archaeologist storage arch = data.archaeologists[archAddress];
require(
arch.freeBond >= amount,
"archaeologist does not have enough free bon... | 2,451,153 |
./full_match/8453/0x1a920B29eBD437074225cAeE44f78FC700B27a5d/sources/contracts/AxelarGateway.sol | AUDIT: If `newImplementation.setup` performs `selfdestruct`, it will result in the loss of _this_ implementation (thereby losing the gateway) if `upgrade` is entered within the context of _this_ implementation itself. solhint-disable-next-line avoid-low-level-calls | function upgrade(
address newImplementation,
bytes32 newImplementationCodeHash,
bytes calldata setupParams
) external override onlyAdmin {
if (newImplementationCodeHash != newImplementation.codehash) revert InvalidCodeHash();
emit Upgraded(newImplementation);
if... | 11,536,157 |
pragma solidity ^0.5.10;
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
... | inject NONSTANDARD NAMING | function APPROVE183(address spender, uint256 amount) external returns (bool); | 13,026,270 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract TheRebirth is ERC721Enumerable, Ownable, Reentran... | not revealed URI redemption URI | function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
if(revealed == false) {
return bytes(notRevealedURI).length > 0
? string(abi.enco... | 7,015,585 |
./full_match/5/0xCf86e56b395032163dd4Af966500e2F189f29637/sources/contracts/contracts-V6/src/StandardCampaign.sol | Donate to a campaign โ
| function fundCampaign(
uint256 _id,
uint256 _funding
) public payable isMoneyIntended(_funding) {
checkCampaignExists(_id);
CampaignManager.Campaign storage campaign = campaigns[_id];
campaign.fundCampaign(_funding);
}
| 7,070,515 |
./full_match/40/0xd5dfA52343d2BEbc587D49ADc4fAD83154922445/sources/project_/contracts/IArcanaERC20.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IArcanaERC20 is IERC20 {
function mint(address to, uint256 amount) external;
pragma solidity ^0.8.2;
}
| 9,550,366 |
./full_match/97/0xe75d306558b6F072Ad64323EACD0D2133e51aafD/sources/project:/contracts/TokenFactory/factories/MarketplaceFactory.sol | Creates an ERC1155 token by the caller with OPERATOR_ROLE. uri. salt. Emits a {CreatedERC1155} event indicating the token address./ | function createERC1155Token(string memory uri, uint salt)
external
onlyRole(OPERATOR_ROLE)
whenNotPaused
nonReentrant
{
address beaconProxy = _deployProxy(_getERC1155Data(uri), salt, tokenTypes.ERC1155);
ERC1155 token = ERC1155(address(beaconProxy));
... | 3,283,675 |
./full_match/4/0xf02eb75EC54deA39A16d6037C09456e39f9E7880/sources/ERC721.sol | See {IERC721Enumerable-tokenOfOwnerByIndex}./ | function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
| 764,748 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "../../ConverterVersion.sol";
import "../../interfaces/IConverter.sol";
import "../../interfaces/IConverterAnchor.sol";
impo... | helper, dispatches the Conversion event sourceToken source ERC20 token targetToken target ERC20 token trader address of the caller who executed the conversion sourceAmount amount purchased/sold (in the source token) targetAmount amount returned (in the target token) feeAmount the fee amount/ | function dispatchConversionEvent(
IReserveToken sourceToken,
IReserveToken targetToken,
address trader,
uint256 sourceAmount,
uint256 targetAmount,
uint256 feeAmount
) private {
emit Conversion(sourceToken, targetToken, trader, sourceAmount, targetAmount, ... | 12,547,179 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
contract TaskBlacklist is Ownable {
/// @notice The blacklist of the tasks.
mapping(bytes32 => bool) private _blacklistedTasks;
event TaskBlacklistAdded(bytes32 taskId);
... | Ban the task from being able to be executed. _taskId The task to be banned. | function banTask(bytes32 _taskId) external onlyOwner {
_blacklistedTasks[_taskId] = true;
emit TaskBlacklistAdded(_taskId);
}
| 12,843,596 |
./partial_match/1/0xAAcC51327ad63E22a63D8E1b2187716182D56dad/sources/src/test/MaliciousRecipient.sol | Also receive some eth in the process | function setStartAttack() public payable {
startAttack = true;
}
| 16,103,558 |
// Dependency file: @openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)
// pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contra... | Execute a voted proposal If positiveVoted < 70%, It need to pass 50% and expired | function execute(uint256 proposalId) external onlyListedOwner returns (bool) {
Proposal memory currentProposal = _proposalStorage[proposalId];
int256 positiveVoted = _calculatePercent(currentProposal.vote);
if (positiveVoted < 70) {
require(block.timestamp > _proposalStorage[proposalId].expired, "Mu... | 6,437,687 |
// SPDX-License-Identifier: U-U-U-UPPPPP!!!
pragma solidity ^0.7.4;
import "./TokensRecoverable.sol";
import "./IERC31337.sol";
import "./IUniswapV2Router02.sol";
import "./IERC20.sol";
import "./RootedTransferGate.sol";
import "./IUniswapV2Factory.sol";
import "./SafeMath.sol";
import "./SafeERC20.sol";
import "./ILi... | Sweeps the Base token under the floor to this address | function sweepFloor() public override liquidityControllerOnly()
{
elite.sweepFloor(address(this));
}
| 14,338,773 |
// contracts/GameItems.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface ExternalContract {
function balanceOf(address owner) e... | Get array of minted token ids | function getMintedTokenIds() public view returns (uint256[] memory) {
return mintedTokenIds;
}
| 10,378,797 |
./full_match/4/0x999B3AC9F446374F1D1779daf768b904586E812b/sources/TimelockController.sol | Cancel an operation. Requirements: - the caller must have the 'canceller' role./ | function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE) {
require(isOperationPending(id), "TimelockController: operation cannot be cancelled");
delete _timestamps[id];
emit Cancelled(id);
}
| 827,926 |
./partial_match/1/0xA83Bb332564e226779963bF0cD7c8ED4aAE40E95/sources/DarkMaster.sol | Handover the Darktoken mintage right. | function handoverDarkMintage(address newOwner) public onlyOwner {
dark.transferOwnership(newOwner);
}
| 16,049,406 |
./full_match/1/0x8D8912E1237F9FF3EF661F32743CFB276E052F98/sources/redpacket.sol | It takes the unhashed password and a hashed random seed generated from the user Unsuccessful | function claim(bytes32 id, string memory password, address payable recipient, bytes32 validation)
public returns (uint claimed) {
RedPacket storage rp = redpacket_by_id[id];
Packed memory packed = rp.packed;
require (unbox(packed.packed1, 224, 32) > block.timestamp, "Expired");
... | 8,467,675 |
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
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 ... | Make sure symbol has 3-8 chars in [A-Za-z._] and name has up to 128 chars. | function checkSymbolAndName(
string memory _symbol,
string memory _name
)
internal
pure
{
bytes memory s = bytes(_symbol);
require(s.length >= 3 && s.length <= 8);
for (uint i = 0; i < s.length; i++) {
require(
);
}
... | 2,246,193 |
./full_match/1/0x197CFa4C1275130699de3137E91a6d4e5A3Edd21/sources/scripts/contracts/Ownable.sol | Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./ | function transferOwnership(address newOwner) public onlyOwner {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| 4,879,191 |
//Address: 0xA5d1e58ECe1fC438d64E65769d2ab730143a4Caf
//Contract name: RobomedIco
//Balance: 555.251988902432127803 Ether
//Verification Date: 10/24/2017
//Transacion Count: 1252
// CODE STARTS HERE
pragma solidity ^0.4.11;
/**
* @title Math
* @dev Assorted math operations y
*/
library Math {
function max64... | Transfer tokens from one address to another _from address The address which you want to send tokens from _to address The address which you want to transfer to _value uint256 the amout of tokens to be transfered/ Check is not needed because sub(_allowance, _value) will already throw if this condition is not met requi... | function transferFrom(address _from, address _to, uint256 _value) public afterIco returns (bool) {
var _allowance = allowed[_from][msg.sender];
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_va... | 5,365,246 |
./full_match/1/0x9e52dB44d62A8c9762FA847Bd2eBa9d0585782d1/sources/contracts/v2/core/SgETH.sol | Remove a minter - only callable by DEFAULT_ADMIN_ROLE enforced internally oz uses maps so 0 address will return true but does not break anything | function removeMinter(address minterAddress) external {
revokeRole(MINTER, minterAddress);
}
| 9,711,503 |
pragma solidity ^0.6.0;
... | inject NONSTANDARD NAMING | function LOG40(string memory p0, uint p1, string memory p2, address p3) internal view { | 1,019,031 |
pragma solidity ^0.4.20; // Solidity compiler version supported by Azure Blockchain Workbench
//---------------------------------------------
//Generated automatically for application 'BasicProvenance' by AppCodeGen utility
//---------------------------------------------
import "./BasicProvenance.sol";
contract Wor... | Transition preconditions Call overridden function Complete in this contract Transition postconditions | function Transition_InTransit_Number_1_Complete () public {
require(State == StateType.InTransit);
Complete();
assert(State == StateType.Completed);
}
| 6,375,321 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IVotingPowerFormula.sol";
import "./lib/ReentrancyGuardUpgradeable.sol";
import "./lib/PrismProxyImplementation.sol";
import "./lib/VotingPowerStorage.sol";
import "./lib/SafeERC20.sol";
/**
* @title VotingPower
* @dev Implementation contr... | Address of lockManager return Address of lockManager/ | function lockManager() public view returns (address) {
AppStorage storage app = VotingPowerStorage.appStorage();
return app.lockManager;
}
| 7,225,145 |
./full_match/1/0x5F0752b1Da55277f7FaF478Bc30857B25FE10edD/sources/localhost/picontract/picontract.sol | _pi ๆฏๆ pi token ็ๅ็บฆ _entrance ๆ pi token ็้ธๅธๅ็บฆ _balancer ๆฏ pi token/weth ๅ็บฆ็ๅฐๅ _minAmountOut ๆฏๆๅๆๅฐ้่ฆ่ทๅพๅคๅฐ weth buy token at balancer exit the pie pool check result | function balancerToPi(
address _entrance,
address _balancer,
uint256 _slippageDiscount,
uint256 _slippageDiscountBase
) public payable onlyTrader {
uint256 ethIn = (msg.value % (1 ether)) * 100;
uint256 maxPrice = 1000000000000000000000000000;
uint256 _min... | 8,426,677 |
pragma solidity ^0.4.20;
/*
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ... | -- APPLICATION ENTRY POINTS --/ add administrators here | function POW33()
public
{
administrators[0x3446e0F8Bc2556a2f00A317D89549DBbD6e26458] = true;
}
| 10,123,304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.