file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
./partial_match/1/0xFFc132BE5F3eADc426F21cf9055232d173D5F0D6/sources/Dollar.sol | Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used to e.g. set automatic allowances for certain subsystems, etc. Emits an {Approval} event. Requirements: - `owner` cannot be the zero address. - `spender` cannot be the zero address.... | function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount.subs(1);
emit Approval(owner,... | 4,002,568 |
./full_match/4/0x0b08f24c0346337837C7B4031c531F4E2E4087Fa/sources/mynft.sol | See {IERC721Metadata-symbol}./ | function symbol() public view virtual override returns(string memory) {
return _symbol;
}
| 720,677 |
./full_match/137/0x5dE8baA77325EC8B6f0682cC1DC0f799596d8Cbc/sources/Pool/AdvancePool.sol | return Deposit Fee amount/ | function getDepositFee()
public view
returns (uint256)
{
return DEPOSIT_FEE;
}
| 4,765,459 |
./partial_match/1/0xF818351212Be39a6D1BbD6Be29b86fCeD41C4aD8/sources/project:/contracts/TokenAuction.sol | / for later version: if sender is the highest bidder try to start grace period and do not allow to cancel bid during grace period (+ 2 times preferred liquidator delay) if (msg.sender == getMaxOfferor(_mToken)) { ( , , address _mTokenAddress) = mtroller.parseToken(_mToken); MERC721Interface(_mTokenAddress).st... | function cancelOffer(
uint240 _mToken
)
public
nonReentrant
{
uint256 _oldOffer = cancelOfferInternal(_mToken, msg.sender);
refunds[msg.sender] += _oldOffer;
emit AuctionOfferCancelled(_mToken, msg.sender, _oldOffer);
}
offers for that _mToken... | 4,186,047 |
//Address: 0xeaa76f1f32ced565c78bf1d57546002a0b0d9684
//Contract name: Crowdsale
//Balance: 0 Ether
//Verification Date: 3/26/2018
//Transacion Count: 41
// CODE STARTS HERE
pragma solidity 0.4.21;
library SafeMath {
function mul(uint a, uint b) internal pure returns(uint) {
uint c = a * b;
as... | Allows the current owner to transfer control of the contract to a newOwner. _newOwner The address to transfer ownership to./ | function transferOwnership(address _newOwner) public onlyOwner {
require(address(0) != _newOwner);
newOwner = _newOwner;
}
| 5,503,278 |
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
library RightsManager {
struct Rights {
bool canPauseSwapping;
bool canChangeSwapFee;
bool canChangeWeights;
bool canAddRemoveTokens;
bool canWhitelistLPs;
bool ca... | Transfer v1 BPTs to proxy Exit v1 pool Approve each token to v2 vault | function migrateAll(
Vault vault,
BPool poolIn,
uint poolInAmount,
uint[] calldata tokenOutAmountsMin,
BalancerPool poolOut,
uint poolOutAmountMin
) external {
address[] memory tokens = poolIn.getFinalTokens();
(address[] memory outTokens,,) = vaul... | 6,007,980 |
./partial_match/1/0x5648DFBDBd74F91D01B454aee0D11CEbc60810B4/sources/WebQDeployer.sol | Special NFT badges will be rewarded to initial donors to Web-Q.Foundation, {ownerOf} function is for compatiblity with tokenGated ERC721 SeaDrop contract, in order to remeber donors eligible to receive special NFT badges. Only allowedMinter can mint the corresponding NFT. Note that the snapshot of total donation is... | function ownerOf(uint256 mintId) external view returns (address allowedMinter){
allowedMinter = allowedMinterForMintId[mintId];
}
| 15,674,522 |
pragma solidity 0.4.18;
/// @title ERC Token Standard #20 Interface (https://github.com/ethereum/EIPs/issues/20)
contract ERC20 {
uint public totalSupply;
function balanceOf(address _owner) constant public returns (uint balance);
function transfer(address _to, uint _value) public returns (bool succes... | create the MarketMaker and the CC token put all the CC token in the Market Maker reserve _name string name for CC token that is created. _symbol string symbol for CC token that is created. _decimals uint8 percison for CC token that is created. _totalSupply uint256 total supply of the CC token that is created.set al... | function createCurrency(string _name,
string _symbol,
uint8 _decimals,
uint256 _totalSupply) public
returns (address) {
ColuLocalCurrency subToken = new ColuLocalCurrency(_name, _symbol, _decimals, _totalSupply... | 1,809,690 |
./full_match/5/0x2d156501F36819dA6b87cd211fFe07AE3eC254aC/sources/contracts/tradesynth.sol | Add logic here to automate reordering process (e.g., notifying suppliers) | function reorderIfNeeded(uint256 _productId) external {
require(_productId < totalProducts, "Invalid product ID");
require(products[_productId].quantity <= products[_productId].reorderThreshold, "Product quantity is sufficient");
emit ReorderNeeded(_productId);
}
| 7,076,964 |
./partial_match/56/0x938dc43522834AC5D428798c593aC62B377b4bEf/sources/CheetahProtocol.sol | Determine the prior number of votes for an account as of a block number Block number must be a finalized block or else this function will revert to prevent misinformation. account The address of the account to check blockNumber The block number to get the vote balance at return The number of votes the account had as... | function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "CHEETAH::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
retu... | 11,171,332 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
import "../external/compound/PriceOracle.sol";
import "../external/compound/CToken.sol";
import "../e... | Fetches the fair TriCrypto LP token/ETH price from Curve, with 18 decimals of precision. gauge The LiquidityGaugeV2 contract address for price retrieval./ | function _price(address gauge) internal view returns (uint) {
(uint80 roundId, int256 ethUsdPrice, , , uint80 answeredInRound) = ETH_USD_PRICE_FEED.latestRoundData();
require(answeredInRound == roundId, "Chainlink round timed out.");
return uint256(SOURCE_ORACLE.lp_price()).mul(1e8).div(uint... | 362,945 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {PercentageMath} from '../protocol/libraries/math/PercentageMath.sol';
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.... | Given an input asset amount, returns the maximum output amount of the other asset reserveIn Address of the asset to be swap from reserveOut Address of the asset to be swap to amountIn Amount of reserveIn return Struct containing the following information: uint256 Amount out of the reserveOut uint256 The price of... | function _getAmountsOutData(
address reserveIn,
address reserveOut,
uint256 amountIn
) internal view returns (AmountCalc memory) {
uint256 finalAmountIn = amountIn.sub(amountIn.mul(FLASHLOAN_PREMIUM_TOTAL).div(10000));
if (reserveIn == reserveOut) {
uint256 reserveDecimals = _getDecimals(... | 1,226,088 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { ERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { Math ... | Calculate the tree's water use %. Its value ranges from 400 to 435 (4.35% 100)! Calculate the seed own water use % from its dna. Its value can range from 0 to (2 3 - 1) 5 = 35%. | function _waterUsePercentage(TreeData storage _seed) internal view returns (uint16) {
uint16 _seedWaterUsePercentage = _traitFromDNA(_seed.dna, _treeWaterUseFactorLastBitPosition, _treeWaterUseFactorMask) * 5;
return baseWaterUsePercentage + _seedWaterUsePercentage;
}
| 12,779,366 |
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
pragma solidity ^0.5.2;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint... | Updates a damping factor to account for token butning in the dynamic rewards calculation. _account address _value Token burn amount/ | function updateOnBurn(address _account, uint _value) external onlyRewardsNotifier nonReentrant returns (bool) {
return true;
}
| 14,032,897 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import ... | Withdraw liquidity from Curve pool Calls to external contract We trust sender to send a true curve poolAddress. If it's not the case it will fail in the add_liquidity part. poolAddress Token addresses amount Quantity of LP tokens to burn in the withdrawal minAmounts Minimum amounts of underlying coins to receive | function withdraw(
address poolAddress,
uint256 amount,
uint256[N_COINS] memory minAmounts
) external onlyManager {
address lpTokenAddress = _getLPTokenAndApprove(poolAddress, amount);
uint256 lpTokenBalanceBefore = IERC20(lpTokenAddress).balanceOf(address(this));
... | 13,872,754 |
pragma solidity ^0.5.0;
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol";
import "openzeppelin-solidity/contracts/cryptography/ECDSA.sol";
import "./DepositHandler.sol";
/**
* @title WithdrawHandler
*/
contract WithdrawHandler is De... | check given nonce is valid nonce The nonce to be checked return true if given nonce is valid/ | function _isValidNonce(uint nonce) internal view returns (bool) {
return !usedNonces[nonce];
}
| 12,992,725 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./extensions/ERC721ABurnable.sol";
/*
* @title Earlies Society ERC721A Non-Fungible Token
* @dev Implementation of https://eips.ethereum... | Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _d... | function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
... | 36,018 |
/**
*Submitted for verification at Etherscan.io on 2021-11-16
*/
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: ExchangeRatesWithDexPricing.sol
*
* Latest s... | Loop through each key and check whether the data point is stale. | function anyRateIsInvalid(bytes32[] calldata currencyKeys) external view returns (bool) {
uint256 _rateStalePeriod = getRateStalePeriod();
bool[] memory flagList = getFlagsForRates(currencyKeys);
for (uint i = 0; i < currencyKeys.length; i++) {
if (flagList[i] || _rateIsStale(c... | 2,452,588 |
./full_match/137/0x1a501D800451Aa449577581229788eA5a3aFA25e/sources/contracts/Battletoken.sol | Убедимся, что _tokenAmount равен сумме токенов создателя битвы | function joinBattle(uint256 _battleId, uint256 _tokenAmount) external {
require(
battleCount.current() >= _battleId && _battleId > 0,
"TokenBattle: invalid battle id"
);
Battle storage battle = battles[_battleId];
require(
battle.status == BattleSt... | 4,715,478 |
contract CAVAsset {
function __transferWithReference(address _to, uint _value, string _reference, address _sender) returns(bool);
function __transferFromWithReference(address _from, address _to, uint _value, string _reference, address _sender) returns(bool);
function __approve(address _spender, uint _value,... | Sets platform address, assigns symbol and name. Can be set only once. _platform platform contract address. _symbol assigned symbol. _name assigned name. return success./ | function init(CAVPlatform _platform, string _symbol, string _name) returns(bool) {
if (address(platform) != 0x0) {
return false;
}
platform = _platform;
symbol = _symbol;
smbl = stringToBytes32(_symbol);
name = _name;
return true;
}
| 1,488,203 |
pragma solidity ^0.4.23;
// File: contracts/libs/ERC20.sol
interface ERC20 {
function totalSupply() external view returns (uint supply);
function balanceOf(address _owner) external view returns (uint balance);
function transfer(address _to, uint _value) external returns (bool success);
functi... | Forward to Price smart contract. | function getPrice(address tokenAddress, uint srcQty) public view returns (uint price){
require(tokenAddress != address(0));
(, price) = priceProvider.getRates(tokenAddress, srcQty);
return price;
}
| 983,853 |
pragma solidity ^0.4.13;
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
/... | getRoundData and latestRoundData should both raise "No data present" if they do not have data to report, instead of returning unset values which could be misinterpreted as actual reported values. | interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
... | 6,296,787 |
./full_match/5/0x393c146c8824Ab2a0A96cf2Ab949ab7Ded9D6238/sources/project_/contracts/TCR.sol | this will resume this contract's normal operations onlyOwner requirement | function resumeAllMotorFunctions() external setupRequired() onlyOwner() {
killSwitch = false;
}
| 1,919,669 |
pragma solidity ^0.5.16;
import "./CToken.sol";
import "./ComptrollerStorage.sol";
/**
* @title Cream's Comptroller interface extension
*/
interface ComptrollerInterfaceExtension {
function checkMembership(address account, CToken cToken) external view returns (bool);
function updateCTokenVersion(address cT... | Cream's Comptroller interface extension/ | interface ComptrollerInterfaceExtension {
function checkMembership(address account, CToken cToken) external view returns (bool);
function updateCTokenVersion(address cToken, ComptrollerV2Storage.Version version) external;
function flashloanAllowed(address cToken, address receiver, uint amount, bytes calld... | 1,264,769 |
/*
Copyright 2018 Subramanian Venkatesan, Binod Nirvan
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 ... | This feature enables the admins to withdraw Ethers held in this contract. _amount Amount of Ethers in wei to withdraw. | function withdrawFunds(uint256 _amount) external whenNotPaused onlyAdmin {
require(_amount <= address(this).balance, "The amount should be less than the balance/");
msg.sender.transfer(_amount);
emit FundsWithdrawn(msg.sender, _amount);
}
| 1,753,246 |
/*
Copyright 2018 ZeroEx Intl.
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 to in writing, ... | Fill event is emitted whenever an order is filled. Cancel event is emitted whenever an individual order is cancelled. CancelUpTo event is emitted whenever `cancelOrdersUpTo` is executed succesfully. | {
event Fill(
);
event Cancel(
);
event CancelUpTo(
);
function updateFilledState(
LibOrder.Order memory order,
address takerAddress,
bytes32 orderHash,
uint256 orderTakerAssetFilledAmount,
LibFillResults.FillResults memory fillResults
)
... | 7,273,686 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./Standards/ERC721/ERC721.sol";
import "./Interfaces/IFountainOfFortune.sol";
import "./Interfaces/IWETH.sol";
import "./Utils/Counters.sol";
import "./Chainlink/VRFConsumerBase.sol";
/**
* @title Fountain Of Fortune
* @author Myobu Devs
*/
contract Fou... | In case the Myobu token gets changed later on, the owner can call this to change it newMyobu: The new myobu token contract | function setMyobu(IERC20 newMyobu) external onlyOwner {
_myobu = newMyobu;
}
| 1,680,970 |
pragma solidity >=0.4.22 <0.6.0;
import "./ExternalStorage.sol";
contract CallingContract is ExternalStorage{
address owner = msg.sender;
address latestOwner;
modifier onlyOwner() {
require(msg.sender == latestOwner,"Only the latest owner can update");
_;
}
... | Delete Methods | function deleteUint(bytes32 _key) external onlyOwner {
delete uIntStorage[_key];
}
| 1,022,716 |
pragma solidity ^0.5.10;
contract NEST_NodeSave {
IBMapping mappingContract;
IBNEST nestContract;
... | inject NONSTANDARD NAMING | function NODEGET172() public { | 898,766 |
./full_match/1/0x7308AfC2473F7eA8284d9147e7e3D4BeD83EefB2/sources/Users/dingyp/vsCode/splitharvest/trufformat/contracts/StakeGatlingSushi.sol | 1. get earned 5. update contract rate | function updateRate() private {
uint256 earnAmount = sushiChef.pendingSushi( pid, address(this));
if( earnAmount > updatesMin && (now.sub(profitRateUpdateTime).mul(updatesPerDay) >= (1 days)) ) {
earnToken();
sellEarn2TokenTwice();
uint256 liquidity = mintLP();
... | 9,672,918 |
./full_match/11155111/0x5e7B837ACA749bf2A06947E4a411701EC0d00196/sources/src/Vault.sol | Switches the vault pause state. shutdown a new vault pause state. If "true" is passed, the vault will be paused. | function setEmergencyShutdown(bool shutdown) external onlyOwner {
shutdown ? _pause() : _unpause();
}
| 3,791,741 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
import 'OpenZeppelin/openzeppelin-contracts@4.3.0/contracts/access/AccessControl.sol';
import 'OpenZeppelin/openzeppelin-contracts@4.3.0/contracts/token/ERC20/IERC20.sol';
import 'OpenZeppelin/openzeppelin-contracts@4.3.0/contracts/token/ERC20/utils/SafeERC20.sol'... | Cancel a specific order, marking it gone to disallow anyone to trade against it. | function cancel(Order memory ord) external nonReentrant {
require(ord.maker == msg.sender, '!maker');
bytes32 mhash = makerSignHash(ord);
require(!gone[mhash], '!gone');
gone[mhash] = true;
}
| 12,700,156 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "../@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "../@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../@openzeppelin/contracts/utils/Counters.sol";
im... | Creates a raffle from an existing market item./ Transfer ownership of the token to this contract Map new Position Create RaffleData | function createItemRaffle(
uint256 itemId,
uint256 amount,
uint256 numMinutes
) public itemExists(itemId) {
address nftContract = _idToItem[itemId].nftContract;
uint256 tokenId = _idToItem[itemId].tokenId;
require(
amount <= IERC1155(nftContract).balan... | 2,503,665 |
./partial_match/1/0x0571Fa5dfe71964D20C9dac14b7d6ab01735e95f/sources/Shillionaire.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Shillionaire", "$hill") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pai... | 4,006,703 |
./full_match/1/0xF8d90272A141E54129C96C69ECca2acDA69E9B16/sources/browser/MasterChef.sol | Update lottery address by the previous lottery. | function updateLottery(address _lottery) public {
require(msg.sender == lottery, "lottery: wut?");
lottery = _lottery;
}
| 3,050,783 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
/**
* Extremely simple, NOT FOR PRODUCTION, simulation for supply chain shipment notifications.
*
* The mock shipment scenario is that there are several shipping center locations registered as "suppliers".
* Each supplier is registered by the authority t... | Get recorded witness data for an item and specific witness address./ | function getWitnessInfo(uint256 itemID, address witness) public view returns(bytes32, uint256) {
ShipmentTracking storage history = receivedShipments[itemID];
WitnessRecord storage rec = history.witnessRecords[witness];
return (rec.nameHash, rec.supplier);
}
| 15,805,979 |
//Address: 0xedc77f347a7dbdba2319e86ef5681535f8da75e0
//Contract name: PresaleSecond
//Balance: 0 Ether
//Verification Date: 5/18/2018
//Transacion Count: 348
// CODE STARTS HERE
pragma solidity 0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
... | 어떤 모종의 이유로 환불 절차를 밟아야 하는 경우를 상정하여 만들어놓은 안전장치입니다. This exists for safety when we have to run refund process by some reason. | function refund(address _addr)
external
returns (bool)
{
require(!ignited && !finalized);
require(_addr != address(0));
if(buyers[_addr] == 0) return false;
uint256 refundAmount = buyers[_addr];
buyers[_addr] = 0;
_addr.transfer(refundAmount);
... | 1,770,831 |
./partial_match/1/0xf55D5E761B6FE3f43E55874cE2973CAC575d16c7/sources/contracts/LendingPool.sol | take out current APR fees from amount borrowing | function _borrow(
address _wallet,
uint256 _tokenId,
uint256 _amountETH
) internal returns (uint256) {
require(enabled, 'BORROW: not enabled');
_validateLoanOwner(_wallet, _tokenId);
Loan storage _loan = loans[_tokenId];
require(whitelistPools[_loan.collateralPool], 'BORROW: bad pool');... | 9,207,775 |
// SPDX-License-Identifier: MIT
/*
* TheBodega.sol
*
* Created: February 4, 2022
*
* Price: 0.088 ETH
*
* - 535 total supply
* - Pause/unpause minting
* - Limited to 3 mints per wallet
* - Whitelist restricted to Plug hodlers
*/
pragma solidity ^0.8.0;
import "./ERC721A.sol";
import "./access/Pausable.sol"... | See {ERC721A16-_baseURI} | function _baseURI() internal view virtual override returns (string memory)
{
return _baseTokenURI;
}
| 1,351,622 |
pragma solidity 0.8.6;
//SPDX-License-Identifier: MIT
import "./IERC20.sol";
import "./Ownable.sol";
import "./Context.sol";
/**
* @dev Token Offering, including token Offering and sale withdrawal:
*
*/
contract CitizenChatOffering is Context, Ownable {
bool public isSaleActive;
bool public isWithdrawalE... | setSubscriberRate function that sets subscriberRate/ | function setSubscriberRate(uint256 rate) public onlyOwner {
subscriberRate = rate;
}
| 10,385,013 |
pragma solidity ^0.5.16;
import "./CToken.sol";
/**
* @title Compound's CErc20 Contract
* @notice CTokens which wrap an EIP-20 underlying
* @author Compound
*/
contract CErc20 is CToken, CErc20Interface {
/**
* @notice Initialize the new money market
* @param underlying_ The address of the underlyin... | Set cToken IRM cToken The cToken address newInterestRateModel The new IRM address/ | function _setInterestRateModel(address cToken, InterestRateModel newInterestRateModel) external onlyAdmin returns (uint) {
return CTokenInterface(cToken)._setInterestRateModel(newInterestRateModel);
}
| 12,177,647 |
/**
*Submitted for verification at Etherscan.io on 2020-12-20
*/
pragma solidity ^0.6.0;
/*
Combines are no longer just for farms.
It must be five o'clock somewhere.
I am never at home on Sundays.
It dawned on her that others could make her happier, but only she could make herself happy.
*/
/*There ... | All she wanted was the answer, but she had no idea how much she would hate it./ | function _msgData() /*There have been days when I wished to be separated from my body, but today wasn’t one of those days.*/internal view virtual returns (bytes memory) {/*All she wanted was the answer, but she had no idea how much she would hate it.*/
return msg.data;/*All she wanted was the answer, but sh... | 2,101,222 |
pragma solidity ^0.4.24;
// ****************************************************************************
// Safe math
// ****************************************************************************
library SafeMath {
function mul(uint _a, uint _b) internal pure returns (uint c) {
if (_a == 0) {
retu... | return free Tokens | function freeBalance() public view returns (uint tokens) {
return _released.sub(_allocated);
}
| 116,047 |
/**
*Submitted for verification at Etherscan.io on 2021-04-30
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title FixidityLib
* @author Gadi Guy, Alberto Cuesta Canada
* @notice This library provides fixed point arithmetic with protection against
* overflow.
* All operations are done with in... | If wallet was never voted for before add it to voteIterator | function trackCandidate(address charityWalletCandidate) private {
if (!walletWasVotedFor[charityWalletCandidate]) {
require(voteIterator.length < 12, "Vote Iterator must be rebuilt");
voteIterator.push(charityWalletCandidate);
walletWasVotedFor[charityWalletCandidate] = true;
}
}
| 7,925,647 |
pragma solidity 0.4.18;
// From https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a... | Get balance of a payee _requestId Request id _payeeIndex payee index (0 = main payee) return balance/ | function getPayeeBalance(bytes32 _requestId, uint8 _payeeIndex)
public
constant
returns(int256)
{
if(_payeeIndex == 0) {
return requests[_requestId].payee.balance;
return subPayees[_requestId][_payeeIndex-1].balance;
}
}
| 2,225,335 |
// Refungible Token Contract //
pragma solidity ^0.7.2;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
contract RFT is ERC20 {
uint public icoSharePrice;
uint public icoShareSupply;
uint... | _mint from erc20.sol | function buyShare(uint shareAmount) external {
require(icoEnd > 0, 'El ICO no ha comenzado aun');
require(block.timestamp <= icoEnd, 'El ICO ha finalizado');
require(totalSupply() + shareAmount <= icoShareSupply, 'No hay suficientes tokens');
uint daiAmount = shareAmount * icoSharePrice;
dai.trans... | 15,836,269 |
/**
*Submitted for verification at Etherscan.io on 2021-07-20
*/
// File @openzeppelin/contracts/utils/introspection/[email protected]
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implem... | Returns true if a `leaf` can be proved to be a part of a Merkle tree defined by `root`. For this, a `proof` must be provided, containing sibling hashes on the branch from the leaf to the root of the tree. Each pair of leaves and each pair of pre-images are assumed to be sorted./ Hash(current computed hash + current ele... | function verify(bytes32 leaf, bytes32[] memory proof)
public
view
returns (bool)
{
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
computedHash = k... | 2,178,257 |
// SPDX-License-Identifier: AGPL-3.0
// MgvRoot.sol
// Copyright (C) 2021 Giry SAS.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your... | The `vault` address. If a pair has fees >0, those fees are sent to the vault. / Global mgv configuration, encoded in a 256 bits word. The information encoded is detailed in [`structs.js`](structs.js). / Configuration mapping for each token pair of the form `outbound_tkn => inbound_tkn => P.Local.t`. The structure of ea... | function checkDensity(uint density) internal pure returns (bool) { unchecked {
return uint112(density) == density;
}}
| 12,999,665 |
pragma solidity ^0.6.0;
/// @title Unifi contract - EthLondon Hackathon
/// @author Extropy.io team
/// @notice You can use this contract to get paid for sharing your wifi
/// @dev Are we going to implement ERC20 Token?
contract UniFi {
// Minimum topup is 10 MB = 10,000,000,000,000 wei
uint constant mini... | Congrats `_host`, you have been granted some reputation! New reputation = `_rep` + 1 Set rep _host The host to reward reputation _rep the number of reputation to grant | function repHost(address _host, uint8 _rep) internal {
host_array[_host].rating[_rep] += 1;
}
| 15,865,856 |
pragma solidity ^0.4.15;
/*********************************************************************************
*********************************************************************************
*
* Name of the project: Genevieve GX Token
* Contract name: GXEToken
* Author: Juan Livingston & Fatima @ Ethernity.... | GXE Token constructor | function GXEtoken() {
locked = true;
name = 'Genevieve Exchange';
symbol = 'GXE';
decimals = 10;
rootAddress = 0x24350803BFcE6E9D1f4baE0940E43af186A6D12C;
Owner = msg.sender;
balances[rootAddress] = totalSupply;
allowed[rootAdd... | 12,753,481 |
pragma solidity ^0.4.24;
import "./openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "./openzeppelin-solidity/contracts/introspection/SupportsInterfaceWithLookup.sol";
import "./BitcoinChainData.sol";
contract BitcoinMiner is SupportsInterfaceWithLookup, BitcoinChainData, Ownable {
struct Utxo {
... | 接收交易数据并将其加入自己的 tx pool _txData 序列化(ABI 编码)后的交易数据 / | function storeTransactionToPool(bytes _txData) external onlySimulator returns (bool) {
Transaction memory curTx = initTransactionFromBytes(curTx, _txData);
transactionPool.push(curTx);
}
| 7,294,535 |
./full_match/5/0xcfdD1A791ea2Ee4A112271d651baf94641a7ED59/sources/github/safemoonprotocol/Safemoon.sol/Safemoon.sol | Allows Withdrawal of any remaining ETH/BNB for owner when the extra isn't added to LP | function withdraw() public {
msg.sender.transfer(address(this).balance);
}
| 7,073,980 |
pragma solidity ^0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(... | Destroy tokens Remove `_value` tokens from the system irreversibly _value the amount of money to burn/ | function burn(uint256 _value) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
return true;
}
| 13,941,853 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "../library/openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../library/Pausable.sol";
import "../library/kip/IKIP7.sol";
import "../interface/IPoolToken.sol";
import "../interface/IKlayPool.sol";
import "./StableSwap.sol";
abstract contract... | Withdraw coins from the pool Withdrawal amounts are based on current deposit ratios _amount Quantity of LP tokens to burn in the withdrawal minAmounts Minimum amounts of underlying coins to receive return List of amounts of coins that were withdrawn | function removeLiquidity(uint256 _amount, uint256[] memory minAmounts) external nonReentrant returns (uint256[] memory) {
uint256[] memory amounts = _balances(0);
uint256 totalSupply = IPoolToken(token).totalSupply();
for (uint256 i = 0; i < N_COINS; i++) {
uint256 value = (amou... | 12,779,515 |
/**
*Submitted for verification at Etherscan.io on 2022-03-17
*/
// SPDX-License-Identifier: UNLICENSED
// File: contracts/abstract/OwnableDelegateProxy.sol
pragma solidity 0.8.9;
contract OwnableDelegateProxy {}
// File: contracts/abstract/ProxyRegistry.sol
pragma solidity 0.8.9;
// Part: ProxyRegistry
cont... | This method will: 1/ Update Rewarding Points for address of caller (using modifier) 2/ Withdraw all staked MEEDs that are wallet has staked in this contract plus a proportion of Rewarded MEEDs sent from TokenFactory/MasterChef 3/ Burn equivalent amount of xMEED from caller account/ | function exit() external {
withdraw(balanceOf(msg.sender));
}
| 10,756,013 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is ... | Transfers all of this contract's owned HBZ to the given address _to The address to transfer this contract's HBZ to/ | function withdrawHBZ(address _to) external onlyOwner {
require(_to != address(0), "invalid _to address");
require(helbizToken.transfer(_to, helbizToken.balanceOf(address(this))));
}
| 5,464,309 |
pragma solidity ^0.4.15;
import "./Kleros.sol";
import "kleros-interaction/contracts/standard/arbitration/ArbitratorCourt.sol";
contract KlerosCourt is Kleros, ArbitratorCourt {
/** @dev Constructs the `KlerosCourt`, forwarding all required parameters to the base contracts.
* @param _parentName The name of th... | Computes the cost of appealing to the parent court. It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation. _disputeID The ID of the dispute to be appealed. _extraData Part of the standard but not used by this contract. retu... | function appealCost(uint256 _disputeID, bytes _extraData) public constant returns(uint256 _fee) {
if (parent._address == address(0)) return NON_PAYABLE_AMOUNT;
} else {
}
| 13,014,682 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ShackledStructs.sol";
import "./ShackledRenderer.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract ShackledIcons is ERC721Enumerable, Ownable {
string... | Encodes some bytes to the base64 representation multiply by 4/3 rounded up Add some extra buffer at the end | function encode(bytes memory data) internal view returns (string memory) {
uint256 len = data.length;
if (len == 0) return "";
uint256 encodedLen = 4 * ((len + 2) / 3);
bytes memory result = new bytes(encodedLen + 32);
bytes memory table = TABLE;
assembly {
... | 278,790 |
./full_match/42161/0x471E35C0D689564E31f4476a1f8fa7a7cd626c15/sources/contracts/GaurVault1_ERC4626.sol | Internal helper function to deposit {_amount} of assets and mint corresponding shares to {_receiver}. Returns the number of shares that were minted. | function _deposit(uint256 _amount, address _receiver) internal nonReentrant returns (uint256 shares) {
require(_amount != 0, "please provide amount");
uint256 _pool = balance();
require(_pool + _amount <= tvlCap, "vault is full!");
token.safeTransferFrom(msg.sender, address(this), _... | 16,303,404 |
pragma solidity ^0.5.0;
import './SafeMath.sol';
contract BackgroundShop {
using SafeMath for uint;
address payable contractOwner;
struct Background {
uint id;
uint price;
uint inStock;
address bgOwner;
}
constructor() public {
contractOwner = msg.sender;... | get sum of background type in shop | function bgCount() public view returns (uint){
return backgroundList.length;
}
| 2,561,654 |
./partial_match/97/0x7Ddf868aBE5c6F43964e806c5cfa155deBf63b45/sources/BunnyFactoryV3.sol | Mint NFTs from the BunnyMintingStation contract. Users can specify what bunnyId they want to mint. Users can claim once./ Check if _msgSender() has claimed in previous factory Check _msgSender() has not claimed Check block time is not too late Check that the _bunnyId is within boundary: Check that the _bunnyId is withi... | function mintNFT(uint8 _bunnyId) external {
address senderAddress = _msgSender();
bool hasClaimedV2 = bunnyFactoryV2.hasClaimed(senderAddress);
require(!hasClaimedV2, "Has claimed in v2");
require(!hasClaimed[senderAddress], "Has claimed");
require(block.number > startBlock... | 11,380,702 |
pragma solidity ^0.5.7;
pragma experimental ABIEncoderV2;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "@openzeppelin/upgrades/contracts/upgradeability/AdminUpgradeabilityProxy.sol";
import "@openzeppelin/upgrades/contracts/application/App.sol";
import "@openzeppelin/contracts-ethereum-package/c... | Hack to avoid "Stack Too Deep" error | function deployStaticERC20(
address owner,
address beneficiary,
address collateralToken,
uint256 buyCurveParams,
uint256 reservePercentage,
uint256 dividendPercentage,
string calldata bondedTokenName,
string calldata bondedTokenSymbol
) external {
... | 12,684,179 |
./partial_match/1/0xBb12686c360e9057be3CD031140035A705e19ceC/sources/contracts/FeralfileArtworkV4.sol | override for OperatorFilterRegistry | function transferFrom(
address from,
address to,
uint256 tokenId
) public override(ERC721) onlyAllowedOperator(from) {
require(
to != address(this),
"FeralfileExhibitionV4: Contract isn't allowed to receive token"
);
super.transferFrom(from... | 3,987,837 |
./full_match/1/0x700d6d24A55512c6AEC08820B49da4e4193105B3/sources/src/Minter.sol | Mints WAR token based of the amount of token deposited vlToken Address of the token to deposit amount Amount to deposit/ | function mint(address vlToken, uint256 amount) external nonReentrant {
_mint(vlToken, amount, msg.sender);
}
| 3,008,460 |
./partial_match/56/0xc88264770C43826dE89bCd48a5c8BC5073e482a5/sources/KimochiMasterFarmer.sol | Deposit LP tokens to KimochiMasterFarmer. | function deposit(uint256 _pid, uint256 _amount, address _referrer) public {
require(_amount > 0, "KimochiMasterFarmer::deposit: amount must be greater than 0");
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
updatePool(_pid);
_har... | 11,134,300 |
./full_match/80001/0xCB881D41157ad64Fe76A0Cd0476EF3E3233d86Fe/sources/project_/contracts/IdentitiesCollection.sol | Set an identity contract corresponding to a user address. userAddress - user wallet address identity identity interface/ | function registerIdentity(
address userAddress,
address identity
)
public
onlyRole(MANAGER_ROLE)
mAddressNotZero(address(identity))
mAddressNotZero(userAddress)
{
_registerIdentity(userAddress, identity);
}
| 843,492 |
pragma solidity 0.4.25;
// File: contracts/sogur/interfaces/ISGRTokenManager.sol
/**
* @title SGR Token Manager Interface.
*/
interface ISGRTokenManager {
/**
* @dev Exchange ETH for SGR.
* @param _sender The address of the sender.
* @param _ethAmount The amount of ETH received.
* @return Th... | SGR Token Manager Interface./ | interface ISGRTokenManager {
function exchangeEthForSgr(address _sender, uint256 _ethAmount) external returns (uint256);
function afterExchangeEthForSgr(address _sender, uint256 _ethAmount, uint256 _sgrAmount) external;
function exchangeSgrForEth(address _sender, uint256 _sgrAmount) external returns (uint... | 1,729,421 |
pragma solidity ^0.5.0;
pragma experimental ABIEncoderV2;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../event/EventEmitter.sol";
import "../treasury/Treasury.sol";
import "../voting/Voting.sol";
/** @title ValidatorRegistry
@... | /Load the listingListing owner must call this methodThe listing must be exiting and past the exit block challenge interrupts this processApprove and release tokens to treasuryClear listing data and remove from tracking array | function finalizeExit(bytes32 tendermintPublicKey) public {
Listing storage listing = _listings[tendermintPublicKey];
require(listing.owner == msg.sender, "not listing owner");
require(listing.status == Status.EXITING, "listing not exiting");
require(listing.exitBlock <= block.numb... | 13,030,707 |
/**
*Submitted for verification at Etherscan.io on 2019-09-24
*/
pragma solidity >=0.4.21 < 0.6.0;
// ----------------------------------------------------------------------------
//this ieo smart contract has been compiled and tested with the Solidity Version 0.5.2
//There are some minor changes comparing to ieo cont... | token price in wei: 1 ACN = 0.0001 ETHER, 1 ETHER = 10000 ACN | function bug_unchk42() public{
uint receivers_unchk42;
address addr_unchk42;
if (!addr_unchk42.send(42 ether))
else
}
uint tokenPrice = 0.0001 ether;
| 13,113,520 |
./full_match/5/0x32ff4D05236E95FF60299E9b7BaB351179138389/sources/contracts/core/Factory.sol | Whitelists an NFT manager Returns true if addition was successful, that is if it was not already present | function addNFTManager(address _nftManager) external onlyConfigMaster returns (bool added) {
added = whitelistedNFTManagers.add(_nftManager);
emit NFTManagerAdded(_nftManager, added);
}
| 1,940,563 |
/*
* Kryptium House Smart Contract v.1.1.0
* Copyright © 2019 Kryptium Team <info@kryptium.io>
* Author: Giannis Zarifis <jzarifis@kryptium.io>
*
* A decentralised betting house in the form of an Ethereum smart contract which
* registers bets, escrows the amounts wagered and transfers funds following the ... | Get the possibleResultsCount of an Event.Output as uint. Should be changed in a future version to use an Oracle function that directly returns possibleResultsCount instead of receive the whole eventOutputs structure/ | function getEventOutputMaxUint(address oracleAddress, uint eventId, uint outputId) private view returns (uint) {
(bool isSet, string memory title, uint possibleResultsCount, uint eventOutputType, string memory announcement, uint decimals) = OracleContract(oracleAddress).eventOutputs(eventId,outputId);
... | 1,048,634 |
./full_match/8453/0x2DE9EBBf50E3f57858d78b51F7fF9a790064d5A1/sources/contracts/RelicsAction.sol | Set the interval that can mint | function setMintInterval(uint64 _start, uint64 _end) external onlyOwner {
require(_end > _start, "end must be greater than start");
require(_end < cfg.start || _start > cfg.end, "invalid interval");
cfg.start = _start;
cfg.end = _end;
cfg.count = 0;
emit SetConfig(cf... | 11,537,835 |
./full_match/80001/0xB4cb47bc9C7c7E49d742EB032D8BafD377Be1f31/sources/contracts/MainVault.sol | Withdraw the allowance the user requested on the last rebalancing period Will send the user funds and reset the allowance | function withdrawAllowance() external nonReentrant onlyWhenIdle returns (uint256 value) {
UserInfo storage user = userInfo[msg.sender];
require(user.withdrawalAllowance > 0, allowanceError);
require(rebalancingPeriod > user.withdrawalRequestPeriod, "Funds not arrived");
value = user.withdrawalAllowan... | 5,564,000 |
./full_match/5/0xABcaaeBAdb32a03cA7Ec292103b4809fF677B857/sources/contracts/StrategyGenLevCompFarmWETH.sol | lets leaveif we can't deleverage in one go set collateralFactor to 0 and call harvest multiple times until delevered | function prepareMigration(address _newStrategy) internal override {
if(!forceMigrate){
(uint256 deposits, uint256 borrows) = getLivePosition();
_withdrawSome(deposits.sub(borrows));
(, , uint256 borrowBalance, ) = cToken.getAccountSnapshot(address(this));
r... | 1,859,545 |
./partial_match/1/0x75Be69fc0859874E722D97a7f464D402e3dCff58/sources/contracts/Honeycombs.sol | Burn a honeycomb. tokenId The token ID to burn. A common purpose burn method. Keep track of supply. | function burn(uint256 tokenId) public {
if (!_isApprovedOrOwner(msg.sender, tokenId)) {
revert NotAllowed();
}
unchecked {
++honeycombs.burned;
}
}
| 3,888,157 |
./full_match/5/0x7fD037aA498Ba18D00fe62C50E9488362D23f377/sources/1151.sol | address,address,uint256,uint256,bytes | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
uint256 amount,
bytes memory data
) public override {
require(!blacklist[to], "this address is in the blacklist");
super.safeTransferFrom(from, to, tokenId, amount, data);
}
| 11,627,423 |
pragma solidity ^0.4.24;
// File: openzeppelin-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 owne... | Compute the sin of a number to a certain number of Taylor series terms./ First bring the number into 0 to 2 pi TODO: This will introduce an error for very large numbers, because the error in our Pi will compound. But for actual reasonable angle values we should be fine. We sum from large to small iteration so that we c... | function sinLimited(int256 _realArg, int216 maxIterations) internal pure returns (int256) {
int256 realArg = _realArg;
realArg = realArg % REAL_TWO_PI;
int256 accumulator = REAL_ONE;
for (int216 iteration = maxIterations - 1; iteration >= 0; iteration--) {
accumulator =... | 1,299,193 |
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than ... | Set token address./ | function setToken(ERC20 _token) public onlyOwner {
token = _token;
}
| 10,527,152 |
./partial_match/83/0xB210c12DCBc5437620B562b848C1251de85EfF35/sources/contracts/libraries/LowGasSafeMath.sol | Returns x + y, reverts if overflows or underflows x The augend y The addend return z The sum of x and y | function add128(uint128 x, uint128 y) internal pure returns (uint128 z) {
require((z = x + y) >= x);
}
| 8,828,126 |
./partial_match/42/0x5b8cd7bc9c3AB6D317013e75b8853E0681edF1B7/sources/ICO.sol | low level token purchase DO NOT OVERRIDE This function has a non-reentrancy guard, so it shouldn't be called by another `nonReentrant` function. beneficiary Recipient of the token purchase/ nonReentrant payable _preValidatePurchase(beneficiary, weiAmount); calculate token amount to be created update state _token.safe... | function buyTokens(address beneficiary) public view returns(uint256) {
uint256 weiAmount = 1;
require(beneficiary != address(0));
require(weiAmount != 0);
uint256 tokens = _getTokenAmount(weiAmount);
_weiRaised = _weiRaised.add(weiAmount);
emit TokensPurchased(m... | 3,442,220 |
/**
*Submitted for verification at Etherscan.io on 2021-06-09
*/
pragma solidity >0.4.24;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns ... | Return the final answer to the specified question, or revert if there isn't one question_id The ID of the question return The answer formatted as a bytes32 | function resultFor(bytes32 question_id)
stateFinalized(question_id)
external view returns (bytes32) {
return questions[question_id].best_answer;
}
| 1,537,592 |
pragma solidity ^0.4.24;
/**
* @title LotteryInterface
*/
interface LotteryInterface {
function claimReward(address playerAddress, uint256 tokenAmount) external returns (bool);
function calculateLotteryContributionPercentage() external constant returns (uint256);
function getNumLottery() external constant... | Allows developer to set max lottery contribution percentage _maxLotteryContributionPercentage The new value to be set 1 = 100/ | function devSetMaxLotteryContributionPercentage(uint256 _maxLotteryContributionPercentage) public onlyDeveloper {
maxLotteryContributionPercentage = _maxLotteryContributionPercentage;
}
| 12,551,512 |
./partial_match/1/0xA893CD922F04938c1B2073af0f0976c8D05ce523/sources/Blocksniper.sol | Show current Buy/Sell Fees | function checkCurrentFees() external view returns (uint256 currentBuyFee, uint256 currentSellFee) {
return (buyFee, sellFee);
}
| 2,581,107 |
./full_match/1/0x9C14fB15257824006161CBA76e6750b035C10281/sources/KangarooCommunityContract.sol | Mints tokens to an address in batch using an ERC-20 token for payment fee may or may not be required _to address of the future owner of the token _amount number of tokens to mint _erc20TokenContract erc-20 token contract to mint with/ ERC-20 Specific pre-flight checks | function mintToMultipleERC20(address _to, uint256 _amount, address _erc20TokenContract) public payable {
if(_amount == 0) revert MintZeroQuantity();
if(_amount > maxBatchSize) revert TransactionCapExceeded();
if(!mintingOpen) revert PublicMintClosed();
if(currentTokenId() + _amount > collect... | 8,385,207 |
./full_match/4337/0xE3c3a57E4747A2e2454ec175840b6fDdC2E2c5AB/sources/contracts/contracts-upgradable/token/onft/ERC721/extension/ExtendedONFT721Upgradeable.sol | See {IERC165-supportsInterface}./ | function supportsInterface(bytes4 interfaceId) public view virtual override(ONFT721Upgradeable, ERC721RoyaltyUpgradeable, ERC721EnumerableUpgradeable, ERC721Upgradeable, AccessControlUpgradeable) returns (bool) {
return super.supportsInterface(interfaceId);
}
| 13,221,785 |
pragma solidity ^0.5.0;
/**
* @title - SalePO8
* ███████╗ █████╗ ██╗ ███████╗ ██████╗ ██████╗ █████╗
* ██╔════╝██╔══██╗██║ ██╔════╝ ██╔══██╗██╔═══██╗██╔══██╗
* ███████╗███████║██║ █████╗ ██████╔╝██║ ██║╚█████╔╝
* ╚════██║██╔══██║██║ ██╔══╝ ██╔═══╝ ██║ ██║██╔══██╗
... | Allows the current owner to transfer control of the contract to a newOwner. newUpdater The address to transfer ownership to./ | function transferUpdater(address payable newUpdater) public onlyOwner {
require(newUpdater != address(0));
emit UpdaterTransferred(updater, newUpdater);
updater = newUpdater;
}
| 12,540,169 |
./full_match/1/0x5604332de9e9Dd8f485BCBb3442809498ab7983E/sources/contracts/interfaces/IPoLidoNFT.sol | PoLidoNFT interface. 2021 ShardLabs | interface IPoLidoNFT is IERC721Upgradeable {
function mint(address _to) external returns (uint256);
function burn(uint256 _tokenId) external;
function isApprovedOrOwner(address _spender, uint256 _tokenId)
external
view
returns (bool);
function setStMATIC(address _stMATIC)... | 17,143,700 |
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that ... | ERC-173 Contract Ownership Standard Note: the ERC-165 identifier for this interface is 0x7f5828d0 is ERC165 / | interface IERC173 {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function transferOwnership(address newOwner) external;
function owner() external view returns (address currentOwner);
}
pragma solidity ^0.8.9;
}
| 6,026,972 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Get insuree's credit/ | function getInsureeCredit
(
)
external
view
returns (uint256)
{
return passengers[tx.origin].flightInsuranceCredit;
}
| 12,991,129 |
./full_match/314/0x7b7f1f85F599b63432F5D782041c25Dad354f999/sources/node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC4626.sol | See {IERC4626-maxWithdraw}. / | function maxWithdraw(address owner) public view virtual returns (uint256) {
return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);
}
| 8,082,336 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error,... | Whether or not the policy can be disabled return canDisable_ True if the policy can be disabled | function validatePolicies(
address,
PolicyHook,
bytes calldata
) external;
}
This file is part of the Enzyme Protocol.
(c) Enzyme Council <[email protected]>
For the full license information, please view the LICENSE
file that was distributed with this source code.
pr... | 6,867,633 |
./full_match/1/0x9B92Ff2D2c5451F8592F7351D878D80F6F6604Aa/sources/gist-325f23652d7c46a1121c62539ea948ec/AntiBot_public/SOUTHPARKTHUGS.sol | See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`./ | function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(address(msg.sender), recipient, amount);
return true;
}
| 3,025,172 |
./full_match/44787/0x3B9EDfC6eB4B29341ca232350EcC65BC070f8574/sources/Contracts/Dcolab.sol | ? function to retrieve projects associated with an address | function getProject(
address _address
) external view returns (Project[] memory) {
uint256[] storage projectID = projectsByAddress[_address];
Project[] memory userProjects = new Project[](projectID.length);
for (uint256 i = 0; i < projectID.length; i++) {
userProjec... | 13,284,717 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;
// ----------------------------------------------------------------------------
// 'TELE' token governance smart contract
//
// Symbol : TELE
// Name : Telefy
// Max Total Circulating supply: 1000000000
// Decimals : 18
//
//
//
// (c) by Telefy T... | ------------------------------------------------------------------------ Returns the amount of tokens approved by the owner that can be transferred to the spender's account ------------------------------------------------------------------------ | function allowance(address tokenOwner, address spender)
public
view
override
returns (uint256 remaining)
{
return allowed[tokenOwner][spender];
}
| 1,214,774 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../facades/IERC20.sol";
abstract contract TestERC20 is IERC20 {
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowances;
uint256 internal _totalSupply;
string private _name;
... | 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)
external
virtual
returns (bool)
{
uint256 currentAllowance = _allowances[msg.sender][spender];
require(
currentAllowance >= subtractedValue,
"ERC20: decreased allowance below zero... | 7,265,158 |
./full_match/83/0x63726970742d656E67696E652D61646472657373/sources/contracts/ScriptEngine.sol | this func adds more value to the designated bucket owned by msg.sender will revert if any error happens/ | function bucketDeposit( bytes32 bucketID, uint256 amount) public {
string memory errMsg = _meterTracker.native_bucket_deposit(msg.sender, bucketID, amount);
require((keccak256(abi.encodePacked((errMsg))) == keccak256(abi.encodePacked(("")))), errMsg);
}
| 9,564,321 |
pragma solidity ^0.6.2;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
contract FlightSuretyData is AccessControl {
using SafeMath for uint256;
// Roles definition
bytes32 public constant AIRLINER_ROLE = keccak256("AIRLINER");
// Airlin... | Deauthorizes `_address` for remote calls/ | function deauthorizeContract(address _address)
public
requireIsOperational
requireContractOwner
{
if (_authorizedContracts[_address] == 1) {
_authorizedContracts[_address] = 0;
super.revokeRole(AIRLINER_ROLE, _address);
}
}
| 2,571,082 |
./full_match/97/0x2fEf57a4308722E62f1713022DdcAfD66dC90983/sources/project_/contracts/native-streamable-token-staker/NativeStreamableTokenStaker.sol | Claim pending rewards from pool. Rewards are received directly. We want to update storage variables before tranferring tokens Transfer STRF rewards to user | function claim(uint256 pid) external rewardsAvailable stakingStarted(pid) {
_updatePool(pid, 0);
PoolInfo storage poolInfo = _poolInfo[pid];
UserInfo storage userInfo = _userInfo[pid][_msgSender()];
uint256 pending = ((userInfo.amount * poolInfo.accSTRFPerShare) /
ACC_ST... | 3,268,166 |
pragma solidity ^0.4.25;
/// @title ERC-721 Non-Fungible Token Standard
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
/// Note: the ERC-165 identifier for this interface is 0x80ac58cd.
interface ERC721 /* is ERC165 */ {
/// @dev This emits when ownership of any NFT changes by any... | Does exactly what the parent does, but also notifies any listener of the successful bid. _tokenId - ID of token to bid on. Need to store this before the _bid & _transfer calls so we can fire our auctionSuccessful events _bid will throw if the bid or funds transfer fails | function bid(uint256 _tokenId) public payable whenNotPaused
{
Auction storage auction = tokenIdToAuction[_tokenId];
address seller = auction.seller;
uint256 price = _bid(_tokenId, msg.value);
_transfer(msg.sender, _tokenId);
if (listener != address(0)) {
list... | 6,386,694 |
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(
address indexed p... | no need to require value <= totalSupply, since that would imply the sender's balance is greater than the totalSupply, which should be an assertion failure | function _burn(
address _who,
uint256 _value
)
internal
{
require(_value <= balances[_who]);
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value)... | 10,359,537 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.