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/0x86f78d3cbCa0636817AD9e27a44996C738Ec4932/sources/stableQiVault.sol | withdraws earned interest by vault. Transfer | function withdrawInterest() external onlyOperators nonReentrant {
uint256 adm_fee = maiDebt*adminFee / TEN_THOUSAND;
mai.transfer(adm, adm_fee);
emit WithdrawInterest(maiDebt);
maiDebt = 0;
}
| 2,821,116 |
./full_match/1/0x73b36B067411060440847100ecf76E83456628FE/sources/contracts/ThePlagueUpgradeable.sol | Staked transfers allow users to move staked assets to different wallets without losing the contextual history. This could facilitate OTC staked trading that may bypass royalties but probably good for this. to - The address to transfer to tokenIds - The token ids to transfer/ | function stakedBatchTransfer(
address to,
uint256[] calldata tokenIds
) public {
for (uint256 i; i < tokenIds.length; ) {
uint256 tokenId = tokenIds[i];
require(ownerOf(tokenId) == _msgSender(), "!owner");
_safeTransfer(_msgSender(), to, tokenId, "");
... | 3,145,686 |
// SPDX-License-Identifier: MIT
/*
______ __ __ __ __
|_ _ \ [ | | ] [ | | ]
| |_) | | | .--. .--. .--.| | .--. | |--. .---. .--.| |
| __'. | | / .'`\ \ / .'`\ \ / /... | Validates signature. _sender User wanting to buy. _nft Collection address. _tokenId tokenId from collection. _projectId projectId from DB. _price Price for which user is buying. _timestamp Signature creation timestamp. _signature Signature of above data./ | function validateSignature(
address _sender,
address _nft,
uint256 _tokenId,
uint256 _projectId,
uint256 _price,
uint256 _timestamp,
bytes memory _signature
) private returns (bool) {
bytes32 dataHash = keccak256(
abi.encodePacked(_send... | 6,264,923 |
./full_match/1/0x1aA8fecdf71d25Fbadb4981143dCE6613B1ffc8D/sources/browser/ToshiCashFarm.sol | Safe ToshiCoin transfer to prevent over-transfers./ | function safeToshiCashClaim(address to, uint256 amount) internal {
uint256 coinsBalance = toshiCash.balanceOf(address(this));
uint256 claimAmount = amount > coinsBalance ? coinsBalance : amount;
toshiCash.claim(to, claimAmount);
}
| 2,947,480 |
/**
*Submitted for verification at Etherscan.io on 2021-05-16
*/
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.7.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* i... | Handles the bridged tokens for the first time, includes deployment of new TokenProxy contract. Checks that the value is inside the execution limits and invokes the Mint or Unlock accordingly. _token address of the native ERC20/ERC677 token on the other side. _name name of the native token, name suffix will be appende... | function deployAndHandleBridgedTokens(
address _token,
string calldata _name,
string calldata _symbol,
uint8 _decimals,
address _recipient,
uint256 _value
) external onlyMediator {
address bridgedToken = _getBridgedTokenOrDeploy(_token, _name, _symbol, _de... | 2,001,620 |
./full_match/44787/0x449Ab7283A2f98cc6C71a53Cf2f97aAaC2FEA597/sources/contracts/community/CommunityAdminImplementation.sol | Updates proxy implementation address of ubi committee _newUbiCommittee address of new implementation contract/ | function updateUbiCommittee(IUBICommittee _newUbiCommittee) external override onlyOwner {
address oldUbiCommittee = address(ubiCommittee);
ubiCommittee = _newUbiCommittee;
emit UBICommitteeUpdated(oldUbiCommittee, address(_newUbiCommittee));
}
| 13,248,514 |
./partial_match/1/0x1A963Df363D01EEBB2816b366d61C917F20e1EbE/sources/src/ComptrollerG7.sol | Sets liquidationIncentive Admin function to set liquidationIncentive newLiquidationIncentiveMantissa New liquidationIncentive scaled by 1e18 return uint 0=success, otherwise a failure. (See ErrorReporter for details)/ Check caller is admin | function _setLiquidationIncentive(uint256 newLiquidationIncentiveMantissa)
external
returns (uint256)
{
if (msg.sender != admin) {
return fail(
Error.UNAUTHORIZED,
FailureInfo.SET_LIQUIDATION_INCENTIVE_OWNER_CHECK
);
}
... | 2,595,095 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;
import './RewardedStakeBase.sol';
import './interfaces/StakeTokenConfig.sol';
import '../../tools/upgradeability/VersionedInitializable.sol';
contract StakeToken is RewardedStakeBase, VersionedInitializable {
uint256 private constant TOKEN_REVISION = 2;
... | solhint-disable-next-line func-name-mixedcase | function COOLDOWN_PERIOD() public view returns (uint256) {
return _cooldownPeriod;
}
| 6,059,379 |
pragma solidity ^0.5.5;
import './IERC20.sol';
import './usingOraclize.sol';
/// @notice The open source bank and lending platform for ERC-20 tokens and ETH
/// @author Merunas Grincalaitis <merunasgrincalaitis@gmail.com>
contract Bank is usingOraclize {
/*
We want the following features
- A funct... | To check if a user is already added to the list of holders | function checkExistingHolder() public view returns(bool) {
for(uint256 i = 0; i < holders.length; i++) {
if(holders[i] == msg.sender) {
return true;
}
}
return false;
}
| 2,558,653 |
// contracts/strategies/StratPancakeCakeV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security... | Function to use from Governance Gnosis Safe multisig only in case tokens get stuck. This is to be used if someone, for example, sends tokens to the contract by mistake. There is no guarantee governance will vote to return these./ | function inCaseTokensGetStuck(
address _token,
uint256 _amount,
address _to
) external onlyGovernance {
require(_to != address(0), "zero address");
require(_token != depositToken, "!safe");
IERC20(_token).safeTransfer(_to, _amount);
}
| 892,791 |
pragma solidity ^0.4.13;
contract Campaign {
/*
* Storage
*/
enum Stages {
CampaignCreated,
CampaignStarted,
CampaignSuccessful,
CampaignFailed
}
// Mandatory - passed
address public campaignFactory;
address public creator;
uint public goal;
u... | gets the attributes for the given key | function getAttribute(bytes32 key)
public
constant
returns (string)
{
return attributes[key];
}
| 13,031,760 |
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
contract DSAuthEvents {
event LogSetAuthority(address indexed authority);
event LogSetOwner(address indexed owner);
}
contract DSAuth is DSAuthEvents {
DSAuthority public authority;
address public owner;
constructor() public {
... | if contract receive eth, convert it to WETH deposit eth and get weth | return functionData;
}
receive() external override payable {
if (msg.sender == owner) {
TokenInterface(WETH_ADDRESS).deposit.value(address(this).balance)();
}
}
| 7,334,377 |
pragma solidity ^0.4.23;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "contracts/Trade.sol";
/**
* @title TradeRegistry keeps track of ongoing trades
*/
contract TradeRegistry {
event TradeAdded(address indexed _trade);
event TradeRemoved(address indexed _trade);
mapping(addr... | Add a trade Can only be added by the traders tradeAddress Address of the trade/ | function add(address tradeAddress) external {
Trade trade = Trade(tradeAddress);
require(trade.isTrader(msg.sender));
require(!trade.isFinal());
trades.push(tradeAddress);
for (uint256 i = 0; i < trade.numTraders(); i++) {
address trader = trade.traders(i);
... | 13,101,109 |
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.7.0;
import "./lib/ReEncryptionValidator.sol";
import "./lib/SignatureVerifier.sol";
import "./StakingEscrow.sol";
import "./proxy/Upgradeable.sol";
import "../zeppelin/math/SafeMath.sol";
import "../zeppelin/math/Math.sol";
/**
* @title Adjudicator
*... | Cancels distribution, makes possible to retrieve all bids and owner gets all tokens/ | function internalShutdown() internal {
startBidDate = 0;
endBidDate = 0;
token.safeTransfer(owner(), tokenSupply);
emit Shutdown(msg.sender);
}
| 1,393,532 |
// "SPDX-License-Identifier: UNLICENSED"
pragma experimental ABIEncoderV2;
pragma solidity >=0.6.0;
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./StockAPI.sol";
import "./PredictionsDB.sol";
/**
* Smart Contract to evaluate predictions on DA... | Callback function to fulfill Chainlink request (receives a DAX stock price for a symbol as a string) _requestId - the id of the request, generated by StockAPI contract _close - the close price of the requested DAX stock/ | function fulfillEvaluation(bytes32 _requestId, bytes32 _close)
public
recordClinkFulfillment(_requestId)
{
uint256 i;
while (i < 32 && _close[i] != 0) {
i = i.add(1);
}
bytes memory bytesArray = new bytes(i);
for (i = 0; i < 32 && _close[i] != ... | 14,049,661 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, ... | Deployer withdraws ERC20s/ | function deployerWithdraw20(IERC20 token) external onlyDeployer {
if (address(token) == 0x0000000000000000000000000000000000000000) {
payable(owner()).transfer(address(this).balance);
require(success, "Transfer failed.");
token.transfer(owner(), token.balanceOf(address(th... | 885,361 |
pragma solidity ^0.4.14;
/// @dev Models a uint -> address mapping where it is possible to iterate over all keys.
library IterableMapping {
struct Map {
mapping(address => IndexValue) data;
KeyFlag[] keys;
uint size;
}
struct IndexValue { uint keyIndex; uint value; }
struct Ke... | Changes the price registry for new registrants. | function changePrice(uint _price) onlyowner {
price = _price;
}
| 2,520,943 |
./full_match/43114/0xA568d7B8c2A15D66E515a5a8BC9A1f9AA73F6926/sources/benqi.sol | Claim all the Qi accrued by holder in all markets Claim all the Qi accrued by holder in specific markets Claim all the Qi accrued by specific holders in specific markets for their supplies and/or borrows Claim all the Qi accrued by holder in all markets Claim all the Qi accrued by holder in specific markets Claim all t... | interface IComptroller {
function compAccrued(address) external view returns (uint256);
function compSupplierIndex(address, address)
external
view
returns (uint256);
function compBorrowerIndex(address, address)
external
view
returns (uint256);
function ... | 4,623,877 |
pragma solidity 0.5.17;
import {ValidateSPV} from "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol";
import {BTCUtils} from "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol";
import {BytesLib} from "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol";
import {
IBondedECDSAKeep
} from "@keep-network/keep-ecdsa/c... | Get the caller's withdraw allowance. return The caller's withdraw allowance in wei. | function getWithdrawableAmount(DepositUtils.Deposit storage _d)
internal
view
returns (uint256)
{
return _d.withdrawableAmounts[msg.sender];
}
| 6,360,099 |
pragma solidity ^0.4.19;
/**
* @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 cheaper than... | – unlocks a user's bonded deposits from a claim. superblockHash – claim id. account – user's address. return – user's deposit which was unbonded from the claim. | function unbondDeposit(bytes32 superblockHash, address account) internal returns (uint, uint) {
SuperblockClaim storage claim = claims[superblockHash];
if (!claimExists(claim)) {
return (ERR_SUPERBLOCK_BAD_CLAIM, 0);
}
if (!claim.decided) {
return (ERR_SUPERBL... | 6,390,743 |
./full_match/1/0xa3C8d390c3965D33937865973b6159D37B777C54/sources/src/fund/fees/FeeManager.sol | Convenience function Convention that performace fee is 1 | function performanceFeeAmount() external returns (uint) {
if (fees.length < 2) return 0;
return fees[1].feeAmount();
}
| 3,057,654 |
./full_match/1/0x10F713e75ac9c0E8C2C208359dA790207DCC27D7/sources/contracts/ERC1238/ERC1238.sol | Creates `amount` tokens of token type `id`, and assigns them to the Externally Owned Account (to). Requirements: - `v`, `r` and `s` must be a EIP712 signature from `to` as defined by ERC1238Approval to approve the minting transaction. - `approvalExpiry`, which is part of the signed data, cannot be in the past. Emits a ... | function _mintToEOA(
address to,
uint256 id,
uint256 amount,
uint8 v,
bytes32 r,
bytes32 s,
uint256 approvalExpiry,
bytes memory data
) internal virtual {
require(approvalExpiry >= block.timestamp, "ERC1238: provided approval expiry time ca... | 17,073,913 |
// File: contracts/IERC20.sol
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 (uint256);
function allowance(address... | Batch token transfer. Used by contract creator to distribute initial tokens to holders / | function batchTransfer(address[] _recipients, uint[] _values) onlyOwner public returns (bool) {
require(_recipients.length > 0 && _recipients.length == _values.length);
uint total = 0;
for (uint i = 0; i < _values.length; i++) {
total = total.add(_values[i]);
}
r... | 1,000,568 |
pragma solidity >=0.8.0 <0.9.0;
//SPDX-License-Identifier: MIT
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
/*
---------------------------------
CHAINLINK-POLYGON NETWORK DETAILS
---------------------------------
name: "mumbai",
linkToken: "0x326C977E6efc84E512bB9C30f76E30c160eD06FB",
ethUsdPriceFeed: ... | This will call an api via chainlink to get the floor price of a collection _collectionAddress address of contract/ create a new request Set the URL to perform the GET request on send the request emit event and save id | function requestOpenSeaCollectionSlug(address _collectionAddress) internal returns (bytes32 requestId) {
testStatus = "requestOpenSeaCollectionSlug";
Chainlink.Request memory request = buildChainlinkRequest(bytes32JobId, address(this), this.fulfillCollectionSlug.selector);
string memory url = getContrac... | 12,955,084 |
./full_match/80001/0xAF3786A8E7d40A59d879d9ad86c258152C0C19Eb/sources/contracts/OnlyCoinsSubs.sol | IERC20(0xcB1e72786A6eb3b44C2a2429e317c8a2462CFeb1).transferFrom(creator, onlyCoinsPlatform, creatorPayout); creator.transfer(creatorPayout); onlyCoinsPlatform.transfer(platFee); | function subscribeonemonth(address creator, uint256 subPrice) public virtual {
require(subPrice >= onemonthprice[creator], "You need to spend more ETH!");
uint256 creatorID = uint256(uint160(address(creator)));
uint256 platFee = (subPrice / 100) * platformFee;
u... | 873,883 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
/**
* @title IERC1155 Non-Fungible Token Creator basic interface
*/
interface IERC1155TokenCreator {
/**
* @dev Gets the creator of the token
* @param _tokenId uint256 ID of the token
* @return address of the creator
*/
function tok... | / buy/ Purchases the token if it is for sale. _tokenId uint256 ID of the token. _owner address of the token owner/ The owner of the token must have the marketplace approved Check that the person who set the price still owns the token. Check that token is for sale. Check that enough ether was sent. Wipe the token pri... | function buy(uint256 _tokenId, address _owner) public payable {
require(nifter.getIsForSale(_tokenId, _owner) == true, "bid::not for sale");
ownerMustHaveMarketplaceApproved(_owner);
require(
_priceSetterStillOwnsTheToken(_tokenId, _owner),
"buy::Current token owner ... | 1,455,505 |
pragma solidity 0.6.8;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among ot... | require(allPunksAssigned); Check for the case where there is a bid from the new owner and revault it. Any other bid can stay in place. Kill bid and revault value | function buyPunk(uint256 punkIndex) public payable {
Offer storage offer = punksOfferedForSale[punkIndex];
require(punkIndex < 10000);
address seller = offer.seller;
punkIndexToAddress[punkIndex] = msg.sender;
balanceOf[seller]--;
balanceOf[msg.sender]+... | 7,342,504 |
pragma solidity ^0.4.24;
contract F3Devents {
// fired whenever a player registers a name
event onNewName
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
... | ends the round. manages paying out winner/splitting up pot/ setup local rID grab our winning player and team id's grab our pot amount calculate our winner share, community rewards, gen share, p3d share, and amount reserved for next pot calculate ppt for round mask | function endRound(F3Ddatasets.EventReturns memory _eventData_)
private
returns (F3Ddatasets.EventReturns)
{
uint256 _rID = rID_;
uint256 _winPID = round_[_rID].plyr;
uint256 _winTID = round_[_rID].team;
uint256 _pot = round_[_rID].pot;
uint256 _win = (_... | 14,692,742 |
./full_match/1/0xefaCa6Fc316B3B2Aa6c55FF5E02a62A85d4391e8/sources/contracts/storage/AccountRBAC.sol | Returns wether the specified address has the given permission./ | function hasPermission(
Data storage self,
bytes32 permission,
address target
) internal view returns (bool) {
return target != address(0) && self.permissions[target].contains(permission);
}
| 16,517,169 |
pragma solidity ^0.4.18;
import 'zeppelin-solidity/contracts/math/SafeMath.sol';
import "../Upgradability/OwnableKeyed.sol";
/**
* @title VoteRegistry
*/
contract VoteRegistry is OwnableKeyed {
using SafeMath for uint256;
/**
* @dev Event for when registration vote is created
* @param registrationVoteId An i... | Gets the Nay count for a specific developer registration vote registrationVoteId The ID of the developer registration vote return uint256 Count of Nay votes/ | function getNayCount(uint256 registrationVoteId) public view returns (uint256) {
return _storage.getUint(keccak256("registrationVoteNayCount", registrationVoteId));
}
| 15,873,052 |
./partial_match/1/0x2ebE1461D2Fc6dabF079882CFc51e5013BbA49B6/sources/StrategyControllerV1.sol | note that some strategies do not allow controller to harvest | function harvestStrategy(address _strategy) external {
require(msg.sender == strategist || msg.sender == governance, "!strategist");
IStrategy(_strategy).harvest();
}
| 4,494,491 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
pragma experimental ABIEncoderV2;
import "./messenger/IMessenger.sol";
/**
* @title MessengerRegistry
* @dev MessengerRegistry is a contract to register openly distributed Messengers
*/
contract MessengerRegistry {
struct Messenger {
address ownerA... | Request analytics object for the current period. _periodId 1. id of the canonical period to be analyzed _periodType 2. type of period to be queried _networkName 3. network name to publish analytics _ownerApproval 4. used to choose if the call is going to be funded by the contract owner, to avoid a block by contract... | function requestAnalytics(
uint256 _periodId,
PeriodRegistry.PeriodType _periodType,
bytes32 _networkName,
bool _ownerApproval
) public nonReentrant {
require(isValidNetwork(_networkName), "Invalid network name");
bool periodIsFinished =
periodRegistry... | 1,570,628 |
./full_match/1/0xA33dCbE04278706248891931537Dd56B795c3663/sources/contracts/factories/flexi/FlexiPunkTLD.sol | Only TLD contract owner can call this function. | function changeReferralFee(uint256 _referral) external override onlyOwner {
require(_referral < 5000, "Referral fee cannot be 50% or higher");
emit ReferralFeeChanged(_msgSender(), _referral);
}
| 16,489,247 |
./full_match/43113/0xaB1211F1eb56B0AFC01E8a01537B0116Edcd8160/sources/contracts/Yeswap.sol | Approve `spender` to transfer up to `amount` from `src` This will overwrite the approval amount for `spender` spender The address of the account which may transfer tokens rawAmount The number of tokens that are approved (2^256-1 means infinite) return Whether or not the approval succeeded/ | function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
amount = safe96(rawAmount, "YESW::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
... | 13,192,001 |
pragma solidity ^0.6.0;
import "./Owned.sol";
import "./BREE.sol";
import "./ERC20contract.sol";
import "./SafeMath.sol";
contract BREE_STAKE_FARM is Owned{
using SafeMath for uint256;
uint256 public yieldCollectionFee = 0.01 ether;
uint256 public stakingPeriod = 30 days;
uint256 public sta... | ------------------------------------------------------------------------ Add supported tokens _tokenAddress address of the token asset _farmingRate rate applied for farming yield to produce @required only owner ------------------------------------------------------------------------ | function addToken(address _tokenAddress, uint256 _rate) public onlyOwner {
_addToken(_tokenAddress, _rate);
}
| 987,943 |
pragma solidity 0.5.17;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/utils/ReentrancyGuard.sol";
import "./TokenStaking.sol";
import "./cryptography/BLS.sol";
import "./utils/AddressArrayUtils.sol";
import "./utils/PercentUtils.sol";
import "./libraries/operator/G... | Gets the timeout in blocks after which group candidate ticket submission is finished./ | function ticketSubmissionTimeout() public view returns (uint256) {
return groupSelection.ticketSubmissionTimeout;
}
| 1,840,275 |
/**
*Submitted for verification at Etherscan.io on 2021-11-29
*/
pragma solidity 0.5.12;
/**
* @author XchangeON.
*/
/**
* @title IERC223Token
* @dev ERC223 Contract Interface
*/
contract IERC223Token {
function transfer(address _to, uint256 _value) public returns (bool);
function balanceOf(address who)publ... | Execute a multi-signature transaction from this wallet using 2 signers: one from msg.sender and the other from ecrecover. nonce are numbers starting from 1. They are used to prevent replay attacks and may not be repeated. toAddress the destination address to send an outgoing transaction value the amoun... | function transferMultiSigEther(address payable toAddress, uint value, bytes memory data, uint expireTime, uint nounce, bytes memory signature) public payable onlySigner {
bytes32 operationHash = keccak256(abi.encodePacked("ETHER", toAddress, value, data, expireTime, nounce));
address otherSigner = v... | 15,002,260 |
//SPDX-License-Identifier: TBD
pragma solidity =0.7.4;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint va... | bytes4(keccak256(bytes('approve(address,uint256)'))); | function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
}
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata pa... | 6,170,224 |
pragma solidity ^0.4.24;
import "./ISTO.sol";
import "../../interfaces/ISecurityToken.sol";
import "../../interfaces/IOracle.sol";
import "../../RegistryUpdater.sol";
import "../../libraries/DecimalMath.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/Reentrancy... | solium-disable-next-line security/no-block-members/ | function modifyAddresses(
address _wallet,
address _reserveWallet,
address _usdToken
) public onlyFactoryOrOwner {
require(now < startTime, "STO shouldn't be started");
require(_wallet != address(0) && _reserveWallet != address(0), "Invalid address");
if (fundRais... | 12,790,354 |
pragma solidity 0.5.16;
interface IBasicToken {
function decimals() external view returns (uint8);
}
contract IERC20WithCheckpointing {
function balanceOf(address _owner) public view returns (uint256);
function balanceOfAt(address _owner, uint256 _blockNumber) public view returns (uint256);
function... | Returns the addition of two signed integers, reverting on overflow. Counterpart to Solidity's `+` operator. Requirements: - Addition cannot overflow./ | function add(int128 a, int128 b) internal pure returns (int128) {
int128 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");
return c;
}
| 204,844 |
/*
____ __ __ __ _
/ __/__ __ ___ / /_ / / ___ / /_ (_)__ __
_\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
/___/
* Synthetix: EtherWrapper.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contrac... | Normalize fee to sUSD Burn sETH. Pay down as much sETH debt as we burn. Any other debt is taken on by the stakers. Issue sUSD to the fee pool Tell the fee pool about this | function distributeFees() external {
require(!exchangeRates().rateIsInvalid(sETH), "Currency rate is invalid");
uint amountSUSD = exchangeRates().effectiveValue(sETH, feesEscrowed, sUSD);
synthsETH().burn(address(this), feesEscrowed);
sETHIssued = sETHIssued < feesEscrowed ? 0 : sET... | 5,981,683 |
pragma solidity ^0.5.0;
contract CarInsurance {
address contractOwner;
struct PolicyHolder {
string name;
string vehiclePlateNumber;
address policyOwnerAddress;
address premium;
}
struct Premium {
address premiumOwnerAddress;
uint amountOfEther;
... | name, plate, amountOfEther, brokername, duration, description | function getInsuranceInfo() public view returns (string memory, string memory, uint, string memory, uint, string memory) { | 12,813,938 |
pragma solidity ^0.5.6;
pragma experimental ABIEncoderV2;
contract EmurgoCertificate {
//owner
address public owner;
//managers
mapping(address=>bool) public managers;
//certificate type
struct certificateClassification {
string name;
string description;
string[] skills;... | projects,updated onupdate projects in certificateadd event | function addProjectToCertificate(string memory certId, string memory _title, string memory _description, string memory _url,string memory _technology,string memory _updatedOn) public onlyOwnerOrManager {
project memory tempProject;
tempProject.title=_title;
tempProject.description=_descripti... | 12,634,778 |
pragma solidity ^0.5.0;
// Copyright © 2017, 2018 Weald Technology Trading Limited
// 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
//
//... | unpause the contract/ | function unpause() public ifPermitted(msg.sender, PERM_PAUSE) ifPaused returns (bool) {
paused = false;
emit Unpause();
return true;
}
| 15,780,539 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {PermissionOperators} from '@kyber.network/utils-sc/contracts/PermissionOperators.sol';... | Interface for callbacks hooks when user withdraws from staking contract/ | interface IWithdrawHandler {
function handleWithdrawal(address staker, uint256 reduceAmount) external;
}
pragma solidity 0.7.6;
}
| 10,160,022 |
pragma solidity ^0.4.24;
// ----------------------------------------------------------------------------
// 'Kaasy' CROWDSALE token contract
//
// Deployed to : 0x714c1ef3854591d4118bd6887d4740bc4d5f5412
// Symbol : KAAS
// Name : KAASY.AI Token
// Total supply: 500000000
// Decimals : 18
//
... | ------------------------------------------------------------------------ Set KYC state for `depositer` to `isAllowed`, by admins ------------------------------------------------------------------------emit KYCStateUpdate(depositer, isAllowed); | function setAddressKYC(address depositer, bool isAllowed) public onlyOwnerOrOwnerAPI returns (bool) {
kycAddressState[depositer] = isAllowed;
return true;
}
| 12,867,560 |
./partial_match/1/0x45550398f4D21A37c2598BddfBbD373928003A11/sources/src/libraries/external/FullMath.sol | Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 a The multiplicand b The multiplier denominator The divisor return result The 256-bit result Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv diff: original lib works under 0.7.6 ... | function mulDiv(uint256 a, uint256 b, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
assembly {
let mm := mulmod(a, b, not(0))
prod0 := mul(a, b)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (... | 4,329,307 |
./partial_match/1/0x20b0F20A14528948Ba85926584c00b172E05218a/sources/BX.sol | Returns the amount of tokens in existence. | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view ret... | 15,600,469 |
pragma solidity ^0.5.9;
pragma experimental ABIEncoderV2;
/*
Copyright 2020 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
... | Overridable way to get the WETH address. return wethAddress The WETH address. | function _getWethAddress()
internal
view
returns (address wethAddress)
{
return WETH_ADDRESS;
}
| 178,311 |
./full_match/1/0x44F031695794750CacDDEAd3019bD09d1691EE30/sources/contracts/HalloweenDorkis.sol | Set provenance once it's calculated/ | function setPrice(uint256 price) public onlyOwner {
tokenPrice = price;
emit priceChange(msg.sender, tokenPrice);
}
| 8,320,362 |
/**
*Submitted for verification at Etherscan.io on 2021-09-11
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implemente... | <g transform="rotate(50, 175, 175)"><circle cx="278" cy="312" r="1" fill="fff"/><circle cx="191" cy="111" r="1" fill="fff"/><circle cx="200" cy="167" r="1" fill="fff"/><circle cx="11" cy="145" r="1" fill="fff"/><circle cx="310" cy="205" r="1" fill="fff"/><circle cx="92" cy="55" r="2" fill="fff"/><circle cx="347" cy="11... | function getStars(uint256 tokenId) private pure returns (string memory)
{
return string(abi.encodePacked('<g transform="rotate(', toString(random(string(abi.encodePacked("RANDOMSTARROT", toString(tokenId)))) % 360), ', 175, 175)"><circle cx="278" cy="312" r="1" fill="#fff"/><circle cx="191" cy="111... | 2,182,854 |
./partial_match/11155111/0x92b1ac6344df1C1B959Ac0FB6A3D48aC45Fb0385/sources/contracts/Airdrop.sol | 批量發放空投,dests和values兩個數組長度若相等,則給不同地址發放對應數量token,如果values只有一個元素,則每個地址發放等量token 批量發放一般為官方操作,不受時間、領取額度等以上各種條件限制 判斷當前合約中剩餘token是否夠發放數量,如果不夠則結束髮放並返回已發放的最後一個索引 接收地址不為0,發放數量不為0,則執行發放 | function doAirdrop(address[] memory dests, uint256[] memory values)
external
virtual
returns (uint256)
{
require(msg.sender == owner, "Airdropper: forbidden");
require(tokenAddress != address(0), "Airdropper: address not zero");
uint256 i = 0;
while (i < d... | 3,534,643 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
// NOTE for debugging only
import 'hardhat/console.sol';
// NOTE
// Consider storing a board as an N by M matrix of uint256
// values only. Any operation will modify this map instead
// of storing info to create the map on demand. In other words,
// mov... | ensure end location is walkable, start assumed to be OK add obstructions check adjacent cells | function isValidMove(
uint256 _start,
uint256 _end,
uint256[4] memory _obstructions
) public view returns (bool) {
uint256 numCells = rows * cols;
if (_start >= numCells || _end >= numCells) {
return false;
}
if (_start == _end) {
return false;
}
uint256[] memory map... | 1,055,524 |
pragma solidity 0.5.9;
import "../contracts_common/Libraries/SigUtil.sol";
import "../contracts_common/Libraries/PriceUtil.sol";
import "../Sand.sol";
import "../Asset.sol";
import "../contracts_common/Interfaces/ERC20.sol";
import "../TheSandbox712.sol";
import "../contracts_common/BaseWithStorage/MetaTransactionRece... | cancel a offer previously signed, new offer need to use a id not used yet offerId offer to cancel | function cancelSellerOffer(uint256 offerId) external {
claimed[msg.sender][offerId] = MAX_UINT256;
emit OfferCancelled(msg.sender, offerId);
}
| 918,037 |
pragma solidity ^0.4.23;
contract ERC20Interface {
function totalSupply() public view returns (uint);
function balanceOf(address _owner) public view returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint ... | Transfer tokens from one address to another | function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
require(balances[_from] >= _value);
require(allowed[_from][msg.sender] >= _value);
if (transferMain(_from, _to, _value)){
allowed[_from][msg.sender] -= _value;
return true;... | 7,952,847 |
pragma solidity ^0.4.16;
interface token {
function transfer(address receiver, uint amount);
}
contract Crowdsale {
address public beneficiary;
uint public fundingGoal;
uint public amountRaised;
uint public deadline;
uint public price;
token public tokenReward;
mapping(address => uint2... | Release 10% of reward token Release 10% of reward token when beneficiary call this function./ | function releaseTenPercent() afterDeadline {
require(crowdsaleClosed);
require(percent <= 90);
if (fundingGoalReached && beneficiary == msg.sender) {
percent += 10;
}
}
| 6,738,682 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.7;
import "./strategy-base.sol";
abstract contract StrategyBasisFarmBase is StrategyBase {
// <token1>/<token2> pair
address public token1;
address public token2;
address public rewards;
address public pool;
address[] public path;
/... | State Mutations | function balanceOfPool() public view override returns (uint256) {
return IStakingRewards(pool).balanceOf(poolId,address(this));
}
| 12,773,165 |
./full_match/1/0xa80505c408C4DEFD9522981cD77e026f5a49FE63/sources/contracts/Neuy.sol | Change status of pull | function setPullStatus(bool _pullStatus) public onlyOwner {
pullEnabled = _pullStatus;
}
| 3,184,303 |
//Address: 0xc86414354c06dc8ba428a08bcc589c72c2805959
//Contract name: GAP
//Balance: 0 Ether
//Verification Date: 8/20/2017
//Transacion Count: 13
// CODE STARTS HERE
pragma solidity ^0.4.2;
contract owned
{
address public owner;
function owned()
{
owner = msg.sender;
}
modifier onlyOwner
{
require(... | Calculates the tokens amount | function tokensAmount() internal returns (uint256 _tokensAmount)
{
amountRaisedEth = amountRaisedEth.wplus(amount);
uint256 raisedForNextLevel = amountRaisedEth.wminus(_currentLevelEth);
remainig = amount.minus(raisedForNextLevel);
TokensAmount = (raisedForNextLevel.wdivide(_nextLevelPrice)).wplus(rema... | 12,893,462 |
pragma solidity 0.4.24;
import "./lib/Whitelist.sol";
import "./TraceToRequestorListInterface.sol";
/**
* @title TraceToSPList
* @dev This contract is the whitelist contract for requestors.
*/
contract TraceToRequestorList is Whitelist, TraceToRequestorListInterface{
struct meta {
string country;
... | _hashForMoreDetails the hash of the JSON object in IPFS/ | function addPendingRequestorPR(address _requestorPR, string _country, string _name, string _email, string _uriForMoreDetails, string _hashForMoreDetails)
public {
pendingMetaInfo[_requestorPR] = meta(_country, _name, _email, _uriForMoreDetails, _hashForMoreDetails);
emit NewPendingRequestor(_req... | 12,712,060 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.2;
// import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
// import "@openzeppelin/contracts/access/Ownable.sol";
// import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
/**
* @dev Provides information about the current ex... | See {IERC721Metadata-symbol}./ | function symbol() public view virtual override returns (string memory) {
return _symbol;
}
| 445,488 |
./partial_match/1/0x271682DEB8C4E0901D1a1550aD2e64D568E69909/sources/src/v0.8/dev/VRF.sol | Check that product==scalarmultiplicand Based on Vitalik Buterin's idea in ethresear.ch post cited below. multiplicand: secp256k1 point scalar: non-zero GF(GROUP_ORDER) scalar product: secp256k1 expected to be multiplier multiplicand return verifies true iff product==scalarmultiplicand, with cryptographically high ... | function ecmulVerify(
uint256[2] memory multiplicand,
uint256 scalar,
uint256[2] memory product
) internal pure returns (bool verifies) {
bytes32 scalarTimesX = bytes32(mulmod(scalar, x, GROUP_ORDER));
address actual = ecrecover(bytes32(0), v, bytes32(x), scalarTimesX);
address expected = ad... | 3,883,075 |
/*
Copyright 2019 dYdX Trading Inc.
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 ... | solium-disable-next-line security/no-assign-params | function _addMarketsToBitmap(
uint256[] memory markets,
uint256[] memory bitmaps,
uint marketsLength
) private pure returns (uint) {
for (uint i = 0; i < markets.length; i++) {
if (!Bits.hasBit(bitmaps, markets[i])) {
Bits.setBit(bitmaps, markets[i]);
... | 15,809,484 |
./partial_match/4/0xA1F3D61edAE8c712f9365622987DD178F664Ddfb/sources/JustswapExchange.sol | Convert Tokens to TRX. User specifies maximum input && exact output. trx_bought Amount of TRX purchased. max_tokens Maximum Tokens sold. deadline Time after which this transaction can no longer be executed. return Amount of Tokens sold./ | function tokenToTrxSwapOutput(uint256 trx_bought, uint256 max_tokens, uint256 deadline) public returns (uint256) {
return tokenToTrxOutput(trx_bought, max_tokens, deadline, msg.sender, msg.sender);
}
| 16,996,550 |
./partial_match/1/0x21E354Da5D929A4da55428F6bfd71eD9Ffd5001F/sources/src/contracts/FraxlendPairCore.sol | The ```liquidate``` function allows a third party to repay a borrower's debt if they have become insolvent Caller must invoke ```ERC20.approve``` on the Asset Token contract prior to calling ```Liquidate()``` _sharesToLiquidate The number of Borrow Shares repaid by the liquidator _deadline The timestamp after which ... | function liquidate(uint128 _sharesToLiquidate, uint256 _deadline, address _borrower)
external
whenNotPaused
nonReentrant
approvedLender(msg.sender)
returns (uint256 _collateralForLiquidator)
{
if (block.timestamp > _deadline) revert PastDeadline(block.timestamp, _... | 4,323,396 |
./full_match/42/0xF4F0DC4AEEd4DddecFD36100d139ce9F9c9902a1/sources/contracts/AmongAllTemplate.sol | No se permite que un usuario se auto acepte una reclamación.Sólo se pueden aceptar aquellas peticiones en estado “Unaccepted”.Sólo se permite aceptar reclamaciones a usuarios registrados.Un usuario sólo puede votar una vez la reclamaciónrequire (users[msg.sender].claim.voted == false, "El usuario ya ha votado");Si la p... | function acceptClaim(address addressuser) public returns (bool) {
require (msg.sender != addressuser, "El usuario no se puede aceptar su propia claim");
require (users[msg.sender].claim.claim_status == C_status.Unaccepted, "La peticion tiene que estar Unaccepted");
require (users[msg.sender]... | 16,276,425 |
./full_match/43114/0x67E5830CCef2Dc38aebEf4eC7D06baD5b5957D44/sources/TraderJoeFeeCollectorAdapter.sol | Allows the recovery of tokens sent by mistake to this contract, excluding tokens relevant to its operations. The full balance is sent to the treasury address. This is a privileged function. _token The address of the token to be recovered./ | function recoverLostFunds(address _token) external onlyOwner nonReentrant
delayed(this.recoverLostFunds.selector, keccak256(abi.encode(_token)))
{
require(_token != bonusToken, "invalid token");
require(_token != sourceToken, "invalid token");
require(_token != peggedToken, "invalid token");
for (uint256 _i... | 4,564,131 |
./partial_match/3/0x33a661d0133b03d1EBC7b1Cf2510845849f91643/sources/KebbeToken.sol | See {IERC20-approve}. Requirements: - `spender` cannot be the zero address./ | function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
| 5,167,168 |
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity >=0.4.22 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
/**
* @notice basic implementation of the Staking Mechanism for Ni... | A method to allow a staker to check his rewards. _stakeHolder The stakeholder to check rewards for./ | function getRewards(address _stakeHolder) public view returns(uint256) {
return rewards[_stakeHolder];
}
| 12,791,009 |
./full_match/1/0x83797D8608aA53dFcC77D350081383dF021ee5Bc/sources/contracts/base/ERC721.sol | See {IERC721-approve}./ | function approve(address to, uint256 tokenId) external override {
require(tokenId >= _idShift, 'ERC721: owner query for nonexistent token');
tokenId = tokenId - _idShift;
address owner = ERC721._ownerOf(tokenId);
require(to != owner, 'ERC721: approval to current owner');
re... | 17,008,115 |
pragma solidity ^0.4.15;
/**
* @title Queue
* @dev Data structure contract used in `Crowdsale.sol`
* Allows buyers to line up on a first-in-first-out basis
* See this example: http://interactivepython.org/courselib/static/pythonds/BasicDS/ImplementingaQueueinPython.html
*/
contract Queue {
/* State variables... | Returns the address of the person in the front of the queue / | function getFirst() public constant returns(address) {
if (empty()) {
return 0;
}
return queue[front];
}
| 13,014,973 |
// Copyright 2021 Google LLC. All Rights Reserved.
//
// 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... | getter for root for a specific treeId. | function getRootForTreeId(bytes32 treeId) public view returns (bytes32) {
return calcMerkleRoot(treeDatas[treeId].compactRange);
}
| 12,598,357 |
./full_match/42161/0x2b99224DAD73d7D84b7C74E9161BbD0D01a2A15b/sources/contracts/multiinvoker/MultiInvoker.sol | Deposits `amount` DSU from `msg.sender` into `account`s `product` collateral account account Account to deposit funds on behalf of product Product to deposit funds for amount Amount of DSU to deposit into the collateral account/ Pull the token from the `msg.sender` Deposit the amount to the collateral account | function depositTo(address account, IProduct product, UFixed18 amount) private {
DSU.pull(msg.sender, amount);
collateral.depositTo(account, product, amount);
}
| 16,305,855 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;
library Merkle_Library_ICBS {
// Hashes a and b in the order they are passed
function hash_node(bytes32 a, bytes32 b) internal pure returns (bytes32 hash) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
... | Try to append elements, given an Existence Multi Proof and elements to append | function try_append_many_using_many(
bytes32 root,
bytes[] calldata elements,
bytes[] calldata append_elements,
bytes32[] calldata proof
) internal pure returns (bytes32 element_root) {
bytes32 total_element_count = proof[0];
require(root != bytes32(0) || total_element_count == bytes32(0), ... | 15,873,612 |
./full_match/43113/0xDdEeA2E71ccA4A6F39a4Ab892F514c3a461057BB/sources/Masterchef.sol | Update reward variables of the given pool to be up-to-date. | function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.timestamp <= pool.lastRewardSecond) {
return;
}
if (pool.lpSupply == 0 || pool.allocPoint == 0) {
pool.lastRewardSecond = block.timestamp;
return;
... | 7,195,338 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the on... | @inheritdoc IRaribleSecondarySales using ERC2981 implementation to get the recipient & amount | function getFeeRecipients(uint256 tokenId)
public
view
override
returns (address payable[] memory recipients)
{
(address recipient, uint256 amount) = royaltyInfo(tokenId, 10000);
if (amount != 0) {
recipients = new address payable[](1);
rec... | 9,937,759 |
./full_match/80001/0x9BBf69025BaC045a5109C6eAc64aDBE8bB0cF5D6/sources/contracts/Contract.sol | function to set the amount allowable to be claimed. Only the owner can call this function | function setAmountallowed(uint newAmountAllowed) public onlyOwner {
amountAllowed = newAmountAllowed;
}
| 5,571,480 |
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./Unicode.sol";
import "./UTF8Encoder.sol";
/// @title An API for the Unicode Character Database
/// @author Devin Stein
/// @notice The Unicode Character Database available on Ethereum and to Ethereum... | Get the Unicode decomposition mapping of `_char` This can be used to implement the Unicode decomposition algorithm. _char The character to get return The Unicode decomposition mapping as an array of code points of `_char` | function decompositionMapping(string calldata _char)
external
view
returns (uint32[] memory)
{
return get(_char).decompositionMapping;
}
| 953,369 |
./partial_match/1/0x07567f9c3ec198174737451F95fA5B7359615c8a/sources/IouVesting.sol | return The total number of deposit tokens staked globally, by all users./ | function totalStaked() public view override returns (uint256) {
return _iouPool.balance();
}
| 4,355,580 |
pragma solidity ^0.5.7;
// Voken Public Sale
//
// More info:
// https://vision.network
// https://voken.io
//
// Contact us:
// support@vision.network
// support@voken.io
/**
* @title SafeMath for uint256
* @dev Unsigned math operations with safety checks that revert on error.
*/
librar... | Voken interface/ | interface IVoken {
function balanceOf(address owner) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function inWhitelist(address account) external view returns (bool);
function referrer(address account) external view returns (address);
function... | 12,538,028 |
./full_match/3/0x7EFaD749c69962F8BBB659196c22B5E64953507b/sources/contracts/escrow.sol | Получаем минимальную величину ставки | function GetBidMinimum() public view returns (uint) {
return minimumBid;
}
| 14,189,917 |
/**
*Submitted for verification at Etherscan.io on 2022-01-22
*/
// hevm: flattened sources of src/FlapperMassBid.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity =0.8.11 >=0.5.12;
////// lib/dss-interfaces/src/ERC/GemAbstract.sol
/* pragma solidity >=0.5.12; */
// A base ERC-20 abstract class
// h... | https:github.com/makerdao/sai/blob/master/src/vox.sol | interface SaiVoxAbstract {
function fix() external view returns (uint256);
function how() external view returns (uint256);
function tau() external view returns (uint256);
function era() external view returns (uint256);
function mold(bytes32, uint256) external;
function par() external returns (ui... | 2,203,331 |
// SPDX-License-Identifier: Apache-2.0
/*
* Copyright 2020, Offchain Labs, Inc.
*
* 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
*
*... | overwrite memory so the L2 router receives the L2 address of each gateway | function _setGateways(
address[] memory _token,
address[] memory _gateway,
uint256 _maxGas,
uint256 _gasPriceBid,
uint256 _maxSubmissionCost
) internal returns (uint256) {
require(_token.length == _gateway.length, "WRONG_LENGTH");
for (uint256 i = 0; i < ... | 13,084,329 |
./full_match/3/0xd87FC188326669e5e44AaE8E7E8990536e0b3295/sources/contracts/tokenA.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(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
| 8,280,693 |
/**
*Submitted for verification at Etherscan.io on 2021-04-27
*/
// File: contracts\lib\IERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.3;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in exist... | Reset the blockCursor blockCursor blockCursor value | function setBlockCursor(uint blockCursor) override external onlyGovernance {
_blockCursor = blockCursor;
}
| 6,552,833 |
/**
*Submitted for verification at Etherscan.io on 2021-04-22
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While th... | Mints Free Apes/ If we haven't set the starting index and this is either 1) the last saleable token or 2) the first token to be sold after the end of pre-sale, set the starting index block | function mintApe(uint256 imageId) public payable {
require(saleIsActive, "Sale must be active to mint Ape");
require(imageId <= 9999 && imageId >= 0, "Incorrect imageId");
uint256 mintIndex = totalSupply();
uint256 tokenIndex;
if (mintIndex == 0) {
tokenIndex = 1... | 1,187,835 |
// SPDX-License-Identifier: GPL-3.0
//pragma solidity >=0.4.16 <0.7.0;
pragma solidity ^0.6.6;
//import "@openzeppelin/contracts/access/Ownable.sol";
// -- LaunchSwap, a contract for launching ventures --
// investor submit capital and can redeem it at a cost
// for now this is a single instance of the swap
// the o... | withdraw capitalswap tokens for ethcheck if roundrequire (msg.value == amountETH)cash is receivedsend tokensERC20Token tok = ERC20Token(tokenAddr);tok.transferFrom(_owner, _recipient, 100); | function DivestToTokens(uint256 amountTokens) public {
uint256 bid = getBid();
uint256 receive_eth = amountTokens / bid;
}
| 7,934,702 |
/**
*Submitted for verification at Etherscan.io on 2020-11-11
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() ext... | Token price in eth Current price Initial price | function tokenPrice() public view returns (uint256) {
uint256 ethAmount = IERC20(weth).balanceOf(pairAddress);
uint256 tokenAmount = IERC20(token).balanceOf(pairAddress);
return tokenAmount > 0 ?
ethAmount.mul(1e18).div(tokenAmount) :
(uint256(1e18).div(2));
}
| 12,737,744 |
./full_match/137/0x712A6aa3396291839357b6545DEb24AE8c2e2618/sources/contracts/SGFP.sol | mints tokens to user address to the address that tokens are minted to amount the number of tokens to mint Can only be called by accounts with MINTER or above role. Mints `amount` tokens to `to`./ require( hasRole(ATTENDEE_ROLE, to), "This address is not approved to receive tokens" ); | function airdrop(address to, uint256 amount)
external
virtual
onlyRole(MINTER_ROLE)
whenNotPaused
{
_mint(to, amount);
_approve(to, admin, amount);
}
| 4,773,372 |
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
// @title Contract for adopting a D... | Returns the information about a specific DevDoggie token _tokenId The ID of the DevDoggie token return Returns a _devDoggieType of uint256 return Returns a string for _devDoggieFirstName return Returns a string for _devDoggieLastName | function getDevDoggie(uint256 _tokenId)
external
view
returns (
uint256 _devDoggieType
, string memory _devDoggieFirstName
, string memory _devDoggieLastName
)
{
_devDoggieType = devDoggieTypes[_tokenId];
_devDoggieF... | 5,531,613 |
./full_match/5/0x3D075e95D2eCbec823CD3f2F17DABb97e941CdE4/sources/src/ERC721DelayedRevealAirdrop.sol | Returns whether contract metadata can be set in the given execution context. | function _canSetContractURI() internal view virtual override returns (bool) {
return msg.sender == owner();
}
| 7,056,397 |
pragma solidity ^0.4.21;
// ----------------------------------------------------------------------------
// 'Digitize Coin - DTZ' token contract
//
// Symbol : DTZ
// Name : Digitize Coin
// Total supply: 200,000,000
// Decimals : 18
//
//
// (c) Radek Ostrowski / http://startonchain.com - The MIT Licen... | Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first re... | function approve(address _spender, uint256 _value) canTransfer public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
| 1,531,356 |
/**
*Submitted for verification at Etherscan.io on 2022-04-10
*/
/******************************
*
* https://t.me/MusktwitterDAOVerify
*
* https://twitter.com/MuskDAOERC20
*
******************************/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
abstract contract Context {
function _msgSender... | exclude from paying fees or having max transaction amount | constructor() ERC20("MuskTwitterDAO", "MuskTwitterDAO") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2... | 2,218,365 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC20Vesting.sol";
contract TaleToken is ERC20Vesting {
struct InstantBeneficiary {
address beneficiary;
uint256 amount;
}
uint256 private vestingPeriod = 2592000; // 30 days
uint256 private private... | Adds beneficiary and amount for exchange fee vesting One address can participate in one vesting beneficiary address of the beneficiary to whom vested tokens are transferred amount total amount of tokens to be released at the end of the vesting/ | function addExchangeFeeVestingAddress(address beneficiary, uint256 amount) onlyOwner external {
_createVestingSchedule(
beneficiary,
exchangeFeeVestingStart,
exchangeFeeVestingDuration,
vestingPeriod,
amount);
exchangeFeeVestingAddresses... | 1,036,562 |
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/libraries/CurveMath.sol | Computes the amount of token over-collateralization needed to buffer any loss of precision rounding in the fixed price arithmetic on curve price. This is necessary because price occurs in different units than tokens, and we can't assume a single wei is sufficient to buffer one price unit. In practice the price u... | function priceToTokenPrecision (uint128 liq, uint128 price,
bool inBase) internal pure returns (uint128) {
unchecked {
if (inBase) {
return (liq >> 64) + 1;
uint192 step = FixedPoint.divQ64(liq, price - 1);
uint192... | 4,651,656 |
pragma solidity ^0.4.24;
contract Enum {
enum Operation {
Call,
DelegateCall,
Create
}
}
contract EtherPaymentFallback {
/// @dev Fallback function accepts Ether transactions.
function ()
external
payable
{
}
}
contract Executor i... | Marks a message as signed _data Arbitrary length data that should be marked as signed on the behalf of address(this)/ | function signMessage(bytes _data)
public
authorized
{
signedMessages[getMessageHash(_data)] = 1;
}
| 12,750,530 |
./partial_match/4/0x86614235b3dFE0b96D3355EB0cF0e7830af465B0/sources/RoboController.sol | Transfer ROBO to the account, ONLY if they have accrued tokens above the threshold account The address of the account to transfer ROBO to amount The amount of ROBO to (possibly) transfer return The amount of ROBO which was NOT transferred to the user/ | function _transferROBO(address account, uint amount) internal returns (uint) {
uint total = roboAccrued[account].add(amount);
if (total >= roboClaimThreshold) {
RoboGovToken(roboGovToken).mint(account, total);
return 0;
}
return total;
}
| 8,568,593 |
pragma solidity ^0.4.18;
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) {
// assert(b > 0); // Solidity a... | Payable method Anyone can buy the tokens on tokensale by paying ether | function () public payable {
tokensale(msg.sender);
}
| 8,074,892 |
// contracts/MyContract.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.7.0;
//import "@openzeppelin/contracts/GSN/GSNRecipientERC20Fee.sol";
//import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/upgrades/contracts/Initializable.sol";
//import "@openzeppelin/contracts/acces... | Admin Public Function | function isAdmin(address adminac) public view returns (bool) {
return _admins[adminac];
}
| 7,241,384 |
./partial_match/1/0x22f1c2238c77698d95d2bf09442C289e26093169/sources/LANDAuction.sol | LAND price based on time Note that will select the function to calculate based on the time It should return endPrice if _time < duration _time - uint256 time passed before reach duration return uint256 price for the given time/ | function _getPrice(uint256 _time) internal view returns (uint256) {
for (uint256 i = 0; i < curves.length; i++) {
Func storage func = curves[i];
if (_time < func.limit) {
return func.base.sub(func.slope.mul(_time));
}
}
revert("Invalid time... | 4,120,728 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.