file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: MIT
// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move con... | treasuryAccount_ The address of the system treasury account | function updateTreasuryAccount(address payable treasuryAccount_)
external
override
onlyController
{
treasuryAccount = treasuryAccount_;
}
| 13,875,876 |
./full_match/5/0x48b10b2540bAfA2e3903538487155643CA4d89B3/sources/project_/contracts/Crowdsale.sol | Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. _beneficiary Address performing the token purchase _weiAmount Value in wei involved in the purchase/ | function _preValidatePurchase(address _beneficiary, uint256 _weiAmount)
internal
pure
virtual
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
| 7,085,113 |
./full_match/40/0x8CFA3e3b2d869F5120Cc0aF1da5780e152Dc3b7f/sources/contracts/ApeUsdtUsdc.sol | Function to synchronize balances before new user deposit. Can be overridden in the strategy | function beforeDeposit() external {
require(msg.sender == vault, "!auth");
if(harvestOnDeposit){
_harvest(tx.origin);
}
}
| 9,541,724 |
./partial_match/1/0x6afE6C37bF75f80D512b9D89C19EC0B346b09a8d/sources/RariFundController.sol | Destroys `amount` tokens from `account`. Caller must have the {MinterRole}./ Claim RGT, then burn RYPT | function fundManagerBurnFrom(address account, uint256 amount) public onlyMinter {
if (address(rariGovernanceTokenDistributor) != address(0) && block.number > rariGovernanceTokenDistributor.distributionStartBlock()) rariGovernanceTokenDistributor.distributeRgt(account, IRariGovernanceTokenDistributor.RariPoo... | 2,629,222 |
import "dapple/test.sol";
import "dapple/reporter.sol";
contract Trie {
struct Node {
bool known;
byte letter;
byte[] childset; // only needed for iteration
mapping (byte => bool) child;
}
mapping (bytes => Node) node;
function Trie() {
}
function add(bytes word) {
bytes memory cur... | @doc Tree@doc here the rendered tree: | function testFormat() {
trie.add("foo");
trie.add("foa");
trie.add("foamous");
trie.add("bar");
format();
}
| 2,514,109 |
pragma solidity 0.8.7;
import "./libs/rocketswap-lib/math/SafeMath.sol";
import "./libs/rocketswap-lib/token/BEP20/IBEP20.sol";
import "./libs/rocketswap-lib/token/BEP20/SafeBEP20.sol";
import "./interfaces/IMasterBotdex.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/securit... | Sets call fee Only callable by the contract admin./ | function setCallFee(uint256 _callFee) external onlyAdmin {
require(
_callFee <= MAX_CALL_FEE,
"callFee cannot be more than MAX_CALL_FEE"
);
callFee = _callFee;
}
| 6,368,668 |
pragma solidity 0.4.21;
// File: contracts/BytesDeserializer.sol
/*
* This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net
*
* Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt
*/
/*
* Deserialize... | This is necessary for the blacklisted user to pull his ether from the contract upon being refunded | function collectRefund() external {
require(refundable[msg.sender] > 0);
require(refunded[msg.sender] == false);
uint256 theirwei = refundable[msg.sender];
refundable[msg.sender] = 0;
refunded[msg.sender] == true;
msg.sender.transfer(theirwei);
RefundCollected(msg.sender, now);
}
| 2,166,632 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.7.0;
import "./libs/LibAccess.sol";
import "./libs/LibStorage.sol";
import "./Types.sol";
import "hardhat/console.sol";
abstract contract BaseAccess {
using LibAccess for Types.AccessControl;
//bytes32 public constant ADMIN_ROLE = keccak256("ADMI... | Get the current configuration struct/ | function getConfig() external view returns (Types.Config memory) {
return LibStorage.getConfigStorage().copy();
}
| 21,785 |
//Address: 0x872f634ce643a9b5a4d9bcfa0714382267839fcc
//Contract name: JaroCoinCrowdsale
//Balance: 3 wei
//Verification Date: 5/30/2018
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/... | Helper function that checks for ERC777TokensRecipient on the recipient and calls it. May throw according to `_preventLocking` _from The address holding the tokens being sent _to The address of the recipient _amount The number of tokens to be sent _userData Data generated by the user to be passed to the recipient ... | function callRecipient(
address _operator,
address _from,
address _to,
uint256 _amount,
bytes _userData,
bytes _operatorData,
bool _preventLocking
) private {
address recipientImplementation = interfaceAddr(_to, "ERC777TokensRecipient");
if... | 7,316,310 |
pragma solidity ^0.5.0;
/**For Ethereum*/
import "https://github.com/niguezrandomityengine/ethereumAPI/nreAPI.sol";
contract Randomness is usingNRE {
function randomNumber() public view returns (uint256){
return (ra()%(10**10));
}
}
contract owned {
address payable public owner;
// Contract cons... | / 1. Calculates the fee that goes to the house/contract. 2. Calculates the total prize that can be paid out to winners, after paying the owner/house. 3. Gets the amount bet on the winning result, so it can be used to split 4. Pays out players. Calculates the ratio between player's bet amount and the total prize, to det... | function rewardWinners(BetOption result) private onlyOwner closedForBets {
BetOption winningOption = BetOption(result);
uint fee = address(this).balance * sessions[sessionIndex].ownerFee / 100;
uint totalPrize = address(this).balance - fee;
uint winningBetAmount;
if (winningO... | 2,535,220 |
pragma solidity ^0.4.24;
/**
* @title ERC223 interface
* @dev see https://github.com/ethereum/EIPs/issues/223
*/
interface ERC223I {
function balanceOf(address _owner) external view returns (uint balance);
function name() external view returns (string _name);
function symbol() external view ret... | Returns the minimum value of two numbers./ | function min(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x <= y ? x : y;
return z;
}
| 1,768,885 |
./full_match/42/0xa3331c7d5999460b925AdfEc1B63D8032283CE88/sources/Users/apple/Documents/yai-protocol-private/contracts/strategies/yearnStrategy/yearnTestnet.sol | Controller only function for creating additional rewards from dust | function withdraw(IERC20 _asset, address to, uint256 amount) external returns (uint256) {
require(msg.sender == IStorage(_storage).governance(), "!governance");
_asset.safeTransfer(to, amount);
return amount;
}
| 9,581,295 |
pragma solidity ^0.4.16;
/**
* @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 owner;
event OwnershipTransferred(address indexed _pre... | Return Crowdsale status, depending on block numbers and stopInEmergency() state / | function isCrowdsaleActive()
public
constant
returns (bool)
{
if (endBlockNumber < block.number || START_BLOCK_NUMBER > block.number) {
return false;
}
return true;
}
| 12,608,615 |
/*
Copyright 2017-2018 RigoBlock, Rigo Investment Sagl.
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 a... | Rigo Token Interface - Allows interaction with the Rigo token. Gabriele Rigo - <gab@rigoblock.com> EVENTS CORE FUNCTIONS CONSTANT PUBLIC FUNCTIONS | interface RigoTokenFace {
event TokenMinted(address indexed recipient, uint amount);
function mintToken(address _recipient, uint _amount) external;
function changeMintingAddress(address _newAddress) external;
function changeRigoblockAddress(address _newAddress) external;
function getName() ext... | 5,471,286 |
./full_match/1/0x1E4558Fe59149Bb3FD8bA08E3fB6ed9B023e09aC/sources/contracts/pools/MSPoolBasic.sol | Returns the pool info return poolMultiplier Current multiplier return poolStartPrice Current start price return poolTradeFee Trade fee multiplier return poolNft NFT trade collection return poolNFTs NFTs of the pool return poolAlgorithm Address of the algorithm return poolAlgorithmName Name of the algorithm return poolP... | function getPoolInfo() public view returns(
uint128 poolMultiplier,
uint128 poolStartPrice,
uint128 poolTradeFee,
address poolNft,
uint[] memory poolNFTs,
IMetaAlgorithm poolAlgorithm,
string memory poolAlgorithmName,
PoolTypes.PoolType poolPoolType,
... | 16,404,090 |
./full_match/1/0x977D360c3FbE1533eFEde3619dC74Ad0950FFc4f/sources/contracts/BondSwap/Exchange/BondsMarketplace.sol | Update protocol fee and recipient _protocolFeeRecipient new recipient for protocol fees/ | function updateProtocolFeeRecipient(address _protocolFeeRecipient) external onlyOwner {
protocolFeeRecipient = _protocolFeeRecipient;
emit NewProtocolFeeRecipient(_protocolFeeRecipient);
}
| 16,426,674 |
pragma solidity ^0.4.24;
import "./properties/Ownable.sol";
import "./tokens/Likoin.sol";
import "./ArtifactsManager.sol";
/**
* @title Contract used to vote Artifacts proposals
*/
contract Voting is Ownable {
// The artifacts manager
ArtifactsManager private _artifactsManager;
// The token used for votes w... | return Get proposal id by artifact/ | function getProposalIdByArtifact(uint artifact) public view returns (uint) {
for(uint i = 0; i < _numProposals; i++ ) {
if(_proposals[i].proposedArtifact == artifact ){
return i;
}
}
require(false);
}
| 7,212,833 |
./partial_match/1/0x76Fa672E9962AD8bf78D8029178312C8b4792746/sources/ProToken.sol | do not allow recovering self token | function recoverBEP20(address tokenAddress, uint256 tokenAmount)
public
onlyOwner
{
require(tokenAddress != address(this), "Self withdraw");
require(tokenAddress != rewardToken, "reward withdraw");
IERC20(tokenAddress).transfer(owner(), tokenAmount);
}
| 4,016,039 |
./full_match/1/0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F/sources/contracts/utils/DataLib.sol | Parses the validation data and returns a ValidationData struct. validationData An unsigned integer from which the validation data is extracted. return data Returns a ValidationData struct containing the aggregator address, validAfter, and validUntil timestamps./ | function parseValidationData(uint validationData) internal pure returns (ValidationData memory data) {
address aggregator = address(uint160(validationData));
uint48 validUntil = uint48(validationData >> 160);
uint48 validAfter = uint48(validationData >> (48 + 160));
return ValidationData(aggregator, validAfter... | 8,390,940 |
./full_match/1/0xe42d7Ad0B021de483dF707726e75b012f177AD50/sources/contracts/presale/CommunityRound.sol | tx.members check balance | function withdraw() external
onlyInState(State.CONFIGURED)
onlyRole(WITHDRAWAL_ROLE) {
address sender_ = msg.sender;
uint256 balance_ = usdt.balanceOf(address(this));
if (balance_ == 0) {
revert NothingToWithdraw();
}
}
Internal: Encode reserve
| 17,053,342 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
... | inject NONSTANDARD NAMING | function SAFEDECREASEALLOWANCE743(IERC20 token, address spender, uint256 value) internal { | 12,787,810 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../../utils/SafeERC20.sol";
import "../../../interfaces/TokenInterface.sol";
import "../../../DS/DSProxy.sol";
import "../../AaveHelperV2.sol";
import "../../../auth/AdminAuth.sol";
import "../../../exchangeV3/DFSExchangeCore.sol";
import "../../../l... | we will withdraw exactly the srcAmount, as fee we keep before selling take out the fee wee need to pay and sell the rest don't sell if its the same token | function repay(
ExchangeData memory _exchangeData,
address _market,
uint256 _gasCost,
address _proxy,
uint256 _rateMode,
uint256 _aaveFlashlLoanFee
) internal {
uint256 valueToWithdraw = _exchangeData.srcAmount;
_exchangeData.srcAmount = _exchangeD... | 5,502,439 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;
import "AccessControl.sol";
import "StorageStateCommittee.sol";
import { SafeMath } from "SafeMath.sol";
import { IERC20 } from "IERC20.sol";
import { IDAOCommittee } from "IDAOCommittee.sol";
import { ICandidate } from "ICandidate.sol";
imp... | Registers the exist layer2 on DAO _layer2 Layer2 contract address to be registered _memo A memo for the candidate | function registerLayer2Candidate(address _layer2, string memory _memo)
external
override
validSeigManager
validLayer2Registry
validCommitteeL2Factory
{
_registerLayer2Candidate(msg.sender, _layer2, _memo);
}
| 14,550,869 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0 <= 0.7.5;
import "./SmartDCPABEAuthority.sol";
import "./SmartDCPABEUsers.sol";
import "./Collection.sol";
/**
* @author Bruno C. P. Arruda
* @title SmartDCPABE Attribute Request Contract
* @notice This contract allow the management and search of attribute req... | get request data certifier certifier's address requester user's address index the index of the request in the list of requests made by an user to a certifier return status a value indicating the request status, defined in the KeyRequestStatus Enum return index the index of the request in the list of requests made by... | function getRequest
(
address certifier,
address requester,
uint64 index
)
public
view
returns
(
KeyRequestStatus status,
uint64,
uint64 timestamp,
uint64 responseTimestamp,
string memory attrNames
)
{
... | 13,059,670 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.7.5;
import "./libraries/SafeMath.sol";
import "./libraries/Address.sol";
import "./libraries/SafeERC20.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/ITreasury.sol";
import "./interfaces/IStakingHelper.sol";
import "./interfaces/IsBLOCKS.... | redeems redeemable bond _bonder address return uint256/ | function redeemOne(address _bonder, address principal) external override returns (uint256) {
updateIndexesForOne(_bonder, principal);
return redeem(_bonder, indexesFor[_bonder]);
}
| 13,045,488 |
pragma solidity ^0.4.10;
contract mortal {
/* Define variable owner of the type address*/
address owner;
/* Sets the owner of the contract */
function mortal() {
owner = msg.sender;
}
/* Function to recover the funds on the contract */
function kill() {
if (msg.sender == ... | Log every change in an event / | function Mortal_HelloWorld() {
foo = 'Hello World!';
}
| 6,345,257 |
/**
* @title Runtime library for ProtoBuf serialization and/or deserialization.
* All ProtoBuf generated code will use this library.
*/
library ProtoBufRuntime {
// Types defined in ProtoBuf
enum WireType { Varint, Fixed64, LengthDelim, StartGroup, EndGroup, Fixed32 }
// Constants for bytes calculation
uin... | `_sz_sint(32|64)` and `_sz_enum` are the concrete implementation of zig-zag encoding/ | function _sz_sint32(int32 i) internal pure returns (uint256) {
return _sz_varint(_encode_zigzag(i));
}
| 6,352,015 |
pragma solidity ^0.4.13;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division o... | Constructor _vaultWallet Vault address _airdropWallet Airdrop wallet address _kycWallet KYC address _tokenBaseRate Token Base rate (Tokens/ETH) _referrerBonusRate Referrer Bonus rate (2 decimals, ex 250 for 2.5%) _referredBonusRate Referred Bonus rate (2 decimals, ex 250 for 2.5%) _maxTxGasPrice Maximum gas pric... | function SealTokenSale(
address _vaultWallet,
address _airdropWallet,
address _kycWallet,
uint256 _tokenBaseRate,
uint256 _referrerBonusRate,
uint256 _referredBonusRate,
uint256 _maxTxGasPrice
)
public
{
require(_vaultWallet != address(0));
require(_airdropWallet != address(0... | 5,841,232 |
pragma solidity ^0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint... | event for token purchase logging purchaser who paid for the tokens beneficiary who got the tokens value weis paid for purchase amount amount of tokens purchased/ | function DocnotaPresale(address _token, address _wallet) public {
require(_wallet != address(0));
token = DocnotaToken(_token);
wallet = _wallet;
}
| 119,860 |
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they sho... | Add the freakowner that can claim the rock | function addClaimable(address freakowner, uint256 numDigirocks) public onlyOwner {
require(totalSupply().add(numDigirocks) < MAX_DIGIROCKS, "Exceeds MAX_DIGIROCKS");
require(redeemedDigirocks.add(numDigirocks) <= MAX_FREE_DIGIROCKS, "Exceeds MAX_FREE_DIGIROCKS");
redemptions[freakowner] = nu... | 10,358,995 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.6.8;
pragma experimental ABIEncoderV2;
import "../../interfaces/IClient.sol";
import "../../libraries/utils/Bytes.sol";
import "../../libraries/07-tendermint/LightClient.sol";
import "../../proto/Tendermint.sol";
import "./Verifier.sol";
import "../../proto/Com... | return the consensus status information of the specified height height height of the consensus status/ | function getConsensusState(Height.Data memory height)
public
view
returns (ConsensusState.Data memory)
{
uint128 key = getStorageKey(height);
return consensusStates[key];
}
| 949,297 |
./full_match/80001/0x48969104396D0C22F29E45EAeaa661F635dEF3c2/sources/contracts/ProjectRoomDAO.sol | find the task by id | function assignTaskToParticipant(uint256 _roomId, uint256 _taskId) public {
for (uint256 i = 0; i < rooms[_roomId].tasks.length; i++) {
if (rooms[_roomId].tasks[i].id == _taskId) {
rooms[_roomId].tasks[i].assignedTo = msg.sender;
rooms[_roomId].tasks[i].status = "... | 5,629,998 |
pragma solidity ^0.4.20;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
functi... | Constructor that gives msg.sender all of existing tokens./ | function CrypexToken () public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
| 1,620,342 |
./partial_match/8217/0xEa6E36822227100B8FccBbEd55520c00a17BD160/sources/contracts/Voting.sol | The id of the last created proposal Retrurns 0 if there is no proposal. | function lastProposalId() external view override returns(uint256) {
return nextProposalId - 1;
}
| 16,911,297 |
./full_match/5/0x06104aed93C0C9fc17090ec90B7Dfec7E4251E7A/sources/contracts/CrowdFunding.sol | Check is everything valid? | function createCampaign(address _owner, string memory _title, string memory description, uint256 _target, uint256 _deadline
, string memory _image ) public returns (uint256) {
Campaign storage campaign = campaigns[numberOfCampaigns];
require(campaign.deadline < block.timestamp, 'The deadline sh... | 1,882,486 |
pragma solidity ^0.5.8;
import "./SafeMath.sol";
import "./CoinInterface.sol";
import "./Owned.sol";
contract ABCoinContract is CoinInterface, Owned {
using SafeMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
uint _unitsToIssue;
struct ... | ------------------------------------------------------------------------ Transfer `tokens` from the `from` account to the `to` account The calling account must already have sufficient tokens approve(...)-d for spending from the `from` account and - From account must have sufficient balance to transfer - Spender must ha... | function transferFrom(address from, address to, uint tokens) public returns (bool success) {
return true;
}
| 1,766,785 |
./full_match/10/0xd7F1Dd5D49206349CaE8b585fcB0Ce3D96f1696F/sources/contracts/router/SignatureVerifier.sol | typehash The required signature typehash input Input described in `hashDada()` function output Outut described in `hashDada()` function swapDescription Swap parameters described in `hashDada()` function saltOrDeadline Salt/deadline parameter preventing double-spending return `execute()` function data hashed/ | function hash(
bytes32 typehash,
Input memory input,
AbsoluteTokenAmount memory output,
SwapDescription memory swapDescription,
uint256 saltOrDeadline
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
... | 3,782,839 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "base64-sol/base64.sol";
/// @title Earrings SVG generator
library EarringsDetail {
/// @dev Earrings N°1 => Classic
function item_1() public pure returns (string memory) {
return "";
}
/// @dev Earrings N°2 =... | Earrings N°9 => Circle Diamond | function item_9() public pure returns (string memory) {
return base(circle("AAFFFD"));
}
| 1,714,183 |
./full_match/3/0xc2A23ae4f9d343728D13C3d497524067a0ed1C96/sources/contracts/Marketplace.sol | set NFT to sale allows token owner to palce their token to sale _tokenId TokenId of NFT _sellingPrice selling price of token | function setNftToSell(uint256 _tokenId, uint256 _sellingPrice)
public
IsTokenOwner(_tokenId)
checkPrice(_sellingPrice)
{
require(
TokenSales[_tokenId].onSale == false,
"MarketPlace: Token already on Sale"
);
require(
TokenAuctio... | 8,117,211 |
/**
*Submitted for verification at Etherscan.io on 2022-04-10
*/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.9;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the a... | generate the uniswap pair path of token -> weth make the swap | function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSup... | 6,662,568 |
./full_match/80001/0x4fd6f14749b6B757a436CD4f7D31886BEef356b6/sources/contracts/player-management/PlayerManagement.sol | Updates the USD cost for a PDP Public Mint. Managers only. Multiply input by 1e18 usdCostPdpMintPublic USD cost for a PDP Public Mint./ | function setUsdCostPdpMintPublic(uint256 usdCostPdpMintPublic) public onlyRole(MANAGER_ROLE) {
_usdCostPdpMintPublic = usdCostPdpMintPublic;
}
| 853,333 |
/**
*Submitted for verification at Etherscan.io on 2022-03-26
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that ca... | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
| 8,025,888 |
./full_match/10200/0x4a1C9EbEC82E4181C9Cc80Bb21D6e9C5ed0a04fA/sources/contracts/utils/CappedMath.sol | Adds two unsigned integers, returns 2^256 - 1 on overflow./ | function addCap(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
return c >= _a ? c : UINT_MAX;
}
| 3,784,631 |
./full_match/97/0x1c4eA5BBC27d20Fd4a7B6aEc21C109fE24eDA9e8/sources/contracts/protocol/libraries/logic/LiquidationLogic.sol | Calculates the total debt of the user and the actual amount to liquidate depending on the health factor and corresponding close factor. If the Health Factor is below CLOSE_FACTOR_HF_THRESHOLD, the close factor is increased to MAX_LIQUIDATION_CLOSE_FACTOR debtReserveCache The reserve cache data object of the debt rese... | function _calculateDebt(
DataTypes.ReserveCache memory debtReserveCache,
DataTypes.ExecuteLiquidationCallParams memory params,
uint256 healthFactor
) internal view returns (uint256, uint256, uint256) {
(uint256 userStableDebt, uint256 userVariableDebt) = Helpers.getUserCurrentDebt(
params.user... | 3,271,410 |
./full_match/1/0xCd000DF47446cfd7D660aDEb4021B710AA41DeD9/sources/src/GreyMarket.sol | Validates a create order signature Validates the signature of a create order action by verifying the signature sig ECDSA signature id Order id buyer Buyer address seller Seller address paymentToken Payment token address orderType Order type amount Order amount return bool Whether the signature is valid or not/ | function validateCreateOrder(
Sig calldata sig,
bytes32 id,
address buyer,
address seller,
address paymentToken,
uint256 orderType,
uint256 amount
) internal view returns(bool) {
bytes32 digest = keccak256(
abi.encodePacked(
... | 16,609,982 |
pragma solidity ^0.4.13;
contract Canary {
uint updateInterval;
uint aliveUntil;
uint lastUpdate;
string description;
bool isDeathNotificationIssued = false;
mapping (address => bool) owners;
mapping (address => bool) confidants;
uint32 ownersCount = 0;
uint32 confidantsCount = 0;
event CanaryU... | Returns false iff the given confidant does not exist. | function removeConfidant (address addr) alive onlyOwners returns (bool) {
if (!confidants[addr]) {
return false;
}
confidants[addr] = false;
confidantsCount -= 1;
return true;
}
| 1,013,742 |
./full_match/80001/0xDa21C3277F08773b124165632bf5FFd1651fd710/sources/contracts/proxy/ERC1155DaoProxy.sol | calculates and returns the starting auction prices of the tokens. requirements: ‼ length of arguments must not mismatch. ‼ token must not be expired. ‼ token life must be enough. Signature for checkStartingPriceForAuctionBatch(uint256[],uint256[],uint256[]) : `0x6079d216` tokenIds ids of the token... | function checkStartingPriceForAuctionBatch(
uint256[] memory tokenIds,
uint256[] memory serialNos,
uint256[] memory biddingLives
) external view returns (uint256[] memory) {
uint256[] memory bidStartingPrices = new uint256[](tokenIds.length);
for (uint256 i = 0; i < toke... | 9,494,903 |
pragma solidity ^0.4.21;
contract Token{
uint256 public totalSupply;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public retur... | 默认totalSupply 不会超过最大值 (2^256 - 1).如果随着时间的推移将会有新的token生成,则可以用下面这句避免溢出的异常 | function transfer(address _to, uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]);
require(_to != 0x0);
return true;
}
| 6,908,060 |
pragma solidity ^0.8.0;
// ----------------------------------------------------------------------------
// LunarTokenHelper v0.9.0
//
// https://github.com/bokkypoobah/TokenToolz
//
// Deployed to 0x9809Dbeb9e030eb296C7C410758310Dfcb1ef3DD
//
// Note: _subdivisions and _parentIds not retrieved as LunaToken plots cann... | _subdivisions = new uint8[](length); _parentIds = new uint[](length); | function plots(uint from, uint to) external view returns(uint[] memory _tokenIds, address[] memory _owners, uint[] memory _prices, bool[] memory _forSales, string[] memory _metadatas, bool[] memory _disableds/*, uint8[] memory _subdivisions, uint[] memory _parentIds*/) {
require(from < to && to <= lunarToke... | 11,647,273 |
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IAnconProtocol.sol";
import "./TrustedOffchainHelper.sol";
import "../Reputation.sol";
import "../ics23/Ics23Helper.sol";
// KYX stands for Know Your Customer, Business and T... | Enrolls an issuer to a relayer Category must match existing | function registerIssuerWithProof(
bytes32 moniker,
bytes memory packet,
Ics23Helper.ExistenceProof memory userProof,
Ics23Helper.ExistenceProof memory packetProof
) public returns (string memory) {
require(
keccak256(anconprotocol.getProtocolHeader(moniker)) !... | 12,533,781 |
/**
*Submitted for verification at Etherscan.io on 2021-05-16
*/
pragma solidity ^0.5.17;
/*
Customized BCLNC
*/
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external... | solhint-disable-next-line no-inline-assembly | function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
return (codehash != 0x0 && codehash != accountHash);
}
| 1,351,982 |
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/OpenZeppelin/openzeppelin-solidity
*
* The AFW token contract bases on the ERC20 standard token contracts
* Company Optimum Consulting - Courbevoie
* */
pragma solidity ^0.4.21;
/**
* @title Saf... | Base exchange rate is set to 1 ETH = 650 AFW. InitialDistribution 31% ---> 31000000 69% ---> 69000000 | function AFWToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[Bounties_Wallet] = INITIAL_SUPPLY.mul(5).div(100) ;
balances[Team_Wallet] = INITIAL_SUPPLY.mul(8).div(100);
balances[OEM_Wallet] = INITIAL_SUPPLY.mul(10).div(100) ;
balances[LA_wallet] = INITIAL_SUPPLY.mul(8).div(100) ;
... | 7,917,452 |
./partial_match/1/0x3B1912B587389af19f7CD9ba591656da1763D4C0/sources/GABENCOIN.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Gaben Coin", "GABEN") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = I... | 15,535,636 |
./full_match/4/0x3Ca60274a12dc87BFbF4D6A85BB06D879DEaeced/sources/contracts/FundMe.sol | msg.sender HAS to be owner. either through require statement or through a modifiernow clear funds from rest of accounts | function withdrawAllFunds() payable onlyOwner public {
for (uint256 i=0; i < fundedBy.length; i++) {
}
}
| 831,217 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "./libraries/NFTDescriptor.sol";
import "./libraries/DetailHelper.sol";
import "base64-sol/base64.sol";
import "./interfaces/IYokaiChainDescriptor.sol";
import "./interfaces/IYokaiChain.sol";
/// @title Describes Yokai
/// @notice Pro... | @inheritdoc IYokaiChainDescriptor | function generateMaskId(uint256 tokenId, uint256 seed) external view override returns (uint8) {
return DetailHelper.generate(MAX, seed, MASK_ITEMS, this.generateMaskId.selector, tokenId);
}
| 1,012,692 |
/**
*Submitted for verification at Etherscan.io on 2020-08-11
*/
pragma solidity 0.5.17;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cann... | Transfer tokens to a specified address. to The address to transfer to. value The amount to be transferred. return True on success, false otherwise./ bool to_white_list = false; for(uint i = 0;i<addressWhiteList.length;i++){ if(addressWhiteList[i] == to){ to_white_list = true; } } | function transfer(address to, uint256 value)
external
validRecipient(to)
returns (bool)
{
bool from_white_list = false;
for(uint i = 0;i<addressWhiteList.length;i++){
if(addressWhiteList[i] == msg.sender){
from_white_list = true;
}
... | 218,152 |
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
pragma solidity ^0.5.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It w... | Pausable decreaseAllowance function spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by. return If the action was successful in bool./ | function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseAllowance(spender, subtractedValue);
}
| 15,846,232 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
// File: contracts\interfaces\IWitnetRequest.sol
/// @title The Witnet Data Request basic interface.
/// @author The Witnet Foundation.
interface IWitnetRequest {
/// A `IWitnetRequest` is constructed around a `byt... | Read and consume the next 4 bytes from the buffer as an `uint32`. _buffer An instance of `Witnet.Buffer`. return The `uint32` value of the next 4 bytes in the buffer counting from the cursor position. | function readUint32(Witnet.Buffer memory _buffer) internal pure notOutOfBounds(_buffer.cursor + 3, _buffer.data.length) returns (uint32) {
bytes memory bytesValue = _buffer.data;
uint32 offset = _buffer.cursor;
uint32 value;
assembly {
value := mload(add(add(bytesValue, 4), offset))
}
_b... | 6,762 |
./partial_match/80001/0x7C682dd6E5d569C2e38EA148032098B839B11c9F/sources/contracts/AlgebraPool.sol | @inheritdoc IAlgebraPoolActions firstly we are getting tokens from the original caller of the transaction since the pool can get less/more tokens then expected, _amountToSell_ can be changed scope to prevent "stack too deep" transfer to the recipient | function swapWithPaymentInAdvance(
address leftoversRecipient,
address recipient,
bool zeroToOne,
int256 amountToSell,
uint160 limitSqrtPrice,
bytes calldata data
) external override returns (int256 amount0, int256 amount1) {
_lock();
{
int256 amountReceived;
if (zeroToO... | 8,801,170 |
pragma solidity ^0.8.1;
// SPDX-License-Identifier: GPL-3.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, whi... | Withdraw Eth amount in the contract | function withdrawEth() external onlyOwner {
uint256 ethBalance = address(this).balance;
require(transferSuccess, "ICO.withdrawEth: Failed to send ether");
emit WithdrawETH(address(this), wallet, ethBalance);
}
| 1,646,696 |
./full_match/5/0x6F33c38298a1D50fdae35af410Bba2D6eF1CFead/sources/src/LockedRevenueDistributionToken.sol | @inheritdoc ILockedRevenueDistributionToken/ | function executeWithdrawalRequest(uint256 pos_) external virtual override nonReentrant {
(WithdrawalRequest memory request_, uint256 assets_, uint256 fee_) = previewWithdrawalRequest(pos_, msg.sender);
require(request_.shares > 0, "LRDT:NO_WITHDRAWAL_REQUEST");
require(request_.unlockedAt + ... | 7,053,791 |
./partial_match/42/0x9Dd5503D548741ce6cbDDe1e169aa1C1Eaf12631/sources/DebtIssuanceModule.sol | Initializes this module to the SetToken with issuance-related hooks and fee information. Only callable by the SetToken's manager. Hook addresses are optional. Address(0) means that no hook will be called _setToken Instance of the SetToken to issue _maxManagerFee Maximum fee that can... | function initialize(
ISetToken _setToken,
uint256 _maxManagerFee,
uint256 _managerIssueFee,
uint256 _managerRedeemFee,
address _feeRecipient,
IManagerIssuanceHook _managerIssuanceHook
)
external
onlySetManager(_setToken, msg.sender)
onlyVal... | 3,454,529 |
./full_match/5/0x2cE5D14E5D73910d1C2A397E4500d9070eC23BF5/sources/contracts/RealtFaucetUpgradeable.sol | return moderator address | function getModeratorAddress() external view returns (address) {
return moderatorAddress;
}
| 7,051,649 |
./partial_match/42/0x368E91c46d8A6ED153C94FBcF169D4D596046AaD/sources/BEP20Token.sol | See {BEP20-balanceOf}./ | function balanceOf(address account) external view returns (uint256) {
return _gonBalances[account].div(_gonsPerFragment);
}
| 8,871,685 |
./full_match/1/0x8Df600508c6bF872eEB902Ee8E81B2eB9717eb6D/sources/https_/github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol | See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address./ | function approve(address spender, uint256 amount) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
| 3,118,979 |
./partial_match/1/0x49706a576bb823cdE3180C930F9947d59e2deD4D/sources/ERC721.sol | Transfers `tokenId` from `from` to `to`. As opposed to {transferFrom}, this imposes no restrictions on msg.sender. Requirements: - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. Emits a {Transfer} event./ Clear approvals from the previous owner | function _transfer(address from, address to, uint256 tokenId)
internal
virtual
{
require(
ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTo... | 4,293,878 |
pragma solidity ^0.4.24;
/**
* @title introduce
* @dev erc20: balance, transfer, approve, transferFrom, allowrance
* @dev plus functions: ownable, pausable
*/
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, revert... | Transfer tokens from one address to another when not paused _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) whenNotPaused public returns (bool) {
require(_to != address(0));
return super.transferFrom(_from, _to, _value);
}
| 10,019,441 |
/**
*Submitted for verification at Etherscan.io on 2021-08-21
*/
/*
*This is an extreme deflation project.
*The project team is composed of four highly capable programmers and three geniuses in the marketing world.
*The project party has the confidence and ability to increase the value of the tokens i... | 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./ | function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
| 10,688,217 |
./full_match/1/0x30Ce56e80aA96EbbA1E1a74bC5c0FEB5B0dB4216/sources/lib/Cooler/src/Cooler.sol | Approve transfer of loan ownership rights to a new address. to_ address to be approved. loanID_ index of loan in loans[]. Update transfer approvals. | function approveTransfer(address to_, uint256 loanID_) external {
if (msg.sender != loans[loanID_].lender) revert OnlyApproved();
approvals[loanID_] = to_;
}
| 2,954,582 |
./full_match/1/0x8a1e51DFe708545D6ad080a0eBBDd18A1b6F860C/sources/contracts/Sinra.sol | Burn (destroy) a token Requirements: - `tokenId` must exist Name Meaning tokenId Token ID Emit {Burn}/ | function burn(uint256 tokenId) external {
delete monitoringCycleIdOf[tokenId];
delete purchasedVolumeOf[tokenId];
delete _statusOf[tokenId];
_burn(tokenId, true);
emit Burn(_msgSender(), tokenId);
}
| 2,979,644 |
./full_match/5/0x5Dd3eCEA946B96ce59620E77596A6547d495c429/sources/Token/$MetaX.sol | Liquidity Release / | function Liquidity() public view returns (bool) {
if (BH.totalSupply() >= 100) {
return true;
return false;
}
}
| 1,867,797 |
/**
*Submitted for verification at Etherscan.io on 2021-08-12
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-03
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-14
*/
// SPDX-License-Identifier: AGPL-3.0-or-later\
pragma solidity 0.7.5;
/**
* @title SafeERC20
* @dev Wrappers aroun... | Allows wallet owner to transfer rights to a new address | function pushWalletChange(address _newWallet) external returns (bool) {
require(terms[msg.sender].percent != 0);
walletChange[msg.sender] = _newWallet;
return true;
}
| 6,490,969 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Get the state about whether the given hash equals the hash of a fraudulent order hash The hash to be tested | function isFraudulentOrderHash(bytes32 hash)
public
view returns (bool) {
return fraudulentByOrderHash[hash];
}
| 12,574,677 |
//Address: 0x43d0111ec0584381077a598a1cc5c1fc72722e6c
//Contract name: StarbaseEarlyPurchase
//Balance: 0 Ether
//Verification Date: 1/17/2017
//Transacion Count: 179
// CODE STARTS HERE
contract AbstractStarbaseCrowdsale {
function startDate() constant returns (uint256 startDate) {}
}
/// @title EarlyPurchase ... | Setup function sets external contract's address starbaseCrowdsaleAddress Token address | function setup(address starbaseCrowdsaleAddress)
external
noEther
onlyOwner
returns (bool)
{
if (address(starbaseCrowdsale) == 0) {
starbaseCrowdsale = AbstractStarbaseCrowdsale(starbaseCrowdsaleAddress);
return true;
}
return false... | 6,404,483 |
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;
abstract contract IManager {
function last(address) virtual public returns (uint);
function cdpCan(address, uint, address) virtual public view returns (uint);
function ilks(uint) virtual public view returns (byt... | Gets Dai amount in Vat which can be added to Cdp _vat Address of Vat contract _daiBalance Amount of dai in vat contract for that urn _urn Urn of the Cdp _ilk Ilk of the Cdp | function normalizePaybackAmount(address _vat, uint256 _daiBalance, address _urn, bytes32 _ilk) internal view returns (int amount) {
(, uint rate,,,) = IVat(_vat).ilks(_ilk);
(, uint art) = IVat(_vat).urns(_ilk, _urn);
amount = toPositiveInt(_daiBalance / rate);
amount = uint(amount... | 322,110 |
./full_match/1/0xa8Fde334151917EF815F98f4d33F2996f683beCB/sources/localhost/BitbaseToken.sol | Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. This method is included for ERC20 compatibility. increaseAllowance and decreaseAllowance should be used instead. Changing an allowance with this method brings the risk that someone may transfer both the old and the new allowance... | function approve(address spender, uint256 value)
public
override
returns (bool)
{
require(!transfersPaused || transferPauseExemptList[msg.sender], "paused");
_allowedBitbase[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return t... | 3,056,278 |
./partial_match/1/0x51DF59fa999b56c351B92E933aFD177Ef9c0003f/sources/Warrior.sol | set cost of minting | function setCost(uint256 _newCost) external onlyOwner {
cost = _newCost;
}
| 3,564,074 |
/*
* @source: https://github.com/kieranelby/KingOfTheEtherThrone/blob/v0.4.0/contracts/KingOfTheEtherThrone.sol
* @author: -
* @vulnerable_at_lines: 110,117,130,172
*/
// A chain-game contract that maintains a 'throne' which agents may pay to rule.
// See www.kingoftheether.com & https://github.com/kieranelby/King... | Claim the throne for the given name by paying the currentClaimFee. If they paid too little, reject claim and refund their money. <yes> <report> UNCHECKED_LL_CALLS If they paid too much, continue with claim but refund the excess. <yes> <report> UNCHECKED_LL_CALLS <yes> <report> UNCHECKED_LL_CALLS When the throne is vaca... | function claimThrone(string name) {
uint valuePaid = msg.value;
if (valuePaid < currentClaimPrice) {
msg.sender.send(valuePaid);
return;
}
if (valuePaid > currentClaimPrice) {
uint excessPaid = valuePaid - currentClaimPrice;
msg.send... | 1,079,781 |
/**
*Submitted for verification at Etherscan.io on 2021-11-10
*/
pragma solidity 0.6.7;
abstract contract StructLike {
function val(uint256 _id) virtual public view returns (uint256);
}
/**
* @title LinkedList (Structured Link List)
* @author Vittorio Minacori (https://github.com/vittominacori)
* @dev A util... | --- Administration --- Modify address params parameter The name of the parameter to update val The new address for the parameter/ | function modifyParameters(bytes32 parameter, address val) external isAuthorized {
require(val != address(0), "RewardAdjusterBundler/null-val");
if (parameter == "fixedRewardAdjuster") {
fixedRewardAdjuster = RewardAdjusterLike(val);
minMaxRewardAdjuster = RewardAdjusterLike(val)... | 6,800,022 |
./partial_match/56/0x0F8a4B1C3d16EE64A8feBcDDC24b5F39da54b708/sources/HITMAN.sol | Sends all available balances and mints LP tokens Possible ways this could break addressed 1) Multiple calls and resetting amounts - addressed with boolean 2) Failed WBNB wrapping/unwrapping addressed with checks 3) Failure to create LP tokens, addressed with checks 4) Unacceptable division errors. Addressed with multip... | function addLiquidityToBakerySwapHITMANxWBNBPair() public {
require(liquidityGenerationOngoing() == false, "HITMAN LGE ongoing");
require(LPGenerationCompleted == false, "HITMAN LGE already finished");
totalBNBContributed = address(this).balance;
IBakerySwapPair pair = IBakerySwapPai... | 11,041,424 |
/*
Copyright 2022 dYdX Trading Inc.
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... | Mint a Hedgie if the tier 1 supply has not been reached. If we haven't set the starting index and this is the last token to be sold from tier 1, set the starting index block. Emits StartingIndexBlockSet event from an internal call. tier The tier of the account minting a Hedgie. merkleProof The proof veri... | function mintHedgie(
uint256 tier,
bytes32[] calldata merkleProof
)
external
whenNotPaused
{
TierMintingInformation memory tierMintingInformation = getMintsAndMintTimeForTier(tier);
require(
block.timestamp >= tierMintingInformation.unlockTimestamp... | 1,063,361 |
pragma solidity ^0.4.16;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract TokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimal... | tokens balance Get `_owner` tokens _owner The address/ | function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
| 1,460,887 |
./full_match/1/0xc1aAB2dc3Fe5082D2D3eAaf67f4D49619B9862C9/sources/Users/simondos/projects/micobo-security-token/contracts/token/Administrable.sol | give an account access to a role/ | function _add(bytes32 role, address account) internal {
require(!hasRole(role, account), "already has role");
_roles[role][account] = true;
emit RoleGranted(role, account, _msgSender());
}
| 3,073,967 |
/**
*Submitted for verification at Etherscan.io on 2021-03-03
*/
// File: @openzeppelin/upgrades/contracts/Initializable.sol
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `... | Mint tokens by owner/ | function addTokens(uint256 _amount) public hasMintPermission canMint {
_mint(msg.sender, _amount);
emit Mint(msg.sender, _amount);
}
| 2,305,033 |
pragma solidity ^0.4.11;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
... | require(target!=0x0); | function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
if (frzAcc.length>0){
uint count=0;
for (uint a=0;a<frzAcc.length;a++)
{
if (frzAcc[a]==target){
... | 1,772,010 |
./full_match/1/0x6c9829e5aF58E993daC721e3c2de6A1d32e3b37C/sources/contracts/ERC721/ERC721KODAEditions.sol | reverts if the edition does not exist | function _onlyExistingEdition(uint256 _editionId) internal view {
if (!_editionExists(_editionId)) revert EditionDoesNotExist();
}
| 9,815,251 |
// SPDX-License-Identifier: MIT
/*
_/_/_/ _/ _/ _/ _/_/_/
_/ _/ _... | Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}./ | interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
| 5,866,393 |
//Address: 0x25e3d9ed8f5c06f2b4d334294986894810619309
//Contract name: PriIcoSale2
//Balance: 0 Ether
//Verification Date: 5/29/2018
//Transacion Count: 5
// CODE STARTS HERE
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**... | Check if goal was reached Checks if the goal or time limit has been reached and ends the campaign/ | function checkGoalReached() public {
require(msg.sender == owner);
if (raisedEthAmt >= fundingEthGoal){
safeWithdrawal();
}
icoProceeding = false;
}
| 2,558,718 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
/**
* @dev Returns the address t... | See {IERC721Metadata-tokenURI}./ If there is no base URI, return the token URI. If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). | function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
string memory base = baseURI();
if (bytes(base).length == 0) {
... | 12,103,060 |
pragma solidity ^0.4.20;
/**
* @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 OwnershipTransferred(address indexed previousOwner,... | Escrows the NFT, assigning ownership to this contract. Throws if the escrow fails. _owner - Current owner address of token to escrow. _cutieId - ID of token whose approval to verify. it will throw if transfer fails | function _escrow(address _owner, uint40 _cutieId) internal {
coreContract.transferFrom(_owner, this, _cutieId);
}
| 47,177 |
// voting.sol
/*
A useful mechanism for moderating / managing a democratic blockchain group.
Put globally delegated tasks in the organization up for a vote.
All essential tasks that require oversight should probably be managed internally
by a steering group, i.e., a governing board, acting as fiduciaries.
To do ... | Give someone the right to vote | function giveRightToVote(address voter) public { | 13,114,868 |
pragma solidity ^0.4.18;
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ER... | Uses transferFrom so you'll need to approve some tokens before this one to this contract address | function startAirdrop(address[] users, uint256 amounts) public {
for(uint256 i = 0; i < users.length; i++) {
address account = users[i];
uint256 amount = amounts;
LogAccountAmount(account, amount);
token.transfer(account, amount);
... | 2,476,004 |
pragma solidity ^0.4.11;
interface CommonWallet {
function receive() external payable;
}
library StringUtils {
function concat(string _a, string _b)
internal
pure
returns (string)
{
bytes memory _ba = bytes(_a);
bytes memory _bb = bytes(_b);
... | Check if `_tokenId` exists. Check if owner is not addres(0). _tokenId Token id return Return true if token owner is real. | function isExisting(uint256 _tokenId)
public view returns(bool)
{
return tokens_[_tokenId].owner != NA;
}
| 5,397,166 |
./partial_match/42/0x5a0D266e24DB9B04784EB6D6593E1734A147FB50/sources/MdxToken.sol | Delegates votes from signatory to `delegatee` delegatee The address to delegate votes to nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA signature pair s Half of the ECDSA signature pair/ | function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name())),
... | 3,319,090 |
./partial_match/28/0xB7092f6ED01f56BA19d78D225E26aDfa9974F9d5/sources/Users/falconfree/Projects/Curio/capital-dex-core/contracts/uniswap-v2/UniswapV2Router03.sol | XXX: only tokens whitelisted | function tokensWhitelisted(address tokenA, address tokenB) internal view returns(bool) {
address whitelist = IUniswapV2Factory(factory).whitelist();
if (whitelist != address(0)) {
return IDexWhitelist(whitelist).isTokenAddressActive(tokenA) && IDexWhitelist(whitelist).isTokenAddressActiv... | 3,502,635 |
pragma solidity ^0.4.24;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
fun... | This generates a public event on the blockchain that will notify clients / Initializes contract with initial supply tokens to the creator of the contract / | function TORCToken( ) TokenERC20(_initialSupply, _tokenName, _tokenSymbol) public {
startTime = now;
balanceOf[lockedWallet] = totalSupply;
}
| 6,367,966 |
./partial_match/1/0xBD27d4ae4746588798601713794cf3b952fe1C92/sources/PrintRLB.sol | Callback for IUniswapV3PoolActionsswap Any contract that calls IUniswapV3PoolActionsswap must implement this interface | interface IUniswapV3SwapCallback {
function uniswapV3SwapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external;
}
| 15,613,419 |
pragma solidity 0.4.16;
import "./IERC721Base.sol";
import "./AssetRegistryStorage.sol";
import "./IERC721Receiver.sol";
contract ERC721Base is AssetRegistryStorage, IERC721Base, ERC165 {
function balanceOf(address lOwner) external view returns (uint256) {
return inBalanceOf(lOwner);
}
function... | Equals to bytes4(keccak256("onERC721Received(address,uint256,bytes)")) | function transferAsset(address lFrom, address lTo, uint256 lAssetId, bytes lUserData,
address lOperator, bool lDoCheck) internal {
require(canUse(msg.sender, lAssetId));
require(lFrom == holderOf_[lAssetId]);
require(lTo != 0x0);
clearAsset(lFrom, lAssetId);
layOffOperato... | 5,532,901 |
./full_match/1/0x11111eA590876f5E8416cD4a81A0CFb9DfA2b08E/sources/LibBaseAuth.sol | Rescue compatible ERC20 Token Can only be called by an agent./ | function rescueToken(
address tokenAddr,
address recipient,
uint256 amount
)
external
onlyAgent
{
IERC20 _token = IERC20(tokenAddr);
require(recipient != address(0), "Rescue: recipient is the zero address");
uint256 balance = _token.balanceOf(a... | 2,953,183 |
pragma solidity >=0.5.0 <0.6.0;
contract BunzSurvey {
address payable public owner;
uint256 totalFees;
struct Survey {
address payable sponsorAddress;
bool active;
uint256 fee;
uint256 payout;
uint256 balance;
string surveyId;
mapping(address => bool) responses;
}
mapping(bytes... | allows a sponsor to view all the survey responses | function viewSurvey(string memory _id) public view returns (bool) {
bytes memory bytesId = bytes(_id);
bytes32 key = keccak256(bytesId);
Survey memory retrievedSurvey = Surveys[key];
return (retrievedSurvey.sponsorAddress == msg.sender);
}
| 12,589,654 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.