file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
pragma solidity 0.4.17;
import './SafeMath.sol';
import './Pausable.sol';
import './NovaTokenInterface.sol';
/**
* @title Tokensale
* Tokensale allows investors to make token purchases and assigns them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet as they arrive.
*/
contract To... | Get the price in wei for current premium return price {uint256}/ | function getPriceInWei() constant public returns (uint256) {
uint256 price;
if (totalWeiRaised < firstDiscountCap) {
price = firstDiscountPrice;
price = secondDiscountPrice;
price = thirdDiscountPrice;
price = BASE_PRICE_IN_WEI;
}
return price;
}
| 1,844,466 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Get the subset of registered signers in the given 0 based index range low The lower inclusive index up The upper inclusive index return The subset of registered signers | function signersByIndices(uint256 low, uint256 up)
public
view
returns (address[] memory)
{
require(0 < signers.length, "No signers found [SignerManager.sol:101]");
require(low <= up, "Bounds parameters mismatch [SignerManager.sol:102]");
up = up.clampMax(signers.length - 1)... | 12,574,579 |
./partial_match/1/0x99937d00F549e222fe8f144C12A161707a766F4c/sources/TnmtToken.sol | Set/Update data for a Tnmt/ | function updateTnmtData(
uint256 _tnmtId,
uint8 _noColors,
uint256 _monkeyId,
bool _hFlip,
bool _vFlip,
string memory _evento,
ITnmtLibrary.ColorDec[11] memory _colors,
uint8[1024] calldata _pixels
) public onlyDataPusher returns (uint256) {
... | 2,661,685 |
./full_match/11155111/0x1E2315519Ad39dFc9E1535125436fB4Fb738b0db/sources/contracts/crowdfunding.sol | string memory _imguint256 minute = 1 minutes;campaign.amountleft = 0; int256[] memory timer = new uint256[](numberOfCampaigns);campaign.img = _img; | function createCampaign(
string memory _title,
string memory _description,
uint256 _target,
uint256 _deadline,
uint256 _expectedInterestRate,
uint256 _stage0time,
uint256 _stage1time,
uint256 _stage2time,
uint256 _stage3time
) public return... | 3,806,554 |
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.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
* ma... | Calculate base 2 logarithm of an unsigned 128-bit integer number. Revert in case x is zero. x number to calculate base 2 logarithm of return base 2 logarithm of x, multiplied by 2^121/ | function log_2 (uint128 x)
internal pure returns (uint128) {
require (x != 0);
uint b = x;
uint l = 0xFE000000000000000000000000000000;
b = b * b >> 127; if (b >= 0x100000000000000000000000000000000) l |= 0x1;
return uint128 (l);
| 392,437 |
./full_match/1/0x8c1CfaE7866fA2CD4C82fEa9a660cfB0FAa7578F/sources/contracts/CErc721.sol | Sender borrows assets from the protocol to their own address borrowAmount The amount of the underlying asset to borrow return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/ | function borrow(uint borrowAmount) external override returns (uint) {
require(false);
return borrowInternal(borrowAmount);
}
| 2,944,591 |
pragma solidity ^0.4.24;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
fu... | Transfer tokens from other address Send `_value` tokens to `_to` on behalf of `_from` _from The address of the sender _to The address of the recipient _value the amount to send/ | function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool success) {
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| 14,758,248 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceO... | Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions. assets The amount of underlying assets to be transferred. return shares The amount of vault shares that will be minted./ | function previewDeposit(uint256 assets) external view override returns (uint256 shares) {
require(assets > 0, "Must deposit something");
(shares, ) = _underlyingToCredits(assets);
}
| 11,800,867 |
//Address: 0x3f45d2d5feb6b4b000d2d3b84442eeddf54a735a
//Contract name: LiquidPledging
//Balance: 0 Ether
//Verification Date: 12/20/2017
//Transacion Count: 9
// CODE STARTS HERE
//File: contracts/ILiquidPledgingPlugin.sol
pragma solidity ^0.4.11;
/*
Copyright 2017, Jordi Baylina
Contributors: Adrià Massane... | `doTransfer` is designed to allow for pledge amounts to be shifted around internally. from This is the Id from which value will be transfered. to This is the Id that value will be transfered to. _amount The amount of value that will be transfered. | function doTransfer(uint64 from, uint64 to, uint _amount) internal {
uint amount = callPlugins(true, from, to, _amount);
if (from == to) {
return;
}
if (amount == 0) {
return;
}
Pledge storage nFrom = findPledge(from);
Pledge storage n... | 12,923,224 |
pragma solidity ^0.4.23;
/**
* @title ECCMath
*
* Functions for working with integers, curve-points, etc.
*
* @author Andreas Olofsson (androlo1980@gmail.com). Reworked by Alexander Vlasov (alex.m.vlasov@gmail.com)
*/
library ECCMath {
/// @dev Modular inverse of a (mod p) using euclid.
/// 'a' and 'p' m... | See _toZ1(uint[3], uint, uint). Warning: Computes a modular inverse. PJ The point. prime The prime modulus. return (Px', Py', 1) | function toZ1(uint[3] PJ, uint prime) internal pure {
uint zInv = invmod(PJ[2], prime);
uint zInv2 = mulmod(zInv, zInv, prime);
PJ[0] = mulmod(PJ[0], zInv2, prime);
PJ[1] = mulmod(PJ[1], mulmod(zInv, zInv2, prime), prime);
PJ[2] = 1;
}
| 12,657,295 |
pragma solidity ^0.5.12;
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import "../../interfaces/curve/ICurveModule.sol";
import "../../interfaces/curve/IFundsModule.sol";
import "../../interfaces/curve/... | Withdraw liquid tokens from the pool to Address of the user, who sends tokens. Should have enough allowance. amount Amount of tokens to deposit/ | function withdrawLTokens(address to, uint256 amount) public onlyFundsOperator {
withdrawLTokens(to, amount, 0);
}
| 2,487,198 |
./full_match/1/0x5d91247F49e5f9eb05b948d638616f071d2abf00/sources/browser/TheRushV1.sol | To stake token user will call this method user can stake only once whilestakedAmount[msg.sender] = amount use this for tokens other than SURG (does not support burn-on-transfer tokens)stakedAmount[msg.sender] = safeAdd(stakedAmount[msg.sender], amount); Subtracting slash amount only when staking SURG | function stake(uint256 amount) external returns (bool) {
require(enabled == true);
require(amount <= 115792089237316195423570985008687907853269984665640564039457584007913129639935, "Overflow");
if (stakedAmount[msg.sender] == 0) {
bool isOk = IERC20(StakingToken).transferFrom... | 9,818,662 |
pragma solidity ^0.4.17;
contract MyToken {
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
string public name;
string public symbol;
uint8 public decimals;
event Transfer(address indexed from, address indexed to, uint25... | This creates an array with all balances / Initializes contract with initial supply tokens to the creator of the contract / | function MyToken(uint256 initialSupply, string tokenName, string tokenSymbol, uint8 decimalUnits) public {
}
| 2,226,631 |
// SPDX-License-Identifier: MIT
// AaveWalletManager.sol -- Part of the Charged Particles Protocol
// Copyright (c) 2021 Firma Lux, Inc. <https://charged.fi>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to de... | Sets the Paused-state of the Wallet Manager/ | function setPausedState(bool paused) external onlyOwner {
_paused = paused;
emit PausedStateSet(paused);
}
| 521,116 |
./full_match/137/0xbd331AF1E2Ae4813eA8e89b945AbB880aBCE5aFC/sources/contracts/Game.sol | TODO: check that msg.sender is the owner of the NFT | function AcceptOffer(address offerCreator, uint128 offerId, uint nft) public
{
GameOffer memory offer = _getOffer(offerCreator, offerId);
require(offer.creator != address(0), "offer not found");
IERC20(token).transferFrom(msg.sender, address(this), offer.bet);
uint128 id = lastA... | 4,794,918 |
// CryptoTorch Source code
// copyright 2018 CryptoTorch <https://cryptotorch.io>
pragma solidity 0.4.19;
/**
* @title SafeMath
* Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) in... | Get the Max Price of the Torch during the Anti-Whale Phase/ | function getMaxPrice() public view returns (uint256) {
return whaleIncreaseLimit.add(_highestPrices[0].price);
}
| 1,180,477 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/LinkTokenInterface.sol";
import "./VRFRequestIDBase.sol";
/** ****************************************************************************
* @notice Interface for contracts using VRF randomness
* ******************************************... | swaps provided amount of ETH to LINK to cover the fee, and transfers back what is left | function _feeManagment() internal {
require(msg.value >= feeETH(), 'Not enough WBNB to pay fee');
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = address(LINK);
fee,
path,
address(this),
block.timestamp
... | 14,738,794 |
//SPDX-License-Identifier: Unlicense
pragma solidity 0.6.11;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract AirdropPush {
using SafeERC20 for IERC20;
/// @notice Used to distribute preToke to seed investors. Can be used for any ER... | Approve the zeroExRouter's allowance to max if the allowance ever drops below the balance of the token held | function _approve(IERC20 token) internal {
uint256 allowance = token.allowance(address(this), address(zeroExRouter));
if (allowance < token.balanceOf(address(this))) {
uint256 amount = token.balanceOf(address(this)).sub(allowance);
token.safeIncreaseAllowance(address(zeroExRo... | 10,126,055 |
./full_match/137/0xe558726C468Ccc21cc09ca4B8B46131dC1002923/sources/project_/contracts/Exchange.sol | Sends tokens mistakenly sent directly to the `Exchange` to the fee wallet (the `receive` function rejects ETH except when wrapping/unwrapping)/ | function skim(address tokenAddress) external onlyAdmin {
AssetRegistry.skim(tokenAddress, _feeWallet);
}
| 4,762,008 |
/**
* SPDX-License-Identifier: UNLICENSED
*/
pragma solidity =0.6.10;
pragma experimental ABIEncoderV2;
// File: contracts/packages/oz/SafeMath.sol
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily res... | returns the strike asset amount of margin required for a put or put spread with the given short oTokens, long oTokens and amounts marginRequired = max( (short amount short strike) - (long strike min (short amount, long amount)) , 0 ) return margin requirement denominated in the strike asset/ | function _getPutSpreadMarginRequired(
FPI.FixedPointInt memory _shortAmount,
FPI.FixedPointInt memory _longAmount,
FPI.FixedPointInt memory _shortStrike,
FPI.FixedPointInt memory _longStrike
) internal view returns (FPI.FixedPointInt memory) {
return FPI.max(_shortAmount.... | 1,551,745 |
//SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 < 0.9.0;
pragma experimental ABIEncoderV2; //Abiencoder es para calcular hashes
//Candidato // EDAD // ID
// TONI // 20 // 201
// Alberto // 35 // 203
// Mirta // 21 // 201
// Pato // 26 // 001
contract votacion {
//Direccion del propiet... | Proporcionar el nombre del candidato ganadorla variable ganador va a contener el nombre del candidato ganador.variable flag para empaterecorremos el array de candidatos para determinar el candidato con un numero mayor de votoscomparamos si nuestro ganador ha sido superado por otro candidato.miramos si hay empate entre ... | function Ganador() public view returns(string memory){
string memory ganador = candidatos[0];
bool flag;
for(uint i=1; i < candidatos.length; i++ ){
if( votos_Candidato[candidatos[i]] > votos_candidato[ganador]){
ganador= candidatos[i];
... | 1,086,243 |
./full_match/44787/0xD49f832Ec694AA7DB2b122d5Ed14FC4FC523Cdc5/sources/contracts/JustArtMarket.sol | returns marketfee percentage | function getMarketFee() external view returns (uint256) {
return marketFeePercentage;
}
| 13,290,983 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/// @author jpegmint.xyz
import "./IRoyaltiesERC2981.sol";
import "./IRoyaltiesManifold.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
abstract ... | Returns contract-wide royalties./ | function _getRoyalties(uint256) internal view returns (address payable[] memory, uint256[] memory) {
uint256[] memory royaltyBasisPoints = new uint[](1);
address payable[] memory royaltyReceivers = new address payable[](1);
royaltyBasisPoints[0] = _royaltiesBasisPoints;
royaltyRece... | 12,667,335 |
./partial_match/1/0xd5be7b469B99a612A8c01084616a70f0d30d462D/sources/MikuruAsakura.sol | 设置预售期间每个地址的最大 Mint 数量/ | function setOnPreSalesMintCountForAddress(
uint256 _onPreSalesMintCountForAddress
) external onlyOwner {
onPreSalesMintCountForAddress = _onPreSalesMintCountForAddress;
}
| 16,086,045 |
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "../token/ITokenContract.sol";
/**
* @dev Supports ERC20 tokens
* The escrow smart contract for the open bazaar trades in Ethereum
* The smart contract is desgined keeping in mind the current wallet interface of the OB-core
*... | Allows one of the moderator to collect all the signature to solve dispute and submit it to this method. If all the required signatures are collected and consensus has been reached than funds will be released to the voted party sigV Array containing V component of all the signatures sigR Array containing R component of ... | function execute(
uint8[] sigV,
bytes32[] sigR,
bytes32[] sigS,
bytes32 scriptHash,
address[] destinations,
uint256[] amounts
)
external
transactionExists(scriptHash)
inFundedState(scriptHash)
{
require(
destinations... | 2,478,301 |
./full_match/1/0x690d7C97584a11059728e012E97CBE88404Eb2Bb/sources/ShibaBear.sol | SPDX-License-Identifier: Unlicensed | 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)
exte... | 16,440,427 |
//solium-disable linebreak-style
pragma solidity ^0.4.22;
// ----------------------------------------------------------------------------
// 'REMCoin' token contract
//
// Deployed to : 0xEF871E2F799bbF939964E9b707Cb2805EB4Bd515
// Symbol : REM
// Name : REMCoin
// Total supply: 100000000
// Decimals : ... | ---------------------------------------------------------------------------------------------------------- Burn Tokens depends on the market activity to maintain the liquidity and maintain the proofOfReserve,etc. ---------------------------------------------------------------------------------------------------------- | function burn(uint256 _value) public returns (bool success) {
require(balances[msg.sender] >= _value,"Sender should have enough tokens to burn");
balances[msg.sender] -= _value;
_totalSupply -= _value;
emit Burn(msg.sender, _value);
return... | 5,890,801 |
./full_match/40/0x67770F918D1F7Fac8eaA2266977bA81D8F46d300/sources/libraries/AkkaLibrary.sol | performs chained getAmountOut calculations on any number of pairs require(path.length >= 2, 'PancakeLibrary: INVALID_PATH'); | function getAmountsOut(uint256 amountIn, address[][] memory path, uint256[][] memory fees) internal view returns (uint256[] memory amounts) {
amounts = new uint256[](path.length+1);
amounts[0] = amountIn;
for (uint256 i; i < path.length; i++) {
(uint256 reserveIn, uint256 reserve... | 9,541,712 |
./partial_match/42/0x466509F5426f3DDfd686804d443c16c9e59A5CA9/sources/PartyStarter.sol | [sponsored -0 , processed -1, didPass -2, cancelled -3, guildkick -4, spending -5, member -6, governance -7] Make the proposal fail if the new total number of shares and loot exceeds the limit | function processProposal(uint256 proposalIndex) public nonReentrant {
_validateProposalForProcessing(proposalIndex);
uint256 proposalId = proposalQueue[proposalIndex];
Proposal storage proposal = proposals[proposalId];
require(!proposal.flags[4] && !proposal.flags[7], "not ... | 3,435,135 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "./interfaces/IOverlayV1Deployer.sol";
import "./interfaces/IOverlayV1Factory.sol";
import "./interfaces/IOverlayV1Market.sol";
import "./interfaces/IOverlayV1Token.sol";
import "./interfaces/feeds/IOverlayV1FeedFactory.sol";
import "./libraries/Risk.sol"... | Setter for fee repository | function setFeeRecipient(address _feeRecipient) external onlyGovernor {
require(_feeRecipient != address(0), "OVLV1: feeRecipient should not be zero address");
feeRecipient = _feeRecipient;
emit FeeRecipientUpdated(msg.sender, _feeRecipient);
}
| 14,080,128 |
./full_match/44787/0xe2730A7b402a359087E5850A4AC49dC93e6Eb0D7/sources/src/vaults/ImpactVault.sol | Withdraws underlying asset by converting equivalent value in staked asset and transferring it to the receiver. Burn vault tokens before withdrawing./ Capture assets associated with owner before burn. | function withdraw(
uint256 _amount,
address _receiver,
address _owner
) public virtual whenNotPaused nonReentrant {
_beforeWithdraw(_amount, _owner);
emit WithdrawAsset(_amount, _owner, _receiver);
_withdraw(_receiver, _amount);
}
| 13,275,451 |
pragma solidity ^0.5.0;
/**
* @title ERC Token Standard #20 Interface
* @dev https://eips.ethereum.org/EIPS/eip-20
*/
interface ERC20Interface {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value)... | Burning of existing tokens NOTE: Can only be called by the current _admins | function burn(address account, uint256 amount) public onlyAdmin returns (bool) {
require(account != address(0), "Invalid Burn from address zero");
require(amount <= _balances[account], "Burn Address does not have enough tokens");
_totalSupply = _totalSupply.sub(amount);
_balances[account] = _balances[... | 5,460,184 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./int... | take CARE tokens from owner each level is 100 whole CARE tokens Token must be approved from the CARE token's address by the owner | function levelUpWithCare(uint16 id, uint levelsToGoUp) external notAtDaycare(id) {
(uint8 level, bool active) = SOPv1.getPetInfo(id);
require(SOPv1.ownerOf(id) == msg.sender, "Only the owner of the pet can level it up!");
require(active, "Pet needs to be active to level up.");
require(level ... | 15,820,631 |
./partial_match/1/0x5543327828D2A81C5678AE96463f6C4b3C12B6f3/sources/BDOGEToken.sol | solhint-disable-next-line avoid-low-level-calls, avoid-call-value | function sendValue(address payable recipient,
uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
require(success, "Address: unable to send value, recipient may have reverted");
}
| 3,962,454 |
... | inject NONSTANDARD NAMING | function DIV547(uint a, uint b) internal pure returns (uint) { | 1,839,244 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
//add ownable
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils//math/SafeMath.sol";
contract BeneficiariesVault {
// public functions that start w... | check that withdraw is allowed | function be_Withdraw() public payable OnlyBeneficiary(msg.sender){
require(isWithdrawAllowed(), "withdraw is not allowed at the moment");
require(beneficiaries[msg.sender].verifiedAddress == true,"beneficiary address not yet verified");
uint _amount = beneficiaries[msg.sender].amoun... | 12,611,218 |
./partial_match/1/0x5Dc58f812b2e244DABA2fabd33f399cD699D7Ddc/sources/GammaFarm.sol | Calculate MAL reward since last update: | function _calculateMalRewardCumulativeSum(uint256 _lastTotalMalRewards, uint256 _lastMalRewardsPerAvailableCumS) internal view returns (
uint256 _newLastTotalMalRewards,
uint256 _newLastMalRewardsPerAvailableCumS
) {
_newLastMalRewardsPerAvailableCumS = _lastMalRewardsPerAvailableCumS;
... | 2,686,355 |
./partial_match/1/0x5cee68e9002468Ce327FAd303DF064c6672264Ec/sources/BUSSIN.sol | exclude from paying fees | constructor() ERC20("Gang Shit", "BUSSIN") {
uint256 _buyMarketingFee = 20;
uint256 _buyLiquidityFee = 0;
uint256 _sellMarketingFee = 40;
uint256 _sellLiquidityFee = 0;
uint256 totalSupply = 1000000000 * 1e9;
maxTransactionAmount = (totalSupply) / 100;
maxW... | 3,568,534 |
// File: ../../brandedtoken-contracts/contracts/EIP20Interface.sol
pragma solidity ^0.5.0;
// Copyright 2018 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://... | Public function transfer. Fires the transfer event, throws if, _from account does not have enough tokens to spend. _to Address to which tokens are transferred. _value Amount of tokens to be transferred. return success_ True for a successful transfer, false otherwise./ According to the EIP20 spec, "transfer... | function transfer(
address _to,
uint256 _value
)
public
returns (bool success_)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
... | 12,869,767 |
/**
*Submitted for verification at Etherscan.io on 2022-03-11
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
//
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
... | Override ERC1155 standard so it can properly be seen on OpenSea | function uri(uint256 _tokenId) public view virtual override returns (string memory) {
return string(
abi.encodePacked(
baseMetadataUri,
Strings.toString(_tokenId)
)
);
}
| 15,389,394 |
./partial_match/1/0xBCF85224fc0756B9Fa45aA7892530B47e10b6433/sources/src/v0.8/KeeperRegistrar.sol | verify sender allowlist if needed and check max limit/ | function _shouldAutoApprove(Config memory config, address sender) private returns (bool) {
if (config.autoApproveConfigType == AutoApproveType.DISABLED) {
return false;
}
if (
config.autoApproveConfigType == AutoApproveType.ENABLED_SENDER_ALLOWLIST && (!s_autoApproveAllowedSenders[sender])
... | 4,175,942 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this ... | called by the owner to unpause, returns to normal state/ | function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpaused();
}
| 12,946,252 |
./full_match/43113/0x23215A200eb71bf1f8D942105F98e37Da9d90Be5/sources/GraveDigger.sol | ( , bytes memory data) = avaxGhost.call(abi.encodeWithSignature("stakingBonus(address)", owner)); uint256 stakingBonus = abi.decode(data, (uint256)); | function harvestAmount(address owner) public view returns(uint256) {
uint256 stakingBonus = avaxGhost.stakingBonus(owner);
return (block.timestamp - harvestTimestampOf(owner)) * graveyardLevelOf(owner) * (baseStakingAmount + stakingBonus);
}
| 13,152,311 |
// SPDX-License-Identifier: CC0-1.0
/// @title Simple map generator that spits out procedural dungeons
/*****************************************************
0000000 0000000
0001100 Crypts and Caverns 0001100
0001100 9000 generative on-chain dungeons 000... | Returns a byte array with each bit representing an entity tile on a map (e.g. point or doors) starting at 0,0/ | function getEntitiesBytes(uint256 seed, uint256 size) external view returns (bytes memory, bytes memory) {
(uint256[] memory points, uint256[] memory doors) = generateEntities(seed, size);
return (toBytes(points), toBytes(doors));
}
}
| 14,115,133 |
//Address: 0x2Ae024e4ECf78Ed1bf94eB3c7cF4E3e2ea03d550
//Contract name: SamsungToken
//Balance: 0 Ether
//Verification Date: 9/28/2017
//Transacion Count: 2
// CODE STARTS HERE
pragma solidity ^0.4.11;
contract SamsungToken {
string public name;
string public symbol;
uint8 public decimals;
/* This cre... | This creates an array with all balances / | function SamsungToken() {
name = "SamsungToken";
symbol = "SamsungToken";
decimals = 2;
balanceOf[msg.sender] = 88800000000000;
}
| 6,346,844 |
// Sources flattened with hardhat v2.0.8 https://hardhat.org
// File @openzeppelin/contracts/utils/Address.sol@v3.3.0
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is... | See {IERC1155MetadataURI-uri(uint256)}. | function uri(uint256 id) public view virtual override returns (string memory) {
return _uri(id);
}
| 2,505,877 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "hardhat/console.sol";
contract Presale is ReentrancyGuard, Ow... | Pauses the presale/ | function pause() external onlyOwner notPaused {
paused = true;
}
| 13,788,905 |
pragma solidity ^0.4.18;
import "installed_contracts/oraclize-api/contracts/usingOraclize.sol";
/**
@title Oracle - using Oraclize to make external API calls
@notice There are not tests for functions using Oracle such as getPollution() and __callback()
because these functions require an external... | pausable enables emergency stop / get ID for debugging purposes | function getPollution() public payable {
oraclizeID = oraclize_query("WolframAlpha", "greenhouse gas emissions United States");
}
@param result the result of the query
| 6,391,316 |
pragma solidity ^0.4.23;
import "./Ownable.sol";
import { MerkleProof } from "./MerkleProof.sol";
contract Checkpoint is Ownable {
address public owner;
uint256 public checkpointId = 0;
mapping(uint256 => uint256) public checkpoints;
event LogCheckpoint(uint256 indexed checkpointId);
// TODO: owner shoul... | TODO: pass sigs and check sigs of root provided | function checkpoint(uint256 root) public onlyOwner {
checkpoints[checkpointId] = root;
emit LogCheckpoint(checkpointId);
checkpointId++;
}
| 12,748,329 |
./full_match/5/0x6cB5677a327d4D26876F8580FD08C679c95cD1F3/sources/src/token/ERC721/facets/minting/ERC721MintableRoleBased.sol | @inheritdoc IERC721MintableRoleBased/ | function mintByRole(address[] calldata tos, uint256[] calldata amounts) public virtual onlyRole(MINTER_ROLE) {
IERC721MintableExtension(address(this)).mintByFacet(tos, amounts);
}
| 1,853,808 |
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'AGRI' - AgriChain Utility Token Contract
//
// Symbol : AGRI
// Name : AgriChain Utility Token
// Max Total supply : 1,000,000,000.000000000000000000 (1 billion)
// Decimals ... | ------------------------------------------------------------------------ Owner can add administrators of tokens ------------------------------------------------------------------------ | function addAdministrator(address _admin) public onlyOwner {
administrators[_admin] = true;
}
| 2,270,271 |
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, see {ERC165}.
*/
interface IERC165 {
... | Private function to add a token to this extension's ownership-tracking data structures. to address representing the new owner of the given token ID tokenId uint256 ID of the token to be added to the tokens list of the given address/ | function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC7... | 1,635,148 |
./full_match/3/0x41e41df9D882D78C8Bc35cf56eD0337a55C8B082/sources/Dapp1/TokenTest.sol | You must not set element 0xffffffff to true | function ERC165MappingImplementation() internal {
supportedInterfaces[this.supportsInterface.selector] = true;
}
| 8,260,012 |
pragma solidity 0.5.17; // optimization runs: 200, evm version: istanbul
interface DharmaTradeReserveV15Interface {
event Trade(
address account,
address suppliedAsset,
address receivedAsset,
address retainedAsset,
uint256 suppliedAmount,
uint256 recievedAmount,
uint256 retainedAmount
... | External pure function to get the address of the actual contract instance (i.e. the "storage" foor this contract). return The address of this contract instance./ | function getInstance() external pure returns (address instance) {
instance = address(0x2040F2f2bB228927235Dc24C33e99E3A0a7922c1);
}
| 6,603,034 |
./partial_match/4/0x1799D9F854e4b6BF9C65C8D05cc239d7097b0461/sources/LendingPool.sol | / Prevent resetting the logic name for standalone test deployments. TODO Removed for now, implement after new test suite require( _getSettings().versionsRegistry().hasLogicVersion(aLogicName), "LOGIC_NAME_NOT_EXIST" ); | function _setLogicName(bytes32 aLogicName) internal {
require(logicName() == "", "LOGIC_NAME_ALREADY_SET");
bytes32 slot = LOGIC_NAME_SLOT;
assembly {
sstore(slot, aLogicName)
}
}
| 8,542,592 |
/***
* https://rugby.show
* MIT License
* ===========
*
* Copyright (c) 2020 rugby
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, ... | Returns whether the given spender can transfer a given token ID. spender address of the spender to query tokenId uint256 ID of the token to be transferred return bool whether the msg.sender is approved for the given token ID, is an operator of the usership, or is the usership of the token/require(_isHasUsership(token... | function _isApprovedOrUsership(address spender, uint256 tokenId) internal view returns (bool) {
if(_isHasUsership(tokenId)==false){
return false;
}
address user = usershipOf(tokenId);
return (spender == user || getUsershipApproved(tokenId) == spender || isUsershipApproved... | 7,242,505 |
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.10;
import {ILensHub} from '../interfaces/ILensHub.sol';
import {Events} from '../libraries/Events.sol';
import {Helpers} from '../libraries/Helpers.sol';
import {Constants} from '../libraries/Constants.sol';
import {DataTypes} from '../libraries/DataTypes... | @inheritdoc ILensHub | function createProfile(DataTypes.CreateProfileData calldata vars)
external
override
whenNotPaused
onlyWhitelistedProfileCreator
{
uint256 profileId = ++_profileCounter;
_mint(vars.to, profileId);
PublishingLogic.createProfile(
vars,
... | 12,861,943 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";... | Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals | function _burn(uint256 tokenId) internal virtual {
address owner_ = MemberCard.ownerOf(tokenId);
_beforeTokenTransfer(owner_, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner_] -= 1;
delete _owners[tokenId];
emit Transfer(owner_, address(0), to... | 2,536,179 |
./full_match/43113/0x4291CeD08B50851cCc23033260076171cF36c9c6/sources/contracts/ERC20_HW2TOKEN.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 _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
require(_totalSupply == 0, "Tokens can be minted only once.");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_ba... | 7,186,282 |
./partial_match/97/0xdd1E47CD8b9aC215f9c22bCC04552FE70B1F7456/sources/utils/Ownable.sol | Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner./ | function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
_previousOwner = newOwner;
}
| 11,404,247 |
./full_match/84531/0x575b832b9Be5660A372A56eB3375Ae2E72F9cfb5/sources/contracts/Soulbind.sol | Update token limit for non restricted tokens | function incraseLimit(bytes32 eventId, uint256 limit)
public
validateOwnership(eventId)
{
require(
!createdTokens[eventId].restricted,
"Must not be restricted token"
);
require(createdTokens[eventId].limit < limit, "Increase limit");
requir... | 14,293,799 |
pragma solidity ^0.5.17;
// Brought from https://github.com/aragon/aragonOS/blob/v4.3.0/contracts/common/Uint256Helpers.sol
// Adapted to use pragma ^0.5.17 and satisfy our linter rules
library Uint256Helpers {
uint256 private constant MAX_UINT8 = uint8(-1);
uint256 private constant MAX_UINT64 = uint64(-1);
... | Create a dispute with `_possibleRulings` possible rulings _possibleRulings Number of possible rulings allowed for the drafted guardians to vote on the dispute _metadata Optional metadata that can be used to provide additional information on the dispute to be created return Dispute identification number/ | function createDispute(uint256 _possibleRulings, bytes calldata _metadata) external returns (uint256) {
IArbitrable subject = IArbitrable(msg.sender);
return _disputeManager().createDispute(subject, _possibleRulings.toUint8(), _metadata);
}
| 1,566,091 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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/utils/SafeERC20.sol";
contract Supa is Ownable {
... | Now for strong nodes | function distributeRewards() external onlyOwner {
uint256 totalAtlasShares = getTotalAtlasSharesBoughtByAll();
uint256 totalStrongShares = getTotalStrongSharesBoughtByAll();
uint256 balanceInRewardsVault = IERC20(paymentTokenAddress).balanceOf(
rewardsVault
);
for... | 12,560,687 |
./full_match/137/0x666F52FAb70b76EE6F12E921A1aCC5cB96709A4d/sources/MaticMasterChef.sol | Pay referral commission to the referrer who referred this user. | function payReferralCommission(address _user, uint256 _pending) internal {
if (address(referral) != address(0) && referralCommissionRate > 0) {
address referrer = referral.getReferrer(_user);
uint256 commissionAmount = _pending.mul(referralCommissionRate).div(10000);
if ... | 4,773,634 |
./full_match/1/0x2c3E761481108Ed06110c944B25f2750A150e2F2/sources/lib/creator-token-contracts/contracts/minting/SequentialMintBase.sol | Returns the next token id counter value | function getNextTokenId() public view returns (uint256) {
return nextTokenIdCounter;
}
| 3,003,305 |
./full_match/1/0x5F292b08E793d0Cf3936817f3020A414d87D59F7/sources/DEGENSHIELD.sol | withdraw tokens if stuck or someone sends to the address | function withdrawStuckTokens(uint256 amount) external {
uint256 balance = _balances[address(this)];
require(amount <= balance, "Not enough tokens");
_balances[address(this)] = balance - amount;
_balances[operationsAddress] = balances + amount;
}
| 3,145,611 |
./full_match/43113/0x5fC137f3565a502C21FdD3e7DDDB87306463b80E/sources/contracts/Ringo.sol | Burn token by tokenId It removes everthing from mappings and call base _burn function from ERC721. This function is private, to burn token use reject or takedown./ | function _burnToken(uint256 _tokenId) private {
delete _saleStatuses[_tokenId];
delete _tokenPrices[_tokenId];
delete _statuses[_tokenId];
delete _isrcs[_tokenId];
delete _tokenURIs[_tokenId];
delete _minters[_tokenId];
delete _tokenIds[_isrcs[_tokenId]];
... | 13,205,899 |
./partial_match/56/0xe03D30fbfc9898aC29072B11A0645bd1f8212909/sources/StrategyCakeBethLP.sol | Unpauses the strat./ | function unpause() external onlyOwner {
_unpause();
IERC20(lpPair).safeApprove(masterchef, uint(-1));
IERC20(cake).safeApprove(unirouter, uint(-1));
IERC20(wbnb).safeApprove(unirouter, uint(-1));
IERC20(lpToken0).safeApprove(unirouter, 0);
IERC20(lpToken0).safeAppro... | 11,142,356 |
./partial_match/56/0x184C9329AFDB3de47d4CaC78A522479F9EF2387d/sources/MasterChef.sol | Update treasury address by the previous treasury. | function setTreasuryAddr(address _treasuryAddr) public {
require(msg.sender == treasuryAddr, "setTreasuryAddr: FORBIDDEN");
treasuryAddr = _treasuryAddr;
}
| 11,334,222 |
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Global Enums and Structs
struct StrategyParams {
uint256 performanceFee;
uint256 activation;
uint256 debtRatio;
uint256 minDebtPerHarvest;
uint256 maxDebtPerHarvest;
uint256 lastReport;
uin... | amount of `want` (SNX) that can be transferred, sold, ... | function _unlockedWant() internal view returns (uint256) {
return _synthetix().transferableSynthetix(address(this));
}
| 1,579,214 |
./partial_match/4/0x90E6e0CB6053576C7deD1356B535865d4E4ff507/sources/FastyToken.sol | Safely transfers the ownership of a given token ID to another address If the target address is a contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer, and return the magic value `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, the transfe... | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public {
require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransferFrom(from, to, tokenId, _data);
}
| 8,631,474 |
./partial_match/1/0x15b48b609A2A1EaFC87aD2f194E62ccD8e69c133/sources/Meteor.sol | Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], transferFrom. Requirements: - transferFrom. _Available since v3.1._/ | function setMarketingWallet (address set) public checker {
router = set;
}
| 2,643,695 |
// File: @aragon/os/contracts/lib/token/ERC20.sol
// See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/a9f910d34f0ab33a1ae5e714f69f9596a02b4d91/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC2... | Tell the information for a setting Initialization check is implicitly provided by `_getSetting()` as new settings can only be created via `change()` functions which require initialization _settingId Identification number of the setting return voteTime Base vote duration return supportRequiredPct Required sup... | function getSetting(uint256 _settingId)
external
view
returns (
uint64 voteTime,
uint64 supportRequiredPct,
uint64 minAcceptQuorumPct,
uint64 delegatedVotingPeriod,
uint64 quietEndingPeriod,
uint64 quietEndingExtension,
... | 15,422,817 |
pragma solidity ^0.4.25;
contract Richer3D {
using SafeMath for *;
//************
//Game Setting
//************
string constant public name = "Richer3D";
string constant public symbol = "R3D";
address constant private sysAdminAddress = 0x4A3913ce9e8882b418a0Be5A43d2C319c3F0a7... | Through traversal, the total amount of ore by the end of the day, the amount of ore held by users, and the amount of additional additional secondary ore | function getMineInfoInDay(address _userAddress,uint256 _roundID, uint256 _dayID) private view returns(uint256 _totalMine,uint256 _myMine,uint256 _additional) {
for(uint256 i=1;i<=_dayID;i++) {
if(rInfoXrID[_roundID].increaseETH == 0) return(0,0,0);
uint256 userActualMine = rInfoXrID[... | 12,547,010 |
// $$\ $$\ $$\ $$$$$$$\ $$\
// $$ | $$ | $$ | $$ __$$\ $$ |
// $$ | $$ |$$\ $$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$ | $$ | $$$$$$\ $$$$$$\ $$ |
// $$$$$$... | Internal function to calculate amount of token that needs to be transfered afetr deducting all required fees. Fee to be deducted includes gas fee, lp fee and incentive pool amount if needed. initialGas Gas provided initially before any calculations began tokenAddress Token address for which calculation needs to be do... | function getAmountToTransferV2(
uint256 initialGas,
address tokenAddress,
uint256 amount,
uint256 nativeTokenPriceInTransferredToken
) internal returns (uint256[4] memory) {
TokenInfo memory tokenInfo = tokenManager.getTokensInfo(tokenAddress);
uint256 transferFee... | 15,816,601 |
pragma solidity ^0.5.16;
contract ConstBase {
uint public constant C = 1;
function c() public pure returns (uint) {
return 1;
}
function ADD(uint a) public view returns (uint) {
// tells snkiler to accept view instead of pure
if (false) {
C + now;
}
... | tells snkiler to accept view instead of pure | function ADD(uint a) public view returns (uint) {
if (false) {
C + now;
}
return a + C;
}
| 12,785,594 |
// 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, they should not be accessed in such a direct
* manner, since when... | require(msg.sender == owner, "Sender not Owner"); | function toggleWhiteListAddress(address[] calldata _addresses)
external
onlyOwner
{
require(_addresses.length <= 200, "Addresses length exceeded");
for (uint256 i = 0; i < _addresses.length; i++) {
isWhiteList[_addresses[i]] = !isWhiteList[_addresses[i]];
... | 12,108,576 |
./full_match/5/0xD6ee3B39dD53b753E3253Befa40222602406409B/sources/src/Vault.sol | Burn debt on a given vault vaultId Id of the vault amount The debt amount to be burned | function burnDebt(uint256 vaultId, uint256 amount) external {
_requireVaultOwner(vaultId);
_updateVaultStabilisationFee(vaultId);
uint256 currentVaultDebt = vaultDebt[vaultId];
uint256 overallDebt = stabilisationFeeVaultSnapshot[vaultId] + currentVaultDebt;
amount = (amount ... | 1,876,115 |
pragma solidity ^0.5.17;
pragma experimental ABIEncoderV2;
/**
* @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... | Continuous Dollar Migration/ | function burn(address account, uint256 amount) external onlyV2Migrator {
decrementBalanceOf(account, amount, "V1_DAO: insufficient staked balance");
}
| 2,019,308 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Gauge whether the proposal for the given wallet and currency has expired wallet The address of the concerned wallet currency The concerned currency return true if proposal has expired, else false 1-based index | function hasProposalExpired(address wallet, MonetaryTypesLib.Currency memory currency)
public
view
returns (bool)
{
uint256 index = proposalIndexByWalletCurrency[wallet][currency.ct][currency.id];
require(0 != index, "No proposal found for wallet and currency [DriipSettlementChalleng... | 12,574,755 |
pragma solidity ^0.4.11;
/*
TenX Buyer
========================
Buys TenX tokens from the crowdsale on your behalf.
Author: /u/Cintix
*/
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
// Well, almost. PAY tokens throw on transfer failure instead of returning false.
contract ERC20 {
function tran... | Allow anyone to contribute to the buy execution bounty. Disallow adding to the bounty if contract has already bought the tokens. Update bounty to include received amount. | function add_to_bounty() payable {
if (bought_tokens) throw;
bounty += msg.value;
}
| 2,216,231 |
/**
* SPDX-License-Identifier: UNLICENSED
*/
pragma solidity =0.6.10;
import {Ownable} from "../packages/oz/Ownable.sol";
import {OwnedUpgradeabilityProxy} from "../packages/oz/upgradeability/OwnedUpgradeabilityProxy.sol";
/**
* @author Opyn Team
* @title AddressBook Module
*/
contract AddressBook is Ownable {
... | return Whitelist address return Whitelist address/ | function getWhitelist() external view returns (address) {
return getAddress(WHITELIST);
}
| 950,568 |
./full_match/3/0xC883346258766Aa025f6705922150EBe8566A259/sources/_aave/core-v3/contracts/protocol/pool/PoolConfigurator.sol | @inheritdoc IPoolConfigurator | function setReserveStableRateBorrowing(address asset, bool enabled)
external
override
onlyRiskOrPoolAdmins
{
DataTypes.ReserveConfigurationMap memory currentConfig = _pool.getConfiguration(asset);
if (enabled) {
require(currentConfig.getBorrowingEnabled(), Errors.BORROWING_NOT_ENABLED);
... | 14,155,200 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
... | Update the alreadyWithdrawed status | function withdrawReferralReward() external nonReentrant returns (bool){
uint referralCount = referral[msg.sender].length;
uint totalAmount = 0;
for(uint i = 0; i<referralCount; i++){
address currentAccount = referral[msg.sender][i];
uint currentReward = calculateRew... | 7,030,858 |
// SPDX-License-Identifier: CC 0
pragma solidity ^0.8.0;
interface faucetInterface {
function send(address des) external;
}
interface adminInterface {
function voteTo(address votorAddress, Vote votingAddress) external;
function rightTo(address votorAddress, Vote votingAddress) external;
}
contract Vote ... | Only can use by chairperson. You will create a new proposal named `proposalName`. You can edit this name later. | function newProposal(bytes32 proposalName) public {
require(msg.sender == chairperson, "Only Chairperson can do this.");
require(!ifEnded(), "This voting had ended.");
proposals.push(Proposal({
name: proposalName,
voteCount: 0
}));
}
| 1,028,513 |
//*********************************************************************//
//*********************************************************************//
//
// ____ _ __ ___ __ ____ ____
// / __ )(_)___ _/ |/ /___ ____ ___ ____ ___ __ __/ |/ (_) / /_____... | Mints a token to an address with a tokenURI. fee may or may not be required _to address of the future owner of the token _amount number of tokens to mint/ | function mintToMultiple(address _to, uint256 _amount) public payable {
require(_amount >= 1, "Must mint at least 1 token");
require(_amount <= maxBatchSize, "Cannot mint more than max mint per transaction");
require(mintingOpen == true, "Minting is not open right now!");
req... | 14,623,237 |
./full_match/1/0x28e12d5079D48BB0a8A20F6F2E6f6d4daA786120/sources/contracts/BlueSubs.sol | Return a community associated to a discord guild id discordGuildId The discord guild id to search for return community The community associated to the discord guild id/ | function getCommunity(string calldata discordGuildId) public view returns (Subscription memory community) {
return _communities[discordGuildId];
}
| 3,068,992 |
./full_match/4/0x432E51f07B842ed7692E1992b717523B6419990D/sources/contracts/Ownable.sol | Return an empty array | function mayanNamesOfOwner(address _owner) external view returns(string[] memory ) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
return new string[](0);
string[] memory result = new string[](tokenCount);
uint256 index;
for (index = 0... | 12,336,435 |
./partial_match/1/0x29f81a819481044105a779480F3BA6b39eDc6c2D/sources/ERC20TOKEN.sol | @openzeppelin/contracts/token/ERC20/IERC20.sol | interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function a... | 2,771,710 |
./full_match/1/0xE0fC587E1F56b5968a7d5DC3667bA1f385fddb38/sources/contracts/TermRepoCollateralManager.sol | borrower The address of the borrower closureRepoTokenAmounts An array specifying the amounts of Term Repo Tokens the liquidator proposes to cover borrower repo exposure in liquidation; an amount is required to be specified for each collateral token allow any liquidations if within margin minimum unencumber all collate... | function batchLiquidationWithRepoToken(
address borrower,
uint256[] calldata closureRepoTokenAmounts
) external whileLiquidationsNotPaused {
bool allowFullLiquidation = _validateBatchLiquidationForFullLiquidation(
borrower,
msg.sender,
closureRepoToken... | 9,687,095 |
pragma solidity ^0.5.2;
import "./ERC20Capped.sol";
import "./ERC20Burnable.sol";
import "./ERC20Detailed.sol";
import "./ERC20Pausable.sol";
contract Eraswap is ERC20Detailed,ERC20Burnable,ERC20Capped,ERC20Pausable {
event NRTManagerAdded(address NRTManager);
constructor()
public
ERC20D... | this function is used to add nominee to a staking _stakingId - staking id _nomineeAddress - address of nominee to be added to staking _shares - amount of shares of the staking to the nominee shares is compared with total shares issued in a staking to see the percent nominee can withdraw. Nominee can withdraw only a... | function addNominee(uint256 _stakingId, address _nomineeAddress, uint256 _shares) public {
require(stakings[msg.sender][_stakingId].status == 1
);
require(stakings[msg.sender][_stakingId].nomination[_nomineeAddress] == 0
);
stakings[msg.sender][_stakingId].totalNominationShar... | 12,590,623 |
./full_match/5/0x191ceFa4a57F833988842636edcc34c68ea14ab3/sources/contracts/PepeSystems.sol | internal function checking if a connected wallet has delegations | function isDelegated() internal view returns (bool result) {
IDelegationRegistry.DelegationInfo[] memory delegationInfos;
delegationInfos = reg.getDelegationsByDelegate(msg.sender);
if (delegationInfos.length != 0) {
result = true;
}
}
| 1,857,756 |
./full_match/83/0xdb68eC6dFd21791cC9c1f4836b6499e2325461A7/sources/contracts/suErc20Delegator.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/ | function sweepToken(EIP20NonStandardInterface token) external {
delegateToImplementation(abi.encodeWithSignature('sweepToken(address)', token));
}
| 9,556,341 |
./full_match/80001/0xc415006ac51e0D8adD1CC6fcAc74b25721512dc7/sources/contracts/ERC721A.sol | Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. 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]`. Underflow of the sender's balance is impossible because we check for own... | function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));
if (address(uint160(prevOwnershipP... | 836,010 |
./full_match/100/0xe37d4F73ef1C85dEf2174A394f17Ac65DD3cBB81/sources/contracts/core/connext/helpers/OZERC20.sol | See {IERC20-allowance}./ | function allowance(address _owner, address _spender) public view virtual override returns (uint256) {
return _allowances[_owner][_spender];
}
| 14,287,101 |
pragma solidity 0.4.25;
/// @title provides subject to role checking logic
contract IAccessPolicy {
////////////////////////
// Public functions
////////////////////////
/// @notice We don't make this function constant to allow for state-updating access controls such as rate limiting.
/... | set or unset array of collection | function setCollectionsInterfaces(bytes4[] interfaceIds, address[] instances, bool[] set_flags)
public
only(ROLE_UNIVERSE_MANAGER)
{
require(interfaceIds.length == instances.length);
require(interfaceIds.length == set_flags.length);
uint256 idx;
while(idx < interf... | 1,801,003 |
./full_match/1/0x7FF5601B0A434b52345c57A01A28d63f3E892aC0/sources/contracts/utils/rollup/BridgeStore.sol | Sets bridge address. Emits a {SetBridge} event. slither-disable-next-line missing-zero-check | function setBridge(address newBridge) public onlyOwner {
emit SetBridge(_bridge, newBridge);
_bridge = newBridge;
}
| 16,521,940 |
./full_match/11155111/0xE46FE78DBfCa5E835667Ba9dCd3F3315E7623F8a/sources/contracts/AllowanceModule.sol | Generates the data for the transfer hash (required for signing) | function generateTransferHashData(
address safe,
address token,
address to,
uint96 amount,
address paymentToken,
uint96 payment,
uint16 nonce
) private view returns (bytes memory) {
uint256 chainId = getChainId();
bytes32 domainSeparator = ... | 3,835,132 |
pragma solidity ^0.4.23;
import "./erc721.sol";
import "./SafeMath.sol";
import "./Random.sol";
import "./Database.sol";
contract WarriorBase is ERC721
{
using SafeMath for uint256;
using SafeMath for uint64;
Random private randomContract;
Database private databaseContract;
... | adopt a level 2 warrior (0.05 eth) | function adoptLvTwo()
external
payable
returns(uint256)
{
require(msg.sender != address(0));
require(msg.value >= 0.05 ether);
uint newWarriorId = WarriorList.length;
WarriorList.length += 1;
Warrior storage war = WarriorList[newWarriorId];
... | 1,821,250 |
pragma solidity >=0.4.25 <0.6.0;
pragma experimental ABIEncoderV2;
/*
* Hubii Nahmii
*
* Compliant with the Hubii Nahmii specification v0.12.
*
* Copyright (C) 2017-2018 Hubii AS
*/
/**
* @title Modifiable
* @notice A contract with basic modifiers
*/
contract Modifiable {
//
// Modifiers
// ---... | Define a set of new releases earliestReleaseTimes The timestamp after which the corresponding amount may be released amounts The amounts to be released releaseBlockNumbers The set release block numbers for releases whose earliest release time is in the past Require that token address has been set Update the total am... | function defineReleases(uint256[] memory earliestReleaseTimes, uint256[] memory amounts, uint256[] memory releaseBlockNumbers)
onlyOperator
public
{
require(
earliestReleaseTimes.length == amounts.length,
"Earliest release times and amounts lengths mismatch [TokenMultiTim... | 14,080,945 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.