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 2020-12-21
*/
pragma solidity =0.7.6;
// ----------------------------------------------------------------------------
// NBU token main contract (2020)
//
// Symbol : NBU
// Name : Nimbus
// Total supply : 1.000.000.000 (burnable)
// Decimals : 18
... | First check most recent balance Next check implicit zero balance | function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "NBU::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkp... | 6,690,155 |
./partial_match/1/0x52Acbed747CEd4062640892e822483A42f32E6D2/sources/src/SfrxEthFraxOracle.sol | The ```description``` function returns the description of the contract return _description The description of the contract | function description() external pure override returns (string memory _description) {
_description = "sfrxEth/ETH";
}
| 2,727,332 |
./full_match/28/0xD0Ce0c33E9AD6f1Db1B9b73f39Bf7A4dfA7c47C2/sources/contracts/comptroller/Comptroller.sol | hypothetical account shortfall below collateral requirements)/ For each asset the account is in Read the balances and exchange rate from the mToken semi-opaque error code, we assume NO_ERROR == 0 is invariant between upgrades Calculate effects of interacting with mTokenModify redeem effect sumBorrowPlusEffects += token... | function getHypotheticalAccountLiquidityInternal(
address account,
MToken mTokenModify,
uint256 redeemTokens,
uint256 borrowAmount
)
internal
view
returns (
Error,
uint256,
uint256
)
{
uint256 oErr;
... | 16,365,437 |
./full_match/4/0x6DF8EE677656b9f6da6079A5f0281Bb1C961862e/sources/_openzeppelin/contracts-upgradeable_4.4.0/governance/extensions/GovernorTimelockControlUpgradeable.sol | Emitted when the timelock controller used for proposal execution is modified./ Set the timelock./ | function __GovernorTimelockControl_init(TimelockControllerUpgradeable timelockAddress) internal initializer {
__Context_init_unchained();
__ERC165_init_unchained();
__IGovernor_init_unchained();
__IGovernorTimelock_init_unchained();
__GovernorTimelockControl_init_unchained(ti... | 729,322 |
./full_match/1/0x40Cb7aD80df6a60412c7064Af98b5BB4448fBAAd/sources/contracts/Voyagerz.sol | 32 bytes of seed Uncapped | function getRenderParams(uint256 tokenId) internal view returns (RenderParams memory) {
RenderParams memory rp;
uint256 seed = image_seed[tokenId];
rp.voyage_distance = voyage_count[tokenId] * 4 + 50 + n_sum_first[tokenId];
seed = seed >> 8;
seed = seed >> 8;
... | 16,609,309 |
./full_match/5/0xB3fF7D09c4871cfCfea4e1520e6565092B213AaB/sources/contracts/claim/abstract/ContinuousVesting.sol | Adjustable admin functions | function setVestingConfig(
uint256 _start,
uint256 _cliff,
uint256 _end
) external onlyOwner {
start = _start;
cliff = _cliff;
end = _end;
emit SetContinuousVesting(start, cliff, end);
}
| 1,862,446 |
//Address: 0x861825daa0068136a55f6effb3f4a0b9aa17f51f
//Contract name: Token
//Balance: 0 Ether
//Verification Date: 1/17/2018
//Transacion Count: 167
// CODE STARTS HERE
// Copyright (c) 2017, 2018 EtherJack.io. All rights reserved.
// This code is disclosed only to be used for inspection and audit purposes.
// ... | In case the ICO is emergency-terminated by House, allows investors to pull back the investments | function claimRefund() public {
require(stage == Stages.Aborted);
require(investmentOf[msg.sender] > 0);
uint256 payment = investmentOf[msg.sender];
investmentOf[msg.sender] = 0;
msg.sender.transfer(payment);
}
| 15,810,135 |
./full_match/5/0x191ceFa4a57F833988842636edcc34c68ea14ab3/sources/contracts/PepeSystems.sol | Gift a give number of pepes into a specific wallet wallet - wallet address to mint to pepes - total number of pepes to gift | function giftTeamReserve(address wallet, uint32 pepes) external onlyOwner {
if (_totalMinted() + pepes > maxSupply) revert MaxSupplyReached();
teamMinted -= pepes;
_mint(wallet, pepes);
}
| 1,857,754 |
./full_match/1/0x361384A0d755f972E5Eea26e4F4efBAf976B6461/sources/contracts/external/aave/incentives/base/BaseIncentivesController.sol | @inheritdoc IAaveIncentivesController | function setClaimer(address user, address caller) external override onlyEmissionManager {
_authorizedClaimers[user] = caller;
emit ClaimerSet(user, caller);
}
| 4,835,741 |
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.4;
import "../interfaces/IERC20.sol";
import "../utils/Context.sol";
import "../interfaces/IWhitelist.sol";
contract PrivateSale is Context {
/**
* Investment Structure.
*/
struct Investment {
uint256 _usdt;
uint256 _usdc;
... | returns the amount of usdt invested by `_user`/ | function investment(address _user) public view virtual returns (uint256, uint256, uint256) {
Investment storage i = _investment[_user];
return(i._usdc, i._usdt, i._busd);
}
| 1,129,330 |
./full_match/1/0x817987c96b71875c7F61e36E45F950dE9b6FAbb7/sources/contracts/token/WeAreAllGonnaBeOkay.sol | at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch. | function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if (amount == 0) {
super._transf... | 8,316,632 |
./partial_match/1/0xAD0C361Ef902A7D9851Ca7DcC85535DA2d3C6Fc7/sources/node_modules/_arbitrum/token-bridge-contracts/contracts/tokenbridge/ethereum/ICustomToken.sol | Minimum expected interface for L1 custom token (see TestCustomTokenL1.sol for an example implementation)/ | interface ICustomToken is ArbitrumEnabledToken {
function registerTokenOnL2(
address l2CustomTokenAddress,
uint256 maxSubmissionCostForCustomBridge,
uint256 maxSubmissionCostForRouter,
uint256 maxGasForCustomBridge,
uint256 maxGasForRouter,
uint256 gasPriceBid,
... | 4,392,444 |
./partial_match/8453/0xCFAAf695585f29723978a089c5Cf9462DD030Cc9/sources/DopDopYesYes.sol | Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have ... | function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecke... | 16,755,145 |
/**
* LiquidCraft Token
*
* author: Solulab Inc. - Parth Kaloliya
*
* This is a rewrite of Safemoon contract in the hope to:
*
* - make it easier to change the tokenomics
* - make it easier to maintain the code and develop it further
* - remove redundant code
* - fix some of the issues reported in the Safemoo... | Calculates and returns the amount of tokens corresponding to the given reflected amount./ | function tokenFromReflection(uint256 rAmount)
internal
view
returns (uint256)
{
require(
rAmount <= _reflectedSupply,
'Amount must be less than total reflections'
);
uint256 currentRate = _getCurrentRate();
return rAmount.div(currentRate);
}
| 14,755,745 |
pragma solidity ^0.5.0;
import "./SafeMathM.sol";
import "./ZapStorage.sol";
import "./Utilities.sol";
/**
* @title Zap Getters Library
* @dev This is the getter library for all variables in the Zap Tokens system. ZapGetters references this
* libary for the getters logic
*/
library ZapGettersLibrary{
... | Getter for the total_supply of oracle tokens return uint total supply/ | function totalSupply(ZapStorage.ZapStorageStruct storage self) internal view returns (uint) {
return self.uintVars[keccak256("total_supply")];
}
| 12,546,524 |
./full_match/42/0xBbE177b473f51a5cBa880a75d1ADef8dCA340756/sources/Neuro.sol | Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./ | function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| 16,212,767 |
./full_match/1/0x0c6856AdA9E285555630c60C8E759203a61259c4/sources/contracts/BinaryOptionMarket.sol | Instantiate the options themselves abi.encodePacked("sLONG: ", _oracleKey) consider naming the option: sLongBTC>50@2021.12.31 Note: the ERC20 base contract does not have a constructor, so we do not have to worry about initializing its state separately | function initialize(
address _owner,
address _binaryOptionMastercopy,
IAddressResolver _resolver,
address _creator,
bytes32 _oracleKey,
uint _strikePrice,
) external {
require(!initialized, "Binary Option Market already initialized");
initialized =... | 16,594,705 |
/**
*Submitted for verification at Etherscan.io on 2020-06-08
*/
pragma solidity 0.6.2;
pragma experimental ABIEncoderV2;
/*
* @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, t... | _id Unique identifier for the record _timestamp A timestamp We have integrated with the relay contract; so only relay can call it. Fetch Index Fetch the DataShard for this day. (It may reset it under the hood) Update record! | function setRecord(bytes32 _id, uint _timestamp) internal {
address dataShardAddr = getLatestDataShard();
DataShard rc = DataShard(dataShardAddr);
rc.setRecord(_id, _timestamp);
}
| 12,959,560 |
./full_match/5/0xb26aC84E6979fC75C0D7c885dF7c68B6ED896023/sources/contracts/MyContract.sol | Add a function to set the power level This function is only callable by the admin members | function setPowerLevel(uint256 tokenId, uint256 _powerLevel) public onlyRole(DEFAULT_ADMIN_ROLE) {
powerLevel[tokenId] = _powerLevel;
}
| 1,952,087 |
pragma solidity 0.5.17;
import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol";
import {TBTCDepositToken} from "./TBTCDepositToken.sol";
import {FeeRebateToken} from "./FeeRebateToken.sol";
import {TBTCToken} from "./TBTCToken.sol";
import {TBTCConstants} from "./TBTCConstants.sol";
import "../dep... | Starts signer liquidation by seizing signer bonds. If the deposit is currently being redeemed, the redeemer receives the full bond value; otherwise, a falling price auction begins to buy 1 TBTC in exchange for a portion of the seized bonds; see pur... | function startLiquidation(DepositUtils.Deposit storage _d, bool _wasFraud) internal {
_d.logStartedLiquidation(_wasFraud);
uint256 seized = _d.seizeSignerBonds();
address redeemerAddress = _d.redeemerAddress;
_d.redemptionTeardown();
if (_d.inRedemption() && _wasFraud) {
... | 7,283,182 |
import "../zeppelin/contracts/token/BasicToken.sol";
/**
* @title CrossChain Token
* @dev Token that can be decreased on this chain to be incremented on another chain
* @dev The CrossChain Transfer event will be used as input for the other chain
*/
contract CrossChainToken is BasicToken {
event CrossChainTran... | Burns a specific amount of tokens. _value The amount of token to be burned./ | function crossChainTransfer(uint256 _value) public {
_crossChainTransfer(msg.sender, _value);
}
| 2,557,058 |
./full_match/4/0x3c216791b70D35E3e5DaC7fE610bC700c7fBF49D/sources/contracts/hero/Hero.sol | See {IERC721Enumerable-totalSupply}./ | function totalSupply() public view override returns (uint256) {
unchecked {
return _tokenIdCounter - _burnCounter - 1;
}
}
| 666,014 |
/* solium-disable function-order */
pragma solidity 0.5.17;
import {IBondedECDSAKeepFactory} from "@keep-network/keep-ecdsa/contracts/api/IBondedECDSAKeepFactory.sol";
import {VendingMachine} from "./VendingMachine.sol";
import {DepositFactory} from "../proxy/DepositFactory.sol";
import {IRelay} from "@summa-tx/rela... | This is if a sat is worth 0 wei, or is worth >1 ether. Revert at once. | function _fetchBitcoinPrice() internal view returns (uint256) {
uint256 price = priceFeed.getPrice();
if (price == 0 || price > 10 ** 18) {
revert("System returned a bad price");
}
return price;
}
| 1,057,865 |
./full_match/1/0x000000000055217587F821917562867172942189/sources/src/AutoSniper.sol | deposit Ether into the contract. sniper is the address who's balance is affected./ | function deposit(address sniper) public payable {
if (tx.origin == fulfillerAddress) revert FulfillerCannotHaveBalance();
emit Deposit(sniper, msg.value);
}
| 16,488,583 |
pragma solidity 0.5.7;
import './MixinDisableAndDestroy.sol';
import './MixinApproval.sol';
import './MixinKeys.sol';
import './MixinLockCore.sol';
import 'openzeppelin-solidity/contracts/utils/Address.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol';
import 'openzeppelin-solidity/contra... | 0x150b7a02 == bytes4(keccak256('onERC721Received(address,address,uint256,bytes)')) The fee relative to keyPrice to charge when transfering a Key to another account (potentially on a 0x marketplace). This is calculated as `keyPrice transferFeeNumerator / transferFeeDenominator`. TODO: this value is currently ignored an... | {
using SafeMath for uint;
using Address for address;
event TransferFeeChanged(
uint oldTransferFeeNumerator,
uint oldTransferFeeDenominator,
uint transferFeeNumerator,
uint transferFeeDenominator
);
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
uint public transferFeeNumerator =... | 1,794,477 |
./partial_match/1/0xf1264873436A0771E440E2b28072FAfcC5EEBd01/sources/contracts/Kenshi.sol | Sends `amount` of ERC20 `token` from contract address to `recipient` Useful if someone sent ERC20 tokens to the contract address by mistake. token The address of the ERC20 token contract. recipient The address to which the tokens should be transferred. amount The amount of tokens to transfer./ | function recoverERC20(
address token,
address recipient,
uint256 amount
) external onlyOwner {
IERC20(token).safeTransfer(recipient, amount);
}
| 4,149,514 |
pragma solidity ^0.4.24;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
... | Owner can mark a customer's Tx of payment for MCW as spent Generates an additional Tx of paymant for KWh (hash as proof of spend), which connected to the original Tx. Related event will be generated _customer the address of a customer to whom to spend a Tx _txPaymentForMCW the Tx of payment for MCW which will be ma... | function setCustomerTxAsSpent(address _customer, bytes32 _txPaymentForMCW) public onlyOwner returns(bool) {
require(isValidCustomer(_customer));
TxRegistry txRegistry = TxRegistry(registry[_customer]);
require(txRegistry.getTxTimestampPaymentMCW(_txPaymentForMCW) != 0);
require(txRe... | 10,313,137 |
/**
*Submitted for verification at Etherscan.io on 2021-11-16
*/
// Sources flattened with hardhat v2.6.2 https://hardhat.org
// File @openzeppelin/contracts/access/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 ... | Revert with a standard message if `account` is missing `role`. The format of the revert reason is given by the following regular expression: /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$// | function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
'AccessControl: account ',
Strings.toHexString(uint160(account), 20),
... | 15,272,096 |
pragma solidity ^0.4.25;
/**
* WHAT IS OpenEthereumToken?
* OpenEthereumToken for general ethereum NFT token use; NFT Block Chain Token, URL link, Ethereum Interface,
* Data Rewrite possible, On Chain Data Storage, Transfer of Token
*
* Pay to Recieve token Indivi... | Gets the token symbol return string representing the token symbol/ | function symbol() external view returns (string) {
return symbol_;
}
| 6,822,156 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
import "./IUniswapPCVDeposit.sol";
import "../../Constants.sol";
import "../PCVDeposit.sol";
import "../../refs/UniRef.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol";
import "@uniswap/lib/contracts/libraries/Babylonian.sol";
impo... | No restrictions on withdrawal price | function _removeLiquidity(uint256 liquidity) internal virtual returns (uint256) {
uint256 endOfTime = type(uint256).max;
(, uint256 amountWithdrawn) =
router.removeLiquidity(
address(fei()),
token,
liquidity,
0,
... | 10,229,789 |
/**
*Submitted for verification at Etherscan.io on 2021-12-31
*/
/**
// t.me/ShiBobby
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
abstract contract Context {
functi... | exclude from paying fees or having max transaction amount | constructor() ERC20("ShiBobby", "$SHIBOBBY") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pai... | 2,458,607 |
./full_match/288/0x9284863F131f0145C8F22905C62504E9fD06AB2E/sources/contracts/Ola/Peripheral/ComptrollerPeripherals/RainMaker/SingleAssetDynamicRainMaker.sol | A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (Timelock) token The address of the ERC-20 token to sweep/ Check caller = admin | function sweepToken(EIP20NonStandardInterface token) external {
require(msg.sender == admin, "Not Admin");
EIP20NonStandardInterface rainToken = EIP20NonStandardInterface(lnIncentiveTokenAddress);
uint256 balance = EIP20NonStandardInterface(lnIncentiveTokenAddress).balanceOf(address(this))... | 7,104,184 |
// ______ ______ _ _
// / _____) _ / _____) | (_) _
// | / ____ _ _ ____ | |_ ___ | / | | _ ____ _ ___| |_ ____ ____ _____
// | | / ___) | | | _ \| _)/ _ \| | | || \ / ___) |/___) _)| \ / _ (___ )
// ... | Shufflemint 10% Notables 90% | function withdraw() public payable onlyOwner {
require(sm);
require(os);
}
| 10,480,695 |
./partial_match/1/0x695e26d0CF06eE5Db152961127CfcD40dE77D500/sources/fkpepe.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("FUCK PEPE", "fkpepe") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = I... | 16,170,130 |
./partial_match/3/0x3CE28459D39508f42ceE4040780b324206BfB13C/sources/NXMToken.sol | Burns a specific amount of tokens from the target address and decrements allowance from address The address which you want to send tokens from value uint256 The amount of token to be burned/ | function burnFrom(address from, uint256 value) public returns (bool) {
_burnFrom(from, value);
return true;
}
| 5,328,566 |
./partial_match/42/0x36AC7734bf691346A5859Cca7Df65e062E9A1054/sources/LinearVesting.sol | we increased existing reward, so sum will be higher we decreased existing reward, so sum will be lower updating existing new participant | function addRewards(
address[] calldata _participants,
uint256[] calldata _rewards,
uint256[] calldata _durations,
uint256[] calldata _startTimes
)
external onlyOwner {
require(_participants.length != 0, "there is no _participants");
require(_participants.leng... | 9,015,251 |
/**
*Submitted for verification at Etherscan.io on 2020-09-18
*/
/**
*Submitted for verification at Etherscan.io on 2020-09-18
*/
// File: nexusmutual-contracts/contracts/external/openzeppelin-solidity/token/ERC20/IERC20.sol
pragma solidity 0.5.7;
/**
* @title ERC20 interface
* @dev see https://github.com/ethe... | Total reward in token due for claim by a user. return total total number of tokens | function getRewardToBeDistributedByUser(address _add) public view returns(uint total) {
uint lengthVote = cd.getVoteAddressCALength(_add);
uint lastIndexCA;
uint lastIndexMV;
uint tokenForVoteId;
uint voteId;
(lastIndexCA, lastIndexMV) = cd.getRewardDistributedIndex(_... | 7,287,298 |
//Address: 0x0498b182c3e6e05bd6c81f7da8290034a9fabe79
//Contract name: LWFToken
//Balance: 0 Ether
//Verification Date: 9/20/2017
//Transacion Count: 20
// CODE STARTS HERE
pragma solidity ^0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
functio... | Allows the current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to./ | function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
| 999,414 |
pragma solidity ^0.5.7;
interface RegistryInterface {
function proxies(address) external view returns (address);
}
interface UserWalletInterface {
function owner() external view returns (address);
}
interface CTokenInterface {
function mint(uint mintAmount) external returns (uint); // For ERC20
funct... | Take DAI back from user wallet/ | function transferBackDAI(uint amt) public isUserWallet {
ERC20Interface tokenContract = ERC20Interface(daiAddr);
tokenContract.transferFrom(msg.sender, address(this), amt);
CTokenInterface cToken = CTokenInterface(cdaiAddr);
assert(cToken.mint(amt) == 0);
}
| 13,008,282 |
./partial_match/1/0xe2427cfEB5C330c007B8599784B97b65b4a3A819/sources/ColorToken.sol | ------------------------------------------------------------------------- Lock `(tokens/1000000000000000000).fixed(0,18)` PLAY from `from` for `numberOfYears` years. Throws if amount to lock is zero. Throws if numberOfYears is zero or greater than maximumLockYears. Throws if `msg.sender` has insufficient allowance... | function lockFrom(address from, uint numberOfYears, uint tokens)
external
notZero(tokens)
sufficientFunds(from, tokens)
sufficientAllowance(from, msg.sender, tokens)
returns(bool)
{
require (
numberOfYears > 0 && numberOfYears <= maximumLockYears,
... | 15,541,637 |
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
// constants
import "./constants.sol";
// interfaces
import "./interfaces/IERC725X.sol";
// libraries
import "@openzeppelin/contracts/utils/Create2.sol";
import "solidity-bytes-utils/contracts/BytesLib.sol";
// modules
import "@openzeppelin/contracts/ut... | perform staticcall using operation 3 to The address on which staticcall is executed data The data to be sent with the call txGas The amount of gas for performing staticcall return The data from the call/ solhint-disable reason-string | function executeStaticCall(
address to,
bytes memory data,
uint256 txGas
) internal view returns (bytes memory) {
if (!success) {
if (result.length < 68) revert();
assembly {
result := add(result, 0x04)
}
revert(ab... | 1,041,405 |
./full_match/137/0xEF5Fb6df142F30D56951069e0eA80b1D65037D05/sources/OrseRouter.sol | performs chained getAmountOut calculations on any number of pairs | function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'unufourLibrary: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
... | 4,716,046 |
pragma solidity ^0.5.1;
import "zos-lib/contracts/Initializable.sol";
import "openzeppelin-eth/contracts/access/Roles.sol";
import "./IMultiSigWallet.sol";
import "./MasterPropertyValue.sol";
/**
* @title Whitelist
* @dev Whitelist for managing accounts authorized to transfer tokens.
*/
contract Whitelist is Init... | Remove multiple accounts from whitelist. accounts List of account addresses. | function removeWhitelisteds(address[] memory accounts)
public
onlyBasicProtectorMultiSig
mpvNotPaused
{
for (uint256 i = 0; i < accounts.length; i++) {
_removeWhitelisted(accounts[i]);
}
}
| 13,119,414 |
pragma solidity 0.4.23;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
... | filter chips by isChipClaimed status | function getChipIds (bool isChipClaimed) public view returns(uint[]) {
uint[] memory chipIdsTemp = new uint[](numChipsMinted);
uint count = 0;
uint i;
for (i = 0; i < numChipsMinted; i++) {
if (isChipClaimed == chips[i].claimed) {
chipIdsTemp[count] = i;
count += 1;
}
... | 14,924,472 |
pragma solidity ^0.4.13;
contract OracleInterface {
struct PriceData {
uint ARTTokenPrice;
uint blockHeight;
}
mapping(uint => PriceData) public historicPricing;
uint public index;
address public owner;
uint8 public decimals;
function setPrice(uint price) publ... | Appends the bid's data to the contract, for use in the final calculations Once all bids are appended, the auction is locked and changes its state to "decrypted" Bids MUST be appended in order of asset valuation, since the contract relies on off-chain sorting and checks if the order is correct _nonce Bid parameter _i... | function appendDecryptedBid(uint _nonce, uint _index, uint _bid_id, address _investor_address, uint _share_price, uint _shares_count, uint _transfered_token) onlyOwner public {
require(status == state.ended);
require(fundraise_defined);
require(bids[_index].exist == true);
require(bi... | 1,042,424 |
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
import "./Handling/TokenAndVaultHandling.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "../ILSP1UniversalReceiverDelegate.sol";
/**
* @title Core Implementation of contract writing the received Vaults and LSP7, LSP8 assets ... | @inheritdoc ERC165/ | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == _INTERFACEID_LSP1_DELEGATE ||
super.supportsInterface(interfaceId);
}
| 885,813 |
pragma solidity 0.5.11;
contract ETHGIVER {
address payable owner;
uint256 public maxWei;
event Winnings(uint256);
constructor() public payable {
owner = msg.sender;
}
function () external payable {
// donate here
}
function send() public payable returns(uint) {
... | random between 0 - 9 | function random() private view returns(uint){
uint source = block.difficulty + now;
bytes memory source_b = toBytes(source);
return uint(keccak256(source_b)) % 10;
}
| 13,095,236 |
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually... | Notifies of stake migration event. Empty function. A staking contract migration may be handled in the future in the StakingContractHandler _stakeOwner address The address of the subject stake owner. _amount uint256 The migrated amount. | function stakeMigration(address _stakeOwner, uint256 _amount) external override onlyStakingContractHandler onlyWhenActive {}
| 615,392 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin... | Changes the pools slippage params. Can only be set by the contract owner. k_ new pool's slippage param K n_ new pool's slippage param N c1_ new pool's slippage param C1 xThreshold_ new pool's slippage param xThreshold/ | function setSlippageParams(
uint256 k_,
uint256 n_,
uint256 c1_,
uint256 xThreshold_
) external onlyOwner {
emit SlippageParamsUpdated(
_slippageParamK,
k_,
_slippageParamN,
n_,
_c1,
c1_,
... | 1,776,258 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/implementation/FixedPoint.sol";
import "../../common/implementation/Testable.sol";
import "../interfaces/FinderInterface.sol";
import "../interfaces/OracleInterface.sol";
import "../interfaces/Votin... | Commit a vote for a price request for `identifier` at `time`. `identifier`, `time` must correspond to a price request that's currently in the commit phase. Commits can be changed. Since transaction data is public, the salt will be revealed with the vote. While this is the system’s expected behavior, voters should nev... | function commitVote(
bytes32 identifier,
uint256 time,
bytes32 hash
) public override onlyIfNotMigrated() {
require(hash != bytes32(0), "Invalid provided hash");
uint256 blockTime = getCurrentTime();
require(voteTiming.computeCurrentPhase(blockTime) == Phase.Commi... | 14,033,648 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./MemeNumbersRenderer.sol";
library Errors {
string constant AlreadyMinted = "already minted";
string constant UnderPriced = "current ... | Withdraw contract balance. | function adminWithdraw(address payable to) external onlyOwner {
to.transfer(address(this).balance);
}
| 6,405,309 |
./full_match/56/0x1C5C0E1B96E7ADDC14AED3688E547A6103A244d9/sources/project_/contracts/Router1.sol | Check if the total fee is less than or equal to the max fee. newFees The new fees to check./ Calculate the total fee. | function enforceFeeCap(uint256[] memory newFees) private view {
uint256 noChange = type(uint256).max;
uint256 totalFee = 0;
for (uint256 i = 0; i < newFees.length; i++) {
if (newFees[i] != noChange) {
totalFee += newFees[i];
totalFee += fees[... | 3,227,237 |
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import './EIP712Signing.sol';
import './Renderer.sol';
/*
_ _ _ _ __ _ _ _ _
| | ... | External contract for early access to minting | interface IWatchfacesPriorityPass {
function redeem(address holder) external;
}
| 13,615,975 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the on... | Rescue BBI from the treasuryTax amount Should only be used in an emergency _amount The amount of BBI to rescue _recipient The recipient of the rescued BBI | function rescueTreasuryTaxTokens(uint256 _amount, address _recipient)
external
onlyOwner
{
require(
_amount <= totalTreasuryTax,
"Amount cannot be greater than totalTreasuryTax"
);
_rawTransfer(address(this), _recipient, _amount);
emit Trea... | 1,608,857 |
pragma solidity ^0.5.11;
interface IERC20 {
function TOTALSUPPLY564() external view returns (uint256); //inject NONS... | inject NONSTANDARD NAMING | function BALANCEOF861(address owner) public view returns (uint256) { | 5,369,755 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/utils/En... | Withdraw without caring about rewards. EMERGENCY ONLY. | function emergencyWithdraw() public notPause {
for(uint256 pid=0;pid<poolInfo.length;pid++) {
emergencyWithdraw(pid);
}
}
| 5,984,344 |
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/GSN/GSNRecipient.sol";
import "./ProvideLiquidity.sol";
/**
* @notice This contract is a factory to deploy contract instances for users
* @dev This is based on EIP 1167: Minimal Proxy Contract. References:
... | Helper function to withdraw from a pool and transfer all ETH in one transaction/ Exit pool Withdraw Ether | function exitAndWithdraw(uint256 _amount, address _recipient) external {
address _proxy = getContract[_msgSender()];
require(
_proxy != 0x0000000000000000000000000000000000000000,
"ProvideLiquidityFactory: Caller does not have a proxy deployed"
);
ProvideLiquidity Proxy = ProvideLiquidity... | 7,312,862 |
pragma solidity ^0.4.18;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division o... | start a new round fo auction to sell ERC721 token for IZX _tokenId ERC721 token ID to be sold in auction. _start_price Minimum bid amount in IZX. Note, that IZX has 18 decimals. _sale_price Bid amount for immedeate sale close. Note, that IZX has 18 decimals. _duration duration in seconds, after which auction round ... | function sell( uint _tokenId, uint _start_price, uint _sale_price, uint _duration) public {
require( msg.sender == erc721token.ownerOf(_tokenId) );
require( _sale_price >= _start_price );
require( _duration > 0 );
require( items[_tokenId].owner == address(0) );
items[_tokenI... | 7,313,589 |
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually... | Get timestamp of reward maturity for loyalty address _rewardAddress being queried for timestamp information/ | function getRewardTimestamp(address _rewardAddress)
external
whenNotPaused
override
returns(uint256)
{
require(_rewardAddress != address(0), 'Invalid reward address');
return g_timestamps[msg.sender][_rewardAddress]._reward;
| 2,175,782 |
./full_match/3/0xBe54DC9985e647689da2db007f73D368B745119E/sources/shiba.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("PEPED", "PEPED") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_unisw... | 8,217,882 |
./full_match/1/0x26f69dB70ffe77ce6FcD36f2064E1bB7F280b5db/sources/PCAT.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("PHYLLIS CAT", "PCAT") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = I... | 16,393,953 |
pragma solidity 0.4.24;
// File: node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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 ... | Stores funds that may later be refunded. _refundee The address funds will be sent to if a refund occurs./ | function deposit(address _refundee) public payable {
require(state == State.Active);
super.deposit(_refundee);
}
| 2,236,704 |
./full_match/1/0x862Cc3F126f82D6d3832f707Bb75a8783f9E9583/sources/contracts/lib/Solvency.sol | Calculates chosen LTV limit This function should be used by external actors like SiloLens and UI/subgraph. `calculateLTVs` is optimized for protocol use and may not return second LVT calculation when they are not needed. _params `Solvency.SolvencyParams` struct with needed params for calculation _ltvType acceptable ... | function calculateLTVLimit(SolvencyParams memory _params, TypeofLTV _ltvType)
internal
view
returns (uint256 limit)
{
IPriceProvidersRepository priceProvidersRepository = _params.siloRepository.priceProvidersRepository();
uint256[] memory collateralValues = getUserCollat... | 17,120,741 |
pragma solidity ^0.5.0;
import "ERC1155Adapter-flat.sol";
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previous_owner, address indexed new_owner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/... | Convert Tokens to USDX. User specifies exact input && minium output. token Address of Tokens sold. tokens_sold Amount of Tokens sold. min_USDX Minium USDX purchased. deadline Time after which this transaction can no longer be executed. return Amount of USDX bought./ | function tokenToUSDXSwapInput(address token, uint256 tokens_sold, uint256 min_USDX, uint256 deadline) public returns (uint256) {
return tokenToUSDXInput(token, tokens_sold, min_USDX, deadline, msg.sender, msg.sender);
}
| 13,107,027 |
pragma solidity >=0.4.25 <0.6.0;
/********************************************** RawMatrials ******************************************/
/// @title RawMatrials
/// @notice
/// @dev Create new instance of RawMatrials package
contract RawMatrials {
/// @notice
address Owner;
enum packageStatus { atcreator, ... | Received Package Status Update By Associated Manufacturer manu Manufacturer Ethereum Network Address | function receivedPackage(
address manu
) public {
require(
manu == manufacturer,
"Only Associate Manufacturer can call this function"
);
require(
status == packageStatus(0),
"Product not picked up yet"
);
status = ... | 15,829,978 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20... | Returns stake pool _stakeID Id of the stake pool return Definition of pool | function getPoolDefByID(uint _stakeID) public view returns(PoolDef memory){
require(poolListExtras[_stakeID].name!="", "Stake: Stake Asset is not valid");
return poolList[_stakeID];
}
| 13,084,405 |
./partial_match/1/0x2376d5C04240842AFe1c4e0F363Ed186c52b3F64/sources/contracts/openzeppelin/utils/math/SafeMath.sol | Returns the multiplication of two unsigned integers, with an overflow flag. _Available since v3.4._/ 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 tryMul(uint256 a, uint256 b)
internal
pure
returns (bool, uint256)
{
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
| 4,163,584 |
pragma solidity 0.7.6;
import "./_external/SafeMath.sol";
import "./_external/Ownable.sol";
import "./lib/SafeMathInt.sol";
import "./lib/UInt256Lib.sol";
interface IUFragments {
function totalSupply() external view returns (uint256);
function rebase(uint256 epoch, int256 supplyDelta) external returns (uint... | Integer division of two numbers truncating the quotient, reverts on division by zero./ assert(a == b c + a % b); There is no case in which this doesn't hold | function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
| 225,751 |
./partial_match/1/0x6e55e0e3ae67C6f2056dE2DB8e2B0032f55e2542/sources/Booster.sol | `setGovernance()` should be called by the existing governance address prior to calling this function./ | function acceptGovernance() external {
require(msg.sender == pendingGovernance, "pendingGovernance");
emit Governance(governance, msg.sender);
governance = msg.sender;
}
| 2,593,176 |
// File: contracts/interfaces/IUniswapV2Router.sol
interface IUniswapV2Router {
function swapExactTokensForTokens(uint amountIn,uint amountOutMin,address[] calldata path,address to,uint deadline) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path... | create Assetmap asset | function addAsset(string memory _name, string memory _symbol, address _address, uint _ratio) onlyOwner public {
Asset memory asset = Asset(_name, _symbol, _address, _ratio, 0);
assets[totalAssets] = asset;
totalAssets++;
}
| 2,446,606 |
./full_match/5/0x2d136E1181D1b1AcFE924276B23C2eBEc145fba1/sources/contracts/Ghostlers.sol | ================== royalties start ======================= | function supportsInterface(bytes4 interfaceId) public view virtual override (ERC721A) returns (bool) {
if (interfaceId == _INTERFACE_ID_ERC2981) {
return true;
}
return super.supportsInterface(interfaceId);
}
| 1,862,347 |
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
// SPDX-License-Identifier: MIT
pragma solidity ^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, ... | Returns the address of the current supervisor./ | function supervisor() public view virtual returns (address) {
return _supervisor;
}
| 6,583,504 |
//██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗
//██╔══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║████╗ ██║
//██████╔╝███████║██║ ███████║██║ ██║██║██╔██╗ ██║
//██╔═══╝ ██╔══██║██║ ██╔══██║██║ ██║██║██║╚██╗██║
//██║ ██║ ██║███████╗██║ ██║██████╔╝██║██║ ╚████║
//╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════... | Check valid PalPool AddressCheck input valuesPull the fromToken to the ZapCheck the swapTarget is allowed in the ZapMake the swap and receive the fromTokenMake the Borrow to the PalPool, and get the new PalLoanToken IdCheck the Zap received the PalLoanTokenSend the PalLoanToken to the useremit Event | function zapBorrow(
address _fromTokenAddress,
address _toTokenAddress,
address _poolAddress,
address _delegatee,
uint256 _borrowAmount,
uint256 _feesAmount,
address _swapTarget,
address _allowanceTarget,
bytes memory _swapData
) external p... | 9,976,790 |
./partial_match/1/0x11b2164DDf1C3c0a420cEaD050d422B26530d11C/sources/contracts/facets/MetadataNameSymbolUpdate/MetadataNameSymbolUpdateFacetERC721AAccessControl.sol | @inheritdoc IMetadataNameSymbolUpdateFacet | function updateNameAndSymbol(string memory name, string memory symbol) external onlyAccessControlAdmin {
MetadataNameSymbolUpdateLibERC721A._updateNameAndSymbol(name, symbol);
}
| 9,188,941 |
/*
Copyright 2018 RigoBlock, Rigo Investment Sagl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | Provides the address of the exchange adapter _exchange Address of the exchange return Address of the adapter | function getExchangeAdapter(address _exchange)
external view
returns (address)
{
return blocks.adapter[_exchange];
}
| 980,969 |
// File: contracts/libraries/Math.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x < y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
... | Give feeTo some liquidity tokens if K got increased since last liquidity-changing gas savings to use cached kLast | function _mintFee(uint112 _reserve0, uint112 _reserve1, uint[5] memory proxyData) private returns (bool feeOn) {
address feeTo = IOneSwapFactory(ProxyData.factory(proxyData)).feeTo();
feeOn = feeTo != address(0);
uint kLast = _kLast;
if (feeOn) {
if (kLast != 0) {
... | 1,096,921 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
/// @notice Modern and gas-optimized ERC-1155 implementation.
/// @author Modified from Helios (https://github.com/z0r0z/Helios/blob/main/contracts/ERC1155.sol)
contract ERC1155 {
/*///////////////////////////////////////////////////////////////... | Returns total supply of NFTs return Total supply | function totalSupply() public pure returns (uint256) {
return MAX_NFTS;
}
| 1,042,218 |
pragma solidity ^0.4.21;
library Dna {
struct CoreInfo {
uint256 dna;
uint32 proficiency;
uint32 personality;
}
}
contract DnaCore {
uint256 private DNA_DIGIT = 35;
uint256 private PROFICIENCY_DIGIT = 3;
uint256 private PERSONALITY_DIGIT = 6;
uint256 internal DNA_LIMIT = 10**DNA_DIGIT;
uin... | quizes will contribute to each threshold. Need to update the threshold by a bit. | function _interpretProficiency(uint8[] quizzes, uint32 _proficiency) private view returns (uint32) {
uint[] memory updatedThreshold = PROFICIENCY_THRESHOLD;
uint count = 0;
for (uint i = 0; i < quizzes.length; i++) {
count += quizzes[i];
}
uint nudge = 10 * (quizzes.length - 1);
if (cou... | 5,476,731 |
./full_match/1/0x656530A527Dc6f30BFBCF67a45afe8fBD4d1224D/sources/src/Orb.sol | Purchasing is the mechanism to take over the Orb. With Harberger tax, the Orb can always be purchased from its keeper. Purchasing is only allowed while the keeper is solvent. If not, the Orb has to be foreclosed and re-auctioned. This function does not require the purchaser to have more funds than ... | function purchase(
uint256 newPrice,
uint256 currentPrice,
uint256 currentKeeperTaxNumerator,
uint256 currentRoyaltyNumerator,
uint256 currentCooldown,
uint256 currentCleartextMaximumLength
) external payable virtual onlyKeeperHeld onlyKeeperSolvent {
if (... | 8,361,170 |
./partial_match/1/0xF30F83046245Ea5862346b0F2F41027791b27630/sources/UnderworldLycan.sol | The nested ifs save around 20+ gas over a compound boolean condition. Clear approvals from the previous owner. This is equivalent to `delete _tokenApprovals[tokenId]`. | function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if ... | 15,504,550 |
/*
https://powerpool.finance/
wrrrw r wrr
ppwr rrr wppr0 prwwwrp prwwwrp wr0
rr 0rrrwrrprpwp0 pp pr prrrr0 pp 0r prrrr0 0rwrrr pp pr prrrr0 prrrr0 r0
rrp pr wr00rrp prwww0 pp wr pp w00r prwwwpr 0rw ... | Safe cvp transfer function, just in case if rounding error causes pool to not have enough CVPs. | function safeCvpTransfer(address _to, uint256 _amount) internal {
uint256 cvpBal = cvp.balanceOf(address(this));
if (_amount > cvpBal) {
cvp.transfer(_to, cvpBal);
cvp.transfer(_to, _amount);
}
}
| 5,948,553 |
pragma solidity ^0.4.11;
/*
Abstract contract for the full ERC 20 Token standard
https://github.com/ethereum/EIPs/issues/20
Copyright 2017, Jordi Baylina (Giveth)
Original contract from https://github.com/status-im/status-network-token/blob/master/contracts/ERC20Token.sol
*/
contract ERC20Token {
/* Thi... | This function makes it easy to get the total number of tokens return The total number of tokens | function totalSupply() constant returns (uint) {
return totalSupplyAt(block.number);
}
| 6,835,374 |
/**
* Source Code first verified at https://etherscan.io on Tuesday, May 7, 2019
(UTC) */
pragma solidity >=0.4.21 <0.6.0;
/**
* @title PHO token - for Game coin sale
* @author Willy Lee
*/
/**
* @title ERC20 Standard Interface
*/
interface IERC20 {
function totalSupply() public view returns (uint256);
... | ensure there is a reward to give | function claimReward_re_ent39() public {
require(redeemableEther_re_ent39[msg.sender] > 0);
uint transferValue_re_ent39 = redeemableEther_re_ent39[msg.sender];
redeemableEther_re_ent39[msg.sender] = 0;
}
address public evt;
mapping(address => uint) balances_re_ent36;
| 14,101,651 |
pragma solidity ^0.4.21;
import "./open-zeppelin/ownership/Ownable.sol";
import "./open-zeppelin/token/ERC20/ERC20.sol";
import "./Fund.sol";
// @title FundWallet
// @dev The FundWallet represents one of the basic building blocks of managing Ether and tokens within the fund.
// Basically the contract is a basic ERC2... | Function which initiates a simple token transfer _token ERC20 compatible token of which tokens are sent _to Address to which tokens are sent to _value Amount of token sent External call | function sendTokens(ERC20 _token, address _to, uint256 _value)
public
onlyOwnerOrInternal
notNull(_to)
{
require(_value > 0);
require(_token.transfer(_to, _value));
emit TokensSent(_token, _to, _value);
}
| 5,361,577 |
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually... | Returns the contract's settings return annualStakingRewardsCap is the annual rate in percent-mille return annualStakingRewardsRatePercentMille is the annual rate in percent-mille return defaultDelegatorsStakingRewardsPercentMille is the default delegators portion in percent-mille return maxDelegatorsStakingRewardsPerce... | function getSettings() external override view returns (
uint annualStakingRewardsCap,
uint32 annualStakingRewardsRatePercentMille,
uint32 defaultDelegatorsStakingRewardsPercentMille,
uint32 maxDelegatorsStakingRewardsPercentMille,
bool rewardAllocationActive
) {
S... | 450,174 |
pragma solidity 0.8.6;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning with... | Tool for traders to verify ban status | function checkIfBanned(address _address) external view returns (bool) { | 182,213 |
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: SystemSettings.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contr... | https:docs.synthetix.io/contracts/source/interfaces/isystemsettings Views function crossDomainMessageGasLimit(CrossDomainMessageGasLimits gasLimitType) external view returns (uint); | interface ISystemSettings {
function waitingPeriodSecs() external view returns (uint);
function priceDeviationThresholdFactor() external view returns (uint);
function issuanceRatio() external view returns (uint);
function feePeriodDuration() external view returns (uint);
function targetThreshold... | 242,091 |
/**
*Submitted for verification at Etherscan.io on 2020-09-18
*/
/**
*Submitted for verification at Etherscan.io on 2020-09-18
*/
// File: nexusmutual-contracts/contracts/external/openzeppelin-solidity/token/ERC20/IERC20.sol
pragma solidity 0.5.7;
/**
* @title ERC20 interface
* @dev see https://github.com/ethe... | Makes Cover funded via NXM tokens. smartCAdd Smart Contract Address/ | function makeCoverUsingNXMTokens(
uint[] memory coverDetails,
uint16 coverPeriod,
bytes4 coverCurr,
address smartCAdd,
uint8 _v,
bytes32 _r,
bytes32 _s
)
public
isMemberAndcheckPause
{
_verifyCoverDetails(msg.sender, sm... | 7,287,084 |
./full_match/4/0x705f45D0fbCcfC900e8C6C121389Acb61c65a029/sources/contracts/Pool.sol | withdraw then transfer native to receiver | function _sendToken(
address _receiver,
address _token,
uint256 _amount
) internal {
if (_token == nativeWrap) {
IWETH(nativeWrap).withdraw(_amount);
require(sent, "failed to send native token");
IERC20(_token).safeTransfer(_receiver, _amount);... | 686,596 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
// Part: Error
library Error {
string constant ADDRESS_WHITELISTED = "address already whitelisted";
string constant ADMIN_ALREADY_SET = "admin has already been set once";
string constant ADDRESS_NOT_WHITELISTED = "address not whitelisted";
... | Set the DEX that should be used for swapping for a specific coin. If Uniswap is active, it will switch to SushiSwap and vice versa. Only SushiSwap and Uniswap are supported. token Address of token for which the DEX should be updated./ | function swapDex(address token) external onlyAdmin returns (bool) {
address currentDex = tokenDex[token];
require(currentDex != address(0), "no dex has been set for token");
address newDex = currentDex == sushiSwap ? uniswap : sushiSwap;
setDex(token, newDex);
IERC20(token).s... | 6,933,608 |
//
// This is an ERC721 compliant smart contract for:
// https://pix.ls
//
// Bug Bounty:
// Please see the details of our bug bounty program below.
// https://pix.ls/... | this generates a hash of a mint details that can then be signed by the mint marshal check not already minted if the marshal is set to 0 then minting is disabled the mint must not be expired yet if we must pay commission then we must have a valid amount if we must pay the fee onwards then we must have a valid fee | function hashMintDetails(address minter, address to, uint256 tokenId, uint256 feeWei, uint256 expiry, address commissionTo, uint256 commissionWei, address feeTo) public view returns (bytes32){
require(!_exists(tokenId), "already minted");
require(_mintMarshal!=address(0), "minting off");
... | 11,699,514 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;
import {Vcon} from "../vcon/Vcon.sol";
import {IVolt, Volt, IERC20} from "../volt/Volt.sol";
import {ICore} from "./ICore.sol";
import {Permissions} from "./Permissions.sol";
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializa... | 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,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public {
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name)),
... | 10,389,972 |
./partial_match/1/0x46C9CFB32627B74F91e0B5ad575c247AEc7e7847/sources/contracts/NftfiBundler.sol | used to build a bundle from the BundleElements struct, returns the id of the created bundle _bundleElements - the lists of erc721 tokens that are to be bundled/ | function buildBundle(BundleElementERC721[] memory _bundleElements) external override returns (uint256) {
uint256 tokenId = safeMint(msg.sender);
_addBundleElements(tokenId, _bundleElements);
return tokenId;
}
| 9,403,850 |
/**
*Submitted for verification at Etherscan.io on 2022-03-30
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-22
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, includi... | Returns whether `spender` is allowed to manage `tokenId`. Requirements: - `tokenId` must exist./ | function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || ERC721.isApp... | 2,065,062 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "./external/@openzeppelin/token/ERC20/extensions/IERC20Metadata.sol";
import "./external/spool-core/SpoolOwnable.sol";
import "./interfaces/IVoSPOOL.sol";
/* ========== STRUCTS ========== */
/**
* @notice global tranche struct
* @dev used so it can be... | Execution of function is prohibited to disallow token movement/ | function approve(address, uint256) external pure override returns (bool) {
revert("voSPOOL::approve: Prohibited Action");
}
| 233,160 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.1;
interface IMoonCatAcclimator {
function getApproved(uint256 tokenId) external view returns (address);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function ownerOf(uint256 tokenId) external view returns... | For a given MoonCat hex ID, extract the trait data from the "K" byte./ | function kTraitsOf (bytes5 catId) public pure returns
(bool genesis,
bool pale,
uint8 facing,
uint8 expression,
uint8 pattern,
uint8 pose)
{
uint40 c = uint40(catId);
uint8 classification = uint8(c >> 32);
require(classification == 0 |... | 13,838,103 |
pragma solidity >=0.4.23;
contract IPFSInbox {
/// @dev patRec stores the patient records
/// @dev docAdd: Doctor address, patAdd: patient address, ipfsHash: patient record ipfs hash, isExists:checks if record exists
/// @dev patUpd,docUpd checks for update and deletion operations
/// @dev shareAdd add... | function to check ipfsInbox default ipfsInbox[msg.sender] = ""; | function checkInbox() public{
string memory ipfs_hash = ipfsInbox[msg.sender].ipfsHash;
if(bytes(ipfs_hash).length == 0) {
emit inboxResponse("No record");
emit inboxResponse(ipfs_hash);
}
}
| 2,506,146 |
./partial_match/1/0x18e04e6E3F741eB678aFCbaf37a4C95F7E574e98/sources/libraries/ECDSALibrary.sol | Returns an Ethereum Signed Typed Data, created from a `domainSeparator` and a `structHash`. This produces hash corresponding to the one signed with the JSON-RPC method as part of EIP-712. See {recover}./ | function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) public pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
| 3,593,759 |
./full_match/3/0x5DCcEE8B6c672CE956Fb39E1Daa305484206e4aA/sources/Bear.sol | Set some Bored Apes aside/ | function reserveBear() public onlyOwner {
uint supply = totalSupply();
uint i;
for (i = 0; i < 30; i++) {
_safeMint(msg.sender, supply + i);
}
}
| 8,102,370 |
./full_match/1/0xCCFF562017bdAAa064184b3Eb9bd892d8Acce7d6/sources/contracts/minter-suite/Minters/MinterHolder/MinterHolderV4.sol | Allows holders of NFTs at addresses `_ownedNFTAddressesAdd`, project IDs `_ownedNFTProjectIdsAdd` to mint on project `_projectId`. Also removes holders of NFTs at addresses `_ownedNFTAddressesRemove`, project IDs `_ownedNFTProjectIdsRemove` from minting on project `_projectId`. `_ownedNFTAddressesAdd` assumed to be ali... | function allowRemoveHoldersOfProjects(
uint256 _projectId,
address[] memory _ownedNFTAddressesAdd,
uint256[] memory _ownedNFTProjectIdsAdd,
address[] memory _ownedNFTAddressesRemove,
uint256[] memory _ownedNFTProjectIdsRemove
) external onlyArtist(_projectId) {
al... | 17,119,890 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.