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.7;
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./IOssFunOracle.sol";
contract OssFunOracle is ChainlinkClient, IOssFunOracle {
using Chainlink for Chainlink.Request;
address priv... | https:docs.chain.link/docs/core-adapters/httpget https:docs.chain.link/docs/core-adapters/jsonparse Sends the request | function requestScore(uint256 repoId) override external returns (bytes32 requestId) {
Chainlink.Request memory request = buildChainlinkRequest(
jobId,
address(this),
this.fulfill.selector
);
request.add("queryParams",
string(abi.encodePacked(... | 12,867,128 |
./partial_match/56/0x77bF838815aD47c91208278Ab8e39F9D4CA98F8f/sources/XoxoFarm.sol | View function to see pending XOXOs on frontend. | function pendingXoxo(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accXoxoPerShare = pool.accXoxoPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(this));
... | 11,077,106 |
./full_match/1/0xb176F411fF4F4A74Deb0Ab03379c8af49bE91d3e/sources/contracts/dOTC/SwarmDOTCEscrow.sol | Cancels deposit to escrow Requirements: - sender must be assinged ESCROW_MANAGER_ROLE and Also DOTC_ADMIN_ROLE offerId the Id of the offer token the token from deposit makerCpk maker's CPK address _amountToSend the amount to send return status bool/ | function cancelDeposit(
uint256 offerId,
IERC20Metadata token,
address makerCpk,
uint256 _amountToSend
) external onlyEscrowManager returns (bool status) {
require(makerCpk != address(0) && address(token) != address(0), "Escrow: Passed zero addresses");
deposits[... | 9,757,799 |
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal returns (uint) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint c = a... | CONSTRUCTOR Initialize the DTO Token/ | function DTOToken(address _target) {
target = _target;
totalSupply = 10 ** 27;
balances[target] = totalSupply;
}
| 9,891,242 |
./full_match/1/0x551140b1b42928B733f0139abcFF4857E7575Ec9/sources/browser/MultiverseMarket_721dvi.sol | bool returnBool = abi.decode(data, (bool)); | function test_transfer_token(address _to, uint256 _amount) public
{
(bool check, bytes memory data) = currencyToken.delegatecall(abi.encodeWithSignature("transfer(address, uint256)", _to, _amount));
require(check, "revert : can't transfer");
IERC20 _token = IER... | 3,057,871 |
./full_match/42/0x590E6Da5d35450ffc3Eed3BC5a25A302f5E584FD/sources/contracts/survey.sol | Destroys `amount` tokens from `account`, reducing the total supply. Emits a {Transfer} event with `to` set to the zero address. Requirements: - `account` cannot be the zero address. - `account` must have at least `amount` tokens./ | function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
}
| 9,566,671 |
/**
*Submitted for verification at Etherscan.io on 2021-06-08
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.8.1;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external v... | This function withdraws all the currently available vested tokens from the target tranche This will not allow a user's total tranch balance to go below the user's lien amount Emits Tranche_Balance_Removed event if successful tranche_id Id of target tranche | function withdraw_from_tranche(uint8 tranche_id) public {
require(tranche_id != default_tranche_id);
uint256 to_withdraw = get_vested_for_tranche(msg.sender, tranche_id);
require(user_stats[msg.sender].total_in_all_tranches - to_withdraw >= user_stats[msg.sender].lien);
user_stats[msg.sender].tranche... | 10,633,223 |
//SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils... | Important: Set new price in wei (i.e. 50000000000000000 for 0.05 ETH) | function setPrice(uint _newPrice) external onlyOwner {
price = _newPrice;
}
| 466,193 |
pragma solidity ^0.4.24;
contract LivenetErc721Etheremon {
event Transfer(
address indexed _from,
address indexed _to,
uint256 indexed _tokenId
);
event Approval(
address indexed _owner,
address indexed _approved,
uint256 indexed _tokenId
);
even... | Tells whether an operator is approved by a given owner _owner owner address which you want to query the approval of _operator operator address which you want to query the approval of return bool whether the given operator is approved by the given owner/ | function isApprovedForAll(
address _owner,
address _operator
)
public
view
returns (bool)
{
return true;
}
| 973,577 |
// 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... | Set max slash factor/ | function setMaxSlashFactor(uint256 _maxSlashFactor) external onlyOwner {
params[dt.ParamName.MaxSlashFactor] = _maxSlashFactor;
}
| 260,740 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppeli... | Airdrop tokens to all holders that are included from reward. Requirements: - the caller must have a balance of at least `amount`./require(!_isExcludedFromReward[sender], "Excluded addresses cannot call this function"); | function airdrop(uint256 amount) public {
address sender = _msgSender();
require(balanceOf(sender) >= amount, "The caller must have balance >= amount.");
ValuesFromAmount memory values = _getValues(amount, false);
if (_isExcludedFromReward[sender]) {
_tokenBalances[sender... | 916,813 |
pragma solidity ^0.5.0;
contract ExpTokenInterface {
function name() public view returns (string memory _name);
function symbol() public view returns (string memory _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
fun... | Retrieve the size of the code on target address, this needs assembly . | function transfer(address _to, uint256 _value, bytes32 _data) public {
uint codeLength;
assembly {
codeLength := extcodesize(_to)
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
if(codeLength>0) {
... | 1,756,505 |
pragma solidity ^0.4.19;
contract Ownable {
address public owner;
address public ceoWallet;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
ceoWallet = msg.sender;
}
modifier onlyOwner() {
require(m... | Eight Wonders will ever exist | function totalSupply() public view returns (uint) {
return 8;
}
| 12,867,170 |
./partial_match/56/0x771F6ac940Eeee94C837520bb6b7eB2bcB5a6E14/sources/MasterChef.sol | View function to see pending mushrooms on frontend. | function pendingMushroom(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accMushroomPerShare = pool.accMushroomPerShare;
uint256 lpSupply = pool.lpToken.balanceOf(address(thi... | 11,285,401 |
./partial_match/1/0xFac1098E6090aB52D06B8bA44c9b4C104D9CD670/sources/SafeMath.sol | Adds two numbers, reverts on overflow. | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
| 2,720,345 |
pragma solidity ^0.4.23;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
require(c / a == b, "Overflow - Multiplication");
return c;
}
/**
*... | Calls the passed-in function, performing a memory state check before and after the check is executed. | function checks(function () view _check) conditions(validState, validState) internal view {
_check();
}
| 1,484,829 |
/**
*Submitted for verification at Etherscan.io on 2020-11-20
*/
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sende... | IERC1363 Interface Interface for a Payable Token contract as defined in/ | interface IERC1363 is IERC20, IERC165 {
function transferAndCall(address to, uint256 value) external returns (bool);
function transferAndCall(
address to,
uint256 value,
bytes calldata data
) external returns (bool);
function transferFromAndCall(
address from,
... | 2,274,957 |
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "../LPToken.sol";
import "../interfaces/IRedemptionPriceGetter.sol";
import "../interfaces/ISwap.sol";
import "../MathUtils.sol";
import "../Sw... | Remove liquidity from the pool, weighted differently than the pool's current balances. self Swap struct to read from and write to driftingMetaSwapStorage DriftingMetaSwap struct to read from and write to amounts how much of each token to withdraw maxBurnAmount the max LP token provider is willing to pay to remove l... | function removeLiquidityImbalance(
SwapUtils.Swap storage self,
DriftingMetaSwap storage driftingMetaSwapStorage,
uint256[] memory amounts,
uint256 maxBurnAmount
) public returns (uint256) {
ManageLiquidityInfo memory v = ManageLiquidityInfo(
0,
0,... | 1,087,926 |
pragma solidity 0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is chea... | only owner address can set owner address / | function ownerChangeOwner(address newOwner) public
onlyOwner
{
require(newOwner != 0);
owner = newOwner;
}
| 2,507,472 |
pragma solidity ^0.4.24;
import "zeppelin/token/ERC20/SafeERC20.sol";
import "zeppelin/math/SafeMath.sol";
import "zeppelin/math/Math.sol";
import "./lib/AdditionalMath.sol";
import "contracts/MinersEscrow.sol";
import "contracts/NuCypherToken.sol";
import "contracts/proxy/Upgradeable.sol";
/**
* @notice Contract h... | Set the minimum reward that the node will take/ | function setMinRewardRate(uint256 _minRewardRate) public {
NodeInfo storage node = nodes[msg.sender];
node.minRewardRate = _minRewardRate;
}
| 889,765 |
pragma solidity ^0.4.16;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract ClickGemTokenERC20 {
// Public variables of the token
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decim... | Prevent transfer to 0x0 address. Use burn() instead Check if the sender has enough Check for overflows Save this for an assertion in the future Subtract from the sender Add the same to the recipient Asserts are used to use static analysis to find bugs in your code. They should never fail | function _transfer(address _from, address _to, uint _value) internal {
require(_to != 0x0);
require(balanceOf[_from] >= _value);
require(balanceOf[_to] + _value >= balanceOf[_to]);
uint previousBalances = balanceOf[_from] + balanceOf[_to];
balanceOf[_from] -= _value;
... | 1,144,700 |
// Verified using https://dapp.tools
// hevm: flattened sources of src/token.sol
// SPDX-License-Identifier: MIT AND GPL-3.0-only
pragma solidity >=0.8.0 <0.9.0 >=0.8.2 <0.9.0 >=0.8.7 <0.9.0;
////// lib/openzeppelin-contracts/contracts/utils/Context.sol
/* pragma solidity ^0.8.0; */
/**
* @dev Provides information... | lib/radicle-drips-hub/src/Dai.sol pragma solidity ^0.8.7; / import {IERC20} from "openzeppelin-contracts/token/ERC20/IERC20.sol"; / | interface IDai is IERC20 {
function permit(
address holder,
address spender,
uint256 nonce,
uint256 expiry,
bool allowed,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
| 13,437,362 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './ERC721Tradable.sol';
/**
* @title Token
* Tokens - a contract for my non-fungible tokens.
*/
contract Token is ERC721Tradable {
constructor(address _proxyRegistryAddress)
ERC721Tradable( 'NoWarInUkraineFund', 'NWIUF', _proxyRegistryAddre... | Accept message hash and returns hash message in EIP712 compatible form So that it can be used to recover signer from signature signed using EIP712 formatted data "\\x19" makes the encoding deterministic "\\x01" is the version byte to make it compatible to EIP-191/ | function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32) {
return keccak256(abi.encodePacked('\x19\x01', getDomainSeperator(), messageHash));
}
| 1,163,512 |
./partial_match/56/0xe7DfCB8215ad65c07d5A929e010f0deC51F0069b/sources/BEP20DOROToken.sol | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceed... | 11,190,886 |
./partial_match/4/0xeEBa06913dF686EBB057C3d3E5BeEcFEeBBe47ab/sources/VACCINE.sol | Transfer token for a specified addresses from The address to transfer from. to The address to transfer to. value The amount to be transferred./ | function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
if(_taxRate>0) {
uint256 totax=value.mul(_taxRate).div(10000);
uint256 tosend=value.sub(totax);
_balances[to... | 8,772,976 |
// 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 these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, sinc... | Get valuation of the SetToken with the quote asset as the reserve asset. Returns value in precise units (10e18) Reverts if price is not found Get reserve asset decimals | function _getRedeemReserveQuantity(
ISetToken _setToken,
address _reserveAsset,
uint256 _setTokenQuantity
)
internal
view
returns (uint256)
{
uint256 setTokenValuation = controller.getSetValuer().calculateSetTokenValuation(_setToken, _reserveAsset);
... | 101,363 |
// File: contracts/OpenZepplinOwnable.sol
pragma solidity ^0.5.0;
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-b... | should we ever want to change the address of the MKR_TOKEN_ADDRESS | function set_MKR_TOKEN_ADDRESS (IERC20 _new_MKR_TOKEN_ADDRESS) public onlyOwner {
MKR_TOKEN_ADDRESS = _new_MKR_TOKEN_ADDRESS;
}
| 888,816 |
./full_match/1/0x032Ba44EB2DB607d2F9424b90e191BbFb51152A1/sources/contracts/PrizeDistributionFactoryV2.sol | Allows the owner to override an existing prize distribution in the buffer. PrizeTier and Draw for the given draw id will be pulled in and the prize distribution will be computed. _drawId The draw id to compute for return The resulting Prize Distribution/ | function setPrizeDistribution(uint32 _drawId)
external
onlyOwner
returns (IPrizeDistributionBuffer.PrizeDistribution memory)
{
IPrizeDistributionBuffer.PrizeDistribution
memory _prizeDistribution = _calculatePrizeDistribution(_drawId);
prizeDistributionBuffer... | 16,513,584 |
./full_match/5/0x59584FC5368901b5959ac5F959f3263447eC6B34/sources/contracts/ERC721OnlySign.sol | Verify and process payload. Set royalties, if applicable. | function mintWithSignature(
MintRequest calldata _req,
bytes calldata _signature
) external payable override returns (address signer) {
require(_req.quantity == 1, "quantiy must be 1");
uint256 tokenIdToMint = nextTokenIdToMint();
signer = _processRequest(_req, _signatu... | 7,077,978 |
./partial_match/1/0xE3e026F1c72B2A9D977F59dfE9c0c81c265c34e9/sources/TwoAssetLinearizedTimeSeriesFeed.sol | Removes an existing upgrade. _upgradeHash Keccack256 hash that uniquely identifies function called and arguments/ Reset the timestamp to 0 | function removeRegisteredUpgrade(
bytes32 _upgradeHash
)
external
onlyOwner
{
require(
timeLockedUpgrades[_upgradeHash] != 0,
"TimeLockUpgradeV2.removeRegisteredUpgrade: Upgrade hash must be registered"
);
timeLockedUpgrades[_upgradeHa... | 3,999,276 |
/**
___ ____ ___ ____ _ ___
F _ ", F __ ] F __". /_ _\ /.\ F _ ",
J `-'(| J |--| L J (___| [J L] //_\\ J `-'(|
| _ L | | | | J\___ \ | | / ___ \ | _ L
F |_\ L F L__J J .--___) \ F J / L___J \ F |_\ L
J__| \\__LJ\______/FJ\______JJ____LJ... | exclude from paying fees or having max transaction amount | constructor() ERC20("ROSTAR", "ROSTAR") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uni... | 10,227,126 |
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;
import "@openzeppelin/contracts-upgradeable/token/ERC20/presets/ERC20PresetFixedSupplyUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Acces... | Returns the amount unstaked for a given user/ | function balanceUnstaked(address account) public view returns (uint256) {
return balanceOf(account);
}
| 12,922,917 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.7.0;
contract Whitelist
{
uint256 groupId;
address public whiteListManager;
struct WhitelistGroup
{
mapping(address => bool) members;
address whitelistGroupAdmin;
bool created;
}
mapping(uint256 => WhitelistGrou... | Function to add members to a whitelist group. _groupId Group Id of the whitelist group. _memberAddress List of address to be added to the whitelist group. | function addMembersToGroup(uint256 _groupId, address[] memory _memberAddress)
public
{
require(_isGroup(_groupId), "Group doesn't exist!");
require(_isGroupAdmin(_groupId), "Only goup admin is permitted for this operation");
for (uint256 i = 0; i < _memberAddress.length; i++)
... | 1,482,799 |
./full_match/80001/0x47338cec1f478F2a945ce5da4B0988e4Fd252385/sources/contracts/rental/PlayerRental.sol | TODO: Split into 2 functions - checkRentability (view) returns (bool), rent Rent the asset _tokenId NFT token Id _duration Rental duration check if this is the valid PlayerRental contract check if the asset is valid update borrows pay the rental add the order increase the borrows of the pool | function rentAsset(address _asset, uint256 _tokenId, uint256 _amount, uint256 _duration, bool _isERC721) external {
(address assetPool721, address assetPool1155) = _checkPlayerRental();
_checkAsset(_asset, _tokenId, _amount, _isERC721, assetPool721, assetPool1155);
_updateBorrows(_asset, _... | 5,651,412 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.25 <0.8.0;
pragma experimental ABIEncoderV2;
import { IVault } from "./IVault.sol";
import { VaultBase } from "./VaultBase.sol";
import { IFujiAdmin } from "../IFujiAdmin.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
im... | Paybacks Vault's type underlying to activeProvider _repayAmount: token amount of underlying to repay, or pass -1 to repay full ammount Emits a {Repay} event./ If call from Normal User do typical, otherwise Fliquidator Check User Debt is greater than Zero and amount is not Zero TODO: Get => corresponding amount of Base... | function payback(int256 _repayAmount) public payable override {
if (msg.sender != _fujiAdmin.getFliquidator()) {
updateF1155Balances();
uint256 userDebtBalance = IFujiERC1155(fujiERC1155).balanceOf(msg.sender, vAssets.borrowID);
require(_repayAmount != 0 && userDebtBalance > 0, Errors.VL_NO_DE... | 1,311,373 |
pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
... | Internal functions/ Adds a new transaction to the transaction mapping, if transaction does not exist yet. destination Transaction target address. value Transaction ether value. data Transaction data payload. return Returns transaction ID. | function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
... | 10,511,903 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.18;
pragma experimental ABIEncoderV2;
import "contracts/Zipper.sol";
/// @title Set containing proposals
/// @author Giovanni Rescinito
/// @notice proposals submitted by agents, along with the corresponding assignment and commitment
library Proposals{
//Data... | s set containing proposals tokenId the token associated to the proposal return the proposal associated to the token provided | function getProposalByToken(Set storage s, uint tokenId) view public returns (Proposal memory){
return getProposalAt(s, getIdFromToken(s,tokenId));
}
| 5,544,885 |
./full_match/5/0x76134eE647D72c371E489e35404CC7B5C76B612c/sources/contracts/libraries/eigenda/DataLayrDisclosureLogic.sol | verify pairing for the commitment to interpolating polynomial TODO: verify that this check is correct! check that degree of polynomial in the header matches the length of the submitted polynomial i.e. make sure submitted polynomial doesn't contain extra pointsCalculating r, the point at which to evaluate the interpolat... | function nonInteractivePolynomialProof(
bytes calldata header,
uint32 chunkNumber,
bytes calldata poly,
MultiRevealProof calldata multiRevealProof,
BN254.G2Point calldata polyEquivalenceProof
) public view returns (bool) {
DataStoreKZGMetadata
memory d... | 7,036,530 |
./partial_match/1/0x93C5cF832AD6Be0a7BF5d70B05FBc50864982B46/sources/src/utils/SpaceManager.sol | Check if a space is enabled. space Address of the space. return uint256 whether the space is enabled. | function isSpaceEnabled(address space) external view returns (uint256) {
return spaces[space];
}
| 3,942,592 |
pragma solidity 0.6.6;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high le... | this function handles low level token purchases. Returns whether a particular round has ended or not./ | function _buyToken(uint8 indexArg, uint256 rateArg, uint256 totalSupplyArg) private returns (bool isRoundEnded) {
uint256 tokensNumber = msg.value.mul(rateArg).div(100000);
uint256 actualTotalBalance = _actualSupply[indexArg];
uint256 newTotalRoundBalance = actualTotalBalance.add(tokensNumber);
... | 12,816,464 |
pragma solidity ^0.5.4;
import "./Dependencies/Members.sol";
import "./Dependencies/VerifierInterface.sol";
import "./Dependencies/MiMCInterface.sol";
import "./Dependencies/Verifier.sol";
import "./Dependencies/MerkleTree.sol";
import "./Shared/Owned.sol";
import "./Shared/Operated.sol";
// ----------------------... | n The nulllifier hash to check return True if the nullifier hash has previously been stored in the contract/ | function hasNullifier(uint n) public view returns (bool) {
return nullifierHashHistory[n];
}
| 12,671,070 |
./full_match/1/0x5c93E05783EA4D0D968c7A2C0cDfFCEfC711b213/sources/contracts/strategies/ConvexEthMetaStrategy.sol | Mint OTokens and one-sided add to the Curve pool. This is used when the Curve pool does not have enough OTokens and too many ETH. The OToken/Asset, eg OETH/ETH, price with increase. The amount of assets in the vault is unchanged. The total supply of OTokens is increased. The asset value of the strategy and vault is inc... | function mintAndAddOTokens(uint256 _oTokens)
external
onlyStrategist
nonReentrant
improvePoolBalance
{
IVault(vaultAddress).mintForStrategy(_oTokens);
uint256[2] memory amounts = [uint256(0), uint256(0)];
amounts[oethCoinIndex] = _oTokens;
uint25... | 9,743,603 |
./partial_match/1/0x9460b380c57F65e8AFc4bA3518F643A526640F26/sources/contracts/dependencies/uniswapv3-core/UniswapV3Pool.sol | @inheritdoc IUniswapV3PoolOwnerActions | function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
amount0 = amount0Requested > protocolFees.token0 ? protocolFees.token0 : amount0Requested;
... | 4,203,133 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*******************************************************************************
*
* Copyright (c) 2018-2022 Modenero Corp.
* Released under the MIT License.
*
* ServiceName - Service description.
*
* Version YY.MM.DD
*
* https://modenero.com
* support... | ECRecovery Interface/ | function _ecRecovery() private view returns (
ECRecovery ecrecovery
) {
bytes32 hash = keccak256('aname.ecrecovery');
address aname = _modeneroDb.getAddress(hash);
ecrecovery = ECRecovery(aname);
| 922,241 |
./full_match/1/0xC477b71c6c64671712Cf55953240E952A67cBe23/sources/contracts/TorusPool.sol | Called when an underlying of a Curve Pool has depegged and we want to exit the pool. Will check if a coin has depegged, and will revert if not. Sets the weight of the Curve Pool to 0, and re-enables TOR rewards for deposits. Cannot be called if the underlying of this pool itself has depegged. curvePool_ The Curve Poo... | function handleDepeggedCurvePool(address curvePool_) external override {
require(isRegisteredCurvePool(curvePool_), "pool is not registered");
require(weights.get(curvePool_) != 0, "pool weight already 0");
require(!_isDepegged(address(underlying)), "underlying is depegged");
address... | 5,015,493 |
./full_match/80001/0x2C39b6729f3072F6D777831f4967b2392dB899De/sources/contracts/UniswapV2Factory.sol | this low-level function should be called from a contract which performs important safety checks | function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external lock {
require(amount0Out > 0 || amount1Out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT');
require(amount0Out < _reserve0 && amount1Out < _reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY');
uint balance0;... | 871,143 |
// File: contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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 {
/**
* @dev Returns the amount of tokens in... | Convert CRV to [DAI] using XChanger (XTrinity swap)/ | function convertCRV() public {
uint256 returnAmount;
uint256 balanceCRV = crv.balanceOf(address(this));
if (balanceCRV > 0) {
returnAmount = swap(crv, enterTokenIERC20, balanceCRV, false);
}
}
| 49,699 |
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs
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 '@openzeppelin/contracts/tok... | Gas spent here starts off proportional to the maximum mint batch size. It gradually moves to O(1) as tokens get transferred around in the collection over time./ | function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
require(_exists(tokenId), 'AzukiNextGen: owner query for nonexistent token');
for (uint256 curr = tokenId; ; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.add... | 14,488,599 |
pragma solidity >=0.5.0 <0.7.0;
// Import the different Roles
import "../coffeecore/Ownable.sol";
import "../coffeeaccesscontrol/FarmerRole.sol";
import "../coffeeaccesscontrol/ProcessorRole.sol";
import "../coffeeaccesscontrol/DistributorRole.sol";
import "../coffeeaccesscontrol/RoasterRole.sol";
import "../coffeeacc... | Define a function 'fetchItemBufferTwo' that fetches the data Assign values to the 7 parameters, not to hit the stack limit | function fetchItemBufferTwo(uint _upc) public view returns (
uint itemSKU,
uint originFarmElevation,
uint originFarmPickedAt,
string memory originProductCultivar,
uint productID,
Process productProcessType,
string memory productNotes
)
{
return... | 14,097,283 |
./full_match/1/0xeACa7559F81dADE5d11fE8852E832a699396aBB7/sources/contracts/strategies/OptimizerAPR/genericLender/euler/GenericEuler.sol | Calculates APR from Liquidity Mining Program amountToAdd Amount to add to the currently supplied liquidity (for the `aprAfterDeposit` function) | function _stakingApr(int256) internal view virtual returns (uint256) {
return 0;
}
| 4,957,353 |
pragma solidity 0.5.6;
/**
* @title Metamorphic Contract Factory
* @author 0age
* @notice This contract creates metamorphic contracts, or contracts that can be
* redeployed with new code to the same address. It does so by deploying a
* contract with fixed, non-deterministic initialization code via the CREATE2
*... | View function for retrieving the initialization code of metamorphic contracts for purposes of verification./ | function getMetamorphicContractInitializationCode() external view returns (
bytes memory metamorphicContractInitializationCode
) {
return _metamorphicContractInitializationCode;
}
| 12,604,742 |
./partial_match/1/0xc4d57603D47FB842EC11A5332748f9F96d44cbEB/sources/src/contracts/FraxlendPairCore.sol | The ```_addInterest``` function is invoked prior to every external function and is used to accrue interest and update interest rate Can only called once per block return _interestEarned The amount of interest accrued by all borrowers Add interest only once per block If there are no borrows or contract is paused, no in... | function _addInterest()
internal
returns (
uint256 _interestEarned,
uint256 _feesAmount,
uint256 _feesShare,
uint64 _newRate
)
{
CurrentRateInfo memory _currentRateInfo = currentRateInfo;
if (_currentRateInfo.lastTimestamp =... | 3,702,578 |
// Price Oracle for Stabilize Protocol
// This contract uses Aave Price Oracle
// The main Operator contract can change which Price Oracle it uses
// Updated to use Chainlink upgrade
pragma solidity ^0.6.6;
/************
IPriceOracleGetter interface
Interface for the Aave price oracle.
*/
interface IPriceOracleGette... | Mainnet zaToken Testnet zaToken zTokenList.push(address(0x6d50e2CF85E231A3560bcFbB8f99Ed1424d21415)); | function insertCustomTokens() internal {
zTokenList.push(address(0x1D107B258a2BA3a87B301e635dDc336cfDDe153b));
}
| 10,733,114 |
./full_match/100/0xDF6CD062502f03aE93626116d3C1FcA6649C3F54/sources/contracts/PoolBetting.sol | Bet `amount` tokens that in the condition `conditionId` will happen outcome `outcome`. See {_bet}./ | function bet(
uint256 conditionId,
uint8 outcome,
uint128 amount
) external {
TransferHelper.safeTransferFrom(
token,
msg.sender,
address(this),
amount
);
_bet(conditionId, outcome, amount);
}
| 14,267,664 |
pragma solidity ^0.5.16;
import "./ComptrollerInterface.sol";
import "./CTokenInterfaces.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20Interface.sol";
import "./InterestRateModel.sol";
/**
* @title tropykus CToken Contract
* @notice Abstract base for CTokens
* @author tropykus
*/
... | Get the underlying balance of the `owner` This also accrues interest in a transaction owner The address of the account to query return The amount of underlying owned by `owner`/ | function balanceOfUnderlying(address owner) external returns (uint256) {
(MathError mErr, uint256 balance) = mulScalarTruncate(
exchangeRate,
accountTokens[owner].tokens
);
require(mErr == MathError.NO_ERROR, "T6");
return balance;
}
| 12,741,609 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;
import {IStakeVaultStorage} from "../interfaces/IStakeVaultStorage.sol";
import {IIERC20} from "../interfaces/IIERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./StakeTONStorage.sol";
import "../common/AccessibleCommon.... | view implementation address of selector of function _selector selector of function return impl address of the implementation | function getSelectorImplementation2(bytes4 _selector)
public
view
returns (address impl)
{
if (selectorImplementation[_selector] == address(0))
return proxyImplementation[0];
else if (aliveImplementation[selectorImplementation[_selector]])
return s... | 11,983,121 |
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "./IGameDB.sol";
import "./IGameCards.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
contract GameCards is IGameCards, Ac... | Stop the production of cards for a given season and scarcity level | function stopProductionForSeasonAndScarcityLevel(uint16 season, uint8 level)
public
{
require(hasRole(MINTER_ROLE, _msgSender()), "GameCards: must have minter role to stopProductionForSeasonAndScarcityLevel");
stoppedProductionBySeasonAndScarcityLevel[season][level] = true;
}
| 6,131,792 |
/**
*Submitted for verification at Etherscan.io on 2021-05-13
*/
/**
*Submitted for verification at Etherscan.io on 2017-12-13
*/
pragma solidity ^0.4.18;
// File: contracts/zeppelin-solidity-1.4/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization ... | override StandardTokentransfer ensures the minting has finished or the message sender is the token owner | function transfer(address _to, uint256 _value) public returns (bool) {
require(mintingFinished || msg.sender == owner);
return super.transfer(_to, _value);
}
| 2,024,443 |
pragma solidity >=0.5.0 <0.6.0;
import "../introspection/SupportsInterfaceWithLookup.sol";
import "../../registry-layer/tokens-factory/interfaces/ICAT20EscrowCanceled.sol";
import "../../registry-layer/tokens-factory/interfaces/ICAT20EscrowCreated.sol";
import "../../registry-layer/tokens-factory/interfaces/ICAT20Escr... | Send request to the CAT-20 escrow escrowId Escrow identifier recipient Address of the tokens recipient/ | function triggerProcessed(bytes32 escrowId, address recipient) external {
bytes memory dataForCall = new bytes(32);
bytes memory data = new bytes(32);
ICAT20Escrow(tokensById[escrowId]).processEscrow(
escrowId,
recipient,
dataForCall,
data
... | 5,511,562 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./extensions/ERC721ABurnable.sol";
/*
* @title Earlies Society ERC721A Non-Fungible Token
* @dev Implementation of https://eips.ethereum... | Burns `tokenId`. See {ERC721A-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator./ | function burn(uint256 tokenId) public virtual {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
isApprovedForAll(prevOwnership.addr, _msgSender()) ||
getApproved(tokenId) == _msgSender());
i... | 35,957 |
/**
*Submitted for verification at Etherscan.io on 2021-10-19
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.4.24;
//-----------------------------------------------------------------------------//
// Name : MPadLaunchPad //
// Swap tok... | Check the expected amount per bnb | function checkTokensExpected(uint256 _value) view external returns(uint256){
return _value.mul(tokenPrice).div(decimalBalancer);
}
| 10,974,019 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
// Utilizes the useful mentions in the article below to address the pesky mint costs
// Credit where credit is due
// =============================================================================
// https://shiny.mirror.xyz/OUampBbIz9ebEicfGnQf5At_ReMHl... | This is an example split for 5% of the initial sale (using my own address). =============================================================================(bool hs, ) = payable(0xdFecCC7506725439a862AEfCF134C0B2a345AE5a).call{value: address(this).balance 5 / 100}("");require(hs); ========================================... | function withdraw() public onlyOwner {
require(os);
function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner { maxMintAmountPerTx = _maxMintAmountPerTx; }
function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner { hiddenMetadataUri = _hiddenMetadataUri; }
functio... | 1,830,781 |
./partial_match/1/0x12FE06B3B8114090d570b6f011af9671a4A0153d/sources/tokenExchange.sol | Allows the owner to update the exchange rate and vesting schedule of a Token B variant. | function updateTokenBVariant(
address tokenB,
uint256 exchangeRate,
uint256 vestingSchedule
) public onlyOwner {
require(
tokenB != address(Hope),
"Token B variant cannot be the same as Hope."
);
require(
tokenBVariants[tokenB].... | 16,149,061 |
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./DonationEvents.sol";
/// @title Contract for charity funding with ether donations
/// @author Pengyang Zhou
/// @notice Allows users to ... | Refunds donations to the original donator if the project ends and there are their donations left projectId Project ID project should be ended msg.sender should be one of the donator and has available amount | function refund(uint projectId) public {
require(projectId >= 1 && projectId <= projectCount);
require(projects[projectId].endTime < block.timestamp);
require(projects[projectId].donations[msg.sender].available > 0);
Project storage proj = projects[projectId];
uint256 amount = proj.donations[msg.... | 15,796,560 |
./full_match/1/0x4eAA5213739E19d776dE8ff782eEe4e268A23E33/sources/contracts/LCX_CYC.sol | SafeMath.sub will throw if there is not enough balance. | function transfer(address _to, uint256 _value)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer... | 9,609,161 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
library Date {
struct _Date {
uint16 year;
uint8 month;
uint8 day;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31536000;
uint constant LEAP_YEAR_IN_SECONDS = 31622400;
uint16 constant... | This function is meant to be called internally when finishing your stakeThis is the month it finishes onCalculates partial rewards for month | function getTotalToWidthdrawForNotCompounders(address _account) internal view returns (uint256) {
Stake memory stake = stakes[_account];
Date._Date memory initial = Date.parseTimestamp(stake.createdOn);
uint256 total = calcFullRewardsForInitialMonth(stake, initial, false);
... | 1,979,095 |
./partial_match/1/0xbFb0866AE2256B292b361C4972aA61144E861F8C/sources/Timelock.sol | Anarchy token contract address | function Timelock() public {
token = ERC20(0xD5f1F1338f7de2FdE3aA132667cbAA671860B9FC);
marketingWallet = 0xE18A44813FB456c79fc79Ad1418bA03A7FEaBfe0;
teamWallet = 0x827dDdF45B819dEaF6a5cc8f5D0486B131A778cE;
teamToken1stReleased = false;
teamToken2ndReleased = false;
teamToken3rdRelea... | 2,675,233 |
./partial_match/4/0xBeB03f37Ae5F6AB2aeb5595f74e5428427De3817/sources/VectToken.sol | Advances to the next 256-bit random number in the pool of hash chains./ | function next(bytes32[] memory hashchain) internal pure returns (uint256) {
require(hashchain.length == 1, "Random.next: invalid param");
hashchain[0] = keccak256(abi.encodePacked(hashchain[0]));
return uint256(hashchain[0]);
}
| 8,550,696 |
pragma solidity ^0.4.24;
contract CreditATM {
address owner;
constructor() public {
owner = msg.sender;
addAdmin(owner);
}
struct Exchange {
address sender;
uint percentage;
uint escrow;
}
Exchange[] public ex;
address[] public ad;
event __ad... | Owner releaseFundByStationOwner transaction | function releasePartialFund(address customer,uint amount, bytes32 offchain) public onlyAdmin()
{
require(customer != 0x0 && amount > 0);
customer.transfer(amount);
emit __releasePartialFund(customer, amount, offchain);
}
| 5,541,421 |
./partial_match/1/0x03256E6eEA6E60A7d2E3F94a206C414B491a26A6/sources/EthermonAvatarDistributor.sol | Interface of the ERC20 standard as defined in the EIP./ | interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
exte... | 2,800,945 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./utils/StratManager.sol";
import "./utils/FeeManager.sol";
import "./uti... | pauses deposits and withdraws all funds from third party systems. IMasterChef(chef).emergencyWithdraw(poolId); | function panic() public onlyManager {
pause();
}
| 12,977,729 |
./full_match/44787/0xC4d41D0E0253B60B85Bc35C3b6C042689fC33E55/sources/contracts/governor/PACTDelegate.sol | Owner function for setting the quorum votes _newQuorumVotes new quorum votes/ | function _setQuorumVotes(uint256 _newQuorumVotes) external onlyOwner {
require(
_newQuorumVotes >= proposalThreshold,
"PACT::_setQuorumVotes: invalid quorum votes"
);
uint256 _oldQuorumVotes = votingDelay;
quorumVotes = _newQuorumVotes;
emit QuorumVo... | 13,252,150 |
pragma solidity ^0.4.20;
/*
*
* ==================================== *
* Hey guys its Trevon here, dont talk to me unless its about intangible Coins*
* PROOOOF OF TREVON JAMES DONT MISS OUT ITS GETTING BIG HERE *
* get your tokens here ... | Liquifies tokens to ethereum./ setup data russian hackers BTFO burn the sold tokens update dividends tracker dividing by zero is a bad idea update the amount of dividends per token | function sell(uint256 _amountOfTokens)
onlyBagholders()
public
{
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
ui... | 19,080 |
pragma solidity 0.5.17;
contract IFactRegistry {
/*
Returns true if the given fact was previously registered in the contract.
*/
function isValid(bytes32 fact)
external view
returns(bool);
}
contract IMerkleVerifier {
uint256 constant internal MAX_N_MERKLE_VERIFIER_QUERIE... | Dynamic array holds length followed by values. | function getQueries(uint256[] memory ctx)
internal pure
returns (uint256[] memory)
{
uint256[] memory queries;
uint256 offset = 0x20 + 0x20*MM_N_UNIQUE_QUERIES;
assembly {
queries := add(ctx, offset)
}
return queries;
}
| 7,338,113 |
pragma solidity ^0.6.0;
import "./ERC20/ERC20Capped.sol";
import "./ERC20/ERC20Burnable.sol";
import "./ERC1363/ERC1363.sol";
import "./access/Roles.sol";
import "./TokenRecover.sol";
/**
* Part of the code written below was work of Vittorio Minacori
* https://github.com/vittominacori
*/
/**
* @title OM L... | Function to enable transfers./ | function enableTransfer() public onlyOwner {
_transferEnabled = true;
emit TransferEnabled();
}
| 13,140,620 |
// SPDX-License-Identifier: GPL
pragma solidity ^0.8.0;
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more ab... | See {IERC721-approve}./ | function approve(address to, uint256 tokenId) public virtual override {
address owner = CallistoNFT.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
msg.sender == owner || isApprovedForAll(owner, msg.sender),
"ERC721: approve call... | 12,954,301 |
./partial_match/1/0x5Cd05f801948706859bAD87A1357A44704Bc35a3/sources/contracts/V3SwapRouter1EX.sol | @inheritdoc IV3SwapRouter use amountIn == Constants.CONTRACT_BALANCE as a flag to swap the entire balance of the contract | function exactInputSingle(ExactInputSingleParams memory params)
external
payable
override
returns (uint256 amountOut)
{
bool hasAlreadyPaid;
if (params.amountIn == Constants.CONTRACT_BALANCE) {
hasAlreadyPaid = true;
params.amountIn = IERC2... | 15,531,008 |
./full_match/1/0x44c8bF10B5c405b7a996d4B087b914e1875f7d51/sources/contracts/QMMarketplace.sol | Identifies whether _wallet holds any tokens of a _collection. Returns true if a wallet is not holder and false if a wallet is a holder./ | function isNotHolder(address _wallet, IERC721 _collection) internal view returns (bool) {
return _wallet == address(0x0) || _collection.balanceOf(_wallet) == 0;
}
| 8,418,873 |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Contracts
import {
CONTROLLER,
ADMIN,
EXCHANGE_RATE_FACTOR,
ONE_HUNDRED_PERCENT
} from "./data.sol";
import { ITTokenStrategy } from "./strategies/ITTokenStrategy.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// ... | Redeem supplied Teller token underlying value. amount The amount of Teller tokens to redeem./ Accrue interest and calculate exchange rate Burn Teller Tokens and transfer underlying | function redeem(uint256 amount) external override {
require(amount > 0, "Teller: cannot withdraw 0");
require(
amount <= balanceOf(_msgSender()),
"Teller: redeem amount exceeds balance"
);
uint256 underlyingAmount = _valueInUnderlying(amount, exchangeRate());... | 6,355,627 |
./full_match/3/0x114E200Ea95a4ddBf79227a46af59114D436c6fa/sources/contracts/Faucet.sol | give out ether to anyone that asks limit withdrawal amount send the amount to the address that requested it | function withdraw(uint withdraw_amount) public {
require(withdraw_amount <= 100000000000000000, "amount is too much");
msg.sender.transfer(withdraw_amount);
}
| 8,258,461 |
./partial_match/3/0xa39155B39bDeBacFFEC7142205E2a7E50e524Eb9/sources/Marathon.sol | Hàm lấy chi tiết thông tin của đội (id, tên đội, số lượng vdv, tổng cự li thi đấu, tổng cự li hoàn thành, số lượng vdv hoàn thành 50%) | function getInfoTeam() public view returns(DOI[] memory)
{
uint i=0;
for (i;i<sl;i++)
{
bool kt=true;
if (sd==0) kt=true;
else
for (uint d=0;d<sd;d++)
if (keccak256(bytes(vdvs[i].doi)) == keccak256(bytes(dois[d].TenD... | 5,187,939 |
./full_match/42220/0xc7B57dA5DF5424aa8b6999BEab8aFDDFdC4C8A20/sources/contracts/Router.sol | REMOVE LIQUIDITY | function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) public virtual override ensure(deadline) returns (uint amountA, uint amountB) {
address pair = BlackfarmingLibra... | 16,330,081 |
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be... | Moves tokens `amount` from `sender` to `recipient`. This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc. Emits a {Transfer} event. Requirements: - `sender` cannot be the zero address. - `recipient` cannot be the zero address. - `sender`... | function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
... | 6,708,863 |
pragma solidity 0.5.15;
import "ROOT/libraries/token/ERC1155Receiver.sol";
import "ROOT/libraries/token/ERC20.sol";
import 'ROOT/para/interfaces/IParaShareToken.sol';
import 'ROOT/libraries/TokenId.sol';
import 'ROOT/libraries/Initializable.sol';
import 'ROOT/libraries/Ownable.sol';
/**
* @dev This is an Wrapper aro... | Used by the WrappedShareTokenFactory to account for shares it has transferred _recipient The account to which the newly minted ERC20s will go. _amountIn The amount of tokens which have been wrapped/ | function trustedWrapShares(address _recipient, uint256 _amountIn) external onlyOwner {
_mint(_recipient, _amountIn.mul(precisionMultiplier));
}
| 12,841,028 |
pragma solidity ^0.4.17;
library SafeMath {
function mul(uint a, uint b) internal pure returns(uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
assert(b <= a);
return a - b;
... | This function will allow to transfer unsold tokens to a new contract/wallet address to start new ICO in the future 180 days after ICO ends | function transferRemainingTokens(address _newAddress) external onlyOwner() returns (bool) {
require(_newAddress != address(0));
assert(block.number > endBlock + (numOfBlocksInMinute * 60 * 24 * 180)/100);
if (!token.transfer(_newAddress, token.balanceOf(this)))
return true... | 1,071,682 |
pragma solidity 0.4.22;
import "./zeppelin-solidity/contracts/math/SafeMath.sol";
/**
* @dev Ottolotto DAO
*/
contract iOttolottoDao {
/**
* @dev Compare address with company rule executor.
*/
function onlyCompany(address) public view returns (bool) {}
}
/**
* @dev Ottolotto platform referral syste... | Distribute funds to the winner, platform, and partners. _weiWin Funds for distribution. _game A number of the game. _matched A number of the player matches. _player Player address. _bet Player bet./ | function distributeFunds(
uint256 _weiWin,
uint256 _game,
uint8 _matched,
address _player,
bytes3 _bet
)
internal
{
uint256 toOwner = _weiWin.mul(commission).div(100);
uint256 toPartner = 0;
address partner = referralSystem.getPartne... | 12,947,036 |
/**
*Submitted for verification at Etherscan.io on 2021-05-04
*/
/**
*Submitted for verification at Etherscan.io on 2018-07-03
*/
/**
* EURS Token Smart Contract: EIP-20 compatible token smart contract that
* manages EURS tokens.
*/
/*
* Safe Math Smart Contract.
* Copyright (c) 2018 by STSS (Malta) Limited.
... | Tell how many tokens given spender is currently allowed to transfer from given owner. _owner address to get number of tokens allowed to be transferred from the owner of _spender address to get number of tokens allowed to be transferred by the owner of return number of tokens given spender is currently a... | function allowance (address _owner, address _spender)
public delegatable view returns (uint256 remaining) {
return AbstractToken.allowance (_owner, _spender);
}
| 2,159,785 |
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "../../common/implementation/FixedPoint.sol";
// Simple contract used to withdraw liquidations using a DSProxy from legacy contracts (1.2.2 and below).
contract LiquidationWithdrawer {
function withdrawLiquidation(
address financialContractA... | Resets the rewards expiration timeout. This change only applies to rounds that have not yet begun. NewRewardsExpirationTimeout how long a caller can wait before choosing to withdraw their rewards./ | function setRewardsExpirationTimeout(uint256 NewRewardsExpirationTimeout)
public
override(VotingInterface, VotingAncillaryInterface)
onlyOwner
{
rewardsExpirationTimeout = NewRewardsExpirationTimeout;
}
| 99,062 |
/*
Copyright 2019 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... | Return oracle address associated with a passed token address _tokenAddress Address of token return address Address of oracle associated with token/ Require token address to have matching oracle address Return oracle address associated with token address | function getOracleAddressByToken(
address _tokenAddress
)
public
view
returns (address)
{
require(
oracleWhiteList[_tokenAddress] != address(0),
"OracleWhiteList.getOracleAddressFromToken: No Oracle for that address."
);
return... | 14,097,766 |
./partial_match/1/0x6d3eE8D52eB23850c631d9e561e7696A449AB03F/sources/Nexus.sol | exclude from paying fees or having max transaction amount | constructor() ERC20("Nexus", "NEXUS") {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
excludeFromMaxTransaction(address(_uniswapV2Router), true);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUnisw... | 15,541,270 |
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Own... | If the buy now price is set by the seller, check that the highest bid meets that price./ | function _isBuyNowPriceMet(NFT memory _nft)
internal
view
returns (bool)
{
uint256 buyNowPrice = nftContractAuctions[_nft.nftContractAddress][_nft.tokenId][_nft.nftSellerAddress] .buyNowPrice;
return
buyNowPrice > 0 &&
nftContractAuctions[_nft.nft... | 7,328,235 |
./full_match/40/0x110dE362cc436D7f54210f96b8C7652C2617887D/sources/contracts/LiquidityManager.sol | Add liquidity to a existing nft. addLiquidityParam see AddLiquidityParam for more return liquidityDelta amount of added liquidity return amountX amount of tokenX deposited return amountY amonut of tokenY deposited uint160 sqrtRate_96 = IiZiSwapPool(pool).sqrtRate_96(); | function addLiquidity(
AddLiquidityParam calldata addLiquidityParam
) external payable checkAuth(addLiquidityParam.lid) checkDeadline(addLiquidityParam.deadline) returns (
uint128 liquidityDelta,
uint256 amountX,
uint256 amountY
) {
require(addLiquidityParam.lid < liq... | 9,551,883 |
pragma solidity 0.5.16;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../modules/Griefing.sol";
import "../modules/EventMetadata.sol";
import "../modules/Operated.sol";
import "../modules/Template.sol";
/// @title SimpleGriefing
/// @author Stephane Gosselin (@thegostep) for Numerai Inc
/// @dev Securit... | Get the address of the staker (if set) return staker address of the staker | function getStaker() public view returns (address staker) {
return _data.staker;
}
| 1,062,257 |
pragma solidity ^0.4.11;
import "./HouseholdLibrary.sol";
/*
* Zander Labuschagne se baie werk volg Hier
* 23585137@protonmail.ch | zander.labuschagne@protonmail.ch
* Hierdie kode word gepubliseer onder die BSD-3 nuwe of hersiende lisensie
*/
//HouseholdContract.new().then(function(res) { sc = Househol... | Sets the amount in R which users pay to lower the penalty payments per litre/ | function setLowerPriceReqFactor(uint256 _factor) public returns (uint256 factor) {
lowerPriceReqFactor = _factor;
return lowerPriceReqFactor;
}
| 7,263,957 |
pragma solidity ^0.5.11;
import "./DonateTokenInterface.sol";
import "./EIP20Interface.sol";
import "./CTokenInterface.sol";
import "./UniswapFactoryInterface.sol";
import "./KyberNetworkProxyInterface.sol";
import "./TokenswapInterface.sol";
/**
* @dev Implementation of Growdrop. from creating growdrop to starting,... | Investor and Investee withdraws from Growdrop by Growdrop's identifier. Investor withdraws investor's all funded ERC20 token amount and 'GrowdropToken' calculated by percentage of investor's accrued interest amount. If Growdrop is donation, Investor withdraws investor's all funded ERC20 token amount and ERC721 token fr... | function Withdraw(uint256 _GrowdropCount, bool ToUniswap) public {
require(!WithdrawOver[_GrowdropCount][msg.sender], "already done");
WithdrawOver[_GrowdropCount][msg.sender] = true;
EndGrowdrop(_GrowdropCount);
if(!AddToUniswap[_GrowdropCount]) {
ToUni... | 7,299,679 |
/**
*Submitted for verification at Etherscan.io on 2022-03-11
*/
// File: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/interfaces/IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() extern... | emergency transfer ether to owner. only owner executable | function emergencyTransferEther(uint amount) public onlyOwner {
TransferHelper.safeTransferETH(owner, amount);
}
| 10,533,656 |
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.7.6;
pragma abicoder v2;
import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
import "@openzepp... | Emergency function in case of errant transfer of any token directly to contract/ | function withdrawToken(address token, address receiver)
external
onlyOwnerOrManager
{
require(token != address(token0) && token != address(token1));
uint256 tokenBal = IERC20(address(token)).balanceOf(address(this));
if (tokenBal > 0) {
IERC20(address(token)).... | 10,200,400 |
./full_match/77/0xB1E153DA8b7d1fFe40257bc754FDA381128077da/sources/contracts/official/TCF1/TCF1Token.sol | Owner function to pay dividends to all token holders/ grab our current allowance get the amount needed to pay make sure we are allowed to transfer the total payment value increase the total amount paid transfer the tokens from the sender to the contract snapshot the tokens at the moment the ether enters check if we hav... | function payDividends() public onlyOwner {
require(!bCompletedPayment, "Dividends payment is already completed");
uint256 nAllowance = dividendsToken.allowance(
_msgSender(),
address(this)
);
uint256 nPaymentValue = PERIOD_VALUES[nCurrentSnapshotId];
r... | 5,049,742 |
pragma solidity ^0.4.25;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
... | LIQUIDITY TOKENSALE; 5.75% for liquidity sale; available after TGE | function getLiquidityReleasable() public view returns(uint256){
if(block.timestamp >= TGE_timestamp){
return token.totalSupply().div(10000).mul(575) - (85000 + 3) * 10 ** uint256(18);
return 0;
}
}
| 12,667,431 |
// SPDX-License-Identifier: GPL-3.0
/*
This file is part of the Enzyme Protocol.
(c) Enzyme Council <[email protected]>
For the full license information, please view the LICENSE
file that was distributed with this source code.
*/
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/E... | Cancels fund migration _vaultProxy The VaultProxy for which to cancel migration | function cancelMigration(address _vaultProxy) external {
__cancelMigration(_vaultProxy, false);
}
| 1,697,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.