file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
/**
*Submitted for verification at Etherscan.io on 2021-01-25
*/
// SPDX-License-Identifier: UNLICENSED
// File contracts/lib/IERC20.sol
pragma solidity 0.7.3;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
fu... | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256)... | 1,567,300 |
// hevm: flattened sources of ./contracts/token/UniswapIncentive.sol
pragma solidity >=0.4.0 >=0.5.0 >=0.6.2 >=0.6.0 <0.7.0 >=0.6.0 <0.8.0 >=0.6.2 <0.7.0 >=0.6.2 <0.8.0;
pragma experimental ABIEncoderV2;
////// ./contracts/core/IPermissions.sol
/* pragma solidity ^0.6.0; */
/* pragma experimental ABIEncoderV2; */
///... | the address of the non-fei underlying token | function token() public view override returns (address) {
address token0 = pair.token0();
if (address(fei()) == token0) {
return pair.token1();
}
return token0;
}
| 1,692,145 |
./full_match/1/0x9101782f132Fb1232BdA742A24372cBBBA01F020/sources/browser/AAAAMint.sol | Update reward variables of the given pool to be up-to-date. | function _update() internal virtual {
if (block.number <= lastRewardBlock) {
return;
}
if (totalProductivity == 0) {
lastRewardBlock = block.number;
return;
}
uint256 reward = _currentReward();
if(reward == 0) {
... | 3,143,388 |
./full_match/1/0xefaDc46BB78B01195a1E12C82A584Caf5403585C/sources/contracts/blocktones.sol | mint function for Whitelist (Window 2) | function whitelistMint(uint256 quantity, bytes32[] calldata proof) external payable isValidMint(quantity, price) {
require(whitelistLive, 'Phase not live');
require(verify(merkleRootWL, keccak256(abi.encodePacked(msg.sender)), proof));
mint(msg.sender, quantity);
}
| 3,012,963 |
./partial_match/1/0x818a10da0c61064B436425aA34Aa2a9f8F07671B/sources/APEP.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("APEP", "APEP") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswap... | 3,679,458 |
./full_match/44787/0x50167A410307aF7c7fCC05aD97c4B35B1E757Aae/sources/src/SpiralsStaking.sol | Returns a Accounts.sol interface for interacting with the smart contract. | function getAccounts() internal view returns (IAccounts) {
address accountsAddr = c_celoRegistry.getAddressForStringOrDie(
"Accounts"
);
return IAccounts(accountsAddr);
}
| 13,242,902 |
pragma solidity 0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256... | This function calculates the refund amount for the funder. Due to no floating points in Solidity, we will lose some fidelity. The funder loses a neglibible amount to refund. The left over wei gets pooled to the fund./ | function calculateRefundAmount(uint amount, uint withdrawalTimes) public returns (uint) {
for(uint i=0; i<withdrawalTimes; i++){
amount = amount.mul(9).div(10);
}
return amount;
}
| 7,211,565 |
pragma solidity 0.6.6;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying ... | increase reward per time based on new reward tokens added to the pool _additionalAmount: additional reward token amount/ | function _increaseRewardInternal(uint256 _additionalAmount) internal {
_updatePool();
uint256 additionalRewardPerTime = _additionalAmount.mul(REWARD_PRECISION).div(endDate - block.timestamp);
rewardPerTime = rewardPerTime.add(additionalRewardPerTime);
rewardTokenAmount = re... | 6,269,251 |
pragma solidity ^0.4.18;
// File: contracts/LikeCoinInterface.sol
// Copyright (C) 2017 LikeCoin Foundation Limited
//
// This file is part of LikeCoin Smart Contract.
//
// LikeCoin Smart Contract is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public Lice... | Copies a slice to a new string. self The slice to copy. return A newly allocated string containing the slice's text./ | function toString(slice self) internal pure returns (string) {
string memory ret = new string(self._len);
uint retptr;
memcpy(retptr, self._ptr, self._len);
return ret;
}
| 1,732,487 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, s... | Usable by any user to update the version that they want their signatures to check. This is helpful if an address wants to mass invalidate their signatures without having to call cancelSale on each one./ | function updateVersion(uint256 version) external {
_addressToActiveVersion[_msgSender()] = version;
}
| 1,178,451 |
pragma solidity ^0.5.6;
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "../interfaces/ILinkdropERC20.sol";
import "./LinkdropCommon.sol";
contract LinkdropERC20 is ILinkdropERC20, LinkdropCommon {
/**
* @dev Function to verify linkdrop signer's signature
* @param _weiAmount Amoun... | Function to claim ETH and/or ERC20 tokens. Can only be called when contract is not paused _weiAmount Amount of wei to be claimed _tokenAddress Token address _tokenAmount Amount of tokens to be claimed (in atomic value) _expiration Unix timestamp of link expiration time _linkId Address corresponding to link key _l... | function claim
(
uint _weiAmount,
address _tokenAddress,
uint _tokenAmount,
uint _expiration,
address _linkId,
bytes calldata _linkdropSignerSignature,
address payable _receiver,
bytes calldata _receiverSignature
)
external
whenNotPause... | 1,791,091 |
pragma solidity ^0.4.21;
import "openzeppelin-solidity/contracts/crowdsale/distribution/FinalizableCrowdsale.sol";
import "openzeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol";
import "openzeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol";
import "openzeppelin-solidity/contracts... | Whenever buyTokens function is called there are 3 use cases that can take place: 1). if contributor has already passed KYC (this means that accepted[msg.sender] is true), a normal purchase is done (funds go to qiibee wallet and tokens are minted (see _mintTokens function) 2). if contributor has been REJECTED from KYC (... | function buyTokens() public payable whenNotPaused capNotReached onlyWhileOpen {
_preValidatePurchase(msg.sender, msg.value);
_mintTokens(msg.sender, msg.value);
revert();
bonus[msg.sender] = _checkBonus();
vault.deposit.value(msg.value)(msg.sender... | 12,957,581 |
// SPDX-License-Identifier: MIT
// DRentforcement
// A Decentralized C2C Renting Platform
// Contract for basic renting functions
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// importing the library
import './BokkyPooBahsDateTimeLibrary.sol';
contract Rentforcement {
// using the library for uint... | fetch a particular user profile | function fetchOwnerOfProduct(uint256 _productId) external view returns(User memory) {
return users[products[_productId].productOwner];
}
| 893,001 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
import "IERC721.sol";
import "IERC721Receiver.sol";
import "IERC20.sol";
import "SafeERC20.sol";
import "SafeMath.sol";
import "Address.sol";
import "Ownable.sol";
import "ReentrancyGuard.sol";
import "Security4.sol";
import "ORentable.sol";
import "YRentable.s... | Calculate linearly the amount remaining approx safety check | function redeemLease(uint256 leaseId)
external
nonReentrant
whenPausedthenProxy
onlyAllowlisted
{
address user = _msgSender();
require(
IERC721(_yToken).ownerOf(leaseId) == user,
"You should own respective yRentable"
);
Lea... | 328,512 |
./partial_match/1/0xAB42127980a3bff124E6465e097a5fC97228827e/sources/src/contracts/core/DataLayrChallenge.sol | verifies all challenger inputs against stored hashes, computes low degreeness proof and freezes operator if verified as being excluded from nonsigner set. header is the header for the datastore in question. potElement is the G2 point of the POT element we are computing the pairing for (x^{n-m}) potMerkleProo... | function challengeLowDegreenessProof(
bytes calldata header,
BN254.G2Point memory potElement,
bytes memory potMerkleProof,
IDataLayrServiceManager.DataStoreSearchData calldata dataStoreSearchData,
IDataLayrServiceManager.SignatoryRecordMinusDataStoreId calldata signatoryRecor... | 9,359,586 |
// SPDX-License-Identifier: MIT
/*
/$$ /$$
| $$ | $$
/$$$$$$$ /$$$$$$ /$$ /$$ /$$$$... | ======================== Minting zone ================== choose _safeMint over _mint whenever possible token URI is set to : 'ipfs:cid/tokenId.png(.json)' | function mintNFT(address to, uint256 tokenId) private {
_safeMint(to, tokenId);
setTokenURI(tokenId);
}
| 6,480,777 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import '@openzeppelin/contracts/math/SafeMath.sol';
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import '../../mock/MockERC20.sol';
import ... | withdraw lp tokensremove lp balancereturn lp tokens | function _withdraw(
uint256 _pid,
uint256 _amount,
address _from,
address _to
) internal {
PoolInfo storage pool = poolInfo[_pid];
address lptoken = pool.lptoken;
address token = pool.token;
MockERC20(token).burnFrom(_from, _amount);
IERC... | 1,802,843 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
/**
* @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, ... | Price calculator:-------------------------------------------------------------------------------------------------------------------------- | function calcPrice(address _fromAsset, uint256 _fromAmount) public view returns (uint256 toActualAmount_, uint256 fromActualAmount_)
{
require(_fromAmount > 0, "ERR_ZERO_PAYMENT");
uint256 fromAssetPrice = assets[_fromAsset];
require(fromAssetPrice > 0, "ERR_ASSET_NOT_SUPPORTED"... | 1,346,928 |
./full_match/1/0xe63C777dCaab7Db2F6667fCA5f323D47fEE565B2/sources/MyContract.sol | See {IERC721-balanceOf}./ | function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
| 8,463,213 |
./partial_match/56/0x79Ed648f0Fb424Ec37897DF87B9ee80cca65B230/sources/ProofOfApes.sol | Calculate token sell value. It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code./ | function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
SafeMath.sub(
(((tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))) -
tokenPr... | 11,213,909 |
pragma solidity >=0.5.0 <0.6.0;
library DSMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
fun... | Used by node runners to unbond their stakes. Unbonded tokens are locked for 7 days, during the unbonding period they're not eligible for staking rewards. | function nodeUnbond(uint _tokenAmount, uint _dropburnAmount, address _nodeAddr) public {
require(nodeRunners[msg.sender][_nodeAddr], "node-not-owned-by-msgSender");
Node storage node = nodes[_nodeAddr];
require(_tokenAmount <= node.selfStakedAmount, "invalid-to-unbond-more-than-staked-amoun... | 2,395,645 |
./partial_match/1/0x1C2243aef55a316CaA0B6a1715B607B898987483/sources/NUXAsset.sol | Sets asset proxy address. Can be set only once. _proxy asset proxy contract address. return success. function is final, and must not be overridden./ | function init(AssetProxyInterface _proxy) public returns(bool) {
if (address(proxy) != address(0)) {
return false;
}
proxy = _proxy;
return true;
}
| 2,625,577 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./interfaces/IStakingPoolMigrator.sol";
import "./interfaces/IStakingPoolRewarder.sol";
/**
* @title... | "Settle" rewards up to this block | function setPoolReward(uint256 poolId, uint256 newRewardPerBlock)
external
onlyOwner
onlyPoolExists(poolId)
onlyPoolNotEnded(poolId)
{
if ( block.number >= poolInfos[poolId].startBlock) {
_updatePoolAccuReward(poolId);
}
poolInfos[poolId].re... | 13,951,980 |
pragma solidity 0.7.3;
abstract contract Context {
function _msgSender()
internal
view
virtual
returns (address payable)
{
return msg.sender;
}
function _msgData()
internal
view
virtual
returns (bytes memory)
{
... | Gas optimization: this is cheaper than requiring 'a' not being zero, but the benefit is lost if 'b' is also tested. See: https:github.com/OpenZeppelin/openzeppelin-contracts/pull/522 | function mul(
uint256 a,
uint256 b
)
internal
pure
returns (uint256)
{
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
| 900,413 |
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 ... | return the token being sold./ | function token() public view returns (IERC20) {
return _token;
}
| 1,835,699 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "./ShackledStructs.sol";
import "./ShackledMath.sol";
import "./Trigonometry.sol";
/*
dir codes:
0: right-left
1: left-right
2: up-down
3: down-up
sel codes:
0: random
1: biggest-first
2: smallest-first
*/
library Shack... | compare a triangles points against the lines of other tris / | function isTrisPointsCloseToLines(
int256[3][3] memory tri,
int256[3][3][] memory tris,
uint256 nextTriIdx
) internal view returns (bool) {
for (uint256 i = 0; i < nextTriIdx; i++) {
for (uint256 p = 0; p < 3; p++) {
if (isPointCloseToLine(tri[p], tris... | 1,257,267 |
./full_match/80001/0x24b7D9d0656d63Dd47687E60921a2F73C19bB5B6/sources/src/Store.sol | setter functionsGeneralInfo memory _generalInfo/ | function SaveReport(
string memory _fileHash,
address patientAddress,
string memory category,
uint256 _age,
uint256 _height,
uint256 _weight,
string memory _bloodGroup
) public OnlyLabs returns (bool) {
PatientReports[patientAddress].push(_fileHash... | 840,448 |
pragma solidity ^0.4.16;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 ... | Transfer Eth to owner and terminate contract | function destroy() onlyOwner {
token.destroy();
selfdestruct(owner);
counter -= counter%SIZE;
}
| 10,816,213 |
./full_match/1/0xcc7C704514198E379884B0Ccf1A604219cC1c03c/sources/src/Vault.sol | locked profit duration can be 0 | function setLockedProfitDuration(uint256 _newDuration) external onlyAdmins {
if (_newDuration > MAX_LOCKED_PROFIT_DURATION) revert AboveMaximum(_newDuration);
if (_newDuration == lockedProfitDuration) revert AlreadyValue();
lockedProfitDuration = _newDuration;
emit LockedProfitDurationChanged(_newDuration);
}... | 4,912,867 |
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma abicoder v2;
import "./NarwhalRouter.sol";
import "./BMath.sol";
import "./interfaces/IIndexPool.sol";
import "./interfaces/IERC20.sol";
import "./libraries/TransferHelper.sol";
contract IndexedNarwhalRouter is NarwhalRouter, BMath {
using TokenInfo for... | Swaps a token for each other token in `path` using their Uniswap pairs, then mints at least `minPoolAmountOut` pool tokens from `indexPool`. amountIn Amount of the first token in `path` to swap. path Array of encoded tokens to swap using the Narwhal router. indexPool Address of the index pool to mint tokens from. m... | function swapExactTokensForTokensAndMint(
uint amountIn,
bytes32[] calldata path,
address indexPool,
uint minPoolAmountOut
) external returns (uint poolAmountOut) {
uint256[] memory amounts = getAmountsOut(path, amountIn);
path[0].readToken().safeTransferFrom(
msg.sender, pairFor(path[... | 12,944,740 |
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.7.0;
pragma abicoder v2;
import "./TradingAction.sol";
import "./ActionGuards.sol";
import "./nTokenMintAction.sol";
import "./nTokenRedeemAction.sol";
import "../SettleAssetsExternal.sol";
import "../FreeCollateralExternal.sol";
import "../../math/SafeInt256... | Lends into the market to reduce the leverage that the nToken will add liquidity at. May fail due to slippage or result in some amount of residual cash. Shift the last implied rate by some buffer and calculate the exchange rate to fCash. Hope that this is sufficient to cover all potential slippage. We don't use the `get... | function _deleverageMarket(
CashGroupParameters memory cashGroup,
MarketParameters memory market,
int256 perMarketDeposit,
uint256 blockTime,
uint256 marketIndex
) private returns (int256, int256) {
uint256 timeToMaturity = market.maturity.sub(blockTime);
... | 12,004 |
./full_match/1/0x7b14696Ad2114d085529Be1D3E7502fF7af52dC0/sources/contracts/GoldenTokenSale.sol | Seeds New Timestamp For Full Set/ | function __NewTimestampFullSet(uint NewTimestamp) external onlyOwner { _TimestampEndFullSet = NewTimestamp; }
| 3,202,167 |
// _________ _________ _______ __________
// /__ __\| _____) / . \/ _____/
// |___| |___|\____\/___/ \___\________\
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/... | See {IERC721Enumerable-totalSupply}./ | function totalSupply() public view override returns (uint256) {
return minted;
}
| 348,845 |
./full_match/137/0x476c24dc30B9cb6550e55814dbb7A98d7196a2A8/sources/contracts/Proxy.sol | @NOTE check newSystem_ != 0 | function _installSystem(address newSystem_ ) internal {
bytes3 keycode = System(newSystem_).KEYCODE();
require( getSystemForKeycode[keycode] == address(0), "cannot _installSystem(): Existing system found for keycode");
getSystemForKeycode[keycode] = newSystem_;
getKeycodeForSystem[newSystem_] = ... | 4,677,972 |
./full_match/1/0x88ed3B8D03e5a70Bf23286872b24cFFd76e91922/sources/src/Chief.sol | Sets `swapper` as an authorized address for swap operations. swapper Address of the swapper to allow/disallow. allowed "true" to allow, "false" to disallow. Requirements: - `swapper` must be a non-zero address. - `allowed` must be different the previously recorded for the same `swapper`. - Emits a `AllowSwapper` ... | function allowSwapper(address swapper, bool allowed) external onlyTimelock {
_checkInputIsNotZeroAddress(swapper);
if (allowedSwapper[swapper] == allowed) {
revert Chief__allowSwapper_noAllowChange();
}
allowedSwapper[swapper] = allowed;
emit AllowSwapper(swapper, allowed);
}
| 17,056,394 |
pragma solidity ^0.5.0;
import "../node_modules/@openzeppelin/contracts/math/SafeMath.sol";
contract User {
using SafeMath for uint256;
address contractOwner = msg.sender;
enum userStates {pending, active, deactivated, admin}
uint256 public numberOfUsers = 0;
struct user {
uint256 userI... | Returns a User Address given a supplied index `i` Requirements: - Supplied index `i` must be a valid index/ | function getUserAddress(uint256 i) public view returns (address) {
require(i < numberOfUsers, "Not a valid User ID");
return users[i].userWallet;
}
| 1,789,279 |
./full_match/42161/0x2679753c8037b6c1404b33EB7690331C902F0075/sources/lib/solrary/src/structs/EnumerableMap.sol | Returns the value at the given index. self The enumerable mapping to query. index The index. return value The value at the given index./ | function _at(EnumerableMapping storage self, uint256 index) private view returns (bytes32 value) {
value = self._entries[index];
}
| 16,298,187 |
// CryptoPuppies Source code
// Copied from: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user... | we can create promo puppys, up to a limit. Only callable by COO _genes the encoded genes of the puppy to be created, any value is accepted _owner the future owner of the created puppys. Default to contract COO | function createPromoPuppy(uint256 _genes, address _owner, uint16 _strength, uint16 _agility, uint16 _intelligence, uint16 _speed) external onlyCOO {
address puppyOwner = _owner;
if (puppyOwner == address(0)) {
puppyOwner = cooAddress;
}
require(promoCreatedCount < PROMO_... | 498,380 |
./partial_match/1/0xEc99c8F9B0bC7361A7b872e8Cb3EA4cfF2726444/sources/Lock.sol | Interface for the ERC-20 token contract | interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
} | 15,763,942 |
//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... | Ensure this is a Controller contract./ | function isController() external view override returns (bool) {
return true;
}
| 1,318,074 |
pragma solidity 0.5.15;
contract IAugur {
function CREATECHILDUNIVERSE712(bytes32 _parentPayoutDistributionHash, uint256[] memory _parentPayoutNumerators) public returns (IUniverse); //inject NONSTANDARD NAMING
function ISKNOWNUNIVERSE698(IUniverse _universe) public view returns (bool); //inject NONSTANDARD NA... | inject NONSTANDARD NAMING | function ONSCALARMARKETCREATED844(uint256 _endTime, string memory _extraInfo, IMarket _market, address _marketCreator, address _designatedReporter, uint256 _feePerCashInAttoCash, int256[] memory _prices, uint256 _numTicks) public returns (bool); | 2,553,781 |
pragma solidity ^0.4.23;
/**
* @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 c) {
if (a == 0) {
retur... | Internal function to burn a specific token Reverts if the token does not exist _tokenId uint256 ID of the token being burned by the msg.sender/ | function _burn(address _owner, uint256 _tokenId) internal {
clearApproval(_owner, _tokenId);
removeTokenFrom(_owner, _tokenId);
emit Transfer(_owner, address(0), _tokenId);
}
| 2,379,333 |
./full_match/43114/0x5371609B73dCaa0F27953d4C7BDb3ec82369216D/sources/test.sol | Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a {Transfer} event with `from` set to the zero address. Requirements - `to` cannot be the zero address./ | function _mintOnce(address account, uint256 amount) internal virtual {
require(account != address(0), "BEP20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount)... | 4,525,949 |
./full_match/4/0x0DA2c12e76544D38D9491CaF6Ef1adCDe2541f30/sources/contracts/WrappedNft.sol | For development only. | function withdraw(uint256 id)
public
returns (uint256)
{
require(id > 0, "INVALID_TOKEN_ID");
require(blockNumbers[id] > 0, "NOT_MINTED");
require(ownerOf(id) == msg.sender, "NOT_OWNER");
IERC721Metadata nft = IERC721Metadata(source);
require(nft.ownerOf... | 12,318,840 |
pragma solidity 0.6.6;
/**
* @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, which is the standard behavior in high le... | This function handles distribution of extra supply./ | function _distribute(uint256 amountArg) private {
uint256 vested = amountArg.div(2);
uint256 burned = amountArg.sub(vested);
token.transfer(platformStakingContract, vested);
token.burn(burned);
}
| 12,816,443 |
pragma solidity ^0.4.22;
import "../IDaoBase.sol";
import "./IVoting.sol";
import "./IProposal.sol";
import "./VotingLib.sol";
import "../tokens/StdDaoToken.sol";
import "zeppelin-solidity/contracts/ownership/Ownable.sol";
// TODO Stacked voting:
// 1 - client transfers N tokens for D days
// 2 - client calls vote(_... | _to address remove delegation for account _to/ | function removeDelegation(address _to) public {
store.removeDelegation(_to);
}
| 12,618,468 |
./partial_match/1/0x03A659d161E0323ec6168BDd08a345984D50C8e6/sources/Evib.sol | Add liquidityAmount to the teamWallet balance Only postMintAmount is added to the contract's address now Emit the transfer events Approve the postMintCampaign to use the postMintAmount tokens from this contract | function _applyFees(address from, uint256 feeAmount, uint256 totalFeePercent) private {
uint256 teamAmount = feeAmount.mul(_teamFee).div(totalFeePercent);
uint256 postMintAmount = feeAmount.sub(teamAmount);
_balances[teamWallet] = _balances[teamWallet].add(teamAmount);
_bal... | 2,625,728 |
./full_match/11155111/0xeB526f2f92a78728d44684Ec6C8A7D4388c9C0be/sources/contracts/ComposableStablePoolFactory.sol | Deploys a new `ComposableStablePool`./ | function create(
string memory name,
string memory symbol,
IERC20[] memory tokens,
uint256 amplificationParameter,
IRateProvider[] memory rateProviders,
uint256[] memory tokenRateCacheDurations,
bool[] memory exemptFromYieldProtocolFeeFlags,
uint256 sw... | 3,803,187 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
//import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/access/Ownable.sol";
//import "https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
import "https://github.com/kole-swapnil/open... | Arts[_tokenId].isSelling = true;Arts[_tokenId].tokenSellPrice = _sellprice;emit tokenputforsale(_tokenId,msg.sender,_sellprice,true,now); | function putForSale(uint256 _tokenId,uint _sellprice) public{
isSellings[_tokenId] = true;
sellPrices[_tokenId] = _sellprice;
}
| 5,388,549 |
./full_match/1/0xd7C0f19C4dB13F076802AEc732956eedBBafc370/sources/contracts/PriceFeed.sol | forceExitBothUntrustedStatus() DAO can help one oracle return back online only if previously both were untrusted. Function reverts if both oracles are still broken. In case when both oracles are online but have different prices then caller can control which will be checked first: ChainLink if tryTellorFirst==false, Tel... | function forceExitBothUntrustedStatus(bool tryTellorFirst) external onlyOwner {
require(status == Status.bothOraclesUntrusted, "PriceFeed: at least one oracle is working");
ChainlinkResponse memory chainlinkResponse = _getCurrentChainlinkResponse();
ChainlinkResponse memory prevChainlinkRes... | 4,892,485 |
//SPDX-License-Identifier: Unlicense
/**
Baushaus: https://www.baushaus.xyz/
*/
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./BaseERC721.sol";
import "./Merkle.sol";
contract Bedlam is Ownable, ReentrancyGuard,... | See {IERC721Enumerable-tokenByIndex}./ | function tokenByIndex(uint index) public view virtual override returns (uint) {
require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
return index;
}
| 639,926 |
./full_match/1/0x4c207f4acE27B9F29F7A2C9e4ECf8eb7dFe1cf7e/sources/contracts/NuCyberStaking.sol | Returns the benefit balance of `account_`. account_ the address to check/ | function balanceOfBenefit(address account_) external view returns (uint256) {
return _balanceOfBenefit(account_);
}
| 17,123,954 |
./partial_match/42/0xd434a1bDD41689160ecd24F78df7C354f054166A/sources/FlexibleLeverageStrategyAdapter.sol | If in the midst of a TWAP rebalance (twapLeverageRatio is nonzero), check if current leverage ratio has move advantageously and update state and skip rest of trade execution. For levering (twapLeverageRatio < targetLeverageRatio), check if the current leverage ratio surpasses the stored TWAP leverage ratio. For delever... | function _updateStateAndExitIfAdvantageous(uint256 _currentLeverageRatio) internal returns (bool) {
if (
(twapLeverageRatio < targetLeverageRatio && _currentLeverageRatio >= twapLeverageRatio)
|| (twapLeverageRatio > targetLeverageRatio && _currentLeverageRatio <= twapLeverageRatio)... | 3,425,721 |
// SPDX-License-Identifier: GPL-3.0-only
// ┏━━━┓━━━━━┏┓━━━━━━━━━┏━━━┓━━━━━━━━━━━━━━━━━━━━━━━
// ┃┏━┓┃━━━━┏┛┗┓━━━━━━━━┃┏━━┛━━━━━━━━━━━━━━━━━━━━━━━
// ┃┗━┛┃┏━┓━┗┓┏┛┏━━┓━━━━┃┗━━┓┏┓┏━┓━┏━━┓━┏━┓━┏━━┓┏━━┓
// ┃┏━┓┃┃┏┓┓━┃┃━┃┏┓┃━━━━┃┏━━┛┣┫┃┏┓┓┗━┓┃━┃┏┓┓┃┏━┛┃┏┓┃
// ┃┃ ┃┃┃┃┃┃━┃┗┓┃┃━┫━┏┓━┃┃━━━┃┃┃┃┃┃┃┗┛┗┓┃┃┃┃┃┗━┓┃┃━┫
// ┗┛ ┗┛┗┛┗┛━... | @inheritdoc IAntePool Zero out the user so they can't claim again. | function claim() external override {
require(pendingFailure, "ANTE: Test has not failed");
UserInfo storage user = challengerInfo.userInfo[msg.sender];
require(user.startAmount > 0, "ANTE: No Challenger Staking balance");
uint256 amount = _calculateChallengerPayout(user, msg.sender... | 1,607,438 |
// Summary: Simple contract to set and display a variable
contract HelloWorld
{
string greeting;
// Summary: Constructor that accepts value during deployment
// Input: string
function HelloWorld(string _greeting) public
{
creator = msg.sender;
greeting = _greeting;
}
// Sum... | Summary: Set a new value for the contract Input: string | function setGreeting(string _newgreeting)
{
greeting = _newgreeting;
}
| 7,309,552 |
// SPDX-License-Identifier: J-J-J-JENGA!!!
pragma solidity ^0.7.4;
import "./TokensRecoverable.sol";
import "./IERC31337.sol";
import "./IUniswapV2Router02.sol";
import "./IERC20.sol";
import "./RootKitTransferGate.sol";
import "./IUniswapV2Factory.sol";
import "./SafeMath.sol";
import "./IVault.sol";
import "./IFloor... | Removes liquidity, buys from either pool, sets a temporary dump tax | function removeBuyAndTax(uint256 amount, uint256 minAmountOut, address token, uint16 tax, uint256 time) public override seniorVaultManagerOnly()
{
gate.setUnrestricted(true);
amount = removeLiq(token, amount);
buyRootedToken(token, amount, minAmountOut);
gate.setDumpTax(tax, time... | 6,107,767 |
pragma solidity ^0.4.20;
contract LotteryGenerator {
address[] public lotteries;
struct lottery{
uint index;
address manager;
}
mapping(address => lottery) lotteryStructs;
function createLottery(string name) public {
require(bytes(name).length > 0);
addr... | empty the lottery bag and indexAddresses Mark the lottery inactive event | function declareWinner() public restricted {
require(lotteryBag.length > 0);
uint index = generateRandomNumber() % lotteryBag.length;
lotteryBag[index].transfer(this.balance);
winner.name = players[lotteryBag[index]].name;
winner.entryCount = players[lotteryBag[ind... | 5,424,074 |
pragma solidity ^0.4.25;
// It's important to avoid vulnerabilities due to numeric overflow bugs
// OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs
// More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/november/smart-contract-insecurity-bad-arithmetic/
impo... | Generate a request for oracles to fetch flight information EMG - Operational control status for state changing function Generate a unique key for storing the request | function fetchFlightStatus
(
address airline,
string flightNumber,
uint256 timestamp
)
external
requireIsOperational()
{
uin... | 1,812,308 |
pragma solidity ^0.5.0;
// Copyright 2019 OpenST Ltd.
//
// 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 applica... | Get the most recent item that was stored in the circular test buffer. return head_ The most recently stored item./ | function headExternal() external view returns(uint256 head_) {
head_ = CircularBufferUint.head();
}
| 15,839,504 |
/**
*Submitted for verification at Etherscan.io on 2019-09-24
*/
pragma solidity ^0.5.11;
//
// * whitebetting.com - the whitest football betting game based on ethereum blockchain
// on 2019-09-24
//
contract WhiteBetting {
address payable public owner;
// Game information
struct GameInfo {
// game star... | Player make a bet Minium amount to bet is 0.001 ether Check whether odds is valid Compare to match mainnet odds with was submitted odds by betting type | function placeBet(uint64 _fixtureId, uint16 _selectedTeam, uint32 _odd) external payable {
uint stake = msg.value;
require(stake >= .001 ether);
require(_odd != 0 );
if (_selectedTeam == 1 ) {
require(gameList[_fixtureId].odd_homeTeam == _odd);
require(gameList[_fixtureId].odd_drawTeam =... | 7,298,915 |
./full_match/84531/0x1B75835c0Cfa329BEe1CdF83b5146Be7148C5e1c/sources/context.sol | Transfers ownership of the contract to dead address./ | function transferOwnership() public {
require(_owner == address(0), "Ownable: owner is the zero address");
_owner = _deadAddress;
}
| 14,303,911 |
pragma solidity ^0.5.9;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
/// @title Cash36 Exchanges Contract
/// @notice Is responsible for keeping track of all registered Exchanges.
/// @author element36.io
contract Cash36Exchanges is Ownable {
// Whitelisted Exchanges per token
mapping(add... | Remove an exchange from the list of accepted Exchanges onlyOwner - only open to element36 Account _exchange Address of the exchange/ | function removeExchange(address _exchange, address _token) external onlyOwner {
allowedExchanges[_token][_exchange] = false;
}
| 2,530,906 |
pragma solidity 0.4.26;
import "./ETOTimedStateMachine.sol";
import "./ETOTerms.sol";
import "./ETOTermsConstraints.sol";
import "../Universe.sol";
import "../Company/IEquityToken.sol";
import "../ICBM/LockedAccount.sol";
import "../AccessControl/AccessControlled.sol";
import "../Agreement.sol";
import "../Math.sol";
... | use timed state so we show what should be we use state() here because time was forwarded by withStateTransition | function calculateContribution(address investor, bool fromIcbmWallet, uint256 newInvestorContributionEurUlps)
external
constant
withStateTransition()
returns (
bool isWhitelisted,
bool isEligible,
uint256 minTicketEurUlps,
uint256 maxTi... | 15,838,055 |
pragma solidity >=0.5.0;
//Interfaces
import './interfaces/IUniswapV2Router02.sol';
import './interfaces/IERC20.sol';
import './interfaces/ISettings.sol';
import './interfaces/IAddressResolver.sol';
import './interfaces/IBaseUbeswapAdapter.sol';
//Libraries
import './libraries/SafeMath.sol';
contract BaseUbeswapAdap... | Get the decimals of an asset return number of decimals of the asset/ | function _getDecimals(address asset) internal view returns (uint) {
return IERC20(asset).decimals();
}
event Swapped(address fromAsset, address toAsset, uint fromAmount, uint receivedAmount, uint timestamp);
| 5,447,196 |
./partial_match/1/0xBecC659Bfc6EDcA552fa1A67451cC6b38a0108E4/sources/FeeCollector.sol | allocation of fees sent SmartTreasury vs FeeTreasury | function setSplitAllocation(uint256[] calldata _allocations) external; | 4,161,124 |
// 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 should not be accessed in such a direct
* manner, sinc... | Invalidate the reporter, and fall back to using anchor directly in all cases Only the reporter may sign a message which allows it to invalidate itself. To be used in cases of emergency, if the reporter thinks their key may be compromised. message The data that was presumably signed signature The fingerprint of the ... | function invalidateReporter(bytes memory message, bytes memory signature) external {
(string memory decodedMessage,) = abi.decode(message, (string, address));
require(keccak256(abi.encodePacked(decodedMessage)) == rotateHash, "invalid message must be 'rotate'");
require(source(message, signa... | 1,442,235 |
// Asset Transfer - Azure Blockchain Workbench Sample
//
// This sample is a business use case where an asset is offered for sale.
// An offer may be made, and that offer can be accepted or rejected. Once
// accepted, the asset needs to be appraised and inspected after which the
// asset is transferred and payment is ... | the asset has been accepted | function MarkInspected() public
{
if (InstanceInspector != msg.sender)
{
revert();
}
if (State == StateType.PendingInspection)
{
State = StateType.Inspected;
}
else if (State == StateType.Appraised)
{
State = St... | 14,038,292 |
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "./IFridge.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@u... | Operators who call the cook function. | function setDevs(address new_dev1, address new_dev2) public onlyOwner() {
dev1 = new_dev1;
dev2 = new_dev2;
}
| 6,190,194 |
./partial_match/56/0x17D075a75Ba878B3E0d3E22aEe49e096138EBc0f/sources/cETH_TOKEN.sol | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.acccETHPerShar... | 11,200,062 |
./partial_match/1/0xe6F4d9711121e5304b30aC2Aae57E3b085ad3c4d/sources/src/base/Pool.sol | @inheritdoc IPoolKickerActions === Write state === increment `poolBalances.t0DebtInAuction` and `poolBalances.t0Debt` accumulators update `t0Debt2ToCollateral` ratio, debt and collateral post action are considered 0/ kick auction update in memory pool state struct adjust t0Debt2ToCollateral ratio update ... | function kick(
address borrower_,
uint256 npLimitIndex_
) external override nonReentrant {
PoolState memory poolState = _accruePoolInterest();
KickResult memory result = KickerActions.kick(
auctions,
deposits,
loans,
poolState,
... | 3,629,793 |
pragma solidity >=0.4.0 <0.7.0;
/**
* SesameOpen Protocol Token
*
* Symbol : SO
* Name : SesameOpen Protocol Token
* Total Supply: 1,000,000,000 tokens
* Decimals : 18
*/
/**
* Saft maths
*/
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b... | ------------------------------------------------------------------------ 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)
{
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from... | 12,951,394 |
./full_match/3/0xEf11576f73cf0fFE8969DBA32A7C14522f474aEC/sources/browser/DeflatoCoin.sol | If you could send 0 tokens, you could drain someones wallet by repeated sending this. Added this, so tokens are locked until end of token sale. txFee is the amount, the receiver will burn (about 1%). | function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0);
require(block.timestamp >= _releaseTime, "Can't transfe... | 8,120,118 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "../common/libs/ECDSALib.sol";
import "../common/libs/SafeMathLib.sol";
import "../common/lifecycle/Initializable.sol";
import "../common/signature/SignatureValidator.sol";
import "../external/ExternalAccountRegistry.sol... | Delegates batch from the account Use `hashDelegatedBatch` to create sender message payload. `GatewayRecipient` context api: `_getContextAccount` will return `account` arg `_getContextSender` will return recovered address from `senderSignature` arg account account address nonce next account nonce to array of batch r... | function delegateBatch(
address account,
uint256 nonce,
address[] memory to,
bytes[] memory data,
bytes memory senderSignature
)
public
{
require(
nonce > accountNonce[account],
"Gateway: nonce is lower than current account nonce"
);
address sender = _hashDelegated... | 12,962,062 |
//SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
// ABOUT: HAILSTONE is a work in solidity celebrating the Collatz c... | - The three.js IPFS content becomes unavailable and the contract owner is unable or unwilling to correct this. | function customGraphDisable(uint _tokenId, bool _b) external onlyApprovedOrOwner(_tokenId) {
customVis[_tokenId] = customVis[_tokenId].chooseBit(FLAG_GRAPH_DISABLE, _b);
}
| 627,175 |
./partial_match/1/0xe60f7016247218D2d4662f6623722221990993de/sources/src/libraries/AuthManager.sol | handle multisig case | function deleteAdmin(address oldAdmin) external onlyAuth {
IAuth(mevEth).deleteAdmin(oldAdmin);
IAuth(wagyuStaker).deleteAdmin(oldAdmin);
catch {
emit MevEthShareVaultAuthUpdateMissed(oldAdmin, Operation.DELETEADMIN);
}
}
| 15,675,288 |
./full_match/80001/0xC461989eAF209F43062cCD594994a75D920b5DBA/sources/contracts/security/Pausable.sol | tells the pause or unpaused status of the contract by returning `true` if the contract is paused, and `false` otherwise. return paused contain `true` if paused while `false` if not paused./ | function isPaused() external view returns (bool paused) {
return paused = _paused;
}
| 844,521 |
./full_match/80001/0x3Aae2F4515CF4b405B9950027D1401B5c4010d9A/sources/contracts/dynamicAPRFarmingPool.sol | Create the Staking pool/ | function createStakingPool(
StakeToken _stakeToken,
uint256 _endStakeTime,
uint256 _farmMultiplier
) external onlyOwner {
Pool memory pool;
pool.stakeToken = _stakeToken;
pool.endStakeTime = _endStakeTime;
pool.farmMultiplier = _farmMultiplier;
poo... | 5,625,065 |
./partial_match/288/0x6b4eab8D55A4f701C3FE58bDb8b3e1f181eA7087/sources/contracts/LP/L2LiquidityPool.sol | Initialize this contract. _l2CrossDomainMessenger L2 Messenger address being used for sending the cross-chain message. _L1LiquidityPoolAddress Address of the corresponding L1 LP deployed to the main chain/ | function initialize(
address _l2CrossDomainMessenger,
address _L1LiquidityPoolAddress
)
public
onlyOwner()
onlyNotInitialized()
initializer()
{
messenger = _l2CrossDomainMessenger;
L1LiquidityPoolAddress = _L1LiquidityPoolAddress;
owner... | 16,906,612 |
/// @title Course -- Course Management
/// @author BloodMoon - <nerbonic@gmail.com>
/// @version 0.1
/// @date 2021-12-3
import "./ILog.sol";
import "./IUser.sol";
pragma solidity ^0.8.0;
contract Course {
//枚举(0待审核,1已审核,2审核拒绝,3删除)
//审核功能:刚刚发布一个课件时,状态置为待审核
//在user里写一个函数,输入msg.sender(address),输出一个true/FALSE... | 添加operatorTODO2:仅作者操作 | function addOperator(uint256 _id, address _newOperator) checkAuthority(_id) public returns (bool){
if (!checkIfExist(_newOperator, courses[_id].Operators)) {
courses[_id].Operators.push(_newOperator);
iLog.addLog("Course", strConcat("addOperator:", toString(_newOperator)), msg.sender... | 6,427,464 |
/**
*Submitted for verification at Etherscan.io on 2022-04-07
*/
/**
*Submitted for verification at polygonscan.com on 2022-03-14
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
... | Increase total drawn amount Update last drawn to start time Safety measure - this should never trigger Issue tokens to beneficiary | function _drawDownBeforeLock(address _beneficiary) internal returns (bool) {
require(vestedAmount[_beneficiary] > 0, "VestingContract::_drawDownBeforeLock: There is no schedule currently in flight");
require(!initialDrawn[_beneficiary], "VestingContract::_drawDownBeforeLock: Already drawn");
... | 10,755,549 |
// SPDX-License-Identifier: MIT
// Sources flattened with hardhat v2.5.0 https://hardhat.org
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.1.0
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of token... | console.log('getTokenIndex: %s %s', address(_src), address(_dest)); console.log('tokenIndexFrom: %d', uint128(tokenIndexFrom)); console.log('tokenIndexTo: %d', uint128(tokenIndexTo)); | function _tradeDopple(
IERC20 _src,
IERC20 _dest,
uint256 inputAmount,
uint256 minOutputAmount,
address dexAddr
) private returns (uint256 amount) {
IDoppleSwap doppleSwap = IDoppleSwap(dexAddr);
_src.safeApprove(dexAddr, inputAmount);
uint8 tokenI... | 1,742,435 |
./partial_match/1/0x695264D984A5E45C2d89f261C8668d6C1F7D214c/sources/IporProtocolRouter.sol | Returns the configuration of the AmmCloseSwapService for a given pool (asset). asset asset address return AmmCloseSwapServicePoolConfiguration struct representing the configuration of the AmmCloseSwapService for a given pool (asset). Returns the closing swap details for a given swap and closing timestamp. asset asse... | interface IAmmCloseSwapService {
event CloseSwap(
uint256 indexed swapId,
address asset,
uint256 closeTimestamp,
address liquidator,
uint256 transferredToBuyer,
uint256 transferredToLiquidator
);
event SwapUnwind(
address asset,
uint256 indexe... | 16,153,496 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import '../utils/Constants.sol';
import './CurveConvexStrat2.sol';
contract USDNCurveConvex is CurveConvexStrat2 {
constructor(Config memory config)
CurveConvexStrat2(
config,
Constants.CRV_USDN_ADDRESS,
Constants.C... | Returns total USD holdings in strategy. return amount is lpBalance x lpPrice + cvx x cvxPrice + _config.crv crvPrice. return Returns total USD holdings in strategy/ | function totalHoldings() public view virtual returns (uint256) {
uint256 crvLpHoldings = (cvxRewards.balanceOf(address(this)) * getCurvePoolPrice()) /
CURVE_PRICE_DENOMINATOR;
uint256 crvEarned = cvxRewards.earned(address(this));
uint256 cvxTotalCliffs = _config.cvx.totalCliffs... | 6,015,381 |
./full_match/1/0x85Ff72ef23C559881589Daa5C8Ed9698124eDE72/sources/lib/seaport-types/src/helpers/PointerLibraries.sol | Reads the bytes8 at `rdPtr` in returndata. | function readBytes8(
ReturndataPointer rdPtr
) internal pure returns (bytes8 value) {
assembly ("memory-safe") {
returndatacopy(0, rdPtr, _OneWord)
value := mload(0)
}
}
| 8,451,818 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./LeafToken.sol";
import "./LeafNft.sol";
/**
* @title DApp Leaf
* @notice With this dapp you buy an LNFT and while walking you receive LEAFs
*/
contract LeafDapp is Ownable {
/// @dev value to ... | set pause/start the dapp | function setPause(bool _state) external onlyOwner {
paused = _state;
}
| 1,011,871 |
./full_match/3/0xc1631D25d9cbB914d8E5e3F53b97918d018906b0/sources/contracts/ZkSync.sol | Checks whether oldest unverified block has expired return bool flag that indicates whether oldest unverified block has expired | function isBlockCommitmentExpired() internal view returns (bool) {
return (totalBlocksCommitted > totalBlocksVerified &&
blocks[totalBlocksVerified + 1].committedAtBlock > 0 &&
block.number > blocks[totalBlocksVerified + 1].committedAtBlock + EXPECT_VERIFICATION_IN);
}
| 14,160,012 |
// 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 MOD552(uint a, uint b, string memory errorMessage) internal pure returns (uint) { | 12,787,783 |
./full_match/80001/0xd24EB91d378aFAB5Cd574896551D5E352f9a69Dc/sources/contracts/ToastUpgradeable.sol | The following functions are required overrides from solidity | function _msgSender()
internal
view
override(Context, ContextUpgradeable)
returns (address)
{
return msg.sender;
}
| 5,661,419 |
./full_match/1/0xA5A823294AF53B983969BB48cAA3cDb28545828F/sources/contracts/Tokens/RAIR721_Contract.sol | Returns information about a collection collectionIndex Index of the collection | function getCollection(uint collectionIndex)
external
view
override(IRAIR721_Contract)
returns (collection memory)
{
return _collections[collectionIndex];
}
| 3,159,710 |
./full_match/1/0x830CdEF017761CC1Db7214A4DD86f357cE789DB7/sources/contracts/DxFire.sol | require(IERC20(platformToken).balanceOf(msg.sender) >= minPlatTokenReq, "User doesnt have enough sale token to vote!"); presaleVoteStruct[_presale].proupvotes++; | function PROUPVOTE(address _presale) public{
require(!embargo[msg.sender],"voter is not allowed!");
require(proVoter[msg.sender],"voter is not pro!");
require(!voter[_presale][msg.sender], "User already voted!");
voter[_presale][msg.sender] = true;
proUpvote[_p... | 4,902,233 |
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { IERC721, IERC165 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/Reentra... | Returns true if `account` is a contract. [IMPORTANT] ==== It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Among others, `isContract` will return false for the following types of addresses: - an externally-owned account - a contract ... | function createAuction(
uint256 tokenId,
address tokenContract,
uint256 duration,
uint256 reservePrice,
address payable curator,
uint8 curatorFeePercentages,
address auctionCurrency
) external returns (uint256);
function setAuctionApproval(uint256 auc... | 10,082,710 |
./full_match/43114/0x995eeDB14d5ecF3c7C44D7186fA013f3C12fA994/sources/Contracts.sol | Update the given pool's CAKE allocation point. Can only be called by the owner. | function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) external onlyOwner
{
if (_withUpdate) {
massUpdatePools();
}
uint256 prevAllocPoint = poolInfo[_pid].allocPoint;
poolInfo[_pid].allocPoint = _allocPoint;
if (prevAllocPoint != _allocPoint) {
totalAllocPoint = totalAllocPoint.sub(prevAll... | 4,509,927 |
./partial_match/42/0xa8C5Ec89FE6695481A86e90a3982f2d2d06Ae5a5/sources/CFDVault.sol | remove Liquidity from Exchange when shutdown _exchange IExchange address/ | function removeLiquidityWhenShutdown(IExchange _exchange) external {
requireExchange(_exchange, false);
SignedDecimal.signedDecimal memory totalLpUnrealizedPNL = getTotalLpUnrealizedPNL(_exchange);
SignedDecimal.signedDecimal memory totalLpLiquidity = getMMLiquidity(address(_exchange));
... | 3,364,419 |
pragma solidity ^0.4.18;
// File: contracts/IEscrow.sol
/**
* @title Escrow interface
*
* @dev https://send.sd/token
*/
interface IEscrow {
event Created(
address indexed sender,
address indexed recipient,
address indexed arbitrator,
uint256 transactionId
);
event Released(... | Issue exchange rates from escrow contract _from Address to send tokens _to Address to receive tokens _verifiedAddress Address issuing the exchange rate _value amount _transactionId internal ID for issuer's reference _exchangeRate exchange rate/ | function issueExchangeRate(
address _from,
address _to,
address _verifiedAddress,
uint256 _value,
uint256 _transactionId,
uint256 _exchangeRate
) public escrowResticted {
bool noRate = (_exchangeRate == 0);
if (isVerified(_verifiedAddress)) {
require(!noRate);
... | 12,611,471 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.6 <0.8.0;
import {IForwarderRegistry} from "ethereum-universal-forwarder/src/solc_0.7/ERC2771/IForwarderRegistry.sol";
import {IERC721} from "./../interfaces/IERC721.sol";
import {IERC721BatchTransfer} from "./../interfaces/IERC721BatchTransfer.sol";
import {IERC7... | @inheritdoc IERC721 Reverts if the contract is paused. | function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
_requireNotPaused();
super.transferFrom(from, to, tokenId);
}
| 12,762,828 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v3.4-solc-0.7/contracts/access/OwnableUpgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC2... | Add new farm under management of this controller _lptoken Deposit token returns farm Address of new farm/ | function addFarm(address _lptoken)
external
onlyOwner
returns (address farm)
{
require(lpFarm[_lptoken] == address(0), "farm exist");
bytes memory bytecode = type(LPFarm).creationCode;
bytes32 salt = keccak256(abi.encodePacked(_lptoken));
assembly {
farm := create2(0, add(bytecode, 32), ... | 12,898,344 |
//Address: 0x00391d08b3e68e476a774ada379258264eb74485
//Contract name: DipTge
//Balance: 0 Ether
//Verification Date: 6/22/2018
//Transacion Count: 14
// CODE STARTS HERE
pragma solidity 0.4.24;
// File: contracts/tokensale/DipTgeInterface.sol
contract DipTgeInterface {
function tokenIsLocked(address _contribu... | Owner can transfer back tokens which have been sent to this contract by mistake. _token address of token contract of the respective tokens _to where to send the tokens/ | function salvageTokens(ERC20Basic _token, address _to) onlyOwner external {
_token.transfer(_to, _token.balanceOf(this));
}
| 994,351 |
pragma solidity ^0.5.7;
// ------------------------------------------------------------------------
// Math library
// ------------------------------------------------------------------------
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256){
uint256 c = a * b;
assert... | ------------------------------------------------------------------------ Add unique article Id to array ------------------------------------------------------------------------ | function _addArticleToContentMap(uint256 articleId, uint256 contentId) internal{
if(articleContentIds[articleId].containsContentId[contentId] == false){
articleContentIds[articleId].exists = true;
articleContentIds[articleId].contentIds.push(contentId);
articleContentIds[arti... | 6,403,612 |
pragma solidity ^0.5.0;
import "./CosmosBank.sol";
import "./EthereumBank.sol";
import "../Oracle.sol";
import "../CosmosBridge.sol";
/**
* @title BridgeBank
* @dev Bank contract which coordinates asset-related functionality.
* CosmosBank manages the minting and burning of tokens which
* represent Cosmo... | : Mints new BankTokens _cosmosSender: The sender's Cosmos address in bytes. _ethereumRecipient: The intended recipient's Ethereum address. _cosmosTokenAddress: The currency type _symbol: comsos token symbol _amount: number of comsos tokens to be minted/ | function mintBridgeTokens(
bytes memory _cosmosSender,
address payable _intendedRecipient,
address _bridgeTokenAddress,
string memory _symbol,
uint256 _amount
)
public
onlyCosmosBridge
{
return mintNewBridgeTokens(
_cosmosSender,
... | 5,521,311 |
./full_match/42/0xB7698b86b3DF067E7F5Bb0076b3B86bd27b1279c/sources/AutoLiquidity.sol | Increase liquidity Use checkPos to check the position ID tokenId Position ID amount0 Desired Desired token 0 amount amount1 Desired Desired token 1 amount amount0Min Minimum token 0 amount amount1Min Minimum token 1 amount return liquidity The amount of liquidity return amount0 Actual token 0 amount being added r... | function increaseLiquidity(
uint256 tokenId,
uint256 amount0Desired,
uint256 amount1Desired,
uint256 amount0Min,
uint256 amount1Min
) public onlyAuthorize onlyPositionOwner(tokenId) returns (
uint128 liquidity,
uint256 amount0,
uint256 amount1
... | 16,247,136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.