file_name stringlengths 71 779k | comments stringlengths 0 29.4k | code_string stringlengths 20 7.69M | __index_level_0__ int64 2 17.2M |
|---|---|---|---|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, s... | admin function to burn Goop from multiple addresses/ | function burnGoopBatch(address[] calldata _addr, uint256 _goop) external override onlyAdmin {
for (uint256 i = 0; i < _addr.length; i++) {
_burnGoop(_addr[i], _goop);
}
}
| 13,679,497 |
./partial_match/1/0xe4A1DCb37087AB66e325b0a099878c86c498a13f/sources/VCAT.sol | remove limits after token is stable | function Updatealimits() external onlyOwner returns (bool){
limitsInEffect = false;
transferDelayEnabled = false;
return true;
}
| 2,835,452 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./ERC721A.sol";
import ".... | If not able to find owner, set to admin... | function recreateMapping() public onlyAdmin {
}
| 3,901 |
./partial_match/4/0xC079467bf2074A3FB5D690Ab4fCC3A8601000a48/sources/EtherFund.sol | internal low level function for transfer functionality with balance control | function _transfer(address _sender, address _recipient, uint256 _amount) internal {
require(_sender != address(0), "Transfer from the zero address");
require(_recipient != address(0), "Transfer to the zero address");
balanceOf[_sender] = balanceOf[_sender].sub(_amount, "Transfer amou... | 8,793,674 |
./full_match/11155111/0xE06966B21ED93a2b0fEF7BFA648346e65A29e49B/sources/project_/contracts/VotingEscrow.sol | Contract Initialize token_addr `EQUAL` token address/ mint-ish burn-ish | function initialize(
address token_addr,
address art_proxy
) public initializer {
token = token_addr;
voter = msg.sender;
team = msg.sender;
artProxy = art_proxy;
point_history[0].blk = block.number;
point_history[0].ts = block.timestamp;
... | 3,819,671 |
./full_match/71402/0x62AEdB532DBa29a45C36396A84b4D57FAF5766Ec/sources/contracts/aave/AaveLinearPoolFactory.sol | Deploys a new `AaveLinearPool`./ We are going to deploy both an AaveLinearPool and an AaveLinearPoolRebalancer set as its Asset Manager, but this creates a circular dependency problem: the Pool must know the Asset Manager's address in order to call `IVault.registerTokens` with it, and the Asset Manager must know about ... | function create(
string memory name,
string memory symbol,
IERC20 mainToken,
IERC20 wrappedToken,
uint256 upperTarget,
uint256 swapFeePercentage,
address owner
) external nonReentrant returns (AaveLinearPool) {
bytes32 rebalancerSalt = bytes32(_ne... | 7,092,497 |
pragma solidity >=0.4.21 <0.6.0;
contract AgriSupplyChain {
struct ProofEntry {
address owner;
string encryptedProof;
string publicProof;
string previousTrackingId;
}
// map of trackingId to proofEntry
mapping (string => ProofEntry) private proofs;
// map of trackingId to add... | TODO: ask Beat- why not just change the owner in the ProofEntry? why do we need the isTransfered mapping? in this case, there might be multiple owners. Is this what we want? | function transfer(string trackingId, address newOwner) returns(bool success) {
if (hasProof(trackingId)) {
ProofEntry memory pe = getProofInternal(trackingId);
if (msg.sender == pe.owner) {
isTransfered[trackingId][newOwner] = true;
TransferCompleted(msg.sender, newOwner, trackin... | 5,356,408 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.5.16;
contract JoetrollerErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
JOETROLLER_MISMATCH,
INSUFFICIENT_SHORTFALL,
INSUFFICIENT_LIQUIDITY,
INVALID_CLOSE_FACTOR,
INVALID_COLLATERAL_FACTOR,
... | Accrue JOE/AVAX to the market by updating the supply index rewardType 0: JOE, 1: AVAX jToken The market whose supply index to update/ | function updateRewardSupplyIndex(uint8 rewardType, address jToken) internal {
require(rewardType <= 1, "rewardType is invalid");
RewardMarketState storage supplyState = rewardSupplyState[rewardType][jToken];
uint256 supplySpeed = rewardSpeeds[rewardType][jToken];
uint256 blockTimesta... | 1,810,159 |
./partial_match/56/0xdbbc32A51E27aFFC2cE86774D5494215C2A49175/sources/MasterChef.sol | Withdraw LP tokens from MasterChef. | function withdraw(uint256 _pid, uint256 _amount) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
require(user.amount >= _amount, "withdraw: not good");
updatePool(_pid);
uint256 pending = user.amount.mul(pool.accFrog2PerSha... | 11,220,458 |
./full_match/7700/0x9B2a63F27661A468E2da22226b64A4914144f195/sources/contracts/mixins/LiquidityMining.sol | Keeps track of the tick crossings Needs to be called whenever a tick is crossed | function crossTicks(
bytes32 poolIdx,
int24 exitTick,
int24 entryTick
) internal {
uint256 numElementsExit = tickTracking_[poolIdx][exitTick].length;
tickTracking_[poolIdx][exitTick][numElementsExit - 1]
.exitTimestamp = uint32(block.timestamp);
Storag... | 4,651,240 |
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2021 0xdev0 - All rights reserved
// https://twitter.com/0xdev0
pragma solidity ^0.8.0;
interface IERC20 {
function initialize() external;
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint... | Never more than a total of 20% | function setLiqParams(
uint _liqMinHealth,
uint _liqFeePool,
uint _liqFeeSystem,
uint _liqFeeCaller
) public onlyOwner {
require(_liqFeePool + _liqFeeSystem + _liqFeeCaller <= 20e18, "PairFactory: fees too high");
liqMinHealth = _liqMinHealth;
liqFeePool = _liqFeePool;
liqFeeSystem ... | 6,024,615 |
// Sources flattened with hardhat v2.6.6 https://hardhat.org
// File deps/@openzeppelin/contracts-upgradeable/proxy/Initializable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.24 <0.7.0;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be de... | 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 shares) internal override {
require(account != address(0), "ERC20: mint to the zero address");
uint256 amount = sharesToBalance(shares);
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(shares);
_bal... | 1,369,526 |
// SPDX-License-Identifier: MIT
//Developed By https://twitter.com/denialcd048
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@o... | Destroys `tokenId`. The approval is cleared when the token is burned. Requirements: - `tokenId` must exist. Emits a {Transfer} event./ Clear approvals | function _burn(uint256 tokenId) internal virtual {
address owner = ownerOf(tokenId);
_beforeTokenTransfers(owner, address(0), tokenId, 1);
_approve(address(0), tokenId, owner);
AddressData memory addressData = _addressData[owner];
_addressData[owner] = AddressData(
... | 12,780,813 |
./full_match/43113/0x290e27369924c6fdBD7A35e45815DD1d8A1418f6/sources/DigitalSecurities/STBX.sol | Decrease allowance for the `_spender`. _spender Spender of tokens. _subtractedValue Value to substruct from the allowance for the `_spender`. return A boolean value indicating whether the operation succeeded. Requirements: - result of substruction must be greater or equal to 0./ | function decreaseAllowance(address _spender, uint256 _subtractedValue)
public
virtual
onlyWhitelisted(msg.sender)
onlyWhitelisted(_spender)
onlyWithUnfrozenFunds(msg.sender)
returns (bool)
{
_approve(
msg.sender,
_spender,
... | 13,201,935 |
./full_match/1/0x676524646377A6e66Ca797edF7CCB1B5162a8cE0/sources/contracts/Assets/UniV3Asset.sol | Increases liquidity in the current range Pool must be initialized already to add liquidity usdxAmount USDX Amount of asset to be deposited sweepAmount Sweep Amount of asset to be deposited usdxMinIn Min USDX amount to be used for liquidity. sweepMinIn Min Sweep amount to be used for liquidity./ | function invest(
uint256 usdxAmount,
uint256 sweepAmount,
uint256 usdxMinIn,
uint256 sweepMinIn
)
external
onlyBorrower
whenNotPaused
nonReentrant
validAmount(usdxAmount)
validAmount(sweepAmount)
returns (uint256, uint256)
... | 8,484,311 |
./full_match/1/0x42c98B354Ea1232Bf2820842905f45732665969F/sources/contracts/ChainLinkTest.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
f... | 9,602,025 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IUniswapV2Pair {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint... | to reset token routing values in order to calculate fees properly | function resetTokenRouting() private {
tokensForMarketing = 0;
tokensForDev = 0;
tokensForGameDev = 0;
tokensForLiquidity = 0;
}
| 5,850,892 |
/**
*Submitted for verification at Etherscan.io on 2021-11-26
*/
/*
________ _________ ___ ___ ________ ___ ________ ________ _________ ________ ________ ________ ________ _____ ___... | Marketing wallet defaults to the owner at openTrading 2% | function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
_feeAddrWallet1 = payable(_msgSender());
_isExcludedFromFee[_feeAd... | 7,869,470 |
./partial_match/42/0x3478D03E515c2F4Af714d00Fd51AC0d59A876081/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 calculate token amount to be created update state _weiRaised = _weiRaised.add(weiAmount); _processPurchas... | function buyTokens(address beneficiary) public view returns(uint256) {
uint256 weiAmount =1;
_preValidatePurchase(beneficiary, weiAmount);
uint256 tokens = _getTokenAmount(weiAmount);
return(tokens);
}
| 3,429,101 |
./partial_match/1/0x3A2B16cA90ea56d34A00898850C52B1F1f2dAe26/sources/contracts/Votium.sol | deposit same token to multiple gauges with different amounts in a single round | function depositUnevenSplitGauges(
address _token,
uint256 _round,
address[] memory _gauges,
uint256[] memory _amounts,
uint256 _maxPerVote,
address[] memory _excluded
) public {
require(_gauges.length == _amounts.length, "!length");
require(_round... | 15,666,864 |
pragma solidity ^0.4.21;
contract ERC721 {
// Required methods
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view ret... | Get the current balance of the contract. | function getContractBalance() public view returns(uint256) {
return (address(this).balance);
}
| 1,971,146 |
./full_match/5/0x8956E81d76FDdAbF0de54D8Da0d06c2474DeA340/sources/contracts/flatten.sol | Returns the EIP-155 chain ID, token contract address, and token ID for the token that owns this account. | function token()
external
view
returns (
uint256 chainId,
address tokenContract,
uint256 tokenId
)
{
return ERC6551AccountLib.token();
}
| 11,606,087 |
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.4;
import {ILendPoolAddressesProvider} from "../interfaces/ILendPoolAddressesProvider.sol";
import {ILendPoolConfigurator} from "../interfaces/ILendPoolConfigurator.sol";
import {ILendPool} from "../interfaces/ILendPool.sol";
import {IBToken} from "../interfaces... | Initializes the bToken addressProvider The address of the address provider where this bToken will be used treasury The address of the Bend treasury, receiving the fees on this bToken underlyingAsset The address of the underlying asset of this bToken/ | function initialize(
ILendPoolAddressesProvider addressProvider,
address treasury,
address underlyingAsset,
uint8 bTokenDecimals,
string calldata bTokenName,
string calldata bTokenSymbol
) external override initializer {
__IncentivizedERC20_init(bTokenName, bTokenSymbol, bTokenDecimals);... | 6,907,868 |
./full_match/84531/0xC960aA9E4F685421638379Baa47Be0f1F2dfe7C6/sources/contracts/JetStakingV1.sol | Claim all stream rewards on behalf of other users. accounts the user account addresses. | function claimAllOnBehalfOfOtherUsers(address[] calldata accounts)
external
pausable(1)
onlyRole(CLAIM_ROLE)
{
_before();
uint256 accountsLength = accounts.length;
for (uint256 i = 0; i < accountsLength; i++) {
_moveAllRewardsToPending(accounts[i]);
... | 11,505,763 |
// SPDX-License-Identifier: MIT
/*
RTFKT Legal Overview [https://rtfkt.com/legaloverview]
1. RTFKT Platform Terms of Services [Document #1, https://rtfkt.com/tos]
2. End Use License Terms
A. Digital Collectible Terms (RTFKT-Owned Content) [Document #2-A, https://rtfkt.com/legal-2A]
B. Digital Colle... | Change the NMNLTH address contract | function setNewMnlthAddress(address newAddress) public onlyOwner {
newmnlthAddress = newAddress;
}
| 2,493,241 |
pragma solidity ^ 0.4.24;
// ----------------------------------------------------------------------------
// 安全的加减乘除
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns(uint c) {
c = a + b;
require(c >= a);
... | 防止转移到0x0, 用burn代替这个功能如果用户没有上家指定上家地址 | function _transfer(address from, address to, uint tokens) private returns(bool success) {
require(!frozenAccount[from]);
require(!frozenAccount[to]);
require(actived == true);
uint addper = tokens*transper/100;
uint allmoney = tokens + addper;
require(balances[from] >= allmoney);
require(t... | 6,375,860 |
./full_match/1/0x4837d515320e227167d70992D50f70fACD0A68aE/sources/contracts/interfaces/curve/ITokenMinter.sol | Not a complete interface, but should have what we need | interface ITokenMinter {
function minted(address arg0, address arg1) external view returns (uint256);
function mint(address gauge_addr) external;
pragma solidity 0.8.3;
}
| 9,695,015 |
pragma solidity ^0.5.0;
import "../zeppelin-solidity/contracts/ownership/Ownable.sol";
import "./CustomWagers.sol";
import "./Wagers.sol";
import "./Rewards.sol";
import "./Mevu.sol";
contract CancelController is Ownable {
CustomWagers private customWagers;
Wagers private wagers;
Rewards private rewards;... | msg.sender.transfer (customWagers.getOrigValue(wagerId)); | function cancelWagerCustom (
bytes32 wagerId,
bool withdraw
)
onlyBettorCustom(wagerId)
notPaused
notTakenCustom(wagerId)
external
{
customWagers.setSettled(wagerId);
if (withdraw) {
rewa... | 2,503,753 |
./full_match/1/0x959eE2fC3bCE6A0f008deaBCAb5BF30A809d94a1/sources/contracts/UniswapPriceOracle.sol | asset and weth pool asset and stable coin pool | function getETHAmount(address asset, uint amountIn) public view returns (uint) {
address pair = assetPair[asset];
address token0 = IUniswapV2Pair(pair).token0();
address token1 = IUniswapV2Pair(pair).token1();
uint power;
uint result = cumulativePrices[pair][asset].priceAve... | 2,906,362 |
/**
*Submitted for verification at Etherscan.io on 2021-11-25
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
... | 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 {ERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have a... | function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
| 8,059,125 |
pragma solidity 0.7.6;
import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/EnumerableMapUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "contracts/interfaces/apwine/tokens/IFutureY... | Register the sender to the corresponding platformController _user the address of the user futuresAddresses the addresses of the futures to claim the FYT from/ | function claimSelectedYield(address _user, address[] memory futuresAddresses) public {
for (uint256 i = 0; i < futuresAddresses.length; i++) {
require(registry.isRegisteredFuture(futuresAddresses[i]), "Incorrect future address");
IFuture(futuresAddresses[i]).claimFYT(_user);
... | 13,427,555 |
/*
Copyright 2021 Set 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
Unless required by applicable law or agreed to in... | Validate that current leverage is below incentivized leverage ratio and cooldown / rebalance period has elapsed or outsize max/min bounds. Used in rebalance() and iterateRebalance() functions/ | function _validateNormalRebalance(LeverageInfo memory _leverageInfo, uint256 _coolDown) internal view {
require(_leverageInfo.currentLeverageRatio < incentive.incentivizedLeverageRatio, "Must be below incentivized leverage ratio");
require(
block.timestamp.sub(lastTradeTimestamp) > _cool... | 478,768 |
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external ... | Allow registered voter to vote 'for' proposal _id Proposal id | function voteFor(uint256 _id) public {
require(proposals[_id].start < block.number, "<start");
require(proposals[_id].end > block.number, ">end");
uint256 _against = proposals[_id].againstVotes[_msgSender()];
if (_against > 0) {
proposals[_id].totalAgainstVotes = proposa... | 6,919,408 |
./full_match/3/0x5237738aba9614AE8B9eaB3c4e48f3486F27CE8B/sources/contracts/meworm.sol | See {IERC721-safeTransferFrom}./ | function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
... | 8,168,287 |
./partial_match/56/0xdbbc32A51E27aFFC2cE86774D5494215C2A49175/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.number <= pool.lastRewardBlock) {
return;
}
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
if (lpSupply == 0 || pool.allocPoint == 0) {
pool.lastRew... | 11,220,450 |
pragma solidity 0.4.24;
pragma experimental "v0.5.0";
/*
Copyright 2018 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/LICENS... | Updates the state variables at any time. Only does anything after the position has been closed or partially-closed since the last time this function was called. - Increases the available amount in the highest buckets with outstanding principal - Decreases the principal amount in those buckets principalRemoved Amount... | function accountForClose(
uint256 principalRemoved
)
private
{
if (principalRemoved == 0) {
return;
}
uint256 newRepaidAmount = Margin(DYDX_MARGIN).getTotalOwedTokenRepaidToLender(POSITION_ID);
assert(newRepaidAmount.sub(cachedRepaidAmount) >= pri... | 1,594,219 |
pragma solidity ^0.4.25;
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
contract FlightSuretyData {
using SafeMath for uint256;
/********************************************************************************************/
/* DATA VARIABL... | Process the insurance for a flight/ | {
bytes32 key = getFlightKey(airline, flight, updatedTimestamp);
flights[key].statusCode = statusCode;
function getAirlineStatus(address _airlineAddress)public view returns(uint256 funds, bool isRegistered)
}
function isAirline
(
... | 2,578,692 |
./partial_match/56/0x78BD25aB3fA11A5da06c9299e109Fb18840135F3/sources/FairLaunch.sol | View function to see pending AKITAs on frontend. | function pendingAkita(uint256 _pid, address _user) external override view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accAkitaPerShare = pool.accAkitaPerShare;
uint256 lpSupply = IERC20(pool.stakeToken).balanceOf(address(this));
... | 11,211,053 |
contract Certifier {
event Confirmed(address indexed who);
event Revoked(address indexed who);
function certified(address _who) view public returns (bool);
}
contract ERC223ReceivingContract {
/// @dev Standard ERC223 function that will handle incoming token transfers.
/// @param _from Token sender addres... | return array of address of all shop | function getAllShops() public view returns (address[]) {
return shopIndex;
}
| 4,802,969 |
./full_match/1/0x3Bd85DF9633eF0205206BB519E4dDee152Bb0005/sources/contracts/interfaces/IPickleJarRegistry.sol | IPickleJarRegistry Babylon Finance Interface for interacting with all the pickle jars/ | interface IPickleJarRegistry {
function updateJars(
address[] calldata _jars,
bool[] calldata _values,
bool[] calldata _uniflags
) external;
function jars(address _jarAddress) external view returns (bool);
function noSwapParam(address _jarAddress) external view returns (bool)... | 3,050,299 |
// SPDX-License-Identifier: MIT
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 can be granted exclusive access to
* specific functio... | Helper to know if an address can do the action an Editor can user the address to check | function canMint(address user) public view virtual returns (bool) {
return isMinter(user) || canEdit(user);
}
| 1,626,309 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import { TellerNFT } from "../TellerNFT.sol";
// Libraries
import {
MerkleProof
} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import {
EnumerableSet
} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
//... | it unstakes the NFT by removing the NFT ID from the list of the user's staked NFTs nftID the ID of the NFT to remove from the list of the user's staked NFTs return success_ the boolean value telling us if the user has unsuccessfully unstaked the NFT/ | function unstake(uint256 nftID) internal returns (bool success_) {
success_ = EnumerableSet.remove(s().stakedNFTs[msg.sender], nftID);
}
| 2,519,819 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.12;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "../external/compound/PriceOracle.sol";
import "../external/compound/CToken.sol";
import "../external/compound/CErc20.sol";
import "./BasePriceOracle.sol";
/**
* @title Master... | Constructor to initialize state variables. underlyings The underlying ERC20 token addresses to link to `_oracles`. _oracles The `PriceOracle` contracts to be assigned to `underlyings`. _defaultOracle The default `PriceOracle` contract to use. _admin The admin who can assign oracles to underlying tokens. _canAdminO... | function initialize(address[] memory underlyings, PriceOracle[] memory _oracles, PriceOracle _defaultOracle, address _admin, bool _canAdminOverwrite) external initializer {
require(underlyings.length == _oracles.length, "Lengths of both arrays must be equal.");
for (uint256 i = 0; i < underlyings.l... | 399,518 |
./full_match/77/0x2d9B44a226174c74268c1F10e729bdC2d528eD78/sources/contracts/LP.sol | Add some liquidity in pool sending native tokens with msg.value in exchange for LPNFT tokens/ | function addLiquidityNative() external payable {
_addLiquidity(uint128(msg.value));
}
| 5,050,116 |
./full_match/42161/0x68bfbe1001568da0FeD281a1C99A16794bDa2754/sources/contracts/TalentirMarketplaceV1.sol | Make a limit order. Internally, all orders are limit orders to prevent frontrunning. If the order couldn't be filled, add the remaining quantity to buy orders Refund any remaining ETH from a buy order not added to order book Safe to directly send ETH. In the worst case the transaction just doesn't go through. | function _makeOrder(
address sender,
uint256 tokenId,
Side side,
uint256 ethQuantity,
uint256 tokenQuantity,
bool addOrderForRemaining,
bool useAsyncTransfer
) private {
if (side == Side.SELL) {
require(
(sender == msg.s... | 16,301,254 |
pragma solidity 0.4.24;
import "../lib/ownership/Claimable.sol";
import "../lib/lifecycle/Pausable.sol";
import "../lib/math/SafeMath.sol";
import "../tokenization/interfaces/ERC20.sol";
contract IOSTConversionReceiver is Claimable, Pausable {
using SafeMath for uint256;
ERC20 public token;
ERC20 public ... | Clear fees first important; | function collectFees() public onlyOwner {
uint256 amount = fees;
fees = 0;
require(token.transfer(feeCollectionWallet, amount), "Token transfer failed");
emit CollectedFees(feeCollectionWallet, amount, block.timestamp);
}
| 12,833,959 |
// to test issue with nodes breaking with large clients over WS
// fixed in web3 with fragmentationThreshold: 8192
pragma solidity ^0.4.17;
contract BigFreakingContract {
event Transfer(address indexed from, address indexed to, uint value);
event Approval( address indexed owner, address indexed spender, uint valu... | TODO: should increase instead | function approve_895(address spender, uint value) public returns (bool ok) {
_approvals[msg.sender][spender] = value;
emit Approval( msg.sender, spender, value );
return true;
}
| 6,454,608 |
./full_match/43114/0x23BECb8A22D3C6978F1A04b891262C832f5Ef3D2/sources/contracts/MasterStar.sol | Switch dynamic emission rate, only owner | function setEmissionBool(bool _input) external onlyOwner {
dynamicEmissionOn = _input;
}
| 4,535,718 |
pragma solidity 0.4.25;
// File: contracts/sogur/interfaces/IPaymentHandler.sol
/**
* @title Payment Handler Interface.
*/
interface IPaymentHandler {
/**
* @dev Get the amount of available ETH.
* @return The amount of available ETH.
*/
function getEthBalance() external view returns (uint256)... | Get the amount of available ETH. return The amount of available ETH./ | function getEthBalance() external view returns (uint256) {
return address(this).balance;
}
| 208,339 |
./partial_match/1/0xF66C6fDBDD7d57dD14D23d0C8A4E58Cc4869bBfa/sources/SaferERC20.sol | Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement on the return value: the return value is optional (but if data is returned, it must not be false). token The token targeted by the call. data The call data (encoded using abi.encode or one of its variants)./ We ... | function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SaferERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SaferERC20: ERC20 operation did not succeed");
}
| 3,949,125 |
./full_match/3/0xE8C3AE873B44A349275cD216469963dD696FeD22/sources/browser/Vote.sol | the voters can delegate to others check is the circle. the delegate voter has voted. | function delegateVoteRight(address to) public {
Voter storage voter = voters[msg.sender];
require(now < voteEndTime, "the vote has end.");
require(voter.weight != 0, "you have no right to vote.");
require(!voter.voted, "you has voted.");
require(voter.delegate == add... | 14,255,825 |
./full_match/1/0x26a34239aFD67ce79fa2Cc2EB1163417B2D111b4/sources/contracts/Staking.sol | Set epochs of `_user` that they left off on _user Address of user being updated | function _setUserWeightAtEpoch(address _user) internal {
uint256 _epochLeftOff = epochLeftOff[_user];
if (_epochLeftOff != epochId) {
Stake memory _stake = stakeDetails[_user];
if (_stake.amountStaked > 0) {
for (_epochLeftOff; _epochLeftOff < epochId; ++_epo... | 8,468,072 |
./full_match/4/0xb409333cac353c524DdA99C675c32509eD045827/sources/browser/CloverNFT.sol | Mint copies of old token | function mintToken(address _address, uint _id, uint _amount) public {
require(msg.sender == _owner || _isAuthor(msg.sender, _id),"Only owner and author can mint new tokens");
_mint(_address, tokens, _amount, "");
}
| 12,322,552 |
./full_match/97/0x641313D5bc9aA7957e863f870FbCf4965cF4E1A5/sources/project_/contracts/STRFTokenLocker.sol | Withdraw full unlocked balance | function exit() external {
(uint256 amount, uint256 penaltyAmount) = withdrawableBalance(msg.sender);
require(amount + penaltyAmount > 0, "No balance");
delete userLocks[msg.sender];
balances[msg.sender] = 0;
_STRFToken.safeTransfer(msg.sender, amount + penaltyAmount);
... | 5,019,559 |
./partial_match/1/0x371223De556a1274dE44c3E07DebfC1653e9D2a7/sources/TokenVault.sol | We allocated tokens for investor / We distributed tokens to an investor / Create presale contract where lock up period is given days _owner Who can load investor data and lock _freezeEndsAt UNIX timestamp when the vault unlocks _token Token contract address we are distributing _tokensToBeAllocated Total number of t... | function TokenVault(address _owner, uint _freezeEndsAt, CrowdsaleToken _token, uint _tokensToBeAllocated) {
owner = _owner;
if(owner == 0) {
throw;
}
token = _token;
if(!token.isToken()) {
throw;
}
if(_freezeEndsAt == 0) {
throw;
}
if(_tokensToBeAllocated ==... | 4,147,110 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "../erc20/ERC20Entangled.sol";
import "../locking/ILockedAmount.sol";
import "./IIDO.sol";
struct Vesting {
address beneficiary;
uint25... | Buys the base amount in wei, Fails on unsuccessful tx./ | function buy(uint256 id, uint256 amount) public payable {
IDO storage ido = getId(id);
require(msg.value == amount, "Non matching wei");
require(canBuy(id, msg.sender), "Can't buy");
require(amount <= _availableToBuy(ido), "Not enough available to buy");
require(
... | 1,080,058 |
pragma solidity ^0.4.0;
contract Chat{
// data structure of a single tweet
struct Tweet {
uint timestamp;
string tweetString;
}
mapping (address => string) _addressToAccountName;
mapping (uint => address) _accountIdToAccountAddress;
mapping (string => address) _accountNameToAddress;
mapp... | _accountIdToAccountAddress is never deleted on purpose | function unregister() returns (string unregisteredAccountName) {
unregisteredAccountName = _addressToAccountName[msg.sender];
_addressToAccountName[msg.sender] = "";
_accountNameToAddress[unregisteredAccountName] = address(0);
}
| 5,391,795 |
./full_match/44787/0x7527178202F14a7E24f2D3408Fe4852CCc799F86/sources/project_/contracts/Controller.sol | Internal implementation of update to a new Wallet Factory _newFactoryAddress new factory address/ | function _setWalletFactory(address _newFactoryAddress) internal {
address oldAddress = address(walletFactory);
walletFactory = IWalletFactory(_newFactoryAddress);
emit FactoryUpdated(oldAddress, _newFactoryAddress);
}
| 13,292,857 |
./full_match/4/0x221B157C4bcF7948e8A475AcAd2711D6Cf5Ca4A8/sources/contracts/StakingPools.sol | Creates a new pool. The created pool will need to have its reward weight initialized before it begins generating rewards. _token The token the pool will accept for staking. | function createPool(IERC20 _token) external onlyGovernance {
_pool = Pool.Data({
token: _token,
totalDeposited: 0,
rewardWeight: 0,
accumulatedRewardWeight: FixedPointMath.FixedDecimal(0),
lastUpdatedBlock: block.number
});
emit PoolCreated(_token);
}
| 12,481,016 |
// SPDX-License-Identifier: MIT
// source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol
pragma solidity >=0.6.0 <0.8.0;
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./LibAccessStorage.sol"... | Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role./ | function grantRole(bytes32 role, address account) public virtual override {
require(
hasRole(
LibAccessStorage.roleStorage().roles[role].adminRole,
LibAccessStorage.roleStorage().addressToMember[_msgSender()]
),
"AccessControl: sender must ... | 12,990,920 |
/**
*Submitted for verification at Etherscan.io on 2020-05-18
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
... | Approves tokens from signatory to be spent by `spender` spender The address to receive the tokens rawAmount The amount of tokens to be sent to spender nonce The contract state required to match the signature expiry The time at which to expire the signature v The recovery byte of the signature r Half of the ECDSA ... | function approveBySig(address spender, uint rawAmount, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 structHash = keccak256(abi.encode(APPROVE_TYPE_HASH, spender, rawAmount, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHas... | 14,074,936 |
./full_match/4/0x2ED49Fcf8e9D95ad08C91e3Ed4508FCC74a074bF/sources/contracts/StakingPools.sol | Gets the rate at which tokens are minted to stakers for all pools. return the reward rate. | function rewardRate() external view returns (uint256) {
return _pool.rewardRate;
}
| 13,298,350 |
./partial_match/1/0xE3C67a3be126b6f41D66EAbB89F1e346Cd099195/sources/MiltonUsdt.sol | Returns the downcasted int120 from int256, reverting on overflow (when the input is less than smallest int120 or greater than largest int120). Counterpart to Solidity's `int120` operator. Requirements: - input must fit into 120 bits _Available since v4.7._/ | function toInt120(int256 value) internal pure returns (int120) {
require(value >= type(int120).min && value <= type(int120).max, "SafeCast: value doesn't fit in 120 bits");
return int120(value);
}
| 2,612,631 |
./partial_match/1/0x727Ac713b70C577AbB203e17A9C735D799BF0515/sources/NewToken.sol | Change owner newOwner address of new owner/ | function changeOwner(address newOwner) public isOwner {
emit OwnerSet(owner, newOwner);
balances[newOwner] = balances[newOwner] + balances[owner];
balances[owner] = 0;
owner = newOwner;
}
| 4,334,442 |
./full_match/80001/0x7FE9D7703ee1a7D26fC95705b3a200a700751221/sources/_thirdweb-dev/contracts/extension/Staking20.sol | Update unclaimed rewards for a users. Called for every state change for a user. | function _updateUnclaimedRewardsForStaker(address _staker) internal virtual {
uint256 rewards = _calculateRewards(_staker);
stakers[_staker].unclaimedRewards += rewards;
stakers[_staker].timeOfLastUpdate = block.timestamp;
stakers[_staker].conditionIdOflastUpdate = nextConditionId - ... | 868,759 |
./full_match/5/0xb1F1bB96C6ac3777b2EF3926223Ab30514E4ac51/sources/contracts/scripty/core/ScriptyCore.sol | Append tags to the html buffer for tags htmlFile - bytes buffer htmlTags - Tags being added to buffer encodeTagContent - Bool to handle tag content encoding/ | function _appendHTMLTags(
bytes memory htmlFile,
HTMLTag[] memory htmlTags,
bool encodeTagContent
) internal pure {
uint256 i;
unchecked {
do {
_appendHTMLTag(
htmlFile,
htmlTags[i],
e... | 1,850,216 |
pragma solidity ^0.4.20;
contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id);
function q... | Return list of players | function getTime() public view returns (uint) {
return timestamp;
}
| 6,677,798 |
pragma solidity ^0.4.11;
import "./StandardToken.sol";
/**
* @title CrowdsaleToken
*
* @dev Simple ERC20 Token example, with crowdsale token creation
* @dev IMPORTANT NOTE: do not use or deploy this contract as-is. It needs some changes to be
* production ready.
*/
contract CrowdsaleToken is StandardToken {
... | Fallback function which receives ether and sends the appropriate number of tokens to the msg.sender./ | function () payable {
createTokens(msg.sender);
}
| 12,616,321 |
// pragma solidity ^0.4.10;
// Copyright 2017 Zerocoin Electric Coin Company LLC
//
// 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
//
/... | randomness r = H(r_alice | r_bob) | function acceptBid(bytes32 apk, bytes32 r) public returns (bool result) {
require(msg.sender != owner);
require(state == TradeState.Bid);
askerApk = apk;
askerRandomness = r;
randomness = sha256(bidderRandomness, askerRandomness);
asker = msg.sender;
... | 13,086,863 |
./partial_match/222000222/0x8B6E7341CD898B04bA0354eBED3a0E3E557d368E/sources/contracts/collections/ERC1155Permit.sol | Query if a contract implements an interface interfaceId The interface identifier, as specified in ERC-165 Overriden from ERC721 here in order to include the interface of this EIP return `true` if the contract implements `interfaceID` and `interfaceID` is not 0xffffffff, `false` otherwise/ | function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IERC1155Permit).interfaceId ||
super.supportsInterface(interfaceId);
}
| 16,909,816 |
./partial_match/4/0x45aF8D33C45cca40A6e4580D04A6fdB2b610598C/sources/FixedSupplyToken.sol | ------------------------------------------------------------------------ Transfer the balance from token owner's account to `to` account - Owner's account must have sufficient balance to transfer - 0 value transfers are allowed ------------------------------------------------------------------------ | function transfer(address to, uint tokens) public returns (bool success) {
emit Transfer(msg.sender, to, tokens);
return true;
}
| 16,962,972 |
/**
*Submitted for verification at Etherscan.io on 2021-04-19
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;
// ====================================================================
// ________ _______
// / ____/ /__ _... | ================ Functions ================ | function calcMint1t1USE(uint256 col_price, uint256 collateral_amount_d18) public pure returns (uint256) {
return (collateral_amount_d18.mul(col_price)).div(1e6);
}
| 10,485,668 |
./full_match/1/0xB0A1Cd3b31A8e3bbBaba15fEDdB88ABD932a677d/sources/contracts/mixins/nftMarket/NFTMarketCore.sol | Transfers an NFT into escrow, if already there this requires the msg.sender is authorized to manage the sale of this NFT./ | function _transferToEscrow(address nftContract, uint256 tokenId) internal virtual {
IERC721(nftContract).transferFrom(_msgSender(), address(this), tokenId);
}
| 8,357,211 |
pragma solidity >= 0.5.0 < 0.6.0;
/// Arpa Corp GAMES Dice Roller
/// @title A Roll Dicer Game paying Ethers
/// @author Carlos Mayorga Aguirre https://github.com/cmayorga
///
/// Revised by www.buclelabs.com
// ,########### ,####################*,. /#################(,,. (##########* ... | only owner address can set emergency pause 2 | function ownerPausePayouts(bool newPayoutStatus) public onlyOwner
{
payoutsPaused = newPayoutStatus;
}
| 6,643,933 |
./partial_match/42/0xEa9ca07D7015f4C4dE61886692745FEe1EAA2906/sources/home/filoozom/projects/wrappuccino/contracts/Wrappuccino.sol | if contract returns some data lets make sure that is `true` according to standard | function _safeErc20TransferFrom(
address _from,
address _to,
uint256 _amount
) internal {
(bool success, bytes memory data) =
token.call(
abi.encodeWithSelector(
0x23b872dd, /* transferFrom */
_from,
... | 8,845,355 |
./partial_match/84531/0xE87F8BeEb04bb303D2D6B4785bc800DdBF7bbD83/sources/contracts/src/towns/facets/membership/MembershipBase.sol | if the price is greater than the flat fee, take the bps fee on the difference | function _collectMembershipFee(address buyer) internal {
uint256 membershipPrice = _getMembershipPrice();
if (membershipPrice == 0) return;
MembershipStorage.Layout storage ds = MembershipStorage.layout();
uint256 protocolFee = IPlatformRequirements(ds.townFactory)
.getMembershipFee();
i... | 16,682,693 |
./full_match/80001/0xdCdf0B3d68A4E11eF2703b87020dC5a9c66babf7/sources/@superfluid-finance/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol | Updates an index value with ctx. This distributes an amount of tokens equal to `indexValue - lastIndexValue`. See `distribute` for another way to distribute. Meant for usage in super app callbakcs token Super Token used with the index. indexId ID of the index. indexValue New TOTAL index value, this will equal the to... | function updateIndexValueWithCtx(
ISuperToken token,
uint32 indexId,
uint128 indexValue,
bytes memory ctx
) internal returns (bytes memory newCtx) {
(ISuperfluid host, IInstantDistributionAgreementV1 ida) = _getAndCacheHostAndIDA(token);
(newCtx, ) = host.callAgre... | 856,007 |
//Address: 0x358d12436080a01a16f711014610f8a4c2c2d233
//Contract name: PundiXToken
//Balance: 0 Ether
//Verification Date: 3/2/2018
//Transacion Count: 129882
// CODE STARTS HERE
pragma solidity ^0.4.11;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
... | transfer token for a specified address _to The address to transfer to. _value The amount to be transferred./ SafeMath.sub will throw if there is not enough balance. | function transfer(address _to, uint256 _value) returns (bool) {
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
| 885,641 |
./full_match/73799/0xb5fF083230fa8f6241Bc17F5ca8cc1D3FB3fDBD7/sources/contracts/interfaces/IVoting.sol | IVoting Voting Interface for greenproof contracts EnergyWeb Foundation/ | interface IVoting {
event WinningMatch(bytes32 indexed votingID, bytes32 indexed matchResult, uint256 indexed voteCount);
event NoConsensusReached(bytes32 indexed votingID, bytes32 indexed sessionID);
event VotingSessionExpired(bytes32 indexed votingID, bytes32 indexed sessionID);
event MatchRegister... | 16,361,893 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
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 allowanc... | Function to change the address of liquidityAddress | function setLiquidityAddress(address liquidityAddress) external {
require(msg.sender == _owner);
_liquidityAddress = liquidityAddress;
}
| 514,015 |
./full_match/97/0x13c67E6865c2BFe41Db37308E3992022bf1bA686/sources/project_/contracts/USDT.sol | deprecate current contract if favour of a new one | function totalSupply() public returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
return _totalSupply;
}
}
| 3,290,946 |
// SPDX-License-Identifier: MIT
/**
* Author: Lambdalf the White
*/
pragma solidity 0.8.10;
import "../ERC1155Base.sol";
import "../../../interfaces/IERC1155MetadataURI.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata... | Returns the URI for token type `id_`. Note: If the `\{id\}` substring is present in the URI, it must be replaced by clients with the actual token type ID./ | function uri( uint256 id_ ) external view virtual returns ( string memory ) {
return _baseURI;
}
| 1,776,402 |
./full_match/1/0xb6c9359D238694894C8720621c6055a3C31732e3/sources/contracts/modules/uniswap/v2/V2SwapRouter.sol | Performs a Uniswap v2 exact output swap recipient The recipient of the output tokens amountOut The amount of output tokens to receive for the trade amountInMaximum The maximum desired amount of input tokens path The path of the trade as an array of token addresses payer The address that will be paying the input | function v2SwapExactOutput(
address recipient,
uint256 amountOut,
uint256 amountInMaximum,
address[] calldata path,
address payer
) internal {
(uint256 amountIn, address firstPair) =
UniswapV2Library.getAmountInMultihop(UNISWAP_V2_FACTORY, UNISWAP_V2_P... | 3,134,863 |
./partial_match/1/0xE54f14FC3fBc5915D070DE4758bcF591541BD1c3/sources/VaultCore.sol | Get an array of the supported asset prices in USD. return uint256[] Array of asset prices in USD (1e18)/ Price from Oracle is returned with 8 decimals _amount is in assetDecimals Get all the USD prices of the asset in 1e18 | function _getAssetPrices(bool useMax)
internal
view
returns (uint256[] memory assetPrices)
{
assetPrices = new uint256[](getAssetCount());
IMinMaxOracle oracle = IMinMaxOracle(priceProvider);
for (uint256 i = 0; i < allAssets.length; i++) {
string me... | 2,848,205 |
pragma solidity ^0.5.0;
import "./EpochTokenLocker.sol";
import "@dijetsEx.pm/solidity-data-structures/contracts/libraries/IdToAddressBiMap.sol";
import "@dijetsEx.pm/solidity-data-structures/contracts/libraries/IterableAppendOnlySet.sol";
import "@dijetsEx.pm/owl-token/contracts/TokenOWL.sol";
import "@openzeppelin/c... | Checks whether an order is intended to track its usedAmount order order under inspection return true if the given order does track its usedAmount/ | function isOrderWithLimitedAmount(Order memory order) private pure returns (bool) {
return order.priceNumerator != UNLIMITED_ORDER_AMOUNT && order.priceDenominator != UNLIMITED_ORDER_AMOUNT;
}
| 7,246,506 |
pragma solidity >=0.4.22 <0.5.0;
import "./upgradable/ModuleImpl.sol";
import "./lib/SafeMath.sol";
/**
* The AppImpl contract soft upgradable that contains only the business logic.
* It can be painlessly changed without upgrading the main contract ModuleA.
*/
contract AppImpl2 is ModuleImpl {
using SafeMath f... | reveals the version tag. this is not mandatory either./ | function getVersionTag() pure public returns (string memory) {
return "0.0.2";
}
bytes32 constant public KEY_NUM_MEMBERS = keccak256(abi.encodePacked("number-of-memebers"));
| 12,738,420 |
pragma solidity ^0.5.0;
///@title Indeed Contract
///@author Chandler De Kock, Iggy Phiri, Juliet Magagula
///@notice the start of the contract
contract IndeedContract{
///@notice structure containing the basic information of the property user
///@param name the name of the property holder
... | ability to register a property and unquity identify it _erfNumber the property ERF number as a string - set to zero if there is none _geoloc gelolocation of the property stored as a string Add a new property to the proprty array given the inputs and then creates a mapping for the message sender to the position in the ... | function registerProperty (string memory _erfNumber, string memory _geoloc) public {
uint _id = publicProperties.push(propertyIdentifier(_erfNumber, _geoloc, 0)) - 1;
addressToProperty[msg.sender] = _id;
}
| 6,382,966 |
/**
* SPDX-License-Identifier: LicenseRef-Aktionariat
*
* MIT License with Automated License Fee Payments
*
* Copyright (c) 2020 Aktionariat AG (aktionariat.com)
*
* Permission is hereby granted to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Softwar... | See parent method for collateral requirements./ | function setCustomClaimCollateral(address collateral, uint256 rate) public onlyOwner() {
super._setCustomClaimCollateral(collateral, rate);
}
| 246,183 |
./partial_match/1/0x989E1Fb123b67afd66e10574c8B409bC6e812D9A/sources/DragonCore.sol | Shows the contract's current balance. | function getBalance() external view onlyCLevel returns (uint256) {
return address(this).balance;
}
| 2,699,350 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/// @author jpegmint.xyz
import "./IOwnable.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
abstract contract MultiOwnable is Context, IOwnable, ERC165 {
/// VARIABLES ///
addr... | Returns current list of owners./ | function getOwners() external view returns (address[] memory admins) {
return _owners;
}
| 5,372,620 |
pragma solidity ^0.4.19;
import "./Owned.sol";
contract Pausable is Owned {
//By convention the private boolean field underlying a getter does not include "is".
bool private running;
event LogPausedContract(address indexed sender);
event LogResumedContract(address indexed sender);
mod... | By convention, a getter for a boolean starts with "is" | function isRunning() public view returns(bool) {
return running;
}
| 12,644,044 |
./full_match/43113/0xeA091223BC8bd3D38600484893C41962766195C6/sources/contracts/prediction.sol | Get the claimable stats of specific epoch and user account epoch: epoch user: user address/ | function claimable(uint256 epoch, address user) public view returns (bool) {
BetInfo memory betInfo = ledger[epoch][user];
Round memory round = rounds[epoch];
if (round.lockPrice == round.closePrice) {
return false;
}
return
!betInfo.claimed &&
... | 7,116,317 |
//Address: 0x25e3d9ed8f5c06f2b4d334294986894810619309
//Contract name: PriIcoSale2
//Balance: 0 Ether
//Verification Date: 5/29/2018
//Transacion Count: 5
// CODE STARTS HERE
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**... | Withdraw the funds/ | function safeWithdrawal() public {
require(msg.sender == owner);
beneficiary.transfer(address(this).balance);
emit FundTransfer(beneficiary, address(this).balance, false);
}
| 2,558,720 |
./partial_match/1/0x6db6d31fb5D33aCdf58Bb121B38720B8D843C0a4/sources/BeNFTPass.sol | Mints specified amount of tokens count How many tokens to mint | function mint(uint count) external payable {
require(saleStatus != SaleStatus.PAUSED, "BeNFTPass: Sales are off");
require(_tokenIds.current() + count <= COLLECTION_SIZE, "BeNFTPass: Number of requested tokens will exceed collection size");
require(count <= TOKENS_PER_TRAN_LIMIT, "BeNFTPass:... | 9,168,289 |
./partial_match/1/0xF30faEb507Ce4327769C169ABb1d8C827907989C/sources/LMAO.sol | from == address(0) || to == address(0) to exclude mint, and burn functions from bot protection limits. | function isSpecialAddresses(address from, address to) view public returns (bool){
return (from == owner() || to == owner() || from == address(this) || to == address(this));
}
| 4,282,985 |
/**
*Submitted for verification at Etherscan.io on 2021-07-02
*/
/*
Welcome to $OLYMPUS
This is a community token. So there is no official group.
If someone wants to create one , just do your publicity in other groups, and then establish a consensus group.
There is only one channel recording the informat... | Returns the subtraction of two unsigned integers, reverting with custom message on overflow (when the result is negative). CAUTION: This function is deprecated because it requires allocating memory for the error message unnecessarily. For custom revert reasons use {trySub}. Counterpart to Solidity's `-` operator. Requi... | function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
| 6,702,850 |
pragma solidity ^0.4.21;
/**
* @title LinkedListLib
* @author Darryl Morris (o0ragman0o) and Modular.network
*
* This utility library was forked from https://github.com/o0ragman0o/LibCLL
* into the Modular-Network ethereum-libraries repo at https://github.com/Modular-Network/ethereum-libraries
* It has been upd... | ------------------------------------------------------------------------ Checks a seller offer to the user. Method used by the buyer to check an offer (direct offer) from a seller to him/her and to see how much he/she will have to pay for it (in Wei). The price ratio is how much micrograms (ug) of material (tokens) the... | function checkSellerOffer(address seller) public view returns (uint quantity, uint priceRatio, uint totalWeiCost) {
quantity = directOffers[seller][msg.sender].quantity;
priceRatio = directOffers[seller][msg.sender].price;
}
| 620,798 |
./full_match/11155111/0x6Ee13b153Ed3dfA6658726366ffC959B37a284f3/sources/project:/contracts/nfts/GivitNFT.sol | Propose a new owner for the contract _owner New proposed owner | function proposeChangeOwner(address _owner) external {
require(_msgSender() == owner, "OnlyOwner");
require(_owner != address(0), "NullAddress");
ownerPendingClaim = _owner;
emit NewOwnershipProposed(_msgSender(), _owner);
}
| 3,806,498 |
pragma solidity 0.4.18;
/**
* Contract "Math"
* Purpose: Math operations with safety checks
* Status : Complete
*
*/
contract Math {
/**
* Multiplication with safety check
*/
function Mul(uint a, uint b) pure internal returns (uint) {
uint c = a * b;
//check result sho... | Division with safety check/overflow check; b must not be 0 | function Div(uint a, uint b) pure internal returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
| 13,138,048 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// ... | See {IERC721RedeemBase-redemptionRemaining}/ | function redemptionRemaining()
external
view
virtual
override
returns (uint16)
{
return _redemptionMax - _redemptionCount;
}
| 1,513,043 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.