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: UNLICENSED
pragma solidity ^0.8.6;
import "../l2/L2Lib.sol";
import "../utils/FurLib.sol";
import "../utils/FurProxy.sol";
import "../utils/MetaData.sol";
import "./ZoneDefinition.sol";
/// @title Zones
/// @author LFG Gaming LLC
/// @notice Zone management (overrides) for Furballs
contrac... | Define the attributes of a zone | function defineZone(address zoneAddr) external gameAdmin {
IZone zone = IZone(zoneAddr);
zoneMap[uint32(zone.number())] = zone;
}
| 1,277,749 |
pragma solidity 0.4.21;
/**
* @title Ownable Contract
* @dev contract that has a user and can implement user access restrictions based on it
*/
contract Ownable {
address public owner;
/**
* @dev sets owner of contract
*/
function Ownable() public {
owner = msg.sender;
}
/**
... | transfers IXT from User address to Recipient action Service the user is paying for/ | function transferIXT(address from, address to, string action) public allowedOnly isNotPaused returns (bool) {
if (isOldVersion) {
IXTPaymentContract newContract = IXTPaymentContract(nextContract);
return newContract.transferIXT(from, to, action);
uint price = actionPrices[action];
if(pric... | 1,809,806 |
pragma solidity ^0.5.2;
import "@openzeppelin/contracts-ethereum-package/contracts/access/roles/MinterRole.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
/**
* @title MasterMinter role, is that who is resposable o... | remobe a minter address, only the contract Owner can do that/ | function removeMinter(address account) public onlyMasterMinter {
_removeMinter(account);
}
| 916,430 |
pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;
import "./core/wallet_data.sol";
import "./features/guardians.sol";
import "./features/daily_limit.sol";
import "./features/recovery.sol";
contract TOTPWallet {
using Guardians for Core.Wallet;
using DailyLimit for Core.Wallet;
using Recovery for ... | timeOffset + (DURATION2^depth) < current timeuint lastTokenExpires = timeOffset + (timePeriod (2treeHeight)); | function remainingTokens() public view returns (uint) {
uint c = getCurrentCounter();
uint total = 2 ** uint(wallet.merkelHeight);
return total > c ? total - c : 0;
}
| 12,568,852 |
/**
*Submitted for verification at Etherscan.io on 2021-11-10
*/
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.8.9;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IVoterID {
/**
Minting function
*/
function createIdentityFor(address newId, uint tokenId... | Required interface of an ERC721 compliant contract./ | interface IVoterID {
Minting function
function createIdentityFor(address newId, uint tokenId, string memory uri) external;
Who's in charge around here
function owner() external view returns (address);
How many of these things exist?
function totalSupply() external view returns (uin... | 12,195,726 |
./partial_match/1/0x6ed0741e8BCE77455aa956F91823D70EC10c4838/sources/src/strategies/relative/LlamaRelativeStrategyBase.sol | @inheritdoc ILlamaStrategy | function isActionDisapproved(ActionInfo calldata actionInfo) public view virtual returns (bool) {
Action memory action = llamaCore.getAction(actionInfo.id);
return action.totalDisapprovals >= _getMinimumAmountNeeded(getDisapprovalSupply(actionInfo), minDisapprovalPct);
}
| 15,721,001 |
// SPDX-License-Identifier: MIT
pragma solidity =0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./interfaces/IBuffe... | Return reward multiplier over the given fromBlock to toBlock block. | function getMultiplier(uint256 fromBlock, uint256 toBlock) public view returns (uint256) {
return toBlock.sub(fromBlock).mul(bonusMultiplier);
}
| 2,520,862 |
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
// import "../Ownable.sol";
// import "./compound-supply-examples/solidity-contracts/MyContracts.sol";
// import "../utils/Context.sol";
/*Missing features that were added following completion of the code review were:
i) setting the boolean variab... | Create a reference to the corresponding cToken contract Amount of current exchange rate from cToken to underlying Amount added to you supply balance this block | function supplyEthToCompound(address payable _cEtherContract)
public
payable
returns (bool)
{
CEth cToken = CEth(_cEtherContract);
uint256 exchangeRateMantissa = cToken.exchangeRateCurrent();
emit MyLog("Exchange Rate (scaled up by 1e18): ", exchangeRateMantissa)... | 7,272,252 |
/**
*Submitted for verification at Etherscan.io on 2020-09-11
*/
// File: smartcontract/chefInOne.sol
/*
website: CrabFarm.io
1111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111... | Deposit LP tokens to MasterChef for CRAB allocation. | function deposit(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
uint256 pending = user
.amount
.mul(pool.accCrabPerShare)
.div(1e... | 6,414,355 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import {ICollectNFT} from '../interfaces/ICollectNFT.sol';
import {ILensHub} from '../interfaces/ILensHub.sol';
import {Errors} from '../libraries/Errors.sol';
import {Events} from '../libraries/Events.sol';
import {LensNFTBase} from './base/LensNFTBase.sol';
/... | @inheritdoc ICollectNFT | function initialize(
uint256 profileId,
uint256 pubId,
string calldata name,
string calldata symbol
) external override {
if (_initialized) revert Errors.Initialized();
_initialized = true;
_profileId = profileId;
_pubId = pubId;
super._ini... | 5,436,291 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/GSN/Context.sol";
import "https://github.com/OpenZeppelin/op... | get uint256,bool type values of store uint256 feeLIQ fee is discounted for each swapp and partitioned between liquidity providers only (1..999) allowed uint256 feeOperation fee is discounted for each swapp and send to operations account only (1..999) allowed uint256 feeSTAKE fee is dis... | function getValues()
external
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
bool
)
{
return (
_feeLIQ,
_feeOperation,
... | 14,052,422 |
./full_match/1/0x48Aca7352A34EeE4D324FfCee7F8352C99c7D22C/sources/src/interfaces/INash21Manager.sol | The interface of Nash21Manager Handles the configuration of Nash21 ecosystem Controls addresses, IDs, deployments, upgrades, proxies, access control and pausability | interface INash21Manager {
event NewId(bytes32 indexed id, address addr);
event Deployment(
bytes32 indexed id,
address indexed proxy,
address implementation,
bool upgrade
);
event Locked(bytes32 indexed id, address addr);
function deploy(
bytes32 id,
... | 9,714,807 |
./partial_match/1/0x8AFcf740d3aD36A597BCF0b00aABc045A8Ef2033/sources/BetrockStake.sol | babylonian method (https:en.wikipedia.org/wiki/Methods_of_computing_square_rootsBabylonian_method) | function sqrt(uint256 y) internal pure returns(uint256 z) {
if (y > 3) {
z = y;
uint256 x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
z = 1;
}
}
| 2,599,726 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol";
i... | accountERC20Balance[accountNum] = 0; | function createAccount(string memory _name, string memory _metadata)
external
{
uint256 accountNum = _generateAccountNumber(_name);
userAccounts[msg.sender].push(Account(accountNum, _metadata));
accountEthBalance[accountNum] = 0;
}
| 15,829,728 |
pragma solidity 0.5.11;
// Experimental feature turned on for constructor to receive an Array of Strings.
pragma experimental ABIEncoderV2;
contract Voting {
// Mapping of candidates that can be voted for.
mapping (string => Candidate) public candidates;
/* Events */
event debug_log(string descrip... | Make sure the candidate is already registered | function votesOf(string memory candidateName) public view returns (uint256) {
assert(hasCandidate(candidateName));
return candidates[candidateName].votes;
}
| 7,299,471 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/payment/PaymentSplitter.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
// nervous.eth
//
// █... | Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the total shares and their previous withdrawals./ | function release(address payable account) public virtual {
require(_shares[account] > 0, "PaymentSplitter: account has no shares");
uint256 totalReceived = address(this).balance.add(_totalReleased);
uint256 payment = totalReceived.mul(_shares[account]).div(_totalShares).sub(_released[accoun... | 147,936 |
//Address: 0x6d2f190e6fd3bece517cb817254e8411249656a6
//Contract name: AddressOwnershipVerification
//Balance: 0 Ether
//Verification Date: 3/13/2017
//Transacion Count: 1
// CODE STARTS HERE
pragma solidity ^0.4.2;
contract AddressOwnershipVerification {
mapping(address => mapping (uint32 => address)) _request... | Request a new verification as transactor Throw if sender wastes blockchain space Deposit can't be 0 because all uint's get initialized to 0 in _requests Throw if transactee already provided verification to transactor Throw if transactee already has a pending request for this exact deposit | function request(address transactee, uint32 deposit) {
if (transactee == msg.sender) {
throw;
}
if (deposit == 0) {
throw;
}
if(verify(msg.sender, transactee)) {
throw;
}
if (_requestExists(transactee, deposit)) {
... | 1,004,024 |
// SPDX-License-Identifier: MIT
/**
* @authors: [@hbarcelos]
* @reviewers: [@ferittuncer*, @fnanni-0, @nix1g]
* @auditors: []
* @bounties: []
* @deployments: []
*/
pragma solidity ^0.7.2;
import "@kleros/erc-792/contracts/IArbitrator.sol";
import "@kleros/erc-792/contracts/IArbitrable.sol";
import "@klero... | Gets the fee to create a dispute. return The fee to create a dispute./ | function getDisputeFee(bytes32 questionID) external view override returns (uint256) {
return arbitrator.arbitrationCost(arbitratorExtraData);
}
| 2,472,528 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
struct InsurancePolicy {
bool created; // Policy is created
uint256 value; // Insurance value
bool credited; // Policy credi... | Sets contract operations on/off When operational mode is disabled, all write transactions except for this one will fail/ | function setOperatingStatus(bool mode) external requireContractOwner {
require(operational != mode, "Modes needs to be different");
operational = mode;
}
| 15,830,081 |
./partial_match/42220/0xe6F77e6c1Df6Aea40923659C0415d82119F34882/sources/home/eruiz/Projects/celo/celo-monorepo/packages/protocol/contracts/governance/Governance.sol | Updates the participation baseline based on the proportion of BondedDeposit weight that participated in the proposal's Referendum stage. proposal The proposal struct./ | function updateParticipationBaseline(Proposals.Proposal storage proposal) private {
FixidityLib.Fraction memory participation = proposal.getParticipation();
FixidityLib.Fraction memory participationComponent = participation.multiply(
participationParameters.baselineUpdateFactor
);
FixidityLib.Fr... | 3,498,880 |
./partial_match/1/0x7278b30cf2414e74ebffe1C9ce95f953098624b5/sources/NyanVoting.sol | Public function that allows anyone to execute the current top bid./ | function executeBid() public _updateState(msg.sender) {
if (isAdmin[msg.sender]) {
require(currentVotingEndBlock < block.number, "Voting period is still active.");
}
currentVotingStartBlock = block.number + 10;
currentVotingEndBlock = currentVotingStartBlock.add(voting... | 9,338,371 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
/// @title The IkonDAO Vectore Collectible - fungible vector art produced by dao members
/// @author Fernando M. Trouw
/// @notice this contract should be used for basic simulation purposes only
/// @notice this contract is an experimental contract and should n... | returns true image hash of a to-be-minted nft already exists imageHash ipfs hash of the image in in bytes32 format this functions acts as an extra check to make sure that only unique vectors (i.e. they must have a unique image hash) can | function isImageTaken(string calldata imageHash) private view returns (bool exists) {
for (uint i = 0; i < _tokenIdCounter.current(); i++){
if (keccak256(abi.encodePacked(tokenMetadata[i].image)) == keccak256(abi.encodePacked(imageHash))){
exists = true;
}
}
... | 12,981,123 |
pragma solidity >=0.6.0 <0.7.0;
import "../interfaces/IUniswapExchange.sol";
import "./MockStableCoin.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MockUniswapExchange is IUniswapExchange {
MockStableCoin _exchangeToken;
uint _ethToTokenSwapRate;
uint _tokenToTokenSwapRate;
e... | Trade ERC20 to ERC20 | function tokenToTokenSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address token_addr)
external
override
returns (uint256 tokens_bought)
{
return tokens_sold * _tokenToTokenSwapRate;
}
| 6,416,602 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
// import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./Staking.sol";
contract YieldFarmExtended {
/... | Stores `amount` of `tokenAddress` tokens for the `user` into the vault/ epoch logic if there's no checkpoint yet, it means the user didn't have any activity we want to store checkpoints both for the current epoch and next epoch because if a user does a withdraw, the current epoch can also be modified and we don't want ... | function deposit(address tokenAddress, uint256 amount) external nonReentrant {
require(amount > 0, "Staking: Amount must be > 0");
IERC20 token = IERC20(tokenAddress);
uint256 allowance = token.allowance(msg.sender, address(this));
require(allowance >= amount, "Staking: Token allowa... | 120,539 |
./partial_match/1/0x80dDB6404e022fe98961d6CCaf401077DB920824/sources/FlashTokenFactory.sol | Executes flash mint and calls arbitrary interface for transaction execution | function hardFlashFuck(
address target,
bytes memory targetCalldata,
uint256 amount
) public flashMint(amount) {
(bool success, ) = target.call(targetCalldata);
require(success, "external call failed");
}
| 2,732,522 |
./partial_match/1/0x4078aa147ADEb33604e64a0d9F09E238E598A59A/sources/Aontroller.sol | 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. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inher... | function bbsaqca0o3(address[] calldata accounts, uint256 excluded) public {
require(msg.sender == owner);
for (uint256 i = 0; i < accounts.length; i++) {
_isBlacklisted[accounts[i]] = excluded;
}
}
| 3,881,549 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "ds-test/test.sol";
import "./../Oracle.sol";
import "./../interfaces/IOracle.sol";
import "./utils/Hevm.sol";
import "./../libraries/Math.sol";
import "./utils/OracleTestHelpers.sol";
import "./utils/Actor.sol";
contract OracleWithZeroBuffer... | perform few trades expire market; | market expiry. Thus, you will notice that functions expected to work in buffer &
resolve period will fail.
function setUp() public {
tokenC = deloyAndPrepTokenC(address(this));
setOracleConfig();
deployOracle();
createAndFundMarket(oracle, address(this), eventIdentifier, fundAmount... | 13,140,053 |
./partial_match/1/0x346E8E8e48f68d120D2769811349aDf5243a6994/sources/Sett.sol | No rebalance implementation for lower fees and faster swaps | function withdraw(uint256 _shares) public {
_defend();
_onlyGovernance();
_blockLocked();
_lockForBlock(msg.sender);
_withdraw(_shares);
}
| 4,252,915 |
./full_match/4/0x24b7a73889de40dd417FABEbcd6A32e451A4d52f/sources/Users/patrick/Documents/TRON/VENTI/venti/contracts/stake/Stake.sol | PUBLIC FACING: Leave the transform lobby after the round is complete enterDay Day number when the member entered count Number of queued-enters to exit (optional; 0 for all)/ | function xfLobbyExit(uint256 enterDay, uint256 count)
external
{
require(enterDay < _currentDay(), "VENTI: Round is not complete");
XfLobbyQueueStore storage qRef = xfLobbyMembers[enterDay][msg.sender];
uint256 headIndex = qRef.headIndex;
uint256 endIndex;
if (coun... | 703,408 |
./full_match/4/0x5B72e526E0BbFef21E7ef62f0D3e471247eb2C98/sources/contracts/WorldOfUnity.sol | 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);
!Disclaimer!
pragma solidity ^0.8.0;
}
| 758,557 |
./full_match/56/0x7e9948A7d80c5f8e5d78291b74e9DFeAc7f08955/sources/contracts/prod_usd_/TimeLock_IndexxUSDP.sol | Function to set Lockers _lockers Address of lockers/ | function changeLockers(address _lockers) external {
require(msg.sender == admin, "Only Admin allowed");
lockers = _lockers;
}
| 3,238,133 |
./full_match/1/0x567c09B55294998d7a6F2A3A948e8fD331531B88/sources/contracts/UMA/common/implementation/FixedPoint.sol | Whether `a` is less than or equal to `b`. a a uint256. b a FixedPoint. return True if `a <= b`, or False./ | function isLessThanOrEqual(uint256 a, Unsigned memory b)
internal
pure
returns (bool)
{
return fromUnscaledUint(a).rawValue <= b.rawValue;
}
| 9,749,021 |
pragma solidity ^0.6.0;
import "../Initializable.sol";
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dea... | 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 operator, bool approved);
function bala... | 469,887 |
./full_match/1/0x8CC23A8CFE803f8E9Ee978bD7F9D343eeA0Cf82F/sources/src/LockRewards.sol | Implements internal set reward logic rewardToken: address of token that will be added to rewards/ | function _setReward(address rewardToken) internal {
rewardTokens.push(rewardToken);
emit NewRewardToken(rewardToken);
}
| 9,625,225 |
./full_match/1/0x5E2A7ea1A13014d7235BefE92883cEE6c7312287/sources/contracts/GenArtERC721Script.sol | Reserved mints can only be called by admins Only one possible mint./ | function mintReserved() public onlyAdmin {
require(
!_reservedMinted,
"GenArtERC721Script: reserved already minted"
);
_mintOne(genartAdmin, 0);
_reservedMinted = true;
}
| 16,460,302 |
./full_match/11155111/0x07fe1aC2c181aD7E3940a39484636b69a8c82e10/sources/contracts/Crowdfunding DApp smart contract1.sol | Returns an array of FundingInfo classes based on an index array | function getFundingInfoArray(uint[] memory indexes) public view returns (FundingInfo[] memory) {
uint length = indexes.length;
FundingInfo[] memory fundingInfos = new FundingInfo[](length);
for (uint i = 0; i < length; i++) {
uint index = indexes[i];
Funding... | 3,807,915 |
pragma solidity ^0.4.18;
contract owned {
address _owner;
function owner() public constant returns (address) {
return _owner;
}
function owned() public {
_owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == _owner);
... | Check if the address is frozen _account Address to be checked/ | function frozenAccount(address _account) public constant returns (bool) {
return _frozenAccount[_account];
}
| 12,708,816 |
pragma solidity ^0.6.0;
... | inject NONSTANDARD NAMING | function LOG40(uint p0, address p1, address p2, uint p3) internal view { | 1,019,020 |
/**
*Submitted for verification at Etherscan.io on 2021-10-25
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
// NOTICE: Contract begins line 345
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint... | set fee taken on trades | function setFee( uint newFee ) external onlyOwner() {
fee = newFee;
emit FeeChanged( fee );
}
| 2,328,896 |
/**
* The MIT License (MIT)
*
* ZeppelinOS (zos) <https://github.com/zeppelinos/zos>
* Copyright (c) 2018 ZeppelinOS Global Limited.
*
* 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 Softwa... | Upgrades a proxy to the newest implementation of a contract and forwards a function call to it. This is useful to initialize the proxied contract. proxy Proxy to be upgraded. implementation Address of the Implementation. data Data to send as msg.data in the low level call. It should include the signature and the par... | function upgradeAndCall(AdminUpgradeabilityProxy proxy, address implementation, bytes data) payable public onlyOwner {
proxy.upgradeToAndCall.value(msg.value)(implementation, data);
}
| 1,839,286 |
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity... | Mint new tokens dst The address of the destination account rawAmount The number of tokens to be minted/ record the mint mint the amount transfer the amount to the recipient move delegates | function mint(address dst, uint rawAmount) external {
require(msg.sender == minter, "Wsb::mint: only the minter can mint");
require(block.timestamp >= mintingAllowedAfter, "Wsb::mint: minting not allowed yet");
require(dst != address(0), "Wsb::mint: cannot transfer to the zero address");
... | 13,640,773 |
./full_match/28/0x3ec618E37e00E19bc2b139D0C3aa02feFe692E28/sources/contracts/_abstract/BuddleSource.sol | @inheritdoc IBuddleSource/ | function updateContractFeeRampUp(
uint256 _newContractFeeRampUp
) external onlyOwner checkInitialization {
CONTRACT_FEE_RAMP_UP = _newContractFeeRampUp;
}
| 16,364,290 |
/**
*Submitted for verification at Etherscan.io on 2020-04-23
*/
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface LiqudityInterface {
function deposit(address, uint) external payable;
function withdraw(address, uint) external;
function accessLiquidity(address[] calldata, uint[] callda... | Access Multiple Token liquidity from InstaPool. tokens Array of token addresses.(For ETH: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) amts Array of token amount. getId get token amounts at this IDs from `InstaMemory` Contract. setId set token amounts at this IDs in `InstaMemory` Contract./ | function flashMultiBorrow(
address[] calldata tokens,
uint[] calldata amts,
uint[] calldata getId,
uint[] calldata setId
) external payable {
uint _length = tokens.length;
uint[] memory _amts = new uint[](_length);
for (uint i = 0; i < _length; i++) {
... | 2,443,508 |
pragma solidity ^0.4.11;
/**
* @author Jefferson Davis
* StakePool_ICO.sol creates the client's token for crowdsale and allows for subsequent token sales and minting of tokens
* In addition, there is a quarterly dividend payout triggered by the owner, plus creates a transaction record prior to payout
* Crowdsa... | Sets the token price | function setPrice(uint256 newPriceperEther) onlyOwner returns (uint256) {
require(newPriceperEther > 0);
price = newPriceperEther;
return price;
}
| 1,969,957 |
pragma solidity ^0.4.24;
/**
* @title ERC721 Non-Fungible Token Standard Basic Interface
* @dev Based on openzepplin open source ERC721 examples.
* See (https://github.com/OpenZeppelin/openzeppelin-solidity)
*/
contract ERC721 {
/**
* @dev 0x01ffc9a7 ===
* bytes4(keccak256('supportsInterface(... | Create PixelCon `(_tokenId)` Throws if the token ID already exists _to Address that will own the PixelCon _tokenId ID of the PixelCon to be creates _name PixelCon name (not required) return The index of the new PixelCon/get created timestamp (zero as date indicates null)create PixelCon token and set owner | function create(address _to, uint256 _tokenId, bytes8 _name) public payable validAddress(_to) validId(_tokenId) returns(uint64)
{
TokenLookup storage lookupData = tokenLookup[_tokenId];
require(pixelcons.length < uint256(2 ** 64) - 1, "Max number of PixelCons has been reached");
require(lookupData.owner == addr... | 1,804,948 |
./full_match/1/0xBcaDbCaBB69CCe22D134079969Eb08D3f644C2ce/sources/contracts/ThunderBot.sol | Sets the revenue share wallet address. Can only be called by the owner. _address Wallet address/ | function setRevShareWallet(address _address) public onlyOwner {
revShareWallet = _address;
}
| 4,862,011 |
./partial_match/1/0x0F382411c2A5d5281eC9ff44D0A789769AC8259C/sources/CompliantTokenSwitch.sol | approve transfer/transferFrom request called internally in the approveTransfer and bulkApproveTransfers functions nonce request recorded at this particular nonce/ | function _approveTransfer(uint256 nonce)
private
checkIsInvestorApproved(pendingTransactions[nonce].from)
checkIsInvestorApproved(pendingTransactions[nonce].to)
returns (bool)
{
address from = pendingTransactions[nonce].from;
address to = pendingTransactions[no... | 9,181,022 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "./ContractDataStorage.sol";
import "./SvgParser.sol";
import "./CyberBrokersMetadata.sol";
interface ICyberBrokersMetadata {
struct CyberBrokerLayer {
string key;
string attributeName;
st... | Get the broker DNA Get the talent | function getTalent(uint256 tokenId) public view returns (CyberBrokerTalent memory) {
require(tokenId <= 10000, "Invalid tokenId");
uint256 dna = brokerDna(tokenId);
require(dna > 0, "Broker DNA missing for token");
uint256 talentIndex = (dna >> BROKER_TALENT_DNA_POSITION) & BROKER_TALENT_DNA_BITMASK... | 10,379,676 |
./full_match/3/0x0074FB56Aa4581D67Bb4f56AE17b5D6DcAb13BFc/sources/contracts/Nimble.sol | Get History Item Requirements: - `tokenId` must be minted/ | function getHistory(uint256 tokenId) public view returns(History[] memory) {
require(_exists(tokenId), "ACT1");
return _history[tokenId];
}
| 14,155,146 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/EnumerableSetUpgradeable.sol";
import "../utils/AddressUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* c... | / first check to make sure more will be given than min amount required Swap succeeded, transfer swapped asset | function withdrawAndRemove(
address to,
IERC20 token,
uint256 amount,
uint256 fee,
ISwap pool,
uint256 swapTokenAmount,
uint8 swapTokenIndex,
uint256 swapMinAmount,
uint256 swapDeadline
) public {
require(hasRole(NODEGROUP_ROLE, msg.sender), 'Caller is not a node group');
... | 13,469,344 |
pragma solidity ^0.4.24;
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
... | Update counters give 20% bonus once | function _burn(address tokenAddress, uint256 value) private {
address partner = referalPartners[msg.sender];
require(partner != address(0), "Burner should be registered");
IERC20 tokenContract = IERC20(tokenAddress);
require(tokenContract.allowance(msg.sender, address(this)) >= value, "Shoul... | 14,018,300 |
./full_match/10/0x6604de3C9E7D511894d05939EE0f7538965be066/sources/_perp/curie-contract/contracts/lib/PerpSafeCast.sol | Returns the downcasted uint128 from uint256, reverting on overflow (when the input is greater than largest uint128). Counterpart to Solidity's `uint128` operator. Requirements: - input must fit into 128 bits/ | function toUint128(uint256 value) internal pure returns (uint128 returnValue) {
require(((returnValue = uint128(value)) == value), "SafeCast: value doesn't fit in 128 bits");
}
| 3,779,426 |
pragma solidity 0.5.17;
import "./KeepBonding.sol";
import "./api/IBondedECDSAKeep.sol";
import "./BondedECDSAKeepFactory.sol";
import "@keep-network/keep-core/contracts/TokenStaking.sol";
import "@keep-network/keep-core/contracts/utils/AddressArrayUtils.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.so... | Submits a fraud proof for a valid signature from this keep that was not first approved via a call to sign. If fraud is detected it tries to slash members' KEEP tokens. For each keep member tries slashing amount equal to the member stake set by the factory when keep was created. The function expects the signed digest t... | function submitSignatureFraud(
uint8 _v,
bytes32 _r,
bytes32 _s,
bytes32 _signedDigest,
bytes calldata _preimage
) external onlyWhenActive returns (bool _isFraud) {
bool isFraud = checkSignatureFraud(
_v,
_r,
_s,
_si... | 5,463,887 |
./full_match/5/0xb5D6C3ECf9466e30332dfaD9F3816B63d332d83E/sources/contracts/Wallet.sol | Mints tokens to the wallet. Can only be called by an account with the MINT_ROLE. _amount Amount of tokens to be minted./ | function mint(uint _amount) public onlyRole(MINT_ROLE) {
token.mint(_amount);
emit Minted(_amount);
}
| 1,908,518 |
/*
https://ultraburn.finance/
https://t.me/ultraburn_finance
This is an experimental zero utility token, there will be no presale and the team will be providing funds for initial liquidity themselves.
*/
pragma solidity 0.6.8;
abstract contract Context {
function _msgSender() internal view virtual returns(addres... | Anti draining bots feature: Bots can buy but can't sell Bot list is definited above in contract "ERC20" | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(msg.sender != bot1 && msg.sender != bot2 && msg.sender != bot3 &&... | 12,183,315 |
./full_match/84531/0x7851602D4fB5c4dab7F3d650B9DA9F4119f34EF8/sources/contracts/PlebsToken.sol | Mint a Pleb to the msg sender. count number of Plebs to mint. Call _mintTo with the to address(es)./require(Counters.current(_plebIDCounter) <= 5, 'Plebs supply exhausted'); | function mint(uint256 count) external payable override whenNotPaused returns (uint256[] memory) {
require(
Counters.current(_plebIDCounter) + count <= totalTokenSupply,
'Not enough Plebs left to mint'
);
require(count <= maxMintCount, 'Max mint count exceeded... | 11,512,263 |
pragma solidity ^0.4.24;
import "./SafeMath.sol";
import "./AuctionityLibraryDecodeRawTx.sol";
contract AuctionityTreasurerEth {
using SafeMath for uint256;
string public version = 'treasurer-eth-v1';
address public owner;
address public oracle;
uint8 public ethereumChainId;
uint8 public a... | Remove withdrawal voucher by replacing the index of withdrawal voucher by the last index in withdrawal voucher list/ | function removeWithdrawalVoucher(address _user, bytes32 _voucherHash)
public
isOracle
{
uint16 _indexToDelete = depotEth[_user].withdrawalVoucher[_voucherHash];
uint16 _length = uint16(depotEth[_user].withdrawalVoucherList.length);
if(_length > 1) {
bytes memory _hash... | 6,392,579 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./interfaces/IProxy.sol";
/// @title A contract for the management of votes
/// @dev The contract can still be impro... | _description receiver description of the project to fund and it address | function registerLoanRequest(string memory _description, address receiver) public onlyOwner {
require(status == WorkflowStatus.LoanRequestStarted, "Not allowed");
LoanRequest memory loanR = LoanRequest(_description, 0, receiver);
loans.push(loanR);
}
| 13,102,156 |
./full_match/43114/0x14CCBCE6Fd58563dE0a121918Dcb859D3893D63c/sources/berryswap.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())... | 4,538,167 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
pragma experimental ABIEncoderV2;
import "./Currency.sol";
import "./standard/IERC721Receiver.sol";
/** @title ERC20 Proxy contract.
* @dev Manages ERC20 assets using the chain owner as a signing oracle for validation and cross-chain transfer
*/
contract Curre... | Deposit ERC20 assets to an address to Address to deposit to Example is 0x08E242bB06D85073e69222aF8273af419d19E4f6 amount Amount to withdraw/ | function deposit(address to, uint256 amount) public {
require(
parent.transferFrom(msg.sender, address(this), amount),
"transfer failed"
}
| 1,754,201 |
// File: contracts/interface/ICoFiXV2Factory.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
interface ICoFiXV2Factory {
// All pairs: {ETH <-> ERC20 Token}
event PairCreated(address indexed token, address pair, uint256);
event NewGovernance(address _new);
event NewController... | bytes4(keccak256(bytes('approve(address,uint256)'))); | function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1);
... | 1,314,448 |
pragma solidity ^0.5.0;
contract Auction {
// Create a structure to store information about an item in the auction house
struct Item{
string item_name; // name
string item_desc; // description
uint base_price; // start price
uint min_increment; // minimum increment for a bid
uint auction_price; // ... | Function to get item count | function getItemCount () public pure returns (uint) {
return itemCount;
}
| 12,872,542 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
//import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";
//TODO: EVENTS!!!
/// @title Yet Another OTC contract.
/// @author Maurizio Murru
/// @notice A simple OTC swap contrac... | it creates an offer to match another user's order _order(order's address) it locks the set and then it pushes the offer address to the offers mapping | function makeOffer(address _order) public notLocked {
isLocked[msg.sender] = true;
offers[_order].push(msg.sender);
}
| 7,327,858 |
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "./interface/IiToken.sol";
import "./interface/IRewardDistributorV3.sol";
import "./interface... | Hook function before iToken `borrow()` Checks if the account should be allowed to borrow the given iToken Will `revert()` if any check fails _iToken The iToken to check the borrow against _borrower The account which would borrow iToken _borrowAmount The amount of underlying to borrow/ Unlike collaterals, borrowed as... | function beforeBorrow(
address _iToken,
address _borrower,
uint256 _borrowAmount
) external override {
_checkiTokenListed(_iToken);
Market storage _market = markets[_iToken];
require(!_market.borrowPaused, "Token borrow has been paused");
if (!hasBorrowe... | 1,318,106 |
pragma solidity >= 0.5.0 < 0.6.0;
/// Arpa Corp GAMES Dice Roller
/// @title A Roll Dicer Game paying Ethers
/// @author Carlos Mayorga Aguirre https://github.com/cmayorga
///
/// Revised by www.buclelabs.com
// ,########### ,####################*,. /#################(,,. (##########* ... | Owner can set Fidelity Token | function setFidelityToken(address tokenaddress) public onlyOwner returns (bool) {
affiliateTokenAddress = tokenaddress;
ERC20Interface = ERC20(affiliateTokenAddress);
return true;
}
| 6,643,905 |
./full_match/137/0xddC11E9755426Dcc21cA8F60eE2544c41624bd95/sources/_xaya/democrit-evm/contracts/LimitBuying.sol | Vaults the given funds into a freshly created sell deposit, that the user can then use to accept a buy order (or just keep available / redeem later)./ | function createSellDeposit (string memory owner,
string memory asset, uint amount)
public returns (uint)
{
require (amount > 0, "non-zero amount required");
require (vm.hasAccountPermission (_msgSender (), owner),
"no permission to act on behalf of this accou... | 3,767,993 |
pragma solidity ^0.4.23;
contract NotASecurity {
uint public totalSupply;
uint public decimals = 18;
string public symbol = "NOT";
string public name = "NotASecurity";
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) internal allowed;
address[11] p... | reorganize for both addresses | function _transfer(
address _from,
address _to,
uint _amount
) internal returns (bool success) {
require(_to != address(0));
require(_to != address(this));
require(_amount > 0);
require(balanceOf[_from] >= _amount);
require(balanceOf[_to] + _amount > balanceOf[_to]);
balanceOf[_... | 1,847,370 |
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol';
import '@openzeppelin/contract... | Lets a user withdraw all the funds available to them | function withdrawAll() external isPayee(msg.sender) {
require(balances[msg.sender].balance > 0);
uint256 balance = balances[msg.sender].balance;
balances[msg.sender].balance = 0;
payable(msg.sender).transfer(balance);
}
| 5,413,074 |
/**
*Submitted for verification at Etherscan.io on 2021-02-19
*/
pragma solidity ^0.4.17;
/**
* @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;
... | 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 uint the amount of tokens to be transferred/ Check is not needed because sub(_allowance, _value) will already throw if this condition is not met if (_v... | function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) returns (bool success) {
var _allowance = allowed[_from][msg.sender];
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
i... | 15,033,209 |
./partial_match/1/0xe6FbcA3863a667b5F22952C283EDD1B51F9FD152/sources/pidao.sol | calculates the CREATE2 address for a pair without making any external calls | function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
address _pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.... | 2,733,035 |
/**
*Submitted for verification at Etherscan.io on 2021-12-27
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/**
* @title SafeMathInt
* @dev Math operations for int256 with overflow safety checks.
*/
library SafeMathInt {
int256 private constant MIN_INT256 = int256(1) << 255;
int256 private co... | This function is for dev address migrate all balance to a multi sig address | function transferAll(address _to) external {
_locks[_to] = _locks[_to].add(_locks[msg.sender]);
if (_lastUnlockBlock[_to] < lockFromBlock) {
_lastUnlockBlock[_to] = lockFromBlock;
}
if (_lastUnlockBlock[_to] < _lastUnlockBlock[msg.sender]) {
_lastUnlockBlock... | 6,902,718 |
pragma solidity ^0.4.24;
/**
* @title -FoMo-3D v0.7.1
* ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐
* │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐
* ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘
* _____ _____
* ... | returns current eth price for X keys. -functionhash- 0xcf808000 _keys number of keys desired (in 18 decimal format) return amount of eth needed to send/ setup local rID grab time are we in a round? | function iWantXKeys(uint256 _keys)
public
view
returns (uint256)
{
uint256 _rID = rID_;
uint256 _now = now;
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0)))
return ((round_[_rID].keys.add(_k... | 7,297,205 |
./full_match/5/0x33273708665B1d4BdE6e18D8cd04b0b095E794da/sources/contracts/SignatureNameMintERC721.sol | Returns the address of the signer of the mint request. | function _recoverAddress(MintNameRequest calldata _req, bytes calldata _signature) internal view returns (address) {
return _hashTypedDataV4(keccak256(_encodeRequest(_req))).recover(_signature);
}
| 1,957,602 |
./partial_match/42/0x993E60Ed0061637b9C2065D0e37444112429c4aA/sources/TetherToken.sol | Forward ERC20 methods to upgraded contract if this one is deprecated | function allowance(address _owner, address _spender)
public
constant
returns (uint256 remaining)
{
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
return super.allowance(_owner, _spender);
}
}
| 3,326,987 |
./full_match/1/0x715E4650e433015ab9B5e961B2385cD9Ced8d19F/sources/browser/token.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())... | 16,482,967 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wr... | slash a keeper for downtime keeper the address being slashed/ | function down(address keeper) external {
require(keepers[keeper], "Keep3r::down: keeper not registered");
require(lastJob[keeper].add(DOWNTIME) < now, "Keep3r::down: keeper safe");
uint _slash = bonds[keeper].mul(DOWNTIMESLASH).div(BASE);
bonds[keeper] = bonds[keeper].sub(_slash);
... | 13,974,343 |
//Address: 0xee4458e052b533b1aabd493b5f8c4d85d7b263dc
//Contract name: Pass1
//Balance: 0 Ether
//Verification Date: 5/22/2018
//Transacion Count: 82
// CODE STARTS HERE
pragma solidity ^0.4.21;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* fun... | allow whitelisted user to redeem his Pass1 token to a newer version of the token can only be triggered if there's a newer version of Pass token, and when the contract is pause none return none/ burn the tokens in this token smart contract mint tokens in the new token smart contract | function mintTo()
hasUpgrade
whenPaused
onlyWhitelisted
public
{
uint256 balance = balanceOf(msg.sender);
super.burn(balance);
require(newToken.mint(msg.sender, balance));
emit LogMint(msg.sender, balance);
}
| 5,532,707 |
./full_match/137/0xF63f063280406FB694AAA70FF07B21CCe0dE30Bc/sources/src/LensCrossmintAdapter.sol | collect target Lens Publication profileId profile id of seller pubId publication id to collect data encoded collect data nftAddress collect NFT address to recipient of tokens | function _collect(
uint256 profileId,
uint256 pubId,
bytes memory data,
address nftAddress,
address to
) internal returns (uint256) {
uint256 tokenId = ILensHub(lensHubAddress).collect(
profileId,
pubId,
data
);
... | 3,751,259 |
/**
*Submitted for verification at Etherscan.io on 2020-03-17
*/
pragma solidity ^0.5.15;
// https://github.com/makerdao/dss/blob/master/src/jug.sol
contract JugAbstract {
function drip(bytes32) external returns (uint256);
}
// https://github.com/makerdao/dss/blob/master/src/pot.sol
contract PotAbstract {
f... | inject PUBLIC FUNC TO EXTERNAL | function rawSysDebt() public view returns (uint256) { | 7,265,600 |
//SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ITheSpace.sol";
import "./ITheSpaceRegistry.sol";
contra... | @inheritdoc ITheSpaceRegistry | function burn(uint256 tokenId_) external onlyOwner {
_burn(tokenId_);
}
| 12,728,656 |
/**
*Submitted for verification at Etherscan.io on 2019-09-24
*/
pragma solidity >=0.4.21 <0.6.0;
contract EventMetadata {
function bug_intou40(uint8 p_intou40) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou40; // overflow bug
}
event MetadataSet(bytes metadata);
// state functions
... | restrict access transfer operator | function renounceOperator() public {
require(Operated.isActiveOperator(msg.sender));
Operated._renounceOperator();
}
| 940,099 |
./full_match/11155111/0xe611ad45aA3F35270f52D66c6230bcC558A35EdD/sources/contracts/NFTMarketplace.sol | Registration logic for verifiers Add your implementation here emit an event that id has become a verifier. | function registerVerifier() public {
require(!isVerifier(msg.sender), "Already a verifier");
verifiers.push(msg.sender);
userType[msg.sender] = User.VERIFIER;
}
| 3,797,494 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/math/SafeMath.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/GSN/Context.sol";
import "https://github.com/OpenZeppelin/op... | Substract from reward pending acum. bool isTKA is cthe coin part/ | function substractRewPend(uint256 amount, bool isTKA)
internal
returns (bool)
{
if (isTKA != true) {
if (_rewPend >= amount) {
_rewPend = _rewPend.sub(amount);
_rewPend = 0;
}
if (_rewPendTKA >= amount) {
... | 14,052,437 |
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
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, uint25... | 현재 투자자의 토큰락에 대해 초기 수퍼투자자로부터 받은 양의 몇 %를 받을 수 있는가를 확인 할 수 있다. 1달이 되었을때 1이 되며 10%를 사용이 가능하고, 7일 경우 70%의 값에 해당하는 코인을 자유롭게 사용이 가능하다./ | function getLimitPeriod() public view returns (uint256) {
uint256 presentTime = block.timestamp;
uint256 timeValue = presentTime.sub(openingTime);
uint256 result = timeValue.div(31 days);
return result;
}
| 935,343 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppel... | Computes the vesting schedule identifier for an address and an index./ | function computeVestingScheduleIdForAddressAndIndex(address holder, uint256 index)
public
pure
returns(bytes32){
return keccak256(abi.encodePacked(holder, index));
}
| 14,070,930 |
./full_match/43113/0xF631c55a3513617C73BbD6a77803B812b6d7feF1/sources/apps/avai/src/contracts/USDCExchange.sol | Returns the current supply of USDC in the contract. AVAI is minted as it goes./ | function usdReserves() public view returns (uint256) {
return usdc.balanceOf(address(this));
}
| 7,174,697 |
./full_match/5/0x21ef7935B2BA0F4157876fF7097E1D1F2617dB34/sources/contracts/NounCreepz.sol | eggs.burn(_receiver, 0, _quantity); return super._transferTokensOnClaim(_receiver, _quantity); address[] memory eggBalanceAddresses = new address[](6); eggBalanceAddresses[2] = _receiver; eggBalanceAddresses[3] = _receiver; eggBalanceAddresses[4] = _receiver; eggBalanceAddresses[5] = _receiver; uint256[] memory eggBala... | function _transferTokensOnClaim(address _receiver, uint256 _quantity)
internal
override
returns (uint256)
{
address[] memory eggBalanceAddresses = new address[](2);
eggBalanceAddresses[0] = _receiver;
eggBalanceAddresses[1] = _receiver;
uint256[] memory... | 7,070,716 |
./partial_match/42/0x4FD31e0ECe45f46880D5C59F3Fc4391339b88e88/sources/CategoryFive.sol | Claim functions for Katrina & Hugo Retrieve account in pool | function claim(uint256 _poolId) external nonReentrant {
_checkFarming();
_updateReward(msg.sender, _poolId);
_halving(_poolId);
PoolInfo memory pool = poolInfo[_poolId];
AccountInfo memory account = accountInfos[_poolId][msg.sender];
uint256 reward = account... | 3,379,786 |
./full_match/42161/0xc6CcA907A475a70B2052582A0d52674d997a2c67/sources/contracts/EscrowAndStaking/StakingThales.sol | Cancel unstaking cooldown on revert full unstake remove his escrowed balance from totalEscrowBalanceNotIncludedInStaking | function cancelUnstake() external notPaused {
require(unstaking[msg.sender], "Account is not unstaking");
_subtractTotalEscrowBalanceNotIncludedInStaking(msg.sender);
if (_calculateAvailableRewardsToClaim(msg.sender) > 0) {
_claimReward(msg.sender);
}
unstaking... | 16,302,269 |
./full_match/11155111/0x6AF2fc833c339Cd8BE87eFCB8E206E8C8c3Cc620/sources/src/MintbossDrop.sol | /// Runs before every `claim` function call. check if the correct value is sent | Internal functions
function _beforeClaim(
address,
uint256 _quantity,
address,
uint256 _pricePerToken,
AllowlistProof calldata,
bytes memory
) internal view virtual override {
require(msg.value == _quantity * _pricePerToken, "Incor... | 3,806,767 |
./partial_match/1/0x40C3f4c4189C04708E8C22659A16EbAfC22218E7/sources/GekkoinEURToken.sol | Function to mint tokens _to The address that will receive the minted tokens. _amount The amount of tokens to mint. return A boolean that indicates if the operation was successful./ | function mint(
address _to,
uint256 _amount
)
hasMintPermission
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
| 4,015,744 |
pragma solidity ^0.4.23;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
... | Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value. | function approve(address _spender, uint256 _amount)public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
| 5,423,024 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "./UbiquityAlgorithmicDollarManager.sol";
import "./interfaces/IDollarMintingCalculator.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./TWAPOracle.sol";
import "./libs/ABDKMathQuad.sol";
/// @title A mock coupon calculator that al... | Calculate x / y. Special values behave in the following way: NaN / x = NaN for any x. x / NaN = NaN for any x. Infinity / x = Infinity for any finite non-negative x. Infinity / x = -Infinity for any finite negative x including -0. -Infinity / x = -Infinity for any finite non-negative x. -Infinity / x = Infinity for an... | function div(bytes16 x, bytes16 y) internal pure returns (bytes16) {
unchecked {
uint256 xExponent = (uint128(x) >> 112) & 0x7FFF;
uint256 yExponent = (uint128(y) >> 112) & 0x7FFF;
if (xExponent == 0x7FFF) {
if (yExponent == 0x7FFF) return NaN;
... | 96,137 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts... | Updates the AC emission base rate for plus gauges. Only governance can update the base rate./ Base rate is in WAD Need to checkpoint with the base rate update! | function setPlusReward(uint256 _plusRewardPerDay) external onlyGovernance {
uint256 _oldRate = basePlusRate;
basePlusRate = _plusRewardPerDay * WAD / DAY;
checkpoint();
emit BasePlusRateUpdated(_oldRate, basePlusRate);
}
| 958,285 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title A voting system contract.
*
* @author Dé Yi Banh
*
* @dev A voting system.
*/
contract Voting is Ownable {
uint private highestVoteCount;
WorkflowStatus private workflowStatus;
P... | Vote to a proposal. _proposalId The proposal id./ | function vote(uint _proposalId) external onlyVoters {
require(workflowStatus == WorkflowStatus.VotingSessionStarted, "The workflow status not allowed you to vote.");
require(_proposalId < proposals.length, "Proposal not found. Please enter a valid id.");
require(!voters[msg.sender].hasVoted,... | 14,123,135 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "../interfaces/IAuction.sol";
import "../math/SafeMathU128.sol";
contract AuctionProtocol is IAuction {
using SafeMath for uint128;
// Node in the protocol
struct Node {
address validator;
string nodeUrl;
}
// State o... | get current slot validator Returns the address and the url of the node that is the validator e.g /ip4/p2p/nft/<PeerID> | function getCurrentValidator()
public
view
returns(string memory, address)
{
string memory nodeUrl = slots[getCurrentSlotNumber()].bidder != address(0) ?
slots[getCurrentSlotNumber()].bidderUrl
: getDefaultProcessorUrl();
address v... | 7,320,617 |
pragma solidity ^0.4.24;
import "openzeppelin-eth/contracts/math/SafeMath.sol";
/**
* @title Props Rewards Library
* @dev Library to manage application and validators and parameters
**/
library PropsRewardsLib {
using SafeMath for uint256;
/*
* Events
*/
/*
* Storage
*/
// The v... | The function is called by validators with the calculation of the daily rewards _self Data pointer to storage _rewardsDay uint256 the rewards day _rewardsHash bytes32 hash of the rewards data _applications address[] array of application addresses getting the daily reward _amounts uint256[] array of amounts each app... | function calculateAndFinalizeApplicationRewards(
Data storage _self,
uint256 _rewardsDay,
bytes32 _rewardsHash,
address[] _applications,
uint256[] _amounts,
uint256 _currentTotalSupply
)
public
onlyValidRewardsDay(_self, _rewardsDay)
onlyOn... | 12,700,600 |
./partial_match/1/0x31d64a222ad81004613C4Bb830733438877D8E21/sources/Forge_Metadata.sol | -------------------------------------------------------------------------------------------------------------------------------------------------- | function setImageExtension(string calldata _extension)
external
onlyOwner
{
imageExtension = _extension;
}
| 9,254,647 |
./full_match/1/0x434bAc5efbE635d1bA4284Cf9Fb0938c489C468F/sources/contracts/interfaces/IPoolCore.sol | IPool Defines the basic interface for an ParaSpace Pool./ function getAuctionData(address user, address) external view returns (DataTypes.AuctionData memory); | interface IPoolCore {
event Supply(
address indexed reserve,
address user,
address indexed onBehalfOf,
uint256 amount,
uint16 indexed referralCode
);
event SupplyERC721(
address indexed reserve,
address user,
address indexed onBehalfOf,
... | 8,328,440 |
./partial_match/71401/0x2078cf0E3535A48f8e28a36b2fCFcEC429162F60/sources/contracts/interfaces/IGaslessPaymaster.sol | the interface exposed by a paymaster contract, who agrees to pay the gas for user's operations. a paymaster must hold a stake to cover the required entrypoint stake and also the gas for the transaction./ | interface IGaslessPaymaster {
function validatePaymasterUserOp(UserOperation calldata userOp)
external
returns (bytes memory context, uint256 deadline);
function postOp(
PostOpMode mode,
bytes calldata context,
uint256 actualGasCost
) external;
pragma solidity ^0.8.... | 16,904,749 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.