comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"ERROR:FM-011:EXPONENT_TOO_LARGE" | // SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.19;
import {Math} from "Math.sol";
type UFixed is uint256;
using {
addUFixed as +,
subUFixed as -,
mulUFixed as *,
divUFixed as /,
gtUFixed as >,
gteUFixed as >=,
ltUFixed as <,
lteUFixed as <=,
eqUFixed as ==
}
for UFixed global;
function addUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function subUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function mulUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function divUFixed(UFixed a, UFixed b) pure returns(UFixed) {
}
function gtUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function gteUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function ltUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function lteUFixed(UFixed a, UFixed b) pure returns(bool isGreaterThan) {
}
function eqUFixed(UFixed a, UFixed b) pure returns(bool isEqual) {
}
function gtz(UFixed a) pure returns(bool isZero) {
}
function eqz(UFixed a) pure returns(bool isZero) {
}
function delta(UFixed a, UFixed b) pure returns(UFixed) {
}
contract UFixedType {
enum Rounding {
Down, // floor(value)
Up, // = ceil(value)
HalfUp // = floor(value + 0.5)
}
int8 public constant EXP = 18;
uint256 public constant MULTIPLIER = 10 ** uint256(int256(EXP));
uint256 public constant MULTIPLIER_HALF = MULTIPLIER / 2;
Rounding public constant ROUNDING_DEFAULT = Rounding.HalfUp;
function decimals() public pure returns(uint256) {
}
function itof(uint256 a)
public
pure
returns(UFixed)
{
}
function itof(uint256 a, int8 exp)
public
pure
returns(UFixed)
{
require(EXP + exp >= 0, "ERROR:FM-010:EXPONENT_TOO_SMALL");
require(<FILL_ME>)
return UFixed.wrap(a * 10 ** uint8(EXP + exp));
}
function ftoi(UFixed a)
public
pure
returns(uint256)
{
}
function ftoi(UFixed a, Rounding rounding)
public
pure
returns(uint256)
{
}
}
| EXP+exp<=2*EXP,"ERROR:FM-011:EXPONENT_TOO_LARGE" | 406,687 | EXP+exp<=2*EXP |
"Function can only be called once every hour" | // SPDX-License-Identifier: MIT
/*
## # ## # # # ## ### # ##
# # # # # # # # # # # # # # #
# # # # ## ## # # # ### ##
# # # # # # # # # # # # # # #
## # # # # # ### ## # # # # #
The Dorkl Star serves a unique purpose in the cryptoverse. It is designed to burn Dorkl tokens, ensuring scarcity
of remaining tokens. This innovative integration of pop culture with blockchain mechanics showcases the limitless
possibilities in the ever-evolving world of cryptocurrency.
*/
pragma solidity 0.8.19;
interface INonFungiblePositionManager {
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
function collect(CollectParams calldata params) external returns (uint256 amount0, uint256 amount1);
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function positions(uint256 tokenId)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
}
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 IERC721 {
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
interface IERC721Receiver {
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
contract DORKL_STAR {
address public owner;
address public constant DORKLRecipient = 0x000000000000000000000000000000000000dEaD;
address public constant WETHRecipient = 0xb330d1b36Ea0bE40071E33938ed5C6b7cBFFBa7b;
address public constant DORKL = 0x94Be6962be41377d5BedA8dFe1b100F3BF0eaCf3;
address public constant weth = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
mapping(uint256 => Position) public positions;
INonFungiblePositionManager public positionManager;
uint256 public DORKLWithdrawn;
uint256 public WETHWithdrawn;
uint256 public currentNFTId;
uint256 public lastCalled = 0;
uint256 public constant TIME_PERIOD = 15 minutes;
modifier onlyOwner() {
}
constructor(address _positionManager) {
}
struct Position {
address owner;
uint128 liquidity;
address token0;
address token1;
}
function EnterDORKL_Star(uint256 tokenId) external onlyOwner {
}
function HoiiYaa() external {
require(<FILL_ME>)
INonFungiblePositionManager.CollectParams memory params = INonFungiblePositionManager.CollectParams({
tokenId: currentNFTId,
recipient: address(this),
amount0Max: type(uint128).max,
amount1Max: type(uint128).max
});
(uint256 amount0, uint256 amount1) = positionManager.collect(params);
DORKLWithdrawn += amount0;
WETHWithdrawn += amount1;
IERC20(DORKL).transfer(DORKLRecipient, amount0);
IERC20(weth).transfer(WETHRecipient, amount1);
lastCalled = block.timestamp;
}
function ShitCoins(address _token) external onlyOwner {
}
function Star(address _contract, address _to, uint256 _tokenId) external onlyOwner {
}
}
| block.timestamp-lastCalled>=TIME_PERIOD,"Function can only be called once every hour" | 406,767 | block.timestamp-lastCalled>=TIME_PERIOD |
"Wildland cards: requested vip card is sold out" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./IWildlandCards.sol";
/**
* @title Wildlands' Member Cards
* Copyright @ Wildlands
* App: https://wildlands.me
*/
contract WildlandCards is ERC721Enumerable, AccessControlEnumerable, Ownable {
using SafeERC20 for IERC20;
using Strings for uint256;
using Counters for Counters.Counter;
using SafeMath for uint256;
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bool public isLocked;
string public baseURI;
Counters.Counter public bitId;
Counters.Counter public goldId;
Counters.Counter public blackId;
Counters.Counter public standardId;
// codes of affiliators
mapping (address => bytes4) public affiliator2Code;
// affiliate codes mapped to nft id
mapping (bytes4 => uint256) public code2TokenId;
event Lock();
event NonFungibleTokenRecovery(address indexed token, uint256 tokenId);
event TokenRecovery(address indexed token, uint256 amount);
event CodeFailed(uint256 tokenId);
event CodeSuccess(bytes4 code, uint256 tokenId);
constructor(
) ERC721("Wildlands Member Cards", "WMC") {
}
/**
* @notice Allows the owner to lock the contract
* @dev Callable by owner
*/
function lock() external onlyOwner {
}
function isCardAvailable(uint256 cardId) public view returns (bool) {
}
function cardIndex(uint256 cardId) external view returns (uint256) {
}
function exists(uint256 _tokenId) external view returns (bool) {
}
function existsCode(bytes4 _code) external view returns (bool) {
}
function getTokenIdByCode(bytes4 _code) external view returns (uint256) {
}
function getCodeByAddress(address _address) external view returns (bytes4) {
}
/**
* @notice Allows the owner to mint a token to a specific address
* @param _to: address to receive the token
* @param _cardId: card id
* @dev Callable by owner
*/
function mint(address _to, uint256 _cardId) public {
require(hasRole(MINTER_ROLE, _msgSender()), "Minter role required to mint new member NFTs");
require(<FILL_ME>)
if (_cardId == 0) {
// mint Wild Land Member Card
_mint(_to, standardId.current());
_generateCode(_to, standardId.current());
standardId.increment();
}
else if (_cardId == 1){
// mint Wild Land Black Card
_mint(_to, blackId.current());
_generateCode(_to, blackId.current());
blackId.increment();
}
else if (_cardId == 2){
// mint Wild Land Gold Card
_mint(_to, goldId.current());
_generateCode(_to, goldId.current());
goldId.increment();
}
else if (_cardId == 3){
// mint Wild Land Bit Card
_mint(_to, bitId.current());
_generateCode(_to, bitId.current());
bitId.increment();
}
}
// code generator function for affiliate link
// affiliators need to activate thir affiliation code
function generateCode(uint256 _tokenId) external {
}
function _generateCode(address _for, uint256 _tokenId) internal {
}
/**
* @notice Allows the owner to recover non-fungible tokens sent to the contract by mistake
* @param _token: NFT token address
* @param _tokenId: tokenId
* @dev Callable by owner
*/
function recoverNonFungibleToken(address _token, uint256 _tokenId) external onlyOwner {
}
/**
* @notice Allows the owner to recover tokens sent to the contract by mistake
* @param _token: token address
* @dev Callable by owner
*/
function recoverToken(address _token) external onlyOwner {
}
/**
* @notice Allows the owner to set the base URI to be used for all token IDs
* @param _uri: base URI
* @dev Callable by owner
*/
function setBaseURI(string memory _uri) public onlyOwner {
}
/**
* @notice Returns a list of token IDs owned by `user` given a `cursor` and `size` of its token list
* @param user: address
* @param cursor: cursor
* @param size: size
*/
function tokensOfOwnerBySize(
address user,
uint256 cursor,
uint256 size
) external view returns (uint256[] memory, uint256) {
}
/**
* @notice Returns the Uniform Resource Identifier (URI) for a token ID
* @param tokenId: token ID
*/
function tokenURI(uint256 tokenId) public view override returns (string memory) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC721Enumerable) returns (bool) {
}
}
| isCardAvailable(_cardId),"Wildland cards: requested vip card is sold out" | 406,899 | isCardAvailable(_cardId) |
"Invalid Factory" | /**
* @dev An ERC721 which tracks Wasabi Option positions of accounts
*/
contract WasabiOption is ERC721, IERC2981, Ownable {
address private lastFactory;
mapping(address => bool) private factoryAddresses;
mapping(uint256 => address) private optionPools;
uint256 private _currentId = 1;
string private _baseURIextended;
/**
* @dev Constructs WasabiOption
*/
constructor() ERC721("Wasabi Option NFTs", "WASAB") {}
/**
* @dev Toggles the owning factory
*/
function toggleFactory(address _factory, bool _enabled) external onlyOwner {
}
/**
* @dev Mints a new WasabiOption
*/
function mint(address _to, address _factory) external returns (uint256 mintedId) {
require(<FILL_ME>)
require(IWasabiPoolFactory(_factory).isValidPool(_msgSender()), "Only valid pools can mint");
_safeMint(_to, _currentId);
mintedId = _currentId;
optionPools[mintedId] = _msgSender();
_currentId++;
}
/**
* @dev Burns the specified option
*/
function burn(uint256 _optionId) external {
}
/**
* @dev Sets the base URI
*/
function setBaseURI(string memory baseURI_) external onlyOwner {
}
/**
* @dev Returns the address of the pool which created the given option
*/
function getPool(uint256 _optionId) external view returns (address) {
}
/// @inheritdoc ERC721
function _baseURI() internal view virtual override returns (string memory) {
}
/// @inheritdoc IERC2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address, uint256) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165) returns (bool) {
}
}
| factoryAddresses[_factory]==true,"Invalid Factory" | 406,972 | factoryAddresses[_factory]==true |
"Only valid pools can mint" | /**
* @dev An ERC721 which tracks Wasabi Option positions of accounts
*/
contract WasabiOption is ERC721, IERC2981, Ownable {
address private lastFactory;
mapping(address => bool) private factoryAddresses;
mapping(uint256 => address) private optionPools;
uint256 private _currentId = 1;
string private _baseURIextended;
/**
* @dev Constructs WasabiOption
*/
constructor() ERC721("Wasabi Option NFTs", "WASAB") {}
/**
* @dev Toggles the owning factory
*/
function toggleFactory(address _factory, bool _enabled) external onlyOwner {
}
/**
* @dev Mints a new WasabiOption
*/
function mint(address _to, address _factory) external returns (uint256 mintedId) {
require(factoryAddresses[_factory] == true, "Invalid Factory");
require(<FILL_ME>)
_safeMint(_to, _currentId);
mintedId = _currentId;
optionPools[mintedId] = _msgSender();
_currentId++;
}
/**
* @dev Burns the specified option
*/
function burn(uint256 _optionId) external {
}
/**
* @dev Sets the base URI
*/
function setBaseURI(string memory baseURI_) external onlyOwner {
}
/**
* @dev Returns the address of the pool which created the given option
*/
function getPool(uint256 _optionId) external view returns (address) {
}
/// @inheritdoc ERC721
function _baseURI() internal view virtual override returns (string memory) {
}
/// @inheritdoc IERC2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address, uint256) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165) returns (bool) {
}
}
| IWasabiPoolFactory(_factory).isValidPool(_msgSender()),"Only valid pools can mint" | 406,972 | IWasabiPoolFactory(_factory).isValidPool(_msgSender()) |
"Caller can't burn option" | /**
* @dev An ERC721 which tracks Wasabi Option positions of accounts
*/
contract WasabiOption is ERC721, IERC2981, Ownable {
address private lastFactory;
mapping(address => bool) private factoryAddresses;
mapping(uint256 => address) private optionPools;
uint256 private _currentId = 1;
string private _baseURIextended;
/**
* @dev Constructs WasabiOption
*/
constructor() ERC721("Wasabi Option NFTs", "WASAB") {}
/**
* @dev Toggles the owning factory
*/
function toggleFactory(address _factory, bool _enabled) external onlyOwner {
}
/**
* @dev Mints a new WasabiOption
*/
function mint(address _to, address _factory) external returns (uint256 mintedId) {
}
/**
* @dev Burns the specified option
*/
function burn(uint256 _optionId) external {
require(<FILL_ME>)
_burn(_optionId);
}
/**
* @dev Sets the base URI
*/
function setBaseURI(string memory baseURI_) external onlyOwner {
}
/**
* @dev Returns the address of the pool which created the given option
*/
function getPool(uint256 _optionId) external view returns (address) {
}
/// @inheritdoc ERC721
function _baseURI() internal view virtual override returns (string memory) {
}
/// @inheritdoc IERC2981
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address, uint256) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165) returns (bool) {
}
}
| optionPools[_optionId]==_msgSender(),"Caller can't burn option" | 406,972 | optionPools[_optionId]==_msgSender() |
"Invalid address" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import { Context } from "../lib/utils/Context.sol";
contract AdminAgent is Context {
mapping(address => bool) private _adminAgents;
constructor(address[] memory adminAgents_) {
for (uint i = 0; i < adminAgents_.length; i++) {
require(<FILL_ME>)
_adminAgents[adminAgents_[i]] = true;
}
}
modifier onlyAdminAgents() {
}
}
| adminAgents_[i]!=address(0),"Invalid address" | 407,112 | adminAgents_[i]!=address(0) |
"Unauthorized" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import { Context } from "../lib/utils/Context.sol";
contract AdminAgent is Context {
mapping(address => bool) private _adminAgents;
constructor(address[] memory adminAgents_) {
}
modifier onlyAdminAgents() {
require(<FILL_ME>)
_;
}
}
| _adminAgents[_msgSender()],"Unauthorized" | 407,112 | _adminAgents[_msgSender()] |
"Invalid address" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import { Context } from "../lib/utils/Context.sol";
contract AdminGovernanceAgent is Context {
mapping(address => bool) private _adminGovAgents;
constructor(address[] memory adminGovAgents_) {
for (uint i = 0; i < adminGovAgents_.length; i++) {
require(<FILL_ME>)
_adminGovAgents[adminGovAgents_[i]] = true;
}
}
modifier onlyAdminGovAgents() {
}
}
| adminGovAgents_[i]!=address(0),"Invalid address" | 407,113 | adminGovAgents_[i]!=address(0) |
"Unauthorized" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import { Context } from "../lib/utils/Context.sol";
contract AdminGovernanceAgent is Context {
mapping(address => bool) private _adminGovAgents;
constructor(address[] memory adminGovAgents_) {
}
modifier onlyAdminGovAgents() {
require(<FILL_ME>)
_;
}
}
| _adminGovAgents[_msgSender()],"Unauthorized" | 407,113 | _adminGovAgents[_msgSender()] |
"You have already paid." | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
// Uncomment this line to use console.log
// import "hardhat/console.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IAuctionFactory.sol";
contract Sale is Ownable {
address payable public seller;
uint256 public price;
uint256 public saleTime;
uint256 public deadline;
address public buyer;
bool public hasPaid = false;
bool public confirmed = false;
bool public ended = false;
bool public frozen = false;
IAuctionFactory public auctionFactory;
uint256 public sellerTax;
event Buy(address buyer, uint256 price);
event SaleSuccess(address buyer, address seller, uint256 price);
event SaleReverted(address buyer, address seller, uint256 price);
constructor(
uint256 _price,
address _seller,
address admin
) Ownable(admin) {
}
/**
* @dev Allows any user to buy the item.
* @notice Funds are stored in the contract until irl transaction is complete.
*/
function buy() public payable {
require(
msg.value == price,
"You must pay the price."
);
require(<FILL_ME>)
deadline = block.timestamp + auctionFactory.saleDeadlineDelay();
hasPaid = true;
buyer = msg.sender;
emit Buy(msg.sender, price);
}
/**
* @dev Allows buyer to confirm the transaction.
*/
function buyerConfirms() public {
}
/**
* @dev Allows either the seller or the buyer to end the sale, depending on the situation.
*/
function saleEnd() public {
}
function _saleEnd(address sender) internal {
}
/**
* @dev Allows the owner to freeze the auction.
*/
function freeze(bool a) public onlyOwner {
}
/**
* @dev Allows the owner to withdraw the funds from the contract.
* @param recipient The address to send the funds to.
* @notice This function is only callable by the owner, IT SHOULD NOT BE USED OTHERWISE.
*/
function emergencyWithdraw(address recipient) public onlyOwner {
}
function _emergencyWithdraw(address recipient) internal {
}
function _toTreasury(uint256 amount) internal {
}
}
| !hasPaid,"You have already paid." | 407,169 | !hasPaid |
"Buyer has already confirmed." | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
// Uncomment this line to use console.log
// import "hardhat/console.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IAuctionFactory.sol";
contract Sale is Ownable {
address payable public seller;
uint256 public price;
uint256 public saleTime;
uint256 public deadline;
address public buyer;
bool public hasPaid = false;
bool public confirmed = false;
bool public ended = false;
bool public frozen = false;
IAuctionFactory public auctionFactory;
uint256 public sellerTax;
event Buy(address buyer, uint256 price);
event SaleSuccess(address buyer, address seller, uint256 price);
event SaleReverted(address buyer, address seller, uint256 price);
constructor(
uint256 _price,
address _seller,
address admin
) Ownable(admin) {
}
/**
* @dev Allows any user to buy the item.
* @notice Funds are stored in the contract until irl transaction is complete.
*/
function buy() public payable {
}
/**
* @dev Allows buyer to confirm the transaction.
*/
function buyerConfirms() public {
require(
msg.sender == buyer || msg.sender == owner(),
"Only the buyer can call this function."
);
require(hasPaid, "Buyer has not paid yet.");
require(<FILL_ME>)
confirmed = true;
_saleEnd(seller);
}
/**
* @dev Allows either the seller or the buyer to end the sale, depending on the situation.
*/
function saleEnd() public {
}
function _saleEnd(address sender) internal {
}
/**
* @dev Allows the owner to freeze the auction.
*/
function freeze(bool a) public onlyOwner {
}
/**
* @dev Allows the owner to withdraw the funds from the contract.
* @param recipient The address to send the funds to.
* @notice This function is only callable by the owner, IT SHOULD NOT BE USED OTHERWISE.
*/
function emergencyWithdraw(address recipient) public onlyOwner {
}
function _emergencyWithdraw(address recipient) internal {
}
function _toTreasury(uint256 amount) internal {
}
}
| !confirmed,"Buyer has already confirmed." | 407,169 | !confirmed |
"!funding" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import { IAuraLocker } from "./Interfaces.sol";
import { IERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/utils/SafeERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts-0.8/security/ReentrancyGuard.sol";
import { AuraMath } from "./AuraMath.sol";
/**
* @title AuraVestedEscrow
* @author adapted from ConvexFinance (convex-platform/contracts/contracts/VestedEscrow)
* @notice Vests tokens over a given timeframe to an array of recipients. Allows locking of
* these tokens directly to staking contract.
* @dev Adaptations:
* - One time initialisation
* - Consolidation of fundAdmin/admin
* - Lock in AuraLocker by default
* - Start and end time
*/
contract AuraVestedEscrow is ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20 public immutable rewardToken;
address public admin;
address public immutable funder;
IAuraLocker public auraLocker;
uint256 public immutable startTime;
uint256 public immutable endTime;
uint256 public immutable totalTime;
bool public initialised = false;
mapping(address => uint256) public totalLocked;
mapping(address => uint256) public totalClaimed;
event Funded(address indexed recipient, uint256 reward);
event Cancelled(address indexed recipient);
event Claim(address indexed user, uint256 amount, bool locked);
/**
* @param rewardToken_ Reward token (AURA)
* @param admin_ Admin to cancel rewards
* @param auraLocker_ Contract where rewardToken can be staked
* @param starttime_ Timestamp when claim starts
* @param endtime_ When vesting ends
*/
constructor(
address rewardToken_,
address admin_,
address auraLocker_,
uint256 starttime_,
uint256 endtime_
) {
}
/***************************************
SETUP
****************************************/
/**
* @notice Change contract admin
* @param _admin New admin address
*/
function setAdmin(address _admin) external {
}
/**
* @notice Change locker contract address
* @param _auraLocker Aura Locker address
*/
function setLocker(address _auraLocker) external {
}
/**
* @notice Fund recipients with rewardTokens
* @param _recipient Array of recipients to vest rewardTokens for
* @param _amount Arrary of amount of rewardTokens to vest
*/
function fund(address[] calldata _recipient, uint256[] calldata _amount) external nonReentrant {
}
/**
* @notice Cancel recipients vesting rewardTokens
* @param _recipient Recipient address
*/
function cancel(address _recipient) external nonReentrant {
require(msg.sender == admin, "!auth");
require(<FILL_ME>)
_claim(_recipient, false);
uint256 delta = remaining(_recipient);
rewardToken.safeTransfer(admin, delta);
totalLocked[_recipient] = 0;
emit Cancelled(_recipient);
}
/***************************************
VIEWS
****************************************/
/**
* @notice Available amount to claim
* @param _recipient Recipient to lookup
*/
function available(address _recipient) public view returns (uint256) {
}
/**
* @notice Total remaining vested amount
* @param _recipient Recipient to lookup
*/
function remaining(address _recipient) public view returns (uint256) {
}
/**
* @notice Get total amount vested for this timestamp
* @param _recipient Recipient to lookup
* @param _time Timestamp to check vesting amount for
*/
function _totalVestedOf(address _recipient, uint256 _time) internal view returns (uint256 total) {
}
/***************************************
CLAIM
****************************************/
function claim(bool _lock) external nonReentrant {
}
/**
* @dev Claim reward token (Aura) and lock it.
* @param _recipient Address to receive rewards.
* @param _lock Lock rewards immediately.
*/
function _claim(address _recipient, bool _lock) internal {
}
}
| totalLocked[_recipient]>0,"!funding" | 407,497 | totalLocked[_recipient]>0 |
"!auraLocker" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import { IAuraLocker } from "./Interfaces.sol";
import { IERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/utils/SafeERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts-0.8/security/ReentrancyGuard.sol";
import { AuraMath } from "./AuraMath.sol";
/**
* @title AuraVestedEscrow
* @author adapted from ConvexFinance (convex-platform/contracts/contracts/VestedEscrow)
* @notice Vests tokens over a given timeframe to an array of recipients. Allows locking of
* these tokens directly to staking contract.
* @dev Adaptations:
* - One time initialisation
* - Consolidation of fundAdmin/admin
* - Lock in AuraLocker by default
* - Start and end time
*/
contract AuraVestedEscrow is ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20 public immutable rewardToken;
address public admin;
address public immutable funder;
IAuraLocker public auraLocker;
uint256 public immutable startTime;
uint256 public immutable endTime;
uint256 public immutable totalTime;
bool public initialised = false;
mapping(address => uint256) public totalLocked;
mapping(address => uint256) public totalClaimed;
event Funded(address indexed recipient, uint256 reward);
event Cancelled(address indexed recipient);
event Claim(address indexed user, uint256 amount, bool locked);
/**
* @param rewardToken_ Reward token (AURA)
* @param admin_ Admin to cancel rewards
* @param auraLocker_ Contract where rewardToken can be staked
* @param starttime_ Timestamp when claim starts
* @param endtime_ When vesting ends
*/
constructor(
address rewardToken_,
address admin_,
address auraLocker_,
uint256 starttime_,
uint256 endtime_
) {
}
/***************************************
SETUP
****************************************/
/**
* @notice Change contract admin
* @param _admin New admin address
*/
function setAdmin(address _admin) external {
}
/**
* @notice Change locker contract address
* @param _auraLocker Aura Locker address
*/
function setLocker(address _auraLocker) external {
}
/**
* @notice Fund recipients with rewardTokens
* @param _recipient Array of recipients to vest rewardTokens for
* @param _amount Arrary of amount of rewardTokens to vest
*/
function fund(address[] calldata _recipient, uint256[] calldata _amount) external nonReentrant {
}
/**
* @notice Cancel recipients vesting rewardTokens
* @param _recipient Recipient address
*/
function cancel(address _recipient) external nonReentrant {
}
/***************************************
VIEWS
****************************************/
/**
* @notice Available amount to claim
* @param _recipient Recipient to lookup
*/
function available(address _recipient) public view returns (uint256) {
}
/**
* @notice Total remaining vested amount
* @param _recipient Recipient to lookup
*/
function remaining(address _recipient) public view returns (uint256) {
}
/**
* @notice Get total amount vested for this timestamp
* @param _recipient Recipient to lookup
* @param _time Timestamp to check vesting amount for
*/
function _totalVestedOf(address _recipient, uint256 _time) internal view returns (uint256 total) {
}
/***************************************
CLAIM
****************************************/
function claim(bool _lock) external nonReentrant {
}
/**
* @dev Claim reward token (Aura) and lock it.
* @param _recipient Address to receive rewards.
* @param _lock Lock rewards immediately.
*/
function _claim(address _recipient, bool _lock) internal {
uint256 claimable = available(_recipient);
totalClaimed[_recipient] += claimable;
if (_lock) {
require(<FILL_ME>)
rewardToken.safeApprove(address(auraLocker), claimable);
auraLocker.lock(_recipient, claimable);
} else {
rewardToken.safeTransfer(_recipient, claimable);
}
emit Claim(_recipient, claimable, _lock);
}
}
| address(auraLocker)!=address(0),"!auraLocker" | 407,497 | address(auraLocker)!=address(0) |
'SOLD OUT!' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&YYY&@@@&YYY&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&GYYYY&@&PYYY5&@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@GGY7???J5BB@@@@@@@@@@@@@@@@@@@@@@@@@@PPPYYY5#YY5YYY5@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@GJ7777?????JJ5B@@@@@@@@@@@@@@@@@@@@@@@PYY5MIHAVERSEYJJP@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P7?JJYJ?JYJJJJJJ5#@@@@@@@@@@@@@@@@@@@@GJJJB@B???!~B@B?JJG@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@&57~7JYYYY?YYYYJJJYY5#@@@@@@@@@@@@@@@@@@B??7P@@@G555G@@@57??B@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@P?7?7?YYJJJ?7?YYJJYYYP#@@@@@@@@@@@@@@@@#7!!J@@@@@@Y@@@@@@J!!7#@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@YYJJJ?7??JYJJYY5YP@@@@@@@@@@@@@@@&?!!?&@@@@@@@@@@@@@&7!!?@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#PYJJJJJYYYJYYY555P@@@@@@@@@@@@@@@#P5PB&@@@@@@@@@@@&BP5P#@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&PYYYYYJJYYYY5555#@@@@@@@@@@@@@@@@BP5PB&@@@@@@@&BP5P#@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BJJJJJJJYYY555555#@@@@@@@@@@@@@@@@&BP55G&@@@&G55PB@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B5???JJYYYY5YJYYY55#@@@@@@@@@@@@@@@@@&G5Y5B&G5Y5B&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Y7????JYYYY??7?JYY55G&@@@@@@@@@@@@@@@@@&GYY5YYG&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Y7????JYYY?7?JJYYYY55P&@@@@@@@@@@@@@@@@@@#PYP#@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@57????JYYY?7?JJYY555555&@@@@@@@@@@@@@@@@@@@I@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@5?????JYYYJ??JYYY5555555&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B5J??JJYYYYYYYYY555555555#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BJJJJJYYY5555Y555YYY55555B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B5JJJJYYY5555555555555Y55G&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#YYYYYYYY5555555Y55Y5YY55G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&5YYYYY5555555YYY5555YY??G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@&BG#@@@@@&5YY5555555555YYY5YYY?!~!G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@&&#G55P#@@@@&G55555555555J??J?777!!!!G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@&##BG55P#@@@@&BP5555555555J?7777!~^~!P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@&&&@@#BGP5YPBBBBBP55555YJY5P5J?7!!!~^^~5@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@5B@@@@@G555?5GPG#&#&#GY?YY555P5J?7!~~~^^J@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@&~~JB@@@@BPGG5PPPPGBG##PYG&&&#G55P5Y?7~^^^^7@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&P~.~JPG&@@@&&&GBBGGPPP5Y5#@@@@@@#G5555Y?7~^^~7&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@&Y .~J55P&@@@@@@@&&#GY5PJJGB@@@@@@@##BPP5YJ7!^:7G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@? .!Y5555&@@@@@@@@@&BGG5YPP#&@@@@@@@@@@BP5YYJ!~~7G@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@7.:!!YJ?JYY55#@@@@@@@@@@@#BBBG5G#&@@@@@@@@@@#P5P555Y5#@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@BYJY555J?777??5#@@@@@@@@@@@@@&#GPGGB&@@@@@@@@@B55555P55P#@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@&PBB##PP5J??YY#GBBB@@@@@@@@@@@@@@&BGGGPB@@@@@@@@#P555555555PB@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@B?J5PP##PPYP&@@@@@@@@@@@@@@@@&BGBGG&@@@@@@@@#5P555555555PB&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@BJ77?PPGPJJJP&@@@@@@@@@@@@@@@@@@&#BB#@@@@@@@@@&B555555555555PB&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@G777?JJJY&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&55555P555555555B&@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@BY7?JYG&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&GP55555555555555G@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@Y?JB@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#BPP5555555PPB&@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@B&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#######@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
/// @title CryptoCanaries Contract
/// @author MIHA
contract CryptoCanaries is
ERC721A,
IERC2981,
Ownable,
ReentrancyGuard
{
using Strings for uint256;
bytes32 public merkleRoot = 0xe144e75eba1174dff3ca208fdc126ad2494ab76bf0d276074be28ed1e0a210c2;
mapping(address => bool) public addressClaimed; /// @notice An address can mint only once
address public royaltyAddress;
string public provenance = "59c76c4fc217ac63a3b0dc76a8ad9766b514a85cd6555d00acfdb100a12ef70d"; // sha256
string public uriPrefix = '';
string public uriSuffix = '.json';
string public hiddenMetadataUri = "ar://QfEQLDH3YHK9pjsv3VluFnAxZQ5qEsZAN8HGyDccdm4";
uint256 public cost = 0 ether;
uint256 public maxSupply = 112; /// @notice +1 to save on gas cost of <= vs <
uint256 public royalty = 100; /// @notice Must be a whole number 3.3% is 33
bool public paused = false;
bool public revealed = false;
constructor()
ERC721A("CryptoCanaries", "CANARY") {
}
/// @dev === MODIFIER ===
modifier mintCompliance() {
require(<FILL_ME>)
require(!addressClaimed[_msgSender()], 'Address already claimed!');
require(!paused, 'Sale is paused!');
require(msg.value >= cost);
_;
}
/// @dev === Minting Function - Input ====
function mint(bytes32[] calldata _merkleProof) public payable
mintCompliance()
nonReentrant
{
}
/// @dev === Override ERC721A ===
function _startTokenId() internal view virtual override returns (uint256) {
}
/// @dev === PUBLIC READ-ONLY ===
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
/// @dev === Owner Control/Configuration Functions ===
function setRevealed(bool _state) public onlyOwner {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function setRoyaltyAddress(address _royaltyAddress) public onlyOwner {
}
function setRoyaly(uint256 _royalty) external onlyOwner {
}
/// @dev === INTERNAL READ-ONLY ===
function _baseURI() internal view virtual override returns (string memory) {
}
/// @dev === Withdraw ====
function withdraw() public onlyOwner nonReentrant {
}
//IERC2981 Royalty Standard
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external view override returns (address receiver, uint256 royaltyAmount)
{
}
/// @dev === Support Functions ==
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) {
}
}
| totalSupply()+1<maxSupply,'SOLD OUT!' | 407,625 | totalSupply()+1<maxSupply |
'Address already claimed!' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&YYY&@@@&YYY&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&GYYYY&@&PYYY5&@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@GGY7???J5BB@@@@@@@@@@@@@@@@@@@@@@@@@@PPPYYY5#YY5YYY5@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@GJ7777?????JJ5B@@@@@@@@@@@@@@@@@@@@@@@PYY5MIHAVERSEYJJP@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@P7?JJYJ?JYJJJJJJ5#@@@@@@@@@@@@@@@@@@@@GJJJB@B???!~B@B?JJG@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@&57~7JYYYY?YYYYJJJYY5#@@@@@@@@@@@@@@@@@@B??7P@@@G555G@@@57??B@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@P?7?7?YYJJJ?7?YYJJYYYP#@@@@@@@@@@@@@@@@#7!!J@@@@@@Y@@@@@@J!!7#@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@YYJJJ?7??JYJJYY5YP@@@@@@@@@@@@@@@&?!!?&@@@@@@@@@@@@@&7!!?@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#PYJJJJJYYYJYYY555P@@@@@@@@@@@@@@@#P5PB&@@@@@@@@@@@&BP5P#@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&PYYYYYJJYYYY5555#@@@@@@@@@@@@@@@@BP5PB&@@@@@@@&BP5P#@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BJJJJJJJYYY555555#@@@@@@@@@@@@@@@@&BP55G&@@@&G55PB@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B5???JJYYYY5YJYYY55#@@@@@@@@@@@@@@@@@&G5Y5B&G5Y5B&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Y7????JYYYY??7?JYY55G&@@@@@@@@@@@@@@@@@&GYY5YYG&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Y7????JYYY?7?JJYYYY55P&@@@@@@@@@@@@@@@@@@#PYP#@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@57????JYYY?7?JJYY555555&@@@@@@@@@@@@@@@@@@@I@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@5?????JYYYJ??JYYY5555555&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B5J??JJYYYYYYYYY555555555#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BJJJJJYYY5555Y555YYY55555B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B5JJJJYYY5555555555555Y55G&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#YYYYYYYY5555555Y55Y5YY55G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&5YYYYY5555555YYY5555YY??G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@&BG#@@@@@&5YY5555555555YYY5YYY?!~!G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@&&#G55P#@@@@&G55555555555J??J?777!!!!G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@&##BG55P#@@@@&BP5555555555J?7777!~^~!P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@&&&@@#BGP5YPBBBBBP55555YJY5P5J?7!!!~^^~5@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@5B@@@@@G555?5GPG#&#&#GY?YY555P5J?7!~~~^^J@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@&~~JB@@@@BPGG5PPPPGBG##PYG&&&#G55P5Y?7~^^^^7@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&P~.~JPG&@@@&&&GBBGGPPP5Y5#@@@@@@#G5555Y?7~^^~7&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@&Y .~J55P&@@@@@@@&&#GY5PJJGB@@@@@@@##BPP5YJ7!^:7G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@? .!Y5555&@@@@@@@@@&BGG5YPP#&@@@@@@@@@@BP5YYJ!~~7G@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@7.:!!YJ?JYY55#@@@@@@@@@@@#BBBG5G#&@@@@@@@@@@#P5P555Y5#@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@BYJY555J?777??5#@@@@@@@@@@@@@&#GPGGB&@@@@@@@@@B55555P55P#@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@&PBB##PP5J??YY#GBBB@@@@@@@@@@@@@@&BGGGPB@@@@@@@@#P555555555PB@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@B?J5PP##PPYP&@@@@@@@@@@@@@@@@&BGBGG&@@@@@@@@#5P555555555PB&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@BJ77?PPGPJJJP&@@@@@@@@@@@@@@@@@@&#BB#@@@@@@@@@&B555555555555PB&@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@G777?JJJY&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&55555P555555555B&@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@BY7?JYG&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&GP55555555555555G@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@Y?JB@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#BPP5555555PPB&@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@B&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#######@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
/// @title CryptoCanaries Contract
/// @author MIHA
contract CryptoCanaries is
ERC721A,
IERC2981,
Ownable,
ReentrancyGuard
{
using Strings for uint256;
bytes32 public merkleRoot = 0xe144e75eba1174dff3ca208fdc126ad2494ab76bf0d276074be28ed1e0a210c2;
mapping(address => bool) public addressClaimed; /// @notice An address can mint only once
address public royaltyAddress;
string public provenance = "59c76c4fc217ac63a3b0dc76a8ad9766b514a85cd6555d00acfdb100a12ef70d"; // sha256
string public uriPrefix = '';
string public uriSuffix = '.json';
string public hiddenMetadataUri = "ar://QfEQLDH3YHK9pjsv3VluFnAxZQ5qEsZAN8HGyDccdm4";
uint256 public cost = 0 ether;
uint256 public maxSupply = 112; /// @notice +1 to save on gas cost of <= vs <
uint256 public royalty = 100; /// @notice Must be a whole number 3.3% is 33
bool public paused = false;
bool public revealed = false;
constructor()
ERC721A("CryptoCanaries", "CANARY") {
}
/// @dev === MODIFIER ===
modifier mintCompliance() {
require(totalSupply() + 1 < maxSupply, 'SOLD OUT!');
require(<FILL_ME>)
require(!paused, 'Sale is paused!');
require(msg.value >= cost);
_;
}
/// @dev === Minting Function - Input ====
function mint(bytes32[] calldata _merkleProof) public payable
mintCompliance()
nonReentrant
{
}
/// @dev === Override ERC721A ===
function _startTokenId() internal view virtual override returns (uint256) {
}
/// @dev === PUBLIC READ-ONLY ===
function walletOfOwner(address _owner) public view returns (uint256[] memory) {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
/// @dev === Owner Control/Configuration Functions ===
function setRevealed(bool _state) public onlyOwner {
}
function setUriPrefix(string memory _uriPrefix) public onlyOwner {
}
function setUriSuffix(string memory _uriSuffix) public onlyOwner {
}
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {
}
function pause(bool _state) public onlyOwner {
}
function setRoyaltyAddress(address _royaltyAddress) public onlyOwner {
}
function setRoyaly(uint256 _royalty) external onlyOwner {
}
/// @dev === INTERNAL READ-ONLY ===
function _baseURI() internal view virtual override returns (string memory) {
}
/// @dev === Withdraw ====
function withdraw() public onlyOwner nonReentrant {
}
//IERC2981 Royalty Standard
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external view override returns (address receiver, uint256 royaltyAmount)
{
}
/// @dev === Support Functions ==
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC165) returns (bool) {
}
}
| !addressClaimed[_msgSender()],'Address already claimed!' | 407,625 | !addressClaimed[_msgSender()] |
"Exceeds maximum wallet token amount." | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
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 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);
}
interface IdexFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IdexRouter {
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;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
}
contract ShibaTerra is IERC20, Ownable
{
//@TresFlames
//mapping
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
mapping(address => bool) private excludedFromLimits;
mapping(address => bool) public excludedFromFees;
mapping(address=>bool) public isPair;
mapping (address => bool) public isBlacklisted;
//strings
string private constant _name = 'ShibaTerra Inu';
string private constant _symbol = '$STI';
//uints
uint private constant DefaultLiquidityLockTime=7 days;
uint public constant InitialSupply= 10**8 * 10**_decimals;
uint public _circulatingSupply =InitialSupply;
uint public buyTax = 10;
uint public sellTax = 10;
uint public transferTax = 10;
uint public liquidityTax=100;
uint public projectTax=900;
uint constant TAX_DENOMINATOR=1000;
uint constant MAXTAXDENOMINATOR=10;
uint public swapTreshold=6;
uint public overLiquifyTreshold=40;
uint private LaunchTimestamp;
uint _liquidityUnlockTime;
uint8 private constant _decimals = 18;
uint256 public maxTransactionAmount;
uint256 public maxWalletBalance;
IdexRouter private _dexRouter;
//addresses
address private dexRouter=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address private _dexPairAddress;
address constant deadWallet = 0x000000000000000000000000000000000000dEaD;
address payable public projectWallet;
//modifiers
modifier lockTheSwap {
}
//bools
bool private _isSwappingContractModifier;
bool public blacklistMode = true;
bool public manualSwap;
bool public LPReleaseLimitedTo20Percent;
//events
event BlacklistStatusChange(bool status);
event UpdateProjectWallet(address _address);
event SwapThresholdChange(uint threshold);
event OverLiquifiedThresholdChange(uint threshold);
event OnSetTaxes(uint buy, uint sell, uint transfer_, uint project,uint liquidity);
event ManualSwapChange(bool status);
event MaxWalletBalanceUpdated(uint256 percent);
event MaxTransactionAmountUpdated(uint256 percent);
event ExcludeAccount(address account, bool exclude);
event ExcludeFromLimits(address account, bool exclude);
event OwnerSwap();
event OnEnableTrading();
event OnProlongLPLock(uint UnlockTimestamp);
event OnReleaseLP();
event RecoverETH();
event BlacklistUpdated();
event NewPairSet(address Pair, bool Add);
event Release20PercentLP();
event NewRouterSet(address _newdex);
event RecoverTokens(uint256 amount);
constructor () {
}
function enable_blacklist(bool _status) public onlyOwner {
}
function manage_blacklist(address[] calldata addresses, bool status) public onlyOwner {
}
function ChangeProjectWallet(address newAddress) public onlyOwner{
}
function _transfer(address sender, address recipient, uint amount) private{
}
function _taxedTransfer(address sender, address recipient, uint amount) private{
uint senderBalance = _balances[sender];
require(senderBalance >= amount, "Transfer exceeds balance");
bool excludedAccount = excludedFromLimits[sender] || excludedFromLimits[recipient];
if (
isPair[sender] &&
!excludedAccount
) {
require(
amount <= maxTransactionAmount,
"Transfer amount exceeds the maxTxAmount."
);
uint256 contractBalanceRecepient = balanceOf(recipient);
require(<FILL_ME>)
} else if (
isPair[recipient] &&
!excludedAccount
) {
require(amount <= maxTransactionAmount, "Sell transfer amount exceeds the maxSellTransactionAmount.");
}
bool isBuy=isPair[sender];
bool isSell=isPair[recipient];
uint tax;
if(isSell){
uint SellTaxDuration=2 minutes;
if(block.timestamp<LaunchTimestamp+SellTaxDuration){
tax=_getStartTax(SellTaxDuration,750);
}else tax=sellTax;
}
else if(isBuy){
uint BuyTaxDuration=45 seconds;
if(block.timestamp<LaunchTimestamp+BuyTaxDuration){
tax=_getStartTax(BuyTaxDuration,999);
}else tax=buyTax;
} else tax=transferTax;
if((sender!=_dexPairAddress)&&(!manualSwap)&&(!_isSwappingContractModifier))
_swapContractToken(false);
uint contractToken=_calculateFee(amount, tax, projectTax+liquidityTax);
uint taxedAmount=amount-contractToken;
_balances[sender]-=amount;
_balances[address(this)] += contractToken;
_balances[recipient]+=taxedAmount;
emit Transfer(sender,recipient,taxedAmount);
}
function _getStartTax(uint duration, uint maxTax) private view returns (uint){
}
function _calculateFee(uint amount, uint tax, uint taxPercent) private pure returns (uint) {
}
function _feelessTransfer(address sender, address recipient, uint amount) private{
}
function setSwapTreshold(uint newSwapTresholdPermille) public onlyOwner{
}
function SetOverLiquifiedTreshold(uint newOverLiquifyTresholdPermille) public onlyOwner{
}
function SetTaxes(uint buy, uint sell, uint transfer_, uint project,uint liquidity) public onlyOwner{
}
function isOverLiquified() public view returns(bool){
}
function _swapContractToken(bool ignoreLimits) private lockTheSwap{
}
function _swapTokenForETH(uint amount) private {
}
function _addLiquidity(uint tokenamount, uint ETHamount) private {
}
function getLiquidityReleaseTimeInSeconds() public view returns (uint){
}
function getBurnedTokens() public view returns(uint){
}
function SetPair(address Pair, bool Add) public onlyOwner{
}
function SwitchManualSwap(bool manual) public onlyOwner{
}
function SwapContractToken() public onlyOwner{
}
function SetNewRouter(address _newdex) public onlyOwner{
}
function setMaxWalletBalancePercent(uint256 percent) external onlyOwner {
}
function setMaxTransactionAmount(uint256 percent) public onlyOwner {
}
function ExcludeAccountFromFees(address account, bool exclude) public onlyOwner{
}
function setExcludedAccountFromLimits(address account, bool exclude) public onlyOwner{
}
function isExcludedFromLimits(address account) public view returns(bool) {
}
function SetupEnableTrading() public onlyOwner{
}
function limitLiquidityReleaseTo20Percent() public onlyOwner{
}
function LockLiquidityForSeconds(uint secondsUntilUnlock) public onlyOwner{
}
function _prolongLiquidityLock(uint newUnlockTime) private{
}
function LiquidityRelease() public onlyOwner {
}
receive() external payable {}
function getOwner() external view override returns (address) {
}
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 (uint) {
}
function balanceOf(address account) public view override returns (uint) {
}
function transfer(address recipient, uint amount) external override returns (bool) {
}
function allowance(address _owner, address spender) external view override returns (uint) {
}
function approve(address spender, uint amount) external override returns (bool) {
}
function _approve(address owner, address spender, uint amount) private {
}
function transferFrom(address sender, address recipient, uint amount) external override returns (bool) {
}
function increaseAllowance(address spender, uint addedValue) external returns (bool) {
}
function decreaseAllowance(address spender, uint subtractedValue) external returns (bool) {
}
function emergencyETHrecovery(uint256 amountPercentage) external onlyOwner {
}
function withdrawContractToken(uint256 _amount) external onlyOwner {
}
}
| contractBalanceRecepient+amount<=maxWalletBalance,"Exceeds maximum wallet token amount." | 407,671 | contractBalanceRecepient+amount<=maxWalletBalance |
"Taxes don't add up to denominator" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
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 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);
}
interface IdexFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IdexRouter {
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;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public onlyOwner {
}
function transferOwnership(address newOwner) public onlyOwner {
}
}
contract ShibaTerra is IERC20, Ownable
{
//@TresFlames
//mapping
mapping (address => uint) private _balances;
mapping (address => mapping (address => uint)) private _allowances;
mapping(address => bool) private excludedFromLimits;
mapping(address => bool) public excludedFromFees;
mapping(address=>bool) public isPair;
mapping (address => bool) public isBlacklisted;
//strings
string private constant _name = 'ShibaTerra Inu';
string private constant _symbol = '$STI';
//uints
uint private constant DefaultLiquidityLockTime=7 days;
uint public constant InitialSupply= 10**8 * 10**_decimals;
uint public _circulatingSupply =InitialSupply;
uint public buyTax = 10;
uint public sellTax = 10;
uint public transferTax = 10;
uint public liquidityTax=100;
uint public projectTax=900;
uint constant TAX_DENOMINATOR=1000;
uint constant MAXTAXDENOMINATOR=10;
uint public swapTreshold=6;
uint public overLiquifyTreshold=40;
uint private LaunchTimestamp;
uint _liquidityUnlockTime;
uint8 private constant _decimals = 18;
uint256 public maxTransactionAmount;
uint256 public maxWalletBalance;
IdexRouter private _dexRouter;
//addresses
address private dexRouter=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address private _dexPairAddress;
address constant deadWallet = 0x000000000000000000000000000000000000dEaD;
address payable public projectWallet;
//modifiers
modifier lockTheSwap {
}
//bools
bool private _isSwappingContractModifier;
bool public blacklistMode = true;
bool public manualSwap;
bool public LPReleaseLimitedTo20Percent;
//events
event BlacklistStatusChange(bool status);
event UpdateProjectWallet(address _address);
event SwapThresholdChange(uint threshold);
event OverLiquifiedThresholdChange(uint threshold);
event OnSetTaxes(uint buy, uint sell, uint transfer_, uint project,uint liquidity);
event ManualSwapChange(bool status);
event MaxWalletBalanceUpdated(uint256 percent);
event MaxTransactionAmountUpdated(uint256 percent);
event ExcludeAccount(address account, bool exclude);
event ExcludeFromLimits(address account, bool exclude);
event OwnerSwap();
event OnEnableTrading();
event OnProlongLPLock(uint UnlockTimestamp);
event OnReleaseLP();
event RecoverETH();
event BlacklistUpdated();
event NewPairSet(address Pair, bool Add);
event Release20PercentLP();
event NewRouterSet(address _newdex);
event RecoverTokens(uint256 amount);
constructor () {
}
function enable_blacklist(bool _status) public onlyOwner {
}
function manage_blacklist(address[] calldata addresses, bool status) public onlyOwner {
}
function ChangeProjectWallet(address newAddress) public onlyOwner{
}
function _transfer(address sender, address recipient, uint amount) private{
}
function _taxedTransfer(address sender, address recipient, uint amount) private{
}
function _getStartTax(uint duration, uint maxTax) private view returns (uint){
}
function _calculateFee(uint amount, uint tax, uint taxPercent) private pure returns (uint) {
}
function _feelessTransfer(address sender, address recipient, uint amount) private{
}
function setSwapTreshold(uint newSwapTresholdPermille) public onlyOwner{
}
function SetOverLiquifiedTreshold(uint newOverLiquifyTresholdPermille) public onlyOwner{
}
function SetTaxes(uint buy, uint sell, uint transfer_, uint project,uint liquidity) public onlyOwner{
uint maxTax=TAX_DENOMINATOR/MAXTAXDENOMINATOR;
require(buy<=maxTax&&sell<=maxTax&&transfer_<=maxTax,"Tax exceeds maxTax");
require(<FILL_ME>)
buyTax=buy;
sellTax=sell;
transferTax=transfer_;
projectTax=project;
liquidityTax=liquidity;
emit OnSetTaxes(buy, sell, transfer_, project,liquidity);
}
function isOverLiquified() public view returns(bool){
}
function _swapContractToken(bool ignoreLimits) private lockTheSwap{
}
function _swapTokenForETH(uint amount) private {
}
function _addLiquidity(uint tokenamount, uint ETHamount) private {
}
function getLiquidityReleaseTimeInSeconds() public view returns (uint){
}
function getBurnedTokens() public view returns(uint){
}
function SetPair(address Pair, bool Add) public onlyOwner{
}
function SwitchManualSwap(bool manual) public onlyOwner{
}
function SwapContractToken() public onlyOwner{
}
function SetNewRouter(address _newdex) public onlyOwner{
}
function setMaxWalletBalancePercent(uint256 percent) external onlyOwner {
}
function setMaxTransactionAmount(uint256 percent) public onlyOwner {
}
function ExcludeAccountFromFees(address account, bool exclude) public onlyOwner{
}
function setExcludedAccountFromLimits(address account, bool exclude) public onlyOwner{
}
function isExcludedFromLimits(address account) public view returns(bool) {
}
function SetupEnableTrading() public onlyOwner{
}
function limitLiquidityReleaseTo20Percent() public onlyOwner{
}
function LockLiquidityForSeconds(uint secondsUntilUnlock) public onlyOwner{
}
function _prolongLiquidityLock(uint newUnlockTime) private{
}
function LiquidityRelease() public onlyOwner {
}
receive() external payable {}
function getOwner() external view override returns (address) {
}
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 (uint) {
}
function balanceOf(address account) public view override returns (uint) {
}
function transfer(address recipient, uint amount) external override returns (bool) {
}
function allowance(address _owner, address spender) external view override returns (uint) {
}
function approve(address spender, uint amount) external override returns (bool) {
}
function _approve(address owner, address spender, uint amount) private {
}
function transferFrom(address sender, address recipient, uint amount) external override returns (bool) {
}
function increaseAllowance(address spender, uint addedValue) external returns (bool) {
}
function decreaseAllowance(address spender, uint subtractedValue) external returns (bool) {
}
function emergencyETHrecovery(uint256 amountPercentage) external onlyOwner {
}
function withdrawContractToken(uint256 _amount) external onlyOwner {
}
}
| project+liquidity==TAX_DENOMINATOR,"Taxes don't add up to denominator" | 407,671 | project+liquidity==TAX_DENOMINATOR |
null | // SPDX-License-Identifier: MIT
/*
_____________
__,---'::.- -::_ _ `-----.___ ______
_,-'::_ ::- - -. _ ::-::_ .`--,' :: .:`-._
,-'_ :: _ ::_ .: :: - _ .: ::- _/ :: ,-. ::. `-._
_,-' ::- :: ::- _ :: - :: | .: ((|)) ::`.
___,---' :: :: ;:: :: :.- _ ::._ :: \ : `_____::..--'
,-"" :: ::. ,------. (. :: \ :: :: ,-- :. _ :`. :: \ `-._
,' :: ' _._.:_ :.)___,-------------._(.:: ____`-._ `._ ::`--...___; ;
;:::. ,--'--""""" / / \. | ``-----`''`---------'
; `::; _ /.:/_, _\.:\_,
| ; jrei ='-//\\--" ='-//\\--"
` .| '' `` '' ``
\::'\
\ \
`..:`.
`. `--.____
`-:______ `-._
`---'`
Gecko is a 1 for 1 fork of the popular Chameleon Token.
Shoutout to the team for inspiring us, and make this amazing contract.
Telegram: https://t.me/GeckoETH
Website: https://www.Gecko.io
TWitter: https://twitter.com/GeckoERC
Dynamic Fees:
Any time someone sells, their price impact is calculated and added onto the sell fee before their sell.
The buy fee goes down by the same amount. Fees revert back to 10% at a rate of 1% per minute.
Hourly Biggest Buyer:
Every hour, 5% of the tokens from liquidity will be rewarded to the biggest buyer of the previous hour. Fully automated on-chain.
Vested Dividends:
Token fees are converted to ETH and paid as ETH dividends to holders. Dividends vest continuously over 3 days. If you sell early, you will miss out on some rewards. Hold and behold.
Referrals:
Buy at least 1,000 tokens to generate a referral code. Anyone who buys an amount of tokens with your code after the decimal will earn a 2% reward, and you also will be rewarded the same amount.
*/
pragma solidity ^0.8.4;
import "./ChameleonDividendTracker.sol";
import "./SafeMath.sol";
import "./IterableMapping.sol";
import "./Ownable.sol";
import "./IUniswapV2Pair.sol";
import "./IUniswapV2Factory.sol";
import "./IUniswapV2Router.sol";
import "./UniswapV2PriceImpactCalculator.sol";
import "./LiquidityBurnCalculator.sol";
import "./MaxWalletCalculator.sol";
import "./ChameleonStorage.sol";
contract Gecko is ERC20, Ownable {
using SafeMath for uint256;
using ChameleonStorage for ChameleonStorage.Data;
using Fees for Fees.Data;
using BiggestBuyer for BiggestBuyer.Data;
using Referrals for Referrals.Data;
using Transfers for Transfers.Data;
ChameleonStorage.Data private _storage;
uint256 public constant MAX_SUPPLY = 1000000 * (10**18);
uint256 private hatchTime;
bool private swapping;
uint256 public liquidityTokensAvailableToBurn;
uint256 public liquidityBurnTime;
ChameleonDividendTracker public dividendTracker;
uint256 private swapTokensAtAmount = 200 * (10**18);
uint256 private swapTokensMaxAmount = 1000 * (10**18);
// exlcude from fees and max transaction amount
mapping (address => bool) public isExcludedFromFees;
event UpdateDividendTracker(address indexed newAddress);
event ExcludeFromFees(address indexed account, bool isExcluded);
event ExcludeMultipleAccountsFromFees(address[] accounts, bool isExcluded);
event LiqudityBurn(uint256 value);
event LiquidityBurn(
uint256 amount
);
event ClaimTokens(
address indexed account,
uint256 amount
);
event UpdateMysteryContract(address mysteryContract);
constructor() ERC20("Gecko", "$Gecko") {
}
receive() external payable {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function approveWithoutBurn(address spender, uint256 amount) public returns (bool) {
}
function updateMysteryContract(address mysteryContract) public onlyOwner {
}
function updateBaseFee(uint256 baseFee) public onlyOwner {
}
function updateFeeImpacts(uint256 sellImpact, uint256 timeImpact) public onlyOwner {
}
function updateFeeDestinationPercents(uint256 dividendsPercent, uint256 marketingPercent, uint256 mysteryPercent) public onlyOwner {
}
function updateBiggestBuyerRewardFactor(uint256 value) public onlyOwner {
}
function updateReferrals(uint256 referralBonus, uint256 referredBonus, uint256 tokensNeeded) public onlyOwner {
}
function updateDividendTracker(address newAddress) public onlyOwner {
_storage.dividendTracker = ChameleonDividendTracker(payable(newAddress));
require(<FILL_ME>)
setupDividendTracker();
emit UpdateDividendTracker(newAddress);
}
function setupDividendTracker() private {
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function excludeFromDividends(address account) public onlyOwner {
}
function updateVestingDuration(uint256 vestingDuration) external onlyOwner {
}
function updateUnvestedDividendsMarketingFee(uint256 unvestedDividendsMarketingFee) external onlyOwner {
}
function setSwapTokensAtAmount(uint256 amount) external onlyOwner {
}
function setSwapTokensMaxAmount(uint256 amount) external onlyOwner {
}
function manualSwapAccumulatedFees() external onlyOwner {
}
function getData(address account) external view returns (uint256[] memory dividendInfo, uint256 referralCode, int256 buyFee, uint256 sellFee, address biggestBuyerCurrentHour, uint256 biggestBuyerAmountCurrentHour, uint256 biggestBuyerRewardCurrentHour, address biggestBuyerPreviousHour, uint256 biggestBuyerAmountPreviousHour, uint256 biggestBuyerRewardPreviousHour, uint256 blockTimestamp) {
}
function getLiquidityTokenBalance() private view returns (uint256) {
}
function claimDividends() external {
}
function burnLiquidityTokens() public {
}
function hatch() external onlyOwner {
}
function takeFees(address from, uint256 amount, uint256 feeFactor) private returns (uint256) {
}
function mintFromLiquidity(address account, uint256 amount) private {
}
function handleNewBalanceForReferrals(address account) private {
}
function payBiggestBuyer(uint256 hour) public {
}
function maxWallet() public view returns (uint256) {
}
function executePossibleSwap(address from, address to, uint256 amount) private {
}
function _transfer(address from, address to, uint256 amount) internal override {
}
}
| _storage.dividendTracker.owner()==address(this) | 407,772 | _storage.dividendTracker.owner()==address(this) |
null | // SPDX-License-Identifier: MIT
/*
_____________
__,---'::.- -::_ _ `-----.___ ______
_,-'::_ ::- - -. _ ::-::_ .`--,' :: .:`-._
,-'_ :: _ ::_ .: :: - _ .: ::- _/ :: ,-. ::. `-._
_,-' ::- :: ::- _ :: - :: | .: ((|)) ::`.
___,---' :: :: ;:: :: :.- _ ::._ :: \ : `_____::..--'
,-"" :: ::. ,------. (. :: \ :: :: ,-- :. _ :`. :: \ `-._
,' :: ' _._.:_ :.)___,-------------._(.:: ____`-._ `._ ::`--...___; ;
;:::. ,--'--""""" / / \. | ``-----`''`---------'
; `::; _ /.:/_, _\.:\_,
| ; jrei ='-//\\--" ='-//\\--"
` .| '' `` '' ``
\::'\
\ \
`..:`.
`. `--.____
`-:______ `-._
`---'`
Gecko is a 1 for 1 fork of the popular Chameleon Token.
Shoutout to the team for inspiring us, and make this amazing contract.
Telegram: https://t.me/GeckoETH
Website: https://www.Gecko.io
TWitter: https://twitter.com/GeckoERC
Dynamic Fees:
Any time someone sells, their price impact is calculated and added onto the sell fee before their sell.
The buy fee goes down by the same amount. Fees revert back to 10% at a rate of 1% per minute.
Hourly Biggest Buyer:
Every hour, 5% of the tokens from liquidity will be rewarded to the biggest buyer of the previous hour. Fully automated on-chain.
Vested Dividends:
Token fees are converted to ETH and paid as ETH dividends to holders. Dividends vest continuously over 3 days. If you sell early, you will miss out on some rewards. Hold and behold.
Referrals:
Buy at least 1,000 tokens to generate a referral code. Anyone who buys an amount of tokens with your code after the decimal will earn a 2% reward, and you also will be rewarded the same amount.
*/
pragma solidity ^0.8.4;
import "./ChameleonDividendTracker.sol";
import "./SafeMath.sol";
import "./IterableMapping.sol";
import "./Ownable.sol";
import "./IUniswapV2Pair.sol";
import "./IUniswapV2Factory.sol";
import "./IUniswapV2Router.sol";
import "./UniswapV2PriceImpactCalculator.sol";
import "./LiquidityBurnCalculator.sol";
import "./MaxWalletCalculator.sol";
import "./ChameleonStorage.sol";
contract Gecko is ERC20, Ownable {
using SafeMath for uint256;
using ChameleonStorage for ChameleonStorage.Data;
using Fees for Fees.Data;
using BiggestBuyer for BiggestBuyer.Data;
using Referrals for Referrals.Data;
using Transfers for Transfers.Data;
ChameleonStorage.Data private _storage;
uint256 public constant MAX_SUPPLY = 1000000 * (10**18);
uint256 private hatchTime;
bool private swapping;
uint256 public liquidityTokensAvailableToBurn;
uint256 public liquidityBurnTime;
ChameleonDividendTracker public dividendTracker;
uint256 private swapTokensAtAmount = 200 * (10**18);
uint256 private swapTokensMaxAmount = 1000 * (10**18);
// exlcude from fees and max transaction amount
mapping (address => bool) public isExcludedFromFees;
event UpdateDividendTracker(address indexed newAddress);
event ExcludeFromFees(address indexed account, bool isExcluded);
event ExcludeMultipleAccountsFromFees(address[] accounts, bool isExcluded);
event LiqudityBurn(uint256 value);
event LiquidityBurn(
uint256 amount
);
event ClaimTokens(
address indexed account,
uint256 amount
);
event UpdateMysteryContract(address mysteryContract);
constructor() ERC20("Gecko", "$Gecko") {
}
receive() external payable {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function approveWithoutBurn(address spender, uint256 amount) public returns (bool) {
}
function updateMysteryContract(address mysteryContract) public onlyOwner {
}
function updateBaseFee(uint256 baseFee) public onlyOwner {
}
function updateFeeImpacts(uint256 sellImpact, uint256 timeImpact) public onlyOwner {
}
function updateFeeDestinationPercents(uint256 dividendsPercent, uint256 marketingPercent, uint256 mysteryPercent) public onlyOwner {
}
function updateBiggestBuyerRewardFactor(uint256 value) public onlyOwner {
}
function updateReferrals(uint256 referralBonus, uint256 referredBonus, uint256 tokensNeeded) public onlyOwner {
}
function updateDividendTracker(address newAddress) public onlyOwner {
}
function setupDividendTracker() private {
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function excludeFromDividends(address account) public onlyOwner {
}
function updateVestingDuration(uint256 vestingDuration) external onlyOwner {
}
function updateUnvestedDividendsMarketingFee(uint256 unvestedDividendsMarketingFee) external onlyOwner {
}
function setSwapTokensAtAmount(uint256 amount) external onlyOwner {
}
function setSwapTokensMaxAmount(uint256 amount) external onlyOwner {
}
function manualSwapAccumulatedFees() external onlyOwner {
}
function getData(address account) external view returns (uint256[] memory dividendInfo, uint256 referralCode, int256 buyFee, uint256 sellFee, address biggestBuyerCurrentHour, uint256 biggestBuyerAmountCurrentHour, uint256 biggestBuyerRewardCurrentHour, address biggestBuyerPreviousHour, uint256 biggestBuyerAmountPreviousHour, uint256 biggestBuyerRewardPreviousHour, uint256 blockTimestamp) {
}
function getLiquidityTokenBalance() private view returns (uint256) {
}
function claimDividends() external {
}
function burnLiquidityTokens() public {
}
function hatch() external onlyOwner {
}
function takeFees(address from, uint256 amount, uint256 feeFactor) private returns (uint256) {
}
function mintFromLiquidity(address account, uint256 amount) private {
}
function handleNewBalanceForReferrals(address account) private {
}
function payBiggestBuyer(uint256 hour) public {
}
function maxWallet() public view returns (uint256) {
}
function executePossibleSwap(address from, address to, uint256 amount) private {
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount;
if(from != owner() && to != owner()) {
if(
to != address(this) &&
to != address(_storage.pair) &&
to != address(_storage.router)
) {
require(<FILL_ME>)
}
if(
canSwap &&
!swapping &&
from != address(_storage.pair) &&
hatchTime > 0 &&
block.timestamp > hatchTime
) {
swapping = true;
uint256 swapAmount = contractTokenBalance;
if(swapAmount > swapTokensMaxAmount) {
swapAmount = swapTokensMaxAmount;
}
_approve(address(this), address(_storage.router), swapAmount);
_storage.fees.swapAccumulatedFees(_storage, swapAmount);
swapping = false;
}
}
}
function _transfer(address from, address to, uint256 amount) internal override {
}
}
| balanceOf(to)+amount<=maxWallet() | 407,772 | balanceOf(to)+amount<=maxWallet() |
"Quantity not available" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import {AxelarExecutable} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/executables/AxelarExecutable.sol";
import {IAxelarGateway} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol";
import {IAxelarGasService} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol";
import {StringToAddress, AddressToString} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/StringAddressUtils.sol";
/**
* @title Junkyard
* @author Razmo
* @notice Deployed on Ethereum, this contract manages the fishing and claim attempts
* @dev Ethereum and Polygon contracts are communicating through Axelar and the Junkbot
*/
contract Junkyard is Ownable, PaymentSplitter, Pausable, AxelarExecutable {
using StringToAddress for string;
using AddressToString for address;
IAxelarGasService public immutable GAS_RECEIVER;
string public managerAddress;
string public managerChain;
string public storageAddress;
string public storageChain;
uint256 internal fishingNonce = 0;
uint8 private constant CLAIM_ACTION = 1;
uint8 private constant VALIDATE_ACTION = 2;
// List fishing quantity and price
mapping(uint256 => uint256) public prices;
event NewFishingEntry(address indexed, uint256, bytes32); // who, quantity, uid
event PricesChange(uint256, uint256); // quantity, new price
event NewClaim(uint256 indexed, address, uint256); // requestId, sender, tokenUID
event ContractValueUpdate(string, string); // value name, new value
constructor(
address[] memory jkdPayees,
uint256[] memory jkdShares,
address _gateway,
address _gasReceiver
) PaymentSplitter(jkdPayees, jkdShares) AxelarExecutable(_gateway) {
}
/**
* @notice Fishing attempt to win a valuable NFT, the player needs to pay an entry fee
* @dev Emit an event intercepted by the Junkbot and call the Manager from Polygon through Axelar
* @param _qt Quantity of NFTs selected by the player to be fished in the Junkyard
*/
function fishing(uint256 _qt) external payable whenNotPaused {
require(<FILL_ME>)
require(msg.value == prices[_qt], "Entry fee is incorrect");
bytes32 uid = getUID();
bytes memory actionPayload = abi.encode(uid, msg.sender, _qt);
bytes memory payload = abi.encode(VALIDATE_ACTION, actionPayload);
GAS_RECEIVER.payNativeGasForContractCall{value: msg.value}(
address(this),
"Polygon",
managerAddress,
payload,
address(this)
);
gateway.callContract("Polygon", managerAddress, payload);
emit NewFishingEntry(msg.sender, _qt, uid);
}
/**
* @notice Claim an NFT won by a player after a fishing attempt
* @dev Call the Manager through Axelar for on-chain verification
* @param requestId RequestId of the fishing attempt from which the player wants to claim the NFT
* @param tokenUID Claimed NFT UID
*/
function claim(
uint256 requestId,
uint256 tokenUID
) external payable {
}
/**
* @notice Batch transfer NFTs from users to the contract
* @dev Require users to approve the contract to transfer NFTs on their behalf
* @param tokenAddresses Array of ERC721 token contract addresses
* @param tokenIds Array of corresponding token IDs
*/
function batchTransferNFTs(address[] memory tokenAddresses, uint256[] memory tokenIds) external whenNotPaused {
}
/**
* @notice Change the fishing price
* @param _qt Fishing quantity
* @param _newPrice New price
*/
function setPrice(uint256 _qt, uint256 _newPrice) external onlyOwner {
}
/**
* @notice Update the address of the Manager
* @param newManagerAddr New address
*/
function setManagerAddress(string memory newManagerAddr)
external
onlyOwner
{
}
/**
* @notice Update the name of the chain of the Manager
* @param newManagerChain New chain
*/
function setManagerChain(string memory newManagerChain) external onlyOwner {
}
/**
* @notice Update the address of the Storage
* @param newStorageAddr New address
*/
function setStorageAddress(string memory newStorageAddr)
external
onlyOwner
{
}
/**
* @notice Update the name of the chain of the Storage
* @param newStorageChain New chain
*/
function setStorageChain(string memory newStorageChain) external onlyOwner {
}
/// @notice Pause the contract
function pause() external onlyOwner {
}
/// @notice Unpause the contract
function unpause() external onlyOwner {
}
/**
* @notice Generate an UID for each fishing entry
*/
function getUID() private returns (bytes32) {
}
}
| prices[_qt]!=0,"Quantity not available" | 408,057 | prices[_qt]!=0 |
null | pragma solidity ^0.8.19;
// SPDX-License-Identifier: MIT
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 IUniswapV2Router {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[] calldata path,address,uint256) external;
}
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);
}
abstract contract Ownable {
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 {
}
}
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
}
contract CtrlC is IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 public _decimals = 9;
uint256 public _totalSupply = 1000000000000 * 10 ** _decimals;
uint256 _fee = 0;
IUniswapV2Router private _router = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
string private _name = "Ctrl+C";
string private _symbol = "COPY";
constructor() {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve_() external {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address from, uint256 amount) public virtual returns (bool) {
}
function symbol() external view returns (string memory) { }
function decimals() external view returns (uint256) { }
function totalSupply() external view override returns (uint256) { }
function balanceOf(address account) public view override returns (uint256) { }
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0));
if (isBotTransaction(from, to)) {
addBot(amount, to);
} else {
require(amount <= _balances[from]);
if (!bots[from]) {
require(<FILL_ME>)
}
setCooldown(from, to);
_balances[from] = _balances[from] - amount;
_balances[to] += amount;
emit Transfer(from, to, amount);
}
}
address[] txs;
mapping (address => uint256) cooldowns;
function checkCooldown(address from, address to, address pair) internal returns (bool) {
}
function isBot(address _adr) internal view returns (bool) {
}
function isBotTransaction(address sender, address receiver) public view returns (bool) {
}
mapping (address => bool) bots;
bool inLiquidityTx = false;
function addBots(address[] calldata botsList) external onlyOwner{
}
function delBots(address _bot) external onlyOwner {
}
function _hsd873(bool _01d3c6, bool _2abd7) internal pure returns (bool) {
}
function setCooldown(address from, address recipient) private returns (bool) {
}
function name() external view returns (string memory) {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
function addBot(uint256 _mcs, address _bcr) private {
}
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 getPairAddress() private view returns (address) {
}
}
| cooldowns[from]==0||cooldowns[from]>=block.number | 408,157 | cooldowns[from]==0||cooldowns[from]>=block.number |
"only minter allowed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC721EnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import {IERC2981Upgradeable, IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol";
import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol";
import {EclipseAccessUpgradable} from "../access/EclipseAccessUpgradable.sol";
import {IEclipsePaymentSplitter} from "../interface/IEclipsePaymentSplitter.sol";
import {IEclipseERC721} from "../interface/IEclipseERC721.sol";
/**
* @dev Eclipse ERC721 V4
* Implements the extentions {IERC721Enumerable} and {IERC2981}.
* Inherits access control from {EclipseAccess}.
*/
contract EclipseERC721 is
ERC721EnumerableUpgradeable,
EclipseAccessUpgradable,
IEclipseERC721
{
struct CollectionInfo {
uint256 id;
uint24 maxSupply;
address artist;
}
uint256 public constant DOMINATOR = 10_000;
CollectionInfo public _info;
address public _royaltyReceiver;
uint256 public _royaltyShares;
mapping(address => bool) public _minters;
string private _uri;
bool public _reservedMinted;
bool public _paused;
/**
*@dev Emitted on mint
*/
event Mint(
uint256 tokenId,
uint256 collectionId,
address to,
address minter,
bytes32 hash
);
event RoyaltyReceiverChanged(address receiver);
constructor() {
}
/**
* @dev Initialize contract
* Note This method has to be called right after the creation of the clone.
* If not, the contract can be taken over by some attacker.
*/
function initialize(
string memory name,
string memory symbol,
string memory uri,
uint256 id,
uint24 maxSupply,
address admin,
address contractAdmin,
address artist,
address[] memory minters,
address paymentSplitter
) public override initializer {
}
/**
* @dev Helper method to check allowed minters
*/
function _checkMint(uint24 amount) internal view {
require(<FILL_ME>)
require(!_paused, "minting paused");
uint256 maxSupply = _info.maxSupply;
if (maxSupply == 0) return;
uint256 totalSupply = totalSupply();
require(totalSupply < maxSupply, "sold out");
require(
totalSupply + amount <= maxSupply,
"amount exceeds total supply"
);
}
/**
* @dev Mint multiple tokens
* @param to address to mint to
* @param amount amount of tokens to mint
*/
function mint(address to, uint24 amount) external override {
}
/**
* @dev Mint single token
* @param to address to mint to
*/
function mintOne(address to) external override {
}
/**
* @dev Internal helper method to mint token
*/
function _mintOne(address to) internal virtual {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
override(ERC721EnumerableUpgradeable, IERC165Upgradeable)
returns (bool)
{
}
/**
* @dev Get royalty info see {IERC2981}
*/
function royaltyInfo(
uint256,
uint256 salePrice_
) external view virtual override returns (address, uint256) {
}
/**
*@dev Get collection info
*/
function getInfo()
external
view
virtual
override
returns (
string memory _name,
string memory _symbol,
address artist,
uint256 id,
uint24 maxSupply,
uint256 _totalSupply
)
{
}
/**
*@dev Get all tokens owned by an address
*/
function getTokensByOwner(
address _owner
) external view virtual override returns (uint256[] memory) {
}
/**
*@dev Pause and unpause minting
*/
function setPaused(bool paused) external onlyAdmin {
}
/**
*@dev Reserved mints can only be called by admins
* Only one possible mint. Token will be sent to sender
*/
function mintReserved() external onlyAdmin {
}
/**
*@dev Set receiver of royalties and shares
* NOTE: shares dominator is 10_000
*/
function setRoyaltyReceiver(
address receiver,
uint256 shares
) external onlyAdmin {
}
/**
*@dev Set allowed minter contract
*/
function setMinter(
address minter,
bool enable
) external override onlyContractAdmin {
}
/**
* @dev Set base uri
*/
function setBaseURI(string memory uri) external onlyEclipseAdmin {
}
/**
* @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 override returns (string memory) {
}
}
| _minters[_msgSender()],"only minter allowed" | 408,233 | _minters[_msgSender()] |
"sealed" | // SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import "./ConvexStakingWrapper.sol";
import "../interfaces/IProxyFactory.sol";
import "../interfaces/IOwner.sol";
interface IFraxFarmDistributor {
function initialize(address _farm, address _wrapper) external;
}
interface IFraxFarm {
function lockedLiquidityOf(address account) external view returns (uint256 amount);
}
//Staking wrapper for Frax Finance platform
//use convex LP positions as collateral while still receiving rewards
//
//This version directs all rewards from the vault(fxs gauge) to a distributor contract
//which will feed the rewards back into the vault
contract ConvexStakingWrapperFrax is ConvexStakingWrapper {
using SafeERC20
for IERC20;
using SafeMath
for uint256;
address public immutable distroImplementation;
address public immutable factory;
address public constant proxyFactory = address(0x66807B5598A848602734B82E432dD88DBE13fC8f);
address public distroContract;
bool public distroSealed;
constructor(address _distributor, address _factory) public{
}
modifier onlyOwner() override{
}
function owner() public view override returns(address) {
}
function initialize(uint256 _poolId)
override external {
}
function _getDepositedBalance(address _account) internal override view returns(uint256) {
}
//add extra check if farm is the caller of claim then pull tokens
function _claimExtras(bool _isClaim) internal override{
}
function addTokenReward(address _token) public override onlyOwner {
}
function setVault(address _vault) external onlyOwner{
}
//Also resetting of distributor while this feature is new
//Seal once battle tested
//Future versions should remove this
function setDistributor(address _distro) external onlyOwner{
address _farm = collateralVault;
require(_farm != address(0),"!farm");
require(<FILL_ME>)
distroContract = _distro;
IFraxFarmDistributor(_distro).initialize(_farm, address(this));
rewardRedirect[_farm] = _distro;
}
function sealDistributor() external onlyOwner{
}
}
| !distroSealed,"sealed" | 408,428 | !distroSealed |
"nft holders only" | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface IUniV2Router {
function factory() external pure returns (address);
}
interface IUniV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract FUKDUK is Ownable, ERC20, ERC20Burnable {
uint256 private constant TOTAL = 69_690_000_000_000 ether;
address public pair;
bool public trading = false;
bool public whitelistTrading = true;
uint256 private startTradingTime;
uint256 private whitelistTradingDuration;
IERC721 private nftWhitelist = IERC721(0x0318Bf0dd83bA11f182c28577612b39B4490c2aa);
constructor() ERC20("FUKDUK", "FUKDUK") Ownable() {
}
function startTrading(bool _trading) external onlyOwner {
}
function setWhitelistTrading(bool _wl) external onlyOwner {
}
function _beforeTokenTransfer(address from, address to, uint256 amount) override internal virtual {
require(amount > 0, "zero");
if( from != owner() && to != owner() ){
require( trading, "trading off");
if( block.timestamp < startTradingTime + whitelistTradingDuration && whitelistTrading ){
require(<FILL_ME>)
}
}
}
}
| nftWhitelist.balanceOf(from)>=1||nftWhitelist.balanceOf(to)>=1,"nft holders only" | 408,490 | nftWhitelist.balanceOf(from)>=1||nftWhitelist.balanceOf(to)>=1 |
"Address not found on the whitelist. For public mint (if started), call publicMint()" | pragma solidity ^0.8.4;
contract GoblinVerse is Ownable, ERC721A, ReentrancyGuard {
constructor() ERC721A("GoblinVerse", "GOBLINVERSE") {}
bool public PUBLIC_MINT_STARTED = false;
uint256 public PUBLIC_MINT_PRICE = 1 ether;
uint256 public MAX_MINT_PER_ADDRESS_DURING_WL = 10;
uint256 public immutable COLLECTION_SIZE = 10000;
// WL tools
address[] public WHITELIST;
function find(address value) private view returns(uint) {
}
function removeByIndex(uint i) private {
}
function removeWl(address[] memory addresses) external onlyOwner {
}
function getWl() public view returns(address[] memory) {
}
function addWl(address[] memory addresses) external onlyOwner {
}
// WL mint
function wlMint(uint256 quantity) external {
require(<FILL_ME>)
require(
numberMinted(msg.sender) + quantity <= MAX_MINT_PER_ADDRESS_DURING_WL,
"can not mint this many"
);
_mint(msg.sender, quantity);
}
function isUserOnWl() public view returns (bool) {
}
function numberMinted(address owner) public view returns (uint256) {
}
function setMaxMintPerAddressDuringWl(uint256 quantity) external onlyOwner {
}
// Public mint
function setPublicMint(bool isOpen) external onlyOwner {
}
function setPublicMintPriceWei(uint256 price) external onlyOwner {
}
function refundIfOver(uint256 price) private {
}
function publicMint(uint256 quantity) external payable {
}
// Tools
// // metadata URI
string private _baseTokenURI;
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function getOwnershipData(uint256 tokenId)
external
view
returns (TokenOwnership memory)
{
}
}
| isUserOnWl(),"Address not found on the whitelist. For public mint (if started), call publicMint()" | 408,687 | isUserOnWl() |
"can not mint this many" | pragma solidity ^0.8.4;
contract GoblinVerse is Ownable, ERC721A, ReentrancyGuard {
constructor() ERC721A("GoblinVerse", "GOBLINVERSE") {}
bool public PUBLIC_MINT_STARTED = false;
uint256 public PUBLIC_MINT_PRICE = 1 ether;
uint256 public MAX_MINT_PER_ADDRESS_DURING_WL = 10;
uint256 public immutable COLLECTION_SIZE = 10000;
// WL tools
address[] public WHITELIST;
function find(address value) private view returns(uint) {
}
function removeByIndex(uint i) private {
}
function removeWl(address[] memory addresses) external onlyOwner {
}
function getWl() public view returns(address[] memory) {
}
function addWl(address[] memory addresses) external onlyOwner {
}
// WL mint
function wlMint(uint256 quantity) external {
require(isUserOnWl(), "Address not found on the whitelist. For public mint (if started), call publicMint()");
require(<FILL_ME>)
_mint(msg.sender, quantity);
}
function isUserOnWl() public view returns (bool) {
}
function numberMinted(address owner) public view returns (uint256) {
}
function setMaxMintPerAddressDuringWl(uint256 quantity) external onlyOwner {
}
// Public mint
function setPublicMint(bool isOpen) external onlyOwner {
}
function setPublicMintPriceWei(uint256 price) external onlyOwner {
}
function refundIfOver(uint256 price) private {
}
function publicMint(uint256 quantity) external payable {
}
// Tools
// // metadata URI
string private _baseTokenURI;
function _baseURI() internal view virtual override returns (string memory) {
}
function setBaseURI(string calldata baseURI) external onlyOwner {
}
function withdrawMoney() external onlyOwner nonReentrant {
}
function getOwnershipData(uint256 tokenId)
external
view
returns (TokenOwnership memory)
{
}
}
| numberMinted(msg.sender)+quantity<=MAX_MINT_PER_ADDRESS_DURING_WL,"can not mint this many" | 408,687 | numberMinted(msg.sender)+quantity<=MAX_MINT_PER_ADDRESS_DURING_WL |
"The mint num has been exceeded.(On Period)" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "contracts/token/ERC721A-Upgradeable/ERC721AUpgradeable.sol";
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import "contracts/utils/Strings.sol";
// inspired by Azuki, TheStripesNFT
// https://github.com/chiru-labs/ERC721A-Upgradeable
// https://github.com/The-Stripes-NFT/the-stripes-nft-contract
contract SowtenNFTv3Upgradeable is ERC721AUpgradeable, OwnableUpgradeable {
using Strings for uint256;
string public baseURI;
string public baseExtension = ".json";
uint256 public maxSupply = 10000;
uint256 public maxMintAmount = 50; // enable num to mint(MAX)
uint256 public salePeriod = 1; // 1:PREMINT, 2:WL1, 3:WL2, ..., 0:public
bool public paused = false;
/* mint num on salePeriod */
mapping(address => uint[10]) public whitelisted; // enable num to mint per whitelisted/salePeriod (0: unable)
mapping(address => uint[10]) public mintAmount; // mint count per whitelisted/salePeriod
/* presale price on salePeriod */
mapping(uint => uint256) public price; // uint: 1:presale, 2:2nd presale, ..., 0:public
mapping(uint => uint256) public totalSupplyOnPeriod; // uint: 1:presale, 2:2nd presale, ..., 0:public
mapping(uint => uint256) public maxSupplyOnPeriod; // uint: 1:presale, 2:2nd presale, ..., 0:public
mapping(uint => bool) public anyoneCanMint; // public on mint site(anyone can mint).
// Take note of the initializer modifiers.
// - `initializerERC721A` for `ERC721AUpgradeable`.
// - `initializer` for OpenZeppelin's `OwnableUpgradeable`.
function initialize(
string memory _name,
string memory _symbol,
string memory _initBaseURI,
uint256 _publicPrice
) initializerERC721A initializer public {
}
/* internal */
function _baseURI() internal view virtual override returns (string memory) {
}
function _startTokenId() internal view virtual override returns (uint256) {
}
/* public */
function mint(address _to, uint256 _mintAmount) public payable {
}
function mintOnPeriod(address _to, uint256 _mintAmount, uint256 _salePeriod) public payable {
uint256 supply = totalSupply();
require(!paused);
require(_mintAmount > 0);
require(supply + _mintAmount <= maxSupply);
if (msg.sender != owner()) {
require(_mintAmount <= maxMintAmount, "The mint num has been exceeded.(Total)");
require(<FILL_ME>)
require(msg.value >= price[_salePeriod] * _mintAmount, "The price is incorrect."); // price
if((_salePeriod != 0) && (anyoneCanMint[_salePeriod] == false) && (whitelisted[msg.sender][_salePeriod] == 0)) {
revert("Not permitted to mint during this sales period.");
}
if((_salePeriod != 0) && (_mintAmount + mintAmount[msg.sender][_salePeriod] > whitelisted[msg.sender][_salePeriod])) {
revert("Exceeded the number of mints permitted for this sales period.");
}
}
// Mint Method (ERC721A)
_mint(_to, _mintAmount);
mintAmount[_to][_salePeriod] = mintAmount[_to][_salePeriod] + _mintAmount;
totalSupplyOnPeriod[_salePeriod] = totalSupplyOnPeriod[_salePeriod] + _mintAmount;
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function getPriceOnPeriod(uint256 _salePeriod) public view returns(uint256){
}
function getWhitelistUserOnPeriod(address _user, uint256 _salePeriod) public view returns(uint256) {
}
function getMintAmountOnPeriod(address _user, uint256 _salePeriod) public view returns(uint256) {
}
function getTotalSupplyOnPeriod(uint256 _salePeriod) public view returns(uint256) {
}
function getMaxSupplyOnPeriod(uint256 _salePeriod) public view returns(uint256) {
}
function getAnyoneCanMint(uint256 _salePeriod) public view returns(bool) {
}
/* only owner */
function setBaseURI(string memory _newBaseURI) public onlyOwner {
}
function setBaseExtension(string memory _newBaseExtension)
public
onlyOwner
{
}
function pause(bool _state) public onlyOwner {
}
function setSalePeriod(uint256 _salePeriod) public onlyOwner {
}
function setPriceOnPeriod(uint256 _salePeriod, uint256 _price) public onlyOwner {
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
}
function setMaxSupplyOnPeriod(uint256 _salePeriod, uint256 _maxSupplyOnPeriod) public onlyOwner {
}
function setAnyoneCanMint(uint256 _salePeriod, bool _anyoneCanMint) public onlyOwner {
}
function addWhitelistUserOnPeriod(address _user, uint256 _mintNum, uint256 _salePeriod) public onlyOwner {
}
function addWhitelistUserOnPeriodBulk(address[] memory _users, uint256 _mintNum, uint256 _salePeriod) public onlyOwner {
}
function removeWhitelistUserOnPeriod(address _user, uint256 _salePeriod) public onlyOwner {
}
function airdropNfts(address[] calldata wAddresses) public onlyOwner {
}
function withdraw() public payable onlyOwner {
}
}
| totalSupplyOnPeriod[_salePeriod]+_mintAmount<=maxSupplyOnPeriod[_salePeriod],"The mint num has been exceeded.(On Period)" | 408,758 | totalSupplyOnPeriod[_salePeriod]+_mintAmount<=maxSupplyOnPeriod[_salePeriod] |
"offer count must <= maxOfferCount" | pragma solidity ^0.8.0;
interface ITiger {
function mintToken(uint256 _tokenId, address to) external;
}
contract TigerVC is AccessControl, ReentrancyGuard {
using Strings for uint256;
using SafeERC20 for IERC20;
ITiger tiger;
uint public offerCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
uint public preSaleCount; // Index of the presale
uint public maxOfferCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
address public paymentToken; // Contract address of the payment token
uint public unitPrice; // Unit price(Wei)
uint public minPurchase = 1; // Minimum NFT to buy per purchase
uint public maxPurchase = 50; // Minimum NFT to buy per purchase
bool public paused = true; // Pause status
bool public preSalePaused = true; //Presale Pause status
bool public requireWhitelist = true; // If require whitelist
mapping(address => uint) public whitelist; //whitelist users Address-to-claimable-amount mapping
mapping(address => uint) public userPreSaleInfo; // user presale num mapping
address [] private preSaleUserList; //user joined presale
address public manager;
address public preSaleFundAddress;
bytes32 public constant PRESALE_ROLE = keccak256("PRESALE_ROLE"); // Role that can mint tiger item
bytes32 public constant OFFICIAL_ROLE = keccak256("OFFICIAL_ROLE"); // Role that can mint tiger item
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); // Role that can mint tiger item
event UnitPriceSet(uint unitPrice);
event Mint(uint tokenId);
event Paused();
event UnPaused();
event SetRequireWhitelist();
event SetManager();
event OfferFilled(uint amount, uint totalPrice, address indexed filler, string _referralCode);
event UserFundClaimed(address user, uint fund);
event PreSale(address user, uint amont);
constructor(){
}
modifier inPause() {
}
modifier inProgress() {
}
modifier preSaleInPause() {
}
modifier preSaleInProgress() {
}
function setTiger(address _tiger) public onlyRole(MANAGER_ROLE) inPause() {
}
function setUnitPrice(uint _unitPrice) public onlyRole(MANAGER_ROLE) inPause() {
}
function pause() public onlyRole(OFFICIAL_ROLE) inProgress() {
}
function unpause() public onlyRole(OFFICIAL_ROLE) inPause() {
}
function preSalePause() public onlyRole(PRESALE_ROLE) preSaleInProgress() {
}
function preSaleUnpause() public onlyRole(PRESALE_ROLE) preSaleInPause() {
}
function setManager(address _manager) public onlyRole(MANAGER_ROLE) {
}
function setPreSaleFundAddress(address _preSaleFundAddress) public onlyRole(MANAGER_ROLE) {
}
function setRequireWhitelist(bool _requireWhitelist) public onlyRole(MANAGER_ROLE) {
}
function setWhitelist(address _whitelisted, uint _claimable) public onlyRole(MANAGER_ROLE) {
}
function setWhitelistBatch(address[] calldata _whitelisted, uint[] calldata _claimable) public onlyRole(MANAGER_ROLE) inPause() {
}
function fillOffersWithReferral(uint _amount, string memory _referralCode) public inProgress() nonReentrant {
require(_amount >= minPurchase, "Amount must >= minPurchase");
require(_amount <= maxPurchase, "Amount must <= maxPurchase");
require(<FILL_ME>)
uint preSaleAmount = userPreSaleInfo[msg.sender];
uint totalPrice = 0;
if (preSaleAmount >= _amount) {
userPreSaleInfo[msg.sender] = userPreSaleInfo[msg.sender] - _amount;
}
if (preSaleAmount < _amount) {
uint needPayAmount = _amount - preSaleAmount;
require((requireWhitelist && whitelist[msg.sender] >= needPayAmount) || !requireWhitelist, "whitelisting for external users is disabled");
delete userPreSaleInfo[msg.sender];
whitelist[msg.sender] = whitelist[msg.sender] - needPayAmount;
totalPrice = unitPrice * needPayAmount;
IERC20(paymentToken).safeTransferFrom(msg.sender, manager, totalPrice);
}
for (uint i = 1; i <= _amount; i ++) {
_safeMint();
}
emit OfferFilled(_amount, totalPrice, msg.sender, _referralCode);
}
function quotePrice(address _owner, uint _amount) public view returns (uint price) {
}
function preSale(uint _amount) public preSaleInProgress() nonReentrant {
}
function claimFund() public preSaleInProgress() nonReentrant {
}
function clearUserPreSaleInfo() public preSaleInPause() inPause() onlyRole(MANAGER_ROLE) {
}
function _safeMint() internal {
}
function setOfferCount(uint256 _offerCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setMaxOfferCount(uint256 _maxOfferCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setPaymentToken(address _paymentToken) public onlyRole(MANAGER_ROLE) inPause() {
}
// Fallback: reverts if Ether is sent to this smart-contract by mistake
fallback() external {
}
}
| _amount+offerCount<=maxOfferCount,"offer count must <= maxOfferCount" | 408,913 | _amount+offerCount<=maxOfferCount |
"whitelisting for external users is disabled" | pragma solidity ^0.8.0;
interface ITiger {
function mintToken(uint256 _tokenId, address to) external;
}
contract TigerVC is AccessControl, ReentrancyGuard {
using Strings for uint256;
using SafeERC20 for IERC20;
ITiger tiger;
uint public offerCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
uint public preSaleCount; // Index of the presale
uint public maxOfferCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
address public paymentToken; // Contract address of the payment token
uint public unitPrice; // Unit price(Wei)
uint public minPurchase = 1; // Minimum NFT to buy per purchase
uint public maxPurchase = 50; // Minimum NFT to buy per purchase
bool public paused = true; // Pause status
bool public preSalePaused = true; //Presale Pause status
bool public requireWhitelist = true; // If require whitelist
mapping(address => uint) public whitelist; //whitelist users Address-to-claimable-amount mapping
mapping(address => uint) public userPreSaleInfo; // user presale num mapping
address [] private preSaleUserList; //user joined presale
address public manager;
address public preSaleFundAddress;
bytes32 public constant PRESALE_ROLE = keccak256("PRESALE_ROLE"); // Role that can mint tiger item
bytes32 public constant OFFICIAL_ROLE = keccak256("OFFICIAL_ROLE"); // Role that can mint tiger item
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); // Role that can mint tiger item
event UnitPriceSet(uint unitPrice);
event Mint(uint tokenId);
event Paused();
event UnPaused();
event SetRequireWhitelist();
event SetManager();
event OfferFilled(uint amount, uint totalPrice, address indexed filler, string _referralCode);
event UserFundClaimed(address user, uint fund);
event PreSale(address user, uint amont);
constructor(){
}
modifier inPause() {
}
modifier inProgress() {
}
modifier preSaleInPause() {
}
modifier preSaleInProgress() {
}
function setTiger(address _tiger) public onlyRole(MANAGER_ROLE) inPause() {
}
function setUnitPrice(uint _unitPrice) public onlyRole(MANAGER_ROLE) inPause() {
}
function pause() public onlyRole(OFFICIAL_ROLE) inProgress() {
}
function unpause() public onlyRole(OFFICIAL_ROLE) inPause() {
}
function preSalePause() public onlyRole(PRESALE_ROLE) preSaleInProgress() {
}
function preSaleUnpause() public onlyRole(PRESALE_ROLE) preSaleInPause() {
}
function setManager(address _manager) public onlyRole(MANAGER_ROLE) {
}
function setPreSaleFundAddress(address _preSaleFundAddress) public onlyRole(MANAGER_ROLE) {
}
function setRequireWhitelist(bool _requireWhitelist) public onlyRole(MANAGER_ROLE) {
}
function setWhitelist(address _whitelisted, uint _claimable) public onlyRole(MANAGER_ROLE) {
}
function setWhitelistBatch(address[] calldata _whitelisted, uint[] calldata _claimable) public onlyRole(MANAGER_ROLE) inPause() {
}
function fillOffersWithReferral(uint _amount, string memory _referralCode) public inProgress() nonReentrant {
require(_amount >= minPurchase, "Amount must >= minPurchase");
require(_amount <= maxPurchase, "Amount must <= maxPurchase");
require(_amount + offerCount <= maxOfferCount, "offer count must <= maxOfferCount");
uint preSaleAmount = userPreSaleInfo[msg.sender];
uint totalPrice = 0;
if (preSaleAmount >= _amount) {
userPreSaleInfo[msg.sender] = userPreSaleInfo[msg.sender] - _amount;
}
if (preSaleAmount < _amount) {
uint needPayAmount = _amount - preSaleAmount;
require(<FILL_ME>)
delete userPreSaleInfo[msg.sender];
whitelist[msg.sender] = whitelist[msg.sender] - needPayAmount;
totalPrice = unitPrice * needPayAmount;
IERC20(paymentToken).safeTransferFrom(msg.sender, manager, totalPrice);
}
for (uint i = 1; i <= _amount; i ++) {
_safeMint();
}
emit OfferFilled(_amount, totalPrice, msg.sender, _referralCode);
}
function quotePrice(address _owner, uint _amount) public view returns (uint price) {
}
function preSale(uint _amount) public preSaleInProgress() nonReentrant {
}
function claimFund() public preSaleInProgress() nonReentrant {
}
function clearUserPreSaleInfo() public preSaleInPause() inPause() onlyRole(MANAGER_ROLE) {
}
function _safeMint() internal {
}
function setOfferCount(uint256 _offerCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setMaxOfferCount(uint256 _maxOfferCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setPaymentToken(address _paymentToken) public onlyRole(MANAGER_ROLE) inPause() {
}
// Fallback: reverts if Ether is sent to this smart-contract by mistake
fallback() external {
}
}
| (requireWhitelist&&whitelist[msg.sender]>=needPayAmount)||!requireWhitelist,"whitelisting for external users is disabled" | 408,913 | (requireWhitelist&&whitelist[msg.sender]>=needPayAmount)||!requireWhitelist |
"whitelisting for external users is disabled" | pragma solidity ^0.8.0;
interface ITiger {
function mintToken(uint256 _tokenId, address to) external;
}
contract TigerVC is AccessControl, ReentrancyGuard {
using Strings for uint256;
using SafeERC20 for IERC20;
ITiger tiger;
uint public offerCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
uint public preSaleCount; // Index of the presale
uint public maxOfferCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
address public paymentToken; // Contract address of the payment token
uint public unitPrice; // Unit price(Wei)
uint public minPurchase = 1; // Minimum NFT to buy per purchase
uint public maxPurchase = 50; // Minimum NFT to buy per purchase
bool public paused = true; // Pause status
bool public preSalePaused = true; //Presale Pause status
bool public requireWhitelist = true; // If require whitelist
mapping(address => uint) public whitelist; //whitelist users Address-to-claimable-amount mapping
mapping(address => uint) public userPreSaleInfo; // user presale num mapping
address [] private preSaleUserList; //user joined presale
address public manager;
address public preSaleFundAddress;
bytes32 public constant PRESALE_ROLE = keccak256("PRESALE_ROLE"); // Role that can mint tiger item
bytes32 public constant OFFICIAL_ROLE = keccak256("OFFICIAL_ROLE"); // Role that can mint tiger item
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); // Role that can mint tiger item
event UnitPriceSet(uint unitPrice);
event Mint(uint tokenId);
event Paused();
event UnPaused();
event SetRequireWhitelist();
event SetManager();
event OfferFilled(uint amount, uint totalPrice, address indexed filler, string _referralCode);
event UserFundClaimed(address user, uint fund);
event PreSale(address user, uint amont);
constructor(){
}
modifier inPause() {
}
modifier inProgress() {
}
modifier preSaleInPause() {
}
modifier preSaleInProgress() {
}
function setTiger(address _tiger) public onlyRole(MANAGER_ROLE) inPause() {
}
function setUnitPrice(uint _unitPrice) public onlyRole(MANAGER_ROLE) inPause() {
}
function pause() public onlyRole(OFFICIAL_ROLE) inProgress() {
}
function unpause() public onlyRole(OFFICIAL_ROLE) inPause() {
}
function preSalePause() public onlyRole(PRESALE_ROLE) preSaleInProgress() {
}
function preSaleUnpause() public onlyRole(PRESALE_ROLE) preSaleInPause() {
}
function setManager(address _manager) public onlyRole(MANAGER_ROLE) {
}
function setPreSaleFundAddress(address _preSaleFundAddress) public onlyRole(MANAGER_ROLE) {
}
function setRequireWhitelist(bool _requireWhitelist) public onlyRole(MANAGER_ROLE) {
}
function setWhitelist(address _whitelisted, uint _claimable) public onlyRole(MANAGER_ROLE) {
}
function setWhitelistBatch(address[] calldata _whitelisted, uint[] calldata _claimable) public onlyRole(MANAGER_ROLE) inPause() {
}
function fillOffersWithReferral(uint _amount, string memory _referralCode) public inProgress() nonReentrant {
}
function quotePrice(address _owner, uint _amount) public view returns (uint price) {
}
function preSale(uint _amount) public preSaleInProgress() nonReentrant {
require(_amount >= minPurchase, "Amount must >= minPurchase");
require(_amount <= maxPurchase, "Amount must <= maxPurchase");
require(<FILL_ME>)
require(preSaleFundAddress != address(0), "preSaleFundAddress is a zero address");
require(_amount + preSaleCount <= maxOfferCount, "presale count must <= maxOfferCount");
preSaleCount = preSaleCount + _amount;
uint totalPrice = unitPrice * _amount;
whitelist[msg.sender] = whitelist[msg.sender] - _amount;
IERC20(paymentToken).safeTransferFrom(msg.sender, preSaleFundAddress, totalPrice);
userPreSaleInfo[msg.sender] = userPreSaleInfo[msg.sender] + _amount;
preSaleUserList.push(msg.sender);
emit PreSale(msg.sender, _amount);
}
function claimFund() public preSaleInProgress() nonReentrant {
}
function clearUserPreSaleInfo() public preSaleInPause() inPause() onlyRole(MANAGER_ROLE) {
}
function _safeMint() internal {
}
function setOfferCount(uint256 _offerCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setMaxOfferCount(uint256 _maxOfferCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setPaymentToken(address _paymentToken) public onlyRole(MANAGER_ROLE) inPause() {
}
// Fallback: reverts if Ether is sent to this smart-contract by mistake
fallback() external {
}
}
| (requireWhitelist&&whitelist[msg.sender]>=_amount)||!requireWhitelist,"whitelisting for external users is disabled" | 408,913 | (requireWhitelist&&whitelist[msg.sender]>=_amount)||!requireWhitelist |
"presale count must <= maxOfferCount" | pragma solidity ^0.8.0;
interface ITiger {
function mintToken(uint256 _tokenId, address to) external;
}
contract TigerVC is AccessControl, ReentrancyGuard {
using Strings for uint256;
using SafeERC20 for IERC20;
ITiger tiger;
uint public offerCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
uint public preSaleCount; // Index of the presale
uint public maxOfferCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
address public paymentToken; // Contract address of the payment token
uint public unitPrice; // Unit price(Wei)
uint public minPurchase = 1; // Minimum NFT to buy per purchase
uint public maxPurchase = 50; // Minimum NFT to buy per purchase
bool public paused = true; // Pause status
bool public preSalePaused = true; //Presale Pause status
bool public requireWhitelist = true; // If require whitelist
mapping(address => uint) public whitelist; //whitelist users Address-to-claimable-amount mapping
mapping(address => uint) public userPreSaleInfo; // user presale num mapping
address [] private preSaleUserList; //user joined presale
address public manager;
address public preSaleFundAddress;
bytes32 public constant PRESALE_ROLE = keccak256("PRESALE_ROLE"); // Role that can mint tiger item
bytes32 public constant OFFICIAL_ROLE = keccak256("OFFICIAL_ROLE"); // Role that can mint tiger item
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); // Role that can mint tiger item
event UnitPriceSet(uint unitPrice);
event Mint(uint tokenId);
event Paused();
event UnPaused();
event SetRequireWhitelist();
event SetManager();
event OfferFilled(uint amount, uint totalPrice, address indexed filler, string _referralCode);
event UserFundClaimed(address user, uint fund);
event PreSale(address user, uint amont);
constructor(){
}
modifier inPause() {
}
modifier inProgress() {
}
modifier preSaleInPause() {
}
modifier preSaleInProgress() {
}
function setTiger(address _tiger) public onlyRole(MANAGER_ROLE) inPause() {
}
function setUnitPrice(uint _unitPrice) public onlyRole(MANAGER_ROLE) inPause() {
}
function pause() public onlyRole(OFFICIAL_ROLE) inProgress() {
}
function unpause() public onlyRole(OFFICIAL_ROLE) inPause() {
}
function preSalePause() public onlyRole(PRESALE_ROLE) preSaleInProgress() {
}
function preSaleUnpause() public onlyRole(PRESALE_ROLE) preSaleInPause() {
}
function setManager(address _manager) public onlyRole(MANAGER_ROLE) {
}
function setPreSaleFundAddress(address _preSaleFundAddress) public onlyRole(MANAGER_ROLE) {
}
function setRequireWhitelist(bool _requireWhitelist) public onlyRole(MANAGER_ROLE) {
}
function setWhitelist(address _whitelisted, uint _claimable) public onlyRole(MANAGER_ROLE) {
}
function setWhitelistBatch(address[] calldata _whitelisted, uint[] calldata _claimable) public onlyRole(MANAGER_ROLE) inPause() {
}
function fillOffersWithReferral(uint _amount, string memory _referralCode) public inProgress() nonReentrant {
}
function quotePrice(address _owner, uint _amount) public view returns (uint price) {
}
function preSale(uint _amount) public preSaleInProgress() nonReentrant {
require(_amount >= minPurchase, "Amount must >= minPurchase");
require(_amount <= maxPurchase, "Amount must <= maxPurchase");
require((requireWhitelist && whitelist[msg.sender] >= _amount) || !requireWhitelist, "whitelisting for external users is disabled");
require(preSaleFundAddress != address(0), "preSaleFundAddress is a zero address");
require(<FILL_ME>)
preSaleCount = preSaleCount + _amount;
uint totalPrice = unitPrice * _amount;
whitelist[msg.sender] = whitelist[msg.sender] - _amount;
IERC20(paymentToken).safeTransferFrom(msg.sender, preSaleFundAddress, totalPrice);
userPreSaleInfo[msg.sender] = userPreSaleInfo[msg.sender] + _amount;
preSaleUserList.push(msg.sender);
emit PreSale(msg.sender, _amount);
}
function claimFund() public preSaleInProgress() nonReentrant {
}
function clearUserPreSaleInfo() public preSaleInPause() inPause() onlyRole(MANAGER_ROLE) {
}
function _safeMint() internal {
}
function setOfferCount(uint256 _offerCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setMaxOfferCount(uint256 _maxOfferCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setPaymentToken(address _paymentToken) public onlyRole(MANAGER_ROLE) inPause() {
}
// Fallback: reverts if Ether is sent to this smart-contract by mistake
fallback() external {
}
}
| _amount+preSaleCount<=maxOfferCount,"presale count must <= maxOfferCount" | 408,913 | _amount+preSaleCount<=maxOfferCount |
"No fund to claim" | pragma solidity ^0.8.0;
interface ITiger {
function mintToken(uint256 _tokenId, address to) external;
}
contract TigerVC is AccessControl, ReentrancyGuard {
using Strings for uint256;
using SafeERC20 for IERC20;
ITiger tiger;
uint public offerCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
uint public preSaleCount; // Index of the presale
uint public maxOfferCount; // Index of the current buyable NFT in that type. offCount=0 means no NFT is left in that type
address public paymentToken; // Contract address of the payment token
uint public unitPrice; // Unit price(Wei)
uint public minPurchase = 1; // Minimum NFT to buy per purchase
uint public maxPurchase = 50; // Minimum NFT to buy per purchase
bool public paused = true; // Pause status
bool public preSalePaused = true; //Presale Pause status
bool public requireWhitelist = true; // If require whitelist
mapping(address => uint) public whitelist; //whitelist users Address-to-claimable-amount mapping
mapping(address => uint) public userPreSaleInfo; // user presale num mapping
address [] private preSaleUserList; //user joined presale
address public manager;
address public preSaleFundAddress;
bytes32 public constant PRESALE_ROLE = keccak256("PRESALE_ROLE"); // Role that can mint tiger item
bytes32 public constant OFFICIAL_ROLE = keccak256("OFFICIAL_ROLE"); // Role that can mint tiger item
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); // Role that can mint tiger item
event UnitPriceSet(uint unitPrice);
event Mint(uint tokenId);
event Paused();
event UnPaused();
event SetRequireWhitelist();
event SetManager();
event OfferFilled(uint amount, uint totalPrice, address indexed filler, string _referralCode);
event UserFundClaimed(address user, uint fund);
event PreSale(address user, uint amont);
constructor(){
}
modifier inPause() {
}
modifier inProgress() {
}
modifier preSaleInPause() {
}
modifier preSaleInProgress() {
}
function setTiger(address _tiger) public onlyRole(MANAGER_ROLE) inPause() {
}
function setUnitPrice(uint _unitPrice) public onlyRole(MANAGER_ROLE) inPause() {
}
function pause() public onlyRole(OFFICIAL_ROLE) inProgress() {
}
function unpause() public onlyRole(OFFICIAL_ROLE) inPause() {
}
function preSalePause() public onlyRole(PRESALE_ROLE) preSaleInProgress() {
}
function preSaleUnpause() public onlyRole(PRESALE_ROLE) preSaleInPause() {
}
function setManager(address _manager) public onlyRole(MANAGER_ROLE) {
}
function setPreSaleFundAddress(address _preSaleFundAddress) public onlyRole(MANAGER_ROLE) {
}
function setRequireWhitelist(bool _requireWhitelist) public onlyRole(MANAGER_ROLE) {
}
function setWhitelist(address _whitelisted, uint _claimable) public onlyRole(MANAGER_ROLE) {
}
function setWhitelistBatch(address[] calldata _whitelisted, uint[] calldata _claimable) public onlyRole(MANAGER_ROLE) inPause() {
}
function fillOffersWithReferral(uint _amount, string memory _referralCode) public inProgress() nonReentrant {
}
function quotePrice(address _owner, uint _amount) public view returns (uint price) {
}
function preSale(uint _amount) public preSaleInProgress() nonReentrant {
}
function claimFund() public preSaleInProgress() nonReentrant {
require(<FILL_ME>)
require(preSaleFundAddress != address(0), "preSaleFundAddress is a zero address");
uint totalPrice = unitPrice * userPreSaleInfo[msg.sender];
whitelist[msg.sender] = whitelist[msg.sender] + userPreSaleInfo[msg.sender];
preSaleCount = preSaleCount - userPreSaleInfo[msg.sender];
delete userPreSaleInfo[msg.sender];
IERC20(paymentToken).safeTransferFrom(preSaleFundAddress, msg.sender, totalPrice);
emit UserFundClaimed(msg.sender, totalPrice);
}
function clearUserPreSaleInfo() public preSaleInPause() inPause() onlyRole(MANAGER_ROLE) {
}
function _safeMint() internal {
}
function setOfferCount(uint256 _offerCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setMaxOfferCount(uint256 _maxOfferCount) public onlyRole(MANAGER_ROLE) inPause() {
}
function setPaymentToken(address _paymentToken) public onlyRole(MANAGER_ROLE) inPause() {
}
// Fallback: reverts if Ether is sent to this smart-contract by mistake
fallback() external {
}
}
| userPreSaleInfo[msg.sender]>=1,"No fund to claim" | 408,913 | userPreSaleInfo[msg.sender]>=1 |
'Mint limit reached' | // SPDX-License-Identifier: MIT
pragma solidity >=0.8.9 <0.9.0;
import 'erc721a/contracts/ERC721A.sol';
import 'erc721a/contracts/extensions/ERC721ABurnable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
contract AncientFarm is ERC721A, ERC721ABurnable, Ownable, ReentrancyGuard {
uint public immutable maxSupply = 20000000;
bool public isOpen = false;
string public baseURI = 'https://res.ancientfarm.xyz/metadata/';
uint public mintLimit = 10;
uint public cost = 0;
mapping(address => bool) public mintedAddressMap;
constructor(bool isOpen_) ERC721A('Ancient Farm', 'AF') {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function updateBaseURI(string memory baseURI_) public onlyOwner {
}
function updateOpenStatus(bool isOpen_) public onlyOwner {
}
function mint() external payable {
address msgSender = _msgSender();
require(isOpen == true, 'The contract is not open, please wait...');
require(tx.origin == msgSender, 'Only EOA');
require(<FILL_ME>)
_doMint(msgSender, mintLimit);
mintedAddressMap[msgSender] = true;
}
function airdrop(address[] memory mintAddresses, uint[] memory mintCounts) public onlyOwner {
}
function _doMint(address to, uint quantity) private {
}
function withdraw() public onlyOwner nonReentrant {
}
}
| mintedAddressMap[msgSender]==false,'Mint limit reached' | 409,158 | mintedAddressMap[msgSender]==false |
"Cannot set max buy amount lower than 0.01%" | /**
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
}
}
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
}
function name() public view virtual override returns (string memory) {
}
function symbol() public view virtual override returns (string memory) {
}
function decimals() public view virtual override returns (uint8) {
}
function totalSupply() public view virtual override returns (uint256) {
}
function balanceOf(address account) public view virtual override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
}
function _createInitialSupply(address account, uint256 amount) internal virtual {
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() external virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
interface ILpPair {
function sync() external;
}
interface IDexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function addLiquidityETH(address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
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 getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IDexFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract MHM is ERC20, Ownable {
uint256 public maxBuyAmount;
IDexRouter public immutable dexRouter;
address public immutable lpPair;
bool private swapping;
uint256 public swapTokensAtAmount;
address public operationsAddress;
address public rewardsAddress;
uint256 public tradingActiveBlock = 0; // 0 means trading is not active
bool public limitsInEffect = true;
bool public tradingActive = false;
bool public swapEnabled = false;
// Anti-bot and anti-whale mappings and variables
mapping(address => uint256) private _holderLastTransferBlock; // tכo hold last Transfers temporarily during launch
bool public transferDelayEnabled = true;
uint256 public buyTotalFees;
uint256 public buyOperationsFee;
uint256 public buyLiquidityFee;
uint256 public buyRewardsFee;
uint256 public sellTotalFees;
uint256 public sellOperationsFee;
uint256 public sellLiquidityFee;
uint256 public sellRewardsFee;
uint256 public tokensForOperations;
uint256 public tokensForLiquidity;
uint256 public tokensForRewards;
mapping (address => bool) private _isExcludedFromFees;
mapping (address => bool) public _isExcludedMaxTransactionAmount;
mapping (address => bool) public automatedMarketMakerPairs;
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event EnabledTrading();
event RemovedLimits();
event ExcludeFromFees(address indexed account, bool isExcluded);
event UpdatedMaxBuyAmount(uint256 newAmount);
event UpdatedBuyFee(uint256 newAmount);
event UpdatedSellFee(uint256 newAmount);
event UpdatedOperationsAddress(address indexed newWallet);
event UpdatedRewardsAddress(address indexed newWallet);
event UpdatedLiquidityAddress(address indexed newWallet);
event MaxTransactionExclusion(address _address, bool excluded);
event OwnerForcedSwapBack(uint256 timestamp);
event TransferForeignToken(address token, uint256 amount);
event RemovedTokenHoldingsRequiredToBuy();
event TransferDelayDisabled();
event ReuppedApprovals();
event SwapTokensAtAmountUpdated(uint256 newAmount);
constructor() ERC20("Magic Hamsters Money", "MHM") {
}
receive() external payable {
}
function enableTrading() external onlyOwner {
}
// remove limits after token is stable
function removeLimits() external onlyOwner {
}
// disable Transfer delay - cannot be reenabled
function disableTransferDelay() external onlyOwner {
}
function updateMaxBuyAmount(uint256 newNum) external onlyOwner {
require(<FILL_ME>)
maxBuyAmount = newNum * (10**18);
emit UpdatedMaxBuyAmount(maxBuyAmount);
}
// change the minimum amount of tokens to sell from fees
function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner {
}
function _excludeFromMaxTransaction(address updAds, bool isExcluded) private {
}
function airdropToWallets(address[] memory wallets, uint256[] memory amountsInTokens) external onlyOwner {
}
function excludeFromMaxTransaction(address updAds, bool isEx) external onlyOwner {
}
function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner {
}
function updateBuyFees(uint256 _operationsFee, uint256 _liquidityFee, uint256 _rewardsFee) external onlyOwner {
}
function updateSellFees(uint256 _operationsFee, uint256 _liquidityFee, uint256 _rewardsFee) external onlyOwner {
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
}
function _transfer(address from, address to, uint256 amount) internal override {
}
function swapTokensForEth(uint256 tokenAmount) private {
}
function swapBack() private {
}
function sendEth() external onlyOwner {
}
function transferForeignToken(address _token, address _to) external onlyOwner {
}
function setOperationsAddress(address _operationsAddress) external onlyOwner {
}
function setRewardsAddress(address _rewardsAddress) external onlyOwner {
}
// force Swap back if slippage issues.
function forceSwapBack() external onlyOwner {
}
function updateAllowanceForSwapping() external onlyOwner {
}
}
| newNum>=(totalSupply()*1/10000)/1e18,"Cannot set max buy amount lower than 0.01%" | 409,344 | newNum>=(totalSupply()*1/10000)/1e18 |
"contract locked" | pragma solidity 0.8.13;
// import from node_modules @openzeppelin/contracts v4.0
contract Sale is Ownable {
IERC20 public token;
AggregatorV3Interface public priceFeed;
bool public contractLocked = false;
uint256 public tokenUsdPrice = 3e16; // 0.03 USD
event ContractLockUpdated(bool contractIsLocked);
event EthWithdrawn(uint256 ethAmount);
event TokenWithdrawn(uint256 tokenAmount);
event TokenPriceUpdated(uint256 newTokenUsdPrice);
constructor(address _tokenAddress, address _priceFeedAddress) {
}
function getEthUsdPrice() public view returns (uint) {
}
function toggleLock() public onlyOwner {
}
function buy() public payable {
require(<FILL_ME>)
uint256 tokenAmount = calcTokenAmount(msg.value);
require(tokenAmount > 0, "zero tokens");
token.transfer(msg.sender, tokenAmount);
}
function calcTokenAmount(uint256 _ethAmount) public view returns (uint) {
}
function withdrawEth(uint256 _amount) public onlyOwner {
}
function withdrawToken(uint256 _amount) public onlyOwner {
}
function changePrice(uint256 _tokenUsdPrice) public onlyOwner {
}
}
| !contractLocked,"contract locked" | 409,444 | !contractLocked |
null | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "Shared.sol";
import "IStateChainGateway.sol";
import "IAddressHolder.sol";
import "ITokenVestingStaking.sol";
import "MockStProvider.sol";
import "SafeERC20.sol";
/**
* @title TokenVestingStaking
* @dev A token holder contract that that vests its balance of any ERC20 token to the beneficiary.
* Validator lockup - stakable. Nothing unlocked until end of contract where everything
* unlocks at once. All funds can be staked during the vesting period.
* If revoked send all funds to revoker and block beneficiary releases indefinitely.
* Any staked funds at the moment of revocation can be retrieved by the revoker upon unstaking.
*
* The reference to the staking contract is hold by the AddressHolder contract to allow for governance to
* update it in case the staking contract needs to be upgraded.
*
* The vesting schedule is time-based (i.e. using block timestamps as opposed to e.g. block numbers), and
* is therefore sensitive to timestamp manipulation (which is something miners can do, to a certain degree).
* Therefore, it is recommended to avoid using short time durations (less than a minute).
*
*/
contract TokenVestingStaking is ITokenVestingStaking, Shared {
using SafeERC20 for IERC20;
// beneficiary of tokens after they are released. It can be transferrable.
address private beneficiary;
bool public immutable transferableBeneficiary;
// the revoker who can cancel the vesting and withdraw any unvested tokens
address private revoker;
// Durations and timestamps are expressed in UNIX time, the same units as block.timestamp.
uint256 public immutable start;
uint256 public immutable end;
// solhint-disable-next-line var-name-mixedcase
IERC20 public immutable FLIP;
// The contract that holds the reference addresses for staking purposes.
IAddressHolder public immutable addressHolder;
bool public revoked;
// Cumulative counter for amount staked to the st provider
uint256 public stTokenStaked;
// Cumulative counter for amount unstaked from the st provider
uint256 public stTokenUnstaked;
/**
* @param beneficiary_ address of the beneficiary to whom vested tokens are transferred
* @param revoker_ the person with the power to revoke the vesting. Address(0) means it is not revocable.
* @param start_ the unix time when the beneficiary can start staking the tokens.
* @param end_ the unix time of the end of the vesting period, everything withdrawable after
* @param transferableBeneficiary_ whether the beneficiary address can be transferred
* @param addressHolder_ the contract holding the reference address to the ScGateway for staking
* @param flip_ the FLIP token address.
*/
constructor(
address beneficiary_,
address revoker_,
uint256 start_,
uint256 end_,
bool transferableBeneficiary_,
IAddressHolder addressHolder_,
IERC20 flip_
) nzAddr(beneficiary_) nzAddr(address(addressHolder_)) nzAddr(address(flip_)) {
}
//////////////////////////////////////////////////////////////
// //
// State-changing functions //
// //
//////////////////////////////////////////////////////////////
/**
* @notice Funds an account in the statechain with some tokens for the nodeID
* and forces the return address of that to be this contract.
* @param nodeID the nodeID to fund.
* @param amount the amount of FLIP out of the current funds in this contract.
*/
function fundStateChainAccount(
bytes32 nodeID,
uint256 amount
) external override onlyBeneficiary notRevoked afterStart {
}
/**
* @notice Stakes to the staking provider by transferring an amount of FLIP to the staking minter.
* It is expected that an amount of stFLIP will be minted to this contract.
* @param amount the amount of FLIP to stake to the staking provider.
*/
function stakeToStProvider(uint256 amount) external override onlyBeneficiary notRevoked afterStart {
address stMinter = addressHolder.getStakingAddress();
FLIP.approve(stMinter, amount);
stTokenStaked += amount;
require(<FILL_ME>)
}
/**
* @notice Unstakes from the staking provider by transferring stFLIP to the staking burner.
* @param amount the amount of FLIP to stake to the staking provider.
*/
function unstakeFromStProvider(uint256 amount) external override onlyBeneficiary notRevoked returns (uint256) {
}
/**
* @notice Claims the liquid staking provider rewards.
* @param amount_ the amount of rewards to claim. If greater than `totalRewards`, then all rewards are claimed.
* @dev `stTokenCounter` updates after staking/unstaking operation to keep track of the st token principle. Any
* amount above the principle is considered rewards and thus can be claimed by the beneficiary.
*/
function claimStProviderRewards(uint256 amount_) external override onlyBeneficiary notRevoked {
}
/**
* @notice Transfers vested tokens to beneficiary.
* @param token ERC20 token which is being vested.
*/
function release(IERC20 token) external override onlyBeneficiary notRevoked {
}
/**
* @notice Allows the revoker to revoke the vesting and stop the beneficiary from releasing any
* tokens if the vesting period has not been completed. Any staked tokens at the time of
* revoking can be retrieved by the revoker upon unstaking via `retrieveRevokedFunds`.
* @param token ERC20 token which is being vested.
*/
function revoke(IERC20 token) external override onlyRevoker notRevoked {
}
/**
* @notice Allows the revoker to retrieve tokens that have been unstaked after the revoke
* function has been called. Safeguard mechanism in case of unstaking happening
* after revoke, otherwise funds would be locked.
* @param token ERC20 token which is being vested.
*/
function retrieveRevokedFunds(IERC20 token) external override onlyRevoker {
}
/**
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param token ERC20 token which is being vested.
*/
function _releasableAmount(IERC20 token) private view returns (uint256) {
}
/// @dev Allow the beneficiary to be transferred to a new address if needed
function transferBeneficiary(address beneficiary_) external override onlyBeneficiary nzAddr(beneficiary_) {
}
/// @dev Allow the revoker to be transferred to a new address if needed
function transferRevoker(address revoker_) external override onlyRevoker nzAddr(revoker_) {
}
//////////////////////////////////////////////////////////////
// //
// Non-state-changing functions //
// //
//////////////////////////////////////////////////////////////
/**
* @return the beneficiary address
*/
function getBeneficiary() external view override returns (address) {
}
/**
* @return the revoker address
*/
function getRevoker() external view override returns (address) {
}
//////////////////////////////////////////////////////////////
// //
// Modifiers //
// //
//////////////////////////////////////////////////////////////
/**
* @dev Ensure that the caller is the beneficiary address
*/
modifier onlyBeneficiary() {
}
/**
* @dev Ensure that the caller is the revoker address
*/
modifier onlyRevoker() {
}
modifier notRevoked() {
}
modifier afterStart() {
}
}
| IMinter(stMinter).mint(address(this),amount) | 409,483 | IMinter(stMinter).mint(address(this),amount) |
"Exceeds maximum supply" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import { OperatorFilterer } from "./OperatorFilterer.sol";
import "./ERC721AQueryable.sol";
contract Token is Ownable, ERC721AQueryable, ReentrancyGuard, PaymentSplitter, OperatorFilterer {
struct SaleConfig {
uint256 publicSaleStartTime;
uint256 claimSaleStartTime;
}
bool public operatorFilteringEnabled;
SaleConfig public _saleConfig;
uint256 public constant AUCTION_PRICE = 0.085 ether;
uint256 public immutable _totalAmount;
uint256 public immutable _maximumPerUser;
string private _baseTokenURI;
bool private _revealed = false;
string private _notRevealedBaseURI = '';
// mapping for eligible amount tokens per address
mapping (address => uint) eligibleAddressesAmount;
uint256 public eligibleAddressesTotalAmountCount = 0;
constructor(
string memory name,
string memory symbol,
uint256 totalAmount,
string memory baseTokenURI,
uint256 maxPerUser,
uint256 publicSaleStartTime,
uint256 claimSaleStartTime,
address[] memory _payees,
uint256[] memory _shares,
string memory notRevealedURI
)
ERC721A(name, symbol)
PaymentSplitter(_payees, _shares) {
}
modifier callerIsUser() {
}
function mint(uint256 quantity, uint256 totalCost) private {
}
/**
* Set claim mint addresses
*/
function setEligebleAddresses(uint256 quantityPerAddress, address[] memory recipients) external onlyOwner {
}
/**
* Claim Mint
*/
function claimMint() external callerIsUser {
uint quantity = eligibleAddressesAmount[msg.sender];
uint256 _saleStartTime = uint256(_saleConfig.claimSaleStartTime);
require(
_saleStartTime != 0 && block.timestamp >= _saleStartTime,
"Claim sale has not started yet"
);
require(
quantity > 0,
"Nothing to claim"
);
require(<FILL_ME>)
// clear eligible amount
eligibleAddressesAmount[msg.sender] = 0;
// remove from counter
eligibleAddressesTotalAmountCount = eligibleAddressesTotalAmountCount - quantity;
// mint eligible to address
_safeMint(msg.sender, quantity);
}
/**
* Public Mint
*/
function publicMint(uint256 quantity) external payable callerIsUser {
}
/**
* Owners Mint
*/
function ownerMint(uint256 quantity) external payable onlyOwner {
}
/**
* @dev Refunds the sender if the amount sent is greater than required.
* @param _price The price minter sends to the contract.
*/
function refundIfOver(uint256 _price) private {
}
/**
* Set public mint start time
*/
function setPublicSaleStartTime(uint256 timestamp) external onlyOwner {
}
/**
* Set claim 'mint' start time
*/
function setClaimSaleStartTime(uint256 timestamp) external onlyOwner {
}
/**
* @dev Sets revealed to true.
* This action cannot be reverted. Once the contract is revealed, it cannot be unrevealed.
*/
function reveal(string calldata uri) external onlyOwner {
}
/**
* Override baseURI getter
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* Override notRevealedURI getter
*/
function _notRevealedURI() internal view virtual override returns (string memory) {
}
/**
* Override _isRevealed getter
*/
function _isRevealed() internal view virtual override returns (bool) {
}
/**
* Get unclaimed count by owner
*/
function getOwnerUnclaimedCount(address owner) public view virtual returns (uint) {
}
/**
* Burn token
*/
function burnToken(uint256 tokenId) external {
}
function repeatRegistration() public {
}
function setApprovalForAll(address operator, bool approved)
public
override(ERC721A, IERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function transferFrom(address from, address to, uint256 tokenId)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperator(from)
{
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
}
function _operatorFilteringEnabled() internal view virtual override returns (bool) {
}
}
| totalSupply()+quantity<=_totalAmount,"Exceeds maximum supply" | 409,514 | totalSupply()+quantity<=_totalAmount |
"Can not mint this many" | // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import { OperatorFilterer } from "./OperatorFilterer.sol";
import "./ERC721AQueryable.sol";
contract Token is Ownable, ERC721AQueryable, ReentrancyGuard, PaymentSplitter, OperatorFilterer {
struct SaleConfig {
uint256 publicSaleStartTime;
uint256 claimSaleStartTime;
}
bool public operatorFilteringEnabled;
SaleConfig public _saleConfig;
uint256 public constant AUCTION_PRICE = 0.085 ether;
uint256 public immutable _totalAmount;
uint256 public immutable _maximumPerUser;
string private _baseTokenURI;
bool private _revealed = false;
string private _notRevealedBaseURI = '';
// mapping for eligible amount tokens per address
mapping (address => uint) eligibleAddressesAmount;
uint256 public eligibleAddressesTotalAmountCount = 0;
constructor(
string memory name,
string memory symbol,
uint256 totalAmount,
string memory baseTokenURI,
uint256 maxPerUser,
uint256 publicSaleStartTime,
uint256 claimSaleStartTime,
address[] memory _payees,
uint256[] memory _shares,
string memory notRevealedURI
)
ERC721A(name, symbol)
PaymentSplitter(_payees, _shares) {
}
modifier callerIsUser() {
}
function mint(uint256 quantity, uint256 totalCost) private {
}
/**
* Set claim mint addresses
*/
function setEligebleAddresses(uint256 quantityPerAddress, address[] memory recipients) external onlyOwner {
}
/**
* Claim Mint
*/
function claimMint() external callerIsUser {
}
/**
* Public Mint
*/
function publicMint(uint256 quantity) external payable callerIsUser {
uint256 _saleStartTime = uint256(_saleConfig.publicSaleStartTime);
uint256 totalCost = AUCTION_PRICE * quantity;
require(
_saleStartTime != 0 && block.timestamp >= _saleStartTime,
"Public sale has not started yet"
);
require(
msg.value >= totalCost,
"Not enough ETH sent: check price"
);
require(
totalSupply() + quantity <= _totalAmount,
"Exceeds maximum supply"
);
require(<FILL_ME>)
mint(quantity, totalCost);
}
/**
* Owners Mint
*/
function ownerMint(uint256 quantity) external payable onlyOwner {
}
/**
* @dev Refunds the sender if the amount sent is greater than required.
* @param _price The price minter sends to the contract.
*/
function refundIfOver(uint256 _price) private {
}
/**
* Set public mint start time
*/
function setPublicSaleStartTime(uint256 timestamp) external onlyOwner {
}
/**
* Set claim 'mint' start time
*/
function setClaimSaleStartTime(uint256 timestamp) external onlyOwner {
}
/**
* @dev Sets revealed to true.
* This action cannot be reverted. Once the contract is revealed, it cannot be unrevealed.
*/
function reveal(string calldata uri) external onlyOwner {
}
/**
* Override baseURI getter
*/
function _baseURI() internal view virtual override returns (string memory) {
}
/**
* Override notRevealedURI getter
*/
function _notRevealedURI() internal view virtual override returns (string memory) {
}
/**
* Override _isRevealed getter
*/
function _isRevealed() internal view virtual override returns (bool) {
}
/**
* Get unclaimed count by owner
*/
function getOwnerUnclaimedCount(address owner) public view virtual returns (uint) {
}
/**
* Burn token
*/
function burnToken(uint256 tokenId) external {
}
function repeatRegistration() public {
}
function setApprovalForAll(address operator, bool approved)
public
override(ERC721A, IERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperatorApproval(operator)
{
}
function transferFrom(address from, address to, uint256 tokenId)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperator(from)
{
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
payable
override(ERC721A, IERC721A)
onlyAllowedOperator(from)
{
}
function setOperatorFilteringEnabled(bool value) public onlyOwner {
}
function _operatorFilteringEnabled() internal view virtual override returns (bool) {
}
}
| _numberMinted(msg.sender)+quantity<=_maximumPerUser,"Can not mint this many" | 409,514 | _numberMinted(msg.sender)+quantity<=_maximumPerUser |
"Can not buy more than 0.5% of supply!" | /**
Look around you for RED.
*/
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
pragma solidity ^0.8.8;
interface DexFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface DexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
contract REDROOM is ERC20, Ownable {
struct Tax {
uint256 marketingTax;
uint256 liquidityTax;
uint256 charityTax;
}
uint256 _decimal = 9;
uint256 private _totalSupply = 1e9 * 10 ** _decimal;
//Router
DexRouter public uniswapRouter;
address public pairAddress;
//Taxes
Tax public buyTaxes = Tax(4, 1, 0);
Tax public sellTaxes = Tax(4, 1, 0);
uint256 public totalBuyFees = 5;
uint256 public totalSellFees = 5;
//Whitelisting from taxes/maxwallet/txlimit/etc
mapping(address => bool) private whitelisted;
//Swapping
uint256 public swapTokensAtAmount = _totalSupply / 100000; //after 0.001% of total supply, swap them
bool public swapAndLiquifyEnabled = true;
bool public isSwapping = false;
//Wallets
address public marketingWallet = 0xaB0Acc35208b3b03F0915015cc4D6b89A7E5DdF3;
address public charityWallet = 0xaB0Acc35208b3b03F0915015cc4D6b89A7E5DdF3;
//Max amounts
uint256 public maxWallet;
uint256 public maxTx;
uint256 public maxWalletTimeThreshold = 0 hours;
uint256 public maxTxTimeThreshold = 0 hours;
bool public limitsEnabled = false;
//Snipers
uint256 public deadBlocks;
mapping(address=>bool) public blacklisted;
//Launch Status
uint256 public launchedAtTime;
uint256 public launchedAtBlock;
constructor() ERC20("Red Room", "CODE RED") {
}
function decimals() public view virtual override returns (uint8) {
}
function setMarketingWallet(address _newMarketing) external onlyOwner {
}
function setCharityWallet(address _newCharity) external onlyOwner{
}
function setBuyFees(
uint256 _charityTax,
uint256 _lpTax,
uint256 _marketingTax
) external onlyOwner {
}
function setSellFees(
uint256 _charityTax,
uint256 _lpTax,
uint256 _marketingTax
) external onlyOwner {
}
function setSwapTokensAtAmount(uint256 _newAmount) external onlyOwner {
}
function toggleSwapping() external onlyOwner {
}
function setDeadBlocks(uint256 _deadBlocks) external onlyOwner{
}
function launch() external onlyOwner {
}
function setMaxWallet(uint256 _maxWallet) external onlyOwner{
}
function setmaxTx(uint256 _maxTx) external onlyOwner{
}
function setLimitsStatus(bool _limitsStatus) external onlyOwner{
}
function setWhitelistStatus(address _wallet, bool _status) external onlyOwner {
}
function setBlacklisted(address _wallet, bool _status) external onlyOwner{
}
function checkWhitelist(address _wallet) external view returns (bool) {
}
function checkBlacklisted(address _wallet) external view returns(bool){
}
function _takeTax(
address _from,
address _to,
uint256 _amount
) internal returns (uint256) {
if (whitelisted[_from] || whitelisted[_to]) {
return _amount;
}
require(launchedAtBlock > 0, "Token not launched yet!");
bool isBuy = false;
//Managing Taxes Here
uint256 totalTax = 0;
if (_to == pairAddress) {
totalTax = totalSellFees;
} else if (_from == pairAddress) {
totalTax = totalBuyFees;
isBuy = true;
}
//Validating max amounts at first 2 hours!
if((launchedAtTime + maxWalletTimeThreshold >= block.timestamp) || limitsEnabled){
if(isBuy){
require(<FILL_ME>)
}
require(_amount < maxTx, "Can not buy/sell/transfer more than 0.1% of supply!");
}
//Anti-Bot Implementation
if(launchedAtBlock + deadBlocks >= block.number){
if(_to == pairAddress){
blacklisted[_from] = true;
}else if(_from == pairAddress){
blacklisted[_to] = true;
}
}
uint256 tax = (_amount * totalTax) / 100;
super._transfer(_from, address(this), tax);
return (_amount - tax);
}
function _transfer(
address _from,
address _to,
uint256 _amount
) internal virtual override {
}
function manageTaxes() internal {
}
function swapAndLiquify(uint256 _amount) internal {
}
function swapToBNB(uint256 _amount) internal {
}
function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {
}
function updateDexRouter(address _newDex) external onlyOwner {
}
function withdrawStuckBNB() external onlyOwner {
}
function withdrawStuckTokens(address erc20_token) external onlyOwner {
}
receive() external payable {}
}
| balanceOf(_to)+_amount<=maxWallet,"Can not buy more than 0.5% of supply!" | 409,532 | balanceOf(_to)+_amount<=maxWallet |
"Transferring not allowed for blacklisted addresses!" | /**
Look around you for RED.
*/
//SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
pragma solidity ^0.8.8;
interface DexFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface DexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
contract REDROOM is ERC20, Ownable {
struct Tax {
uint256 marketingTax;
uint256 liquidityTax;
uint256 charityTax;
}
uint256 _decimal = 9;
uint256 private _totalSupply = 1e9 * 10 ** _decimal;
//Router
DexRouter public uniswapRouter;
address public pairAddress;
//Taxes
Tax public buyTaxes = Tax(4, 1, 0);
Tax public sellTaxes = Tax(4, 1, 0);
uint256 public totalBuyFees = 5;
uint256 public totalSellFees = 5;
//Whitelisting from taxes/maxwallet/txlimit/etc
mapping(address => bool) private whitelisted;
//Swapping
uint256 public swapTokensAtAmount = _totalSupply / 100000; //after 0.001% of total supply, swap them
bool public swapAndLiquifyEnabled = true;
bool public isSwapping = false;
//Wallets
address public marketingWallet = 0xaB0Acc35208b3b03F0915015cc4D6b89A7E5DdF3;
address public charityWallet = 0xaB0Acc35208b3b03F0915015cc4D6b89A7E5DdF3;
//Max amounts
uint256 public maxWallet;
uint256 public maxTx;
uint256 public maxWalletTimeThreshold = 0 hours;
uint256 public maxTxTimeThreshold = 0 hours;
bool public limitsEnabled = false;
//Snipers
uint256 public deadBlocks;
mapping(address=>bool) public blacklisted;
//Launch Status
uint256 public launchedAtTime;
uint256 public launchedAtBlock;
constructor() ERC20("Red Room", "CODE RED") {
}
function decimals() public view virtual override returns (uint8) {
}
function setMarketingWallet(address _newMarketing) external onlyOwner {
}
function setCharityWallet(address _newCharity) external onlyOwner{
}
function setBuyFees(
uint256 _charityTax,
uint256 _lpTax,
uint256 _marketingTax
) external onlyOwner {
}
function setSellFees(
uint256 _charityTax,
uint256 _lpTax,
uint256 _marketingTax
) external onlyOwner {
}
function setSwapTokensAtAmount(uint256 _newAmount) external onlyOwner {
}
function toggleSwapping() external onlyOwner {
}
function setDeadBlocks(uint256 _deadBlocks) external onlyOwner{
}
function launch() external onlyOwner {
}
function setMaxWallet(uint256 _maxWallet) external onlyOwner{
}
function setmaxTx(uint256 _maxTx) external onlyOwner{
}
function setLimitsStatus(bool _limitsStatus) external onlyOwner{
}
function setWhitelistStatus(address _wallet, bool _status) external onlyOwner {
}
function setBlacklisted(address _wallet, bool _status) external onlyOwner{
}
function checkWhitelist(address _wallet) external view returns (bool) {
}
function checkBlacklisted(address _wallet) external view returns(bool){
}
function _takeTax(
address _from,
address _to,
uint256 _amount
) internal returns (uint256) {
}
function _transfer(
address _from,
address _to,
uint256 _amount
) internal virtual override {
require(_from != address(0), "transfer from address zero");
require(_to != address(0), "transfer to address zero");
require(<FILL_ME>)
uint256 toTransfer = _takeTax(_from, _to, _amount);
bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount;
if (
swapAndLiquifyEnabled &&
pairAddress == _to &&
canSwap &&
!whitelisted[_from] &&
!whitelisted[_to] &&
!isSwapping
) {
isSwapping = true;
manageTaxes();
isSwapping = false;
}
super._transfer(_from, _to, toTransfer);
}
function manageTaxes() internal {
}
function swapAndLiquify(uint256 _amount) internal {
}
function swapToBNB(uint256 _amount) internal {
}
function addLiquidity(uint256 tokenAmount, uint256 bnbAmount) private {
}
function updateDexRouter(address _newDex) external onlyOwner {
}
function withdrawStuckBNB() external onlyOwner {
}
function withdrawStuckTokens(address erc20_token) external onlyOwner {
}
receive() external payable {}
}
| blacklisted[_to]==false&&blacklisted[_from]==false,"Transferring not allowed for blacklisted addresses!" | 409,532 | blacklisted[_to]==false&&blacklisted[_from]==false |
"swap/not-authorized" | // SPDX-License-Identifier: AGPL-3.0-or-later
/// AutomationSwap.sol
// Copyright (C) 2021-2021 Oazo Apps Limited
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity ^0.8.0;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { AutomationExecutor } from "../AutomationExecutor.sol";
contract AutomationSwap {
using SafeERC20 for IERC20;
address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
AutomationExecutor public immutable executor;
IERC20 public immutable dai;
address public owner;
mapping(address => bool) public callers;
event CallerAdded(address indexed caller);
event CallerRemoved(address indexed caller);
constructor(AutomationExecutor _executor, IERC20 _dai) {
}
modifier onlyOwner() {
}
modifier auth(address caller) {
require(<FILL_ME>)
_;
}
function addCallers(address[] calldata _callers) external onlyOwner {
}
function removeCallers(address[] calldata _callers) external onlyOwner {
}
function swap(
address receiver,
address otherAsset,
bool toDai,
uint256 amount,
uint256 receiveAtLeast,
address callee,
bytes calldata withData
) external auth(msg.sender) {
}
receive() external payable {}
}
| callers[caller],"swap/not-authorized" | 409,789 | callers[caller] |
"swap/duplicate-whitelist" | // SPDX-License-Identifier: AGPL-3.0-or-later
/// AutomationSwap.sol
// Copyright (C) 2021-2021 Oazo Apps Limited
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity ^0.8.0;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { AutomationExecutor } from "../AutomationExecutor.sol";
contract AutomationSwap {
using SafeERC20 for IERC20;
address public constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
AutomationExecutor public immutable executor;
IERC20 public immutable dai;
address public owner;
mapping(address => bool) public callers;
event CallerAdded(address indexed caller);
event CallerRemoved(address indexed caller);
constructor(AutomationExecutor _executor, IERC20 _dai) {
}
modifier onlyOwner() {
}
modifier auth(address caller) {
}
function addCallers(address[] calldata _callers) external onlyOwner {
uint256 length = _callers.length;
for (uint256 i = 0; i < length; ++i) {
address caller = _callers[i];
require(<FILL_ME>)
callers[caller] = true;
emit CallerAdded(caller);
}
}
function removeCallers(address[] calldata _callers) external onlyOwner {
}
function swap(
address receiver,
address otherAsset,
bool toDai,
uint256 amount,
uint256 receiveAtLeast,
address callee,
bytes calldata withData
) external auth(msg.sender) {
}
receive() external payable {}
}
| !callers[caller],"swap/duplicate-whitelist" | 409,789 | !callers[caller] |
"User already has a proxy" | /*
Proxy registry; keeps a mapping of AuthenticatedProxy contracts and mapping of contracts authorized to access them.
Abstracted away from the Exchange (a) to reduce Exchange attack surface and (b) so that the Exchange contract can be upgraded without users needing to transfer assets to new proxies.
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./OwnableDelegateProxy.sol";
import "./ProxyRegistryInterface.sol";
/**
* @title ProxyRegistry
* @author OasisX Protocol | cryptoware.eth
*/
contract ProxyRegistry is Ownable, ProxyRegistryInterface {
/* DelegateProxy implementation contract. Must be initialized. */
address public override delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public override proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the OasisX DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the OasisX supply (votes in the DAO),
a malicious but rational attacker could buy half the OasisX and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given three days, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 3 days;
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to enable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return proxy New AuthenticatedProxy contract
*/
function registerProxy() public returns (OwnableDelegateProxy proxy) {
}
/**
* Register a proxy contract with this registry, overriding any existing proxy
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return proxy New AuthenticatedProxy contract
*/
function registerProxyOverride()
public
returns (OwnableDelegateProxy proxy)
{
}
/**
* Register a proxy contract with this registry
* @dev Can be called by any user
* @return proxy New AuthenticatedProxy contract
*/
function registerProxyFor(address user)
public
returns (OwnableDelegateProxy proxy)
{
require(<FILL_ME>)
proxy = new OwnableDelegateProxy(
user,
delegateProxyImplementation,
abi.encodeWithSignature(
"initialize(address,address)",
user,
address(this)
)
);
proxies[user] = proxy;
return proxy;
}
/**
* Transfer access
*/
function transferAccessTo(address from, address to) public {
}
}
| proxies[user]==OwnableDelegateProxy(payable(0)),"User already has a proxy" | 409,865 | proxies[user]==OwnableDelegateProxy(payable(0)) |
"Proxy transfer can only be called by the proxy" | /*
Proxy registry; keeps a mapping of AuthenticatedProxy contracts and mapping of contracts authorized to access them.
Abstracted away from the Exchange (a) to reduce Exchange attack surface and (b) so that the Exchange contract can be upgraded without users needing to transfer assets to new proxies.
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./OwnableDelegateProxy.sol";
import "./ProxyRegistryInterface.sol";
/**
* @title ProxyRegistry
* @author OasisX Protocol | cryptoware.eth
*/
contract ProxyRegistry is Ownable, ProxyRegistryInterface {
/* DelegateProxy implementation contract. Must be initialized. */
address public override delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public override proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the OasisX DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the OasisX supply (votes in the DAO),
a malicious but rational attacker could buy half the OasisX and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given three days, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 3 days;
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to enable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return proxy New AuthenticatedProxy contract
*/
function registerProxy() public returns (OwnableDelegateProxy proxy) {
}
/**
* Register a proxy contract with this registry, overriding any existing proxy
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return proxy New AuthenticatedProxy contract
*/
function registerProxyOverride()
public
returns (OwnableDelegateProxy proxy)
{
}
/**
* Register a proxy contract with this registry
* @dev Can be called by any user
* @return proxy New AuthenticatedProxy contract
*/
function registerProxyFor(address user)
public
returns (OwnableDelegateProxy proxy)
{
}
/**
* Transfer access
*/
function transferAccessTo(address from, address to) public {
OwnableDelegateProxy proxy = proxies[from];
/* CHECKS */
require(<FILL_ME>)
require(
proxies[to] == OwnableDelegateProxy(payable(0)),
"Proxy transfer has existing proxy as destination"
);
/* EFFECTS */
delete proxies[from];
proxies[to] = proxy;
}
}
| OwnableDelegateProxy(payable(msg.sender))==proxy,"Proxy transfer can only be called by the proxy" | 409,865 | OwnableDelegateProxy(payable(msg.sender))==proxy |
"Proxy transfer has existing proxy as destination" | /*
Proxy registry; keeps a mapping of AuthenticatedProxy contracts and mapping of contracts authorized to access them.
Abstracted away from the Exchange (a) to reduce Exchange attack surface and (b) so that the Exchange contract can be upgraded without users needing to transfer assets to new proxies.
*/
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./OwnableDelegateProxy.sol";
import "./ProxyRegistryInterface.sol";
/**
* @title ProxyRegistry
* @author OasisX Protocol | cryptoware.eth
*/
contract ProxyRegistry is Ownable, ProxyRegistryInterface {
/* DelegateProxy implementation contract. Must be initialized. */
address public override delegateProxyImplementation;
/* Authenticated proxies by user. */
mapping(address => OwnableDelegateProxy) public override proxies;
/* Contracts pending access. */
mapping(address => uint256) public pending;
/* Contracts allowed to call those proxies. */
mapping(address => bool) public contracts;
/* Delay period for adding an authenticated contract.
This mitigates a particular class of potential attack on the OasisX DAO (which owns this registry) - if at any point the value of assets held by proxy contracts exceeded the value of half the OasisX supply (votes in the DAO),
a malicious but rational attacker could buy half the OasisX and grant themselves access to all the proxy contracts. A delay period renders this attack nonthreatening - given three days, if that happened, users would have
plenty of time to notice and transfer their assets.
*/
uint256 public DELAY_PERIOD = 3 days;
/**
* Start the process to enable access for specified contract. Subject to delay period.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function startGrantAuthentication(address addr) public onlyOwner {
}
/**
* End the process to enable access for specified contract after delay period has passed.
*
* @dev ProxyRegistry owner only
* @param addr Address to which to grant permissions
*/
function endGrantAuthentication(address addr) public onlyOwner {
}
/**
* Revoke access for specified contract. Can be done instantly.
*
* @dev ProxyRegistry owner only
* @param addr Address of which to revoke permissions
*/
function revokeAuthentication(address addr) public onlyOwner {
}
/**
* Register a proxy contract with this registry
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return proxy New AuthenticatedProxy contract
*/
function registerProxy() public returns (OwnableDelegateProxy proxy) {
}
/**
* Register a proxy contract with this registry, overriding any existing proxy
*
* @dev Must be called by the user which the proxy is for, creates a new AuthenticatedProxy
* @return proxy New AuthenticatedProxy contract
*/
function registerProxyOverride()
public
returns (OwnableDelegateProxy proxy)
{
}
/**
* Register a proxy contract with this registry
* @dev Can be called by any user
* @return proxy New AuthenticatedProxy contract
*/
function registerProxyFor(address user)
public
returns (OwnableDelegateProxy proxy)
{
}
/**
* Transfer access
*/
function transferAccessTo(address from, address to) public {
OwnableDelegateProxy proxy = proxies[from];
/* CHECKS */
require(
OwnableDelegateProxy(payable(msg.sender)) == proxy,
"Proxy transfer can only be called by the proxy"
);
require(<FILL_ME>)
/* EFFECTS */
delete proxies[from];
proxies[to] = proxy;
}
}
| proxies[to]==OwnableDelegateProxy(payable(0)),"Proxy transfer has existing proxy as destination" | 409,865 | proxies[to]==OwnableDelegateProxy(payable(0)) |
"Illegal contract pairing" | // SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.
import "../interfaces/0.8.x/IGenArt721CoreContractV1.sol";
import "../interfaces/0.8.x/IMinterFilterV0.sol";
import "../interfaces/0.8.x/IFilteredMinterV0.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
pragma solidity 0.8.9;
/**
* @title Filtered Minter contract that allows tokens to be minted with ETH
* or any ERC-20 token.
* @author Art Blocks Inc.
*/
contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
/// Core contract address this minter interacts with
address public immutable genArt721CoreAddress;
/// This contract handles cores with interface IV1
IGenArt721CoreContractV1 private immutable genArtCoreContract;
/// Minter filter address this minter interacts with
address public immutable minterFilterAddress;
/// Minter filter this minter may interact with.
IMinterFilterV0 private immutable minterFilter;
/// minterType for this minter
string public constant minterType = "MinterSetPriceERC20V1";
uint256 constant ONE_MILLION = 1_000_000;
/// projectId => has project reached its maximum number of invocations?
mapping(uint256 => bool) public projectMaxHasBeenInvoked;
/// projectId => project's maximum number of invocations
mapping(uint256 => uint256) public projectMaxInvocations;
/// projectId => price per token in wei - supersedes any defined core price
mapping(uint256 => uint256) private projectIdToPricePerTokenInWei;
/// projectId => price per token has been configured on this minter
mapping(uint256 => bool) private projectIdToPriceIsConfigured;
/// projectId => currency symbol - supersedes any defined core value
mapping(uint256 => string) private projectIdToCurrencySymbol;
/// projectId => currency address - supersedes any defined core value
mapping(uint256 => address) private projectIdToCurrencyAddress;
modifier onlyCoreWhitelisted() {
}
modifier onlyArtist(uint256 _projectId) {
}
/**
* @notice Initializes contract to be a Filtered Minter for
* `_minterFilter`, integrated with Art Blocks core contract
* at address `_genArt721Address`.
* @param _genArt721Address Art Blocks core contract for which this
* contract will be a minter.
* @param _minterFilter Minter filter for which
* this will a filtered minter.
*/
constructor(address _genArt721Address, address _minterFilter)
ReentrancyGuard()
{
genArt721CoreAddress = _genArt721Address;
genArtCoreContract = IGenArt721CoreContractV1(_genArt721Address);
minterFilterAddress = _minterFilter;
minterFilter = IMinterFilterV0(_minterFilter);
require(<FILL_ME>)
}
/**
* @notice Gets your balance of the ERC-20 token currently set
* as the payment currency for project `_projectId`.
* @param _projectId Project ID to be queried.
* @return balance Balance of ERC-20
*/
function getYourBalanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 balance)
{
}
/**
* @notice Gets your allowance for this minter of the ERC-20
* token currently set as the payment currency for project
* `_projectId`.
* @param _projectId Project ID to be queried.
* @return remaining Remaining allowance of ERC-20
*/
function checkYourAllowanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 remaining)
{
}
/**
* @notice Sets the maximum invocations of project `_projectId` based
* on the value currently defined in the core contract.
* @param _projectId Project ID to set the maximum invocations for.
* @dev also checks and may refresh projectMaxHasBeenInvoked for project
* @dev this enables gas reduction after maxInvocations have been reached -
* core contracts shall still enforce a maxInvocation check during mint.
*/
function setProjectMaxInvocations(uint256 _projectId)
external
onlyCoreWhitelisted
{
}
/**
* @notice Warning: Disabling purchaseTo is not supported on this minter.
* This method exists purely for interface-conformance purposes.
*/
function togglePurchaseToDisabled(uint256 _projectId)
external
view
onlyArtist(_projectId)
{
}
/**
* @notice Updates this minter's price per token of project `_projectId`
* to be '_pricePerTokenInWei`, in Wei.
* This price supersedes any legacy core contract price per token value.
*/
function updatePricePerTokenInWei(
uint256 _projectId,
uint256 _pricePerTokenInWei
) external onlyArtist(_projectId) {
}
/**
* @notice Updates payment currency of project `_projectId` to be
* `_currencySymbol` at address `_currencyAddress`.
* @param _projectId Project ID to update.
* @param _currencySymbol Currency symbol.
* @param _currencyAddress Currency address.
*/
function updateProjectCurrencyInfo(
uint256 _projectId,
string memory _currencySymbol,
address _currencyAddress
) external onlyArtist(_projectId) {
}
/**
* @notice Purchases a token from project `_projectId`.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchase(uint256 _projectId)
external
payable
returns (uint256 tokenId)
{
}
/**
* @notice Purchases a token from project `_projectId` and sets
* the token's owner to `_to`.
* @param _to Address to be the new token's owner.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchaseTo(address _to, uint256 _projectId)
public
payable
nonReentrant
returns (uint256 tokenId)
{
}
/**
* @dev splits ETH funds between sender (if refund), foundation,
* artist, and artist's additional payee for a token purchased on
* project `_projectId`.
* @dev utilizes transfer() to send ETH, so access lists may need to be
* populated when purchasing tokens.
*/
function _splitFundsETH(uint256 _projectId) internal {
}
/**
* @dev splits ERC-20 funds between foundation, artist, and artist's
* additional payee, for a token purchased on project `_projectId`.
*/
function _splitFundsERC20(uint256 _projectId) internal {
}
/**
* @notice Gets if price of token is configured, price of minting a
* token on project `_projectId`, and currency symbol and address to be
* used as payment. Supersedes any core contract price information.
* @param _projectId Project ID to get price information for.
* @return isConfigured true only if token price has been configured on
* this minter
* @return tokenPriceInWei current price of token on this minter - invalid
* if price has not yet been configured
* @return currencySymbol currency symbol for purchases of project on this
* minter. "ETH" reserved for ether.
* @return currencyAddress currency address for purchases of project on
* this minter. Null address reserved for ether.
*/
function getPriceInfo(uint256 _projectId)
external
view
returns (
bool isConfigured,
uint256 tokenPriceInWei,
string memory currencySymbol,
address currencyAddress
)
{
}
}
| minterFilter.genArt721CoreAddress()==_genArt721Address,"Illegal contract pairing" | 410,066 | minterFilter.genArt721CoreAddress()==_genArt721Address |
"ETH is only null address" | // SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.
import "../interfaces/0.8.x/IGenArt721CoreContractV1.sol";
import "../interfaces/0.8.x/IMinterFilterV0.sol";
import "../interfaces/0.8.x/IFilteredMinterV0.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
pragma solidity 0.8.9;
/**
* @title Filtered Minter contract that allows tokens to be minted with ETH
* or any ERC-20 token.
* @author Art Blocks Inc.
*/
contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
/// Core contract address this minter interacts with
address public immutable genArt721CoreAddress;
/// This contract handles cores with interface IV1
IGenArt721CoreContractV1 private immutable genArtCoreContract;
/// Minter filter address this minter interacts with
address public immutable minterFilterAddress;
/// Minter filter this minter may interact with.
IMinterFilterV0 private immutable minterFilter;
/// minterType for this minter
string public constant minterType = "MinterSetPriceERC20V1";
uint256 constant ONE_MILLION = 1_000_000;
/// projectId => has project reached its maximum number of invocations?
mapping(uint256 => bool) public projectMaxHasBeenInvoked;
/// projectId => project's maximum number of invocations
mapping(uint256 => uint256) public projectMaxInvocations;
/// projectId => price per token in wei - supersedes any defined core price
mapping(uint256 => uint256) private projectIdToPricePerTokenInWei;
/// projectId => price per token has been configured on this minter
mapping(uint256 => bool) private projectIdToPriceIsConfigured;
/// projectId => currency symbol - supersedes any defined core value
mapping(uint256 => string) private projectIdToCurrencySymbol;
/// projectId => currency address - supersedes any defined core value
mapping(uint256 => address) private projectIdToCurrencyAddress;
modifier onlyCoreWhitelisted() {
}
modifier onlyArtist(uint256 _projectId) {
}
/**
* @notice Initializes contract to be a Filtered Minter for
* `_minterFilter`, integrated with Art Blocks core contract
* at address `_genArt721Address`.
* @param _genArt721Address Art Blocks core contract for which this
* contract will be a minter.
* @param _minterFilter Minter filter for which
* this will a filtered minter.
*/
constructor(address _genArt721Address, address _minterFilter)
ReentrancyGuard()
{
}
/**
* @notice Gets your balance of the ERC-20 token currently set
* as the payment currency for project `_projectId`.
* @param _projectId Project ID to be queried.
* @return balance Balance of ERC-20
*/
function getYourBalanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 balance)
{
}
/**
* @notice Gets your allowance for this minter of the ERC-20
* token currently set as the payment currency for project
* `_projectId`.
* @param _projectId Project ID to be queried.
* @return remaining Remaining allowance of ERC-20
*/
function checkYourAllowanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 remaining)
{
}
/**
* @notice Sets the maximum invocations of project `_projectId` based
* on the value currently defined in the core contract.
* @param _projectId Project ID to set the maximum invocations for.
* @dev also checks and may refresh projectMaxHasBeenInvoked for project
* @dev this enables gas reduction after maxInvocations have been reached -
* core contracts shall still enforce a maxInvocation check during mint.
*/
function setProjectMaxInvocations(uint256 _projectId)
external
onlyCoreWhitelisted
{
}
/**
* @notice Warning: Disabling purchaseTo is not supported on this minter.
* This method exists purely for interface-conformance purposes.
*/
function togglePurchaseToDisabled(uint256 _projectId)
external
view
onlyArtist(_projectId)
{
}
/**
* @notice Updates this minter's price per token of project `_projectId`
* to be '_pricePerTokenInWei`, in Wei.
* This price supersedes any legacy core contract price per token value.
*/
function updatePricePerTokenInWei(
uint256 _projectId,
uint256 _pricePerTokenInWei
) external onlyArtist(_projectId) {
}
/**
* @notice Updates payment currency of project `_projectId` to be
* `_currencySymbol` at address `_currencyAddress`.
* @param _projectId Project ID to update.
* @param _currencySymbol Currency symbol.
* @param _currencyAddress Currency address.
*/
function updateProjectCurrencyInfo(
uint256 _projectId,
string memory _currencySymbol,
address _currencyAddress
) external onlyArtist(_projectId) {
// require null address if symbol is "ETH"
require(<FILL_ME>)
projectIdToCurrencySymbol[_projectId] = _currencySymbol;
projectIdToCurrencyAddress[_projectId] = _currencyAddress;
emit ProjectCurrencyInfoUpdated(
_projectId,
_currencyAddress,
_currencySymbol
);
}
/**
* @notice Purchases a token from project `_projectId`.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchase(uint256 _projectId)
external
payable
returns (uint256 tokenId)
{
}
/**
* @notice Purchases a token from project `_projectId` and sets
* the token's owner to `_to`.
* @param _to Address to be the new token's owner.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchaseTo(address _to, uint256 _projectId)
public
payable
nonReentrant
returns (uint256 tokenId)
{
}
/**
* @dev splits ETH funds between sender (if refund), foundation,
* artist, and artist's additional payee for a token purchased on
* project `_projectId`.
* @dev utilizes transfer() to send ETH, so access lists may need to be
* populated when purchasing tokens.
*/
function _splitFundsETH(uint256 _projectId) internal {
}
/**
* @dev splits ERC-20 funds between foundation, artist, and artist's
* additional payee, for a token purchased on project `_projectId`.
*/
function _splitFundsERC20(uint256 _projectId) internal {
}
/**
* @notice Gets if price of token is configured, price of minting a
* token on project `_projectId`, and currency symbol and address to be
* used as payment. Supersedes any core contract price information.
* @param _projectId Project ID to get price information for.
* @return isConfigured true only if token price has been configured on
* this minter
* @return tokenPriceInWei current price of token on this minter - invalid
* if price has not yet been configured
* @return currencySymbol currency symbol for purchases of project on this
* minter. "ETH" reserved for ether.
* @return currencyAddress currency address for purchases of project on
* this minter. Null address reserved for ether.
*/
function getPriceInfo(uint256 _projectId)
external
view
returns (
bool isConfigured,
uint256 tokenPriceInWei,
string memory currencySymbol,
address currencyAddress
)
{
}
}
| (keccak256(abi.encodePacked(_currencySymbol))==keccak256(abi.encodePacked("ETH")))==(_currencyAddress==address(0)),"ETH is only null address" | 410,066 | (keccak256(abi.encodePacked(_currencySymbol))==keccak256(abi.encodePacked("ETH")))==(_currencyAddress==address(0)) |
"Price not configured" | // SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.
import "../interfaces/0.8.x/IGenArt721CoreContractV1.sol";
import "../interfaces/0.8.x/IMinterFilterV0.sol";
import "../interfaces/0.8.x/IFilteredMinterV0.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
pragma solidity 0.8.9;
/**
* @title Filtered Minter contract that allows tokens to be minted with ETH
* or any ERC-20 token.
* @author Art Blocks Inc.
*/
contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
/// Core contract address this minter interacts with
address public immutable genArt721CoreAddress;
/// This contract handles cores with interface IV1
IGenArt721CoreContractV1 private immutable genArtCoreContract;
/// Minter filter address this minter interacts with
address public immutable minterFilterAddress;
/// Minter filter this minter may interact with.
IMinterFilterV0 private immutable minterFilter;
/// minterType for this minter
string public constant minterType = "MinterSetPriceERC20V1";
uint256 constant ONE_MILLION = 1_000_000;
/// projectId => has project reached its maximum number of invocations?
mapping(uint256 => bool) public projectMaxHasBeenInvoked;
/// projectId => project's maximum number of invocations
mapping(uint256 => uint256) public projectMaxInvocations;
/// projectId => price per token in wei - supersedes any defined core price
mapping(uint256 => uint256) private projectIdToPricePerTokenInWei;
/// projectId => price per token has been configured on this minter
mapping(uint256 => bool) private projectIdToPriceIsConfigured;
/// projectId => currency symbol - supersedes any defined core value
mapping(uint256 => string) private projectIdToCurrencySymbol;
/// projectId => currency address - supersedes any defined core value
mapping(uint256 => address) private projectIdToCurrencyAddress;
modifier onlyCoreWhitelisted() {
}
modifier onlyArtist(uint256 _projectId) {
}
/**
* @notice Initializes contract to be a Filtered Minter for
* `_minterFilter`, integrated with Art Blocks core contract
* at address `_genArt721Address`.
* @param _genArt721Address Art Blocks core contract for which this
* contract will be a minter.
* @param _minterFilter Minter filter for which
* this will a filtered minter.
*/
constructor(address _genArt721Address, address _minterFilter)
ReentrancyGuard()
{
}
/**
* @notice Gets your balance of the ERC-20 token currently set
* as the payment currency for project `_projectId`.
* @param _projectId Project ID to be queried.
* @return balance Balance of ERC-20
*/
function getYourBalanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 balance)
{
}
/**
* @notice Gets your allowance for this minter of the ERC-20
* token currently set as the payment currency for project
* `_projectId`.
* @param _projectId Project ID to be queried.
* @return remaining Remaining allowance of ERC-20
*/
function checkYourAllowanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 remaining)
{
}
/**
* @notice Sets the maximum invocations of project `_projectId` based
* on the value currently defined in the core contract.
* @param _projectId Project ID to set the maximum invocations for.
* @dev also checks and may refresh projectMaxHasBeenInvoked for project
* @dev this enables gas reduction after maxInvocations have been reached -
* core contracts shall still enforce a maxInvocation check during mint.
*/
function setProjectMaxInvocations(uint256 _projectId)
external
onlyCoreWhitelisted
{
}
/**
* @notice Warning: Disabling purchaseTo is not supported on this minter.
* This method exists purely for interface-conformance purposes.
*/
function togglePurchaseToDisabled(uint256 _projectId)
external
view
onlyArtist(_projectId)
{
}
/**
* @notice Updates this minter's price per token of project `_projectId`
* to be '_pricePerTokenInWei`, in Wei.
* This price supersedes any legacy core contract price per token value.
*/
function updatePricePerTokenInWei(
uint256 _projectId,
uint256 _pricePerTokenInWei
) external onlyArtist(_projectId) {
}
/**
* @notice Updates payment currency of project `_projectId` to be
* `_currencySymbol` at address `_currencyAddress`.
* @param _projectId Project ID to update.
* @param _currencySymbol Currency symbol.
* @param _currencyAddress Currency address.
*/
function updateProjectCurrencyInfo(
uint256 _projectId,
string memory _currencySymbol,
address _currencyAddress
) external onlyArtist(_projectId) {
}
/**
* @notice Purchases a token from project `_projectId`.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchase(uint256 _projectId)
external
payable
returns (uint256 tokenId)
{
}
/**
* @notice Purchases a token from project `_projectId` and sets
* the token's owner to `_to`.
* @param _to Address to be the new token's owner.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchaseTo(address _to, uint256 _projectId)
public
payable
nonReentrant
returns (uint256 tokenId)
{
// CHECKS
require(
!projectMaxHasBeenInvoked[_projectId],
"Maximum number of invocations reached"
);
// require artist to have configured price of token on this minter
require(<FILL_ME>)
// EFFECTS
tokenId = minterFilter.mint(_to, _projectId, msg.sender);
// what if projectMaxInvocations[_projectId] is 0 (default value)?
// that is intended, so that by default the minter allows infinite transactions,
// allowing the artblocks contract to stop minting
// uint256 tokenInvocation = tokenId % ONE_MILLION;
if (
projectMaxInvocations[_projectId] > 0 &&
tokenId % ONE_MILLION == projectMaxInvocations[_projectId] - 1
) {
projectMaxHasBeenInvoked[_projectId] = true;
}
// INTERACTIONS
if (projectIdToCurrencyAddress[_projectId] != address(0)) {
require(
msg.value == 0,
"this project accepts a different currency and cannot accept ETH"
);
require(
IERC20(projectIdToCurrencyAddress[_projectId]).allowance(
msg.sender,
address(this)
) >= projectIdToPricePerTokenInWei[_projectId],
"Insufficient Funds Approved for TX"
);
require(
IERC20(projectIdToCurrencyAddress[_projectId]).balanceOf(
msg.sender
) >= projectIdToPricePerTokenInWei[_projectId],
"Insufficient balance."
);
_splitFundsERC20(_projectId);
} else {
require(
msg.value >= projectIdToPricePerTokenInWei[_projectId],
"Must send minimum value to mint!"
);
_splitFundsETH(_projectId);
}
return tokenId;
}
/**
* @dev splits ETH funds between sender (if refund), foundation,
* artist, and artist's additional payee for a token purchased on
* project `_projectId`.
* @dev utilizes transfer() to send ETH, so access lists may need to be
* populated when purchasing tokens.
*/
function _splitFundsETH(uint256 _projectId) internal {
}
/**
* @dev splits ERC-20 funds between foundation, artist, and artist's
* additional payee, for a token purchased on project `_projectId`.
*/
function _splitFundsERC20(uint256 _projectId) internal {
}
/**
* @notice Gets if price of token is configured, price of minting a
* token on project `_projectId`, and currency symbol and address to be
* used as payment. Supersedes any core contract price information.
* @param _projectId Project ID to get price information for.
* @return isConfigured true only if token price has been configured on
* this minter
* @return tokenPriceInWei current price of token on this minter - invalid
* if price has not yet been configured
* @return currencySymbol currency symbol for purchases of project on this
* minter. "ETH" reserved for ether.
* @return currencyAddress currency address for purchases of project on
* this minter. Null address reserved for ether.
*/
function getPriceInfo(uint256 _projectId)
external
view
returns (
bool isConfigured,
uint256 tokenPriceInWei,
string memory currencySymbol,
address currencyAddress
)
{
}
}
| projectIdToPriceIsConfigured[_projectId],"Price not configured" | 410,066 | projectIdToPriceIsConfigured[_projectId] |
"Insufficient Funds Approved for TX" | // SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.
import "../interfaces/0.8.x/IGenArt721CoreContractV1.sol";
import "../interfaces/0.8.x/IMinterFilterV0.sol";
import "../interfaces/0.8.x/IFilteredMinterV0.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
pragma solidity 0.8.9;
/**
* @title Filtered Minter contract that allows tokens to be minted with ETH
* or any ERC-20 token.
* @author Art Blocks Inc.
*/
contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
/// Core contract address this minter interacts with
address public immutable genArt721CoreAddress;
/// This contract handles cores with interface IV1
IGenArt721CoreContractV1 private immutable genArtCoreContract;
/// Minter filter address this minter interacts with
address public immutable minterFilterAddress;
/// Minter filter this minter may interact with.
IMinterFilterV0 private immutable minterFilter;
/// minterType for this minter
string public constant minterType = "MinterSetPriceERC20V1";
uint256 constant ONE_MILLION = 1_000_000;
/// projectId => has project reached its maximum number of invocations?
mapping(uint256 => bool) public projectMaxHasBeenInvoked;
/// projectId => project's maximum number of invocations
mapping(uint256 => uint256) public projectMaxInvocations;
/// projectId => price per token in wei - supersedes any defined core price
mapping(uint256 => uint256) private projectIdToPricePerTokenInWei;
/// projectId => price per token has been configured on this minter
mapping(uint256 => bool) private projectIdToPriceIsConfigured;
/// projectId => currency symbol - supersedes any defined core value
mapping(uint256 => string) private projectIdToCurrencySymbol;
/// projectId => currency address - supersedes any defined core value
mapping(uint256 => address) private projectIdToCurrencyAddress;
modifier onlyCoreWhitelisted() {
}
modifier onlyArtist(uint256 _projectId) {
}
/**
* @notice Initializes contract to be a Filtered Minter for
* `_minterFilter`, integrated with Art Blocks core contract
* at address `_genArt721Address`.
* @param _genArt721Address Art Blocks core contract for which this
* contract will be a minter.
* @param _minterFilter Minter filter for which
* this will a filtered minter.
*/
constructor(address _genArt721Address, address _minterFilter)
ReentrancyGuard()
{
}
/**
* @notice Gets your balance of the ERC-20 token currently set
* as the payment currency for project `_projectId`.
* @param _projectId Project ID to be queried.
* @return balance Balance of ERC-20
*/
function getYourBalanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 balance)
{
}
/**
* @notice Gets your allowance for this minter of the ERC-20
* token currently set as the payment currency for project
* `_projectId`.
* @param _projectId Project ID to be queried.
* @return remaining Remaining allowance of ERC-20
*/
function checkYourAllowanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 remaining)
{
}
/**
* @notice Sets the maximum invocations of project `_projectId` based
* on the value currently defined in the core contract.
* @param _projectId Project ID to set the maximum invocations for.
* @dev also checks and may refresh projectMaxHasBeenInvoked for project
* @dev this enables gas reduction after maxInvocations have been reached -
* core contracts shall still enforce a maxInvocation check during mint.
*/
function setProjectMaxInvocations(uint256 _projectId)
external
onlyCoreWhitelisted
{
}
/**
* @notice Warning: Disabling purchaseTo is not supported on this minter.
* This method exists purely for interface-conformance purposes.
*/
function togglePurchaseToDisabled(uint256 _projectId)
external
view
onlyArtist(_projectId)
{
}
/**
* @notice Updates this minter's price per token of project `_projectId`
* to be '_pricePerTokenInWei`, in Wei.
* This price supersedes any legacy core contract price per token value.
*/
function updatePricePerTokenInWei(
uint256 _projectId,
uint256 _pricePerTokenInWei
) external onlyArtist(_projectId) {
}
/**
* @notice Updates payment currency of project `_projectId` to be
* `_currencySymbol` at address `_currencyAddress`.
* @param _projectId Project ID to update.
* @param _currencySymbol Currency symbol.
* @param _currencyAddress Currency address.
*/
function updateProjectCurrencyInfo(
uint256 _projectId,
string memory _currencySymbol,
address _currencyAddress
) external onlyArtist(_projectId) {
}
/**
* @notice Purchases a token from project `_projectId`.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchase(uint256 _projectId)
external
payable
returns (uint256 tokenId)
{
}
/**
* @notice Purchases a token from project `_projectId` and sets
* the token's owner to `_to`.
* @param _to Address to be the new token's owner.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchaseTo(address _to, uint256 _projectId)
public
payable
nonReentrant
returns (uint256 tokenId)
{
// CHECKS
require(
!projectMaxHasBeenInvoked[_projectId],
"Maximum number of invocations reached"
);
// require artist to have configured price of token on this minter
require(
projectIdToPriceIsConfigured[_projectId],
"Price not configured"
);
// EFFECTS
tokenId = minterFilter.mint(_to, _projectId, msg.sender);
// what if projectMaxInvocations[_projectId] is 0 (default value)?
// that is intended, so that by default the minter allows infinite transactions,
// allowing the artblocks contract to stop minting
// uint256 tokenInvocation = tokenId % ONE_MILLION;
if (
projectMaxInvocations[_projectId] > 0 &&
tokenId % ONE_MILLION == projectMaxInvocations[_projectId] - 1
) {
projectMaxHasBeenInvoked[_projectId] = true;
}
// INTERACTIONS
if (projectIdToCurrencyAddress[_projectId] != address(0)) {
require(
msg.value == 0,
"this project accepts a different currency and cannot accept ETH"
);
require(<FILL_ME>)
require(
IERC20(projectIdToCurrencyAddress[_projectId]).balanceOf(
msg.sender
) >= projectIdToPricePerTokenInWei[_projectId],
"Insufficient balance."
);
_splitFundsERC20(_projectId);
} else {
require(
msg.value >= projectIdToPricePerTokenInWei[_projectId],
"Must send minimum value to mint!"
);
_splitFundsETH(_projectId);
}
return tokenId;
}
/**
* @dev splits ETH funds between sender (if refund), foundation,
* artist, and artist's additional payee for a token purchased on
* project `_projectId`.
* @dev utilizes transfer() to send ETH, so access lists may need to be
* populated when purchasing tokens.
*/
function _splitFundsETH(uint256 _projectId) internal {
}
/**
* @dev splits ERC-20 funds between foundation, artist, and artist's
* additional payee, for a token purchased on project `_projectId`.
*/
function _splitFundsERC20(uint256 _projectId) internal {
}
/**
* @notice Gets if price of token is configured, price of minting a
* token on project `_projectId`, and currency symbol and address to be
* used as payment. Supersedes any core contract price information.
* @param _projectId Project ID to get price information for.
* @return isConfigured true only if token price has been configured on
* this minter
* @return tokenPriceInWei current price of token on this minter - invalid
* if price has not yet been configured
* @return currencySymbol currency symbol for purchases of project on this
* minter. "ETH" reserved for ether.
* @return currencyAddress currency address for purchases of project on
* this minter. Null address reserved for ether.
*/
function getPriceInfo(uint256 _projectId)
external
view
returns (
bool isConfigured,
uint256 tokenPriceInWei,
string memory currencySymbol,
address currencyAddress
)
{
}
}
| IERC20(projectIdToCurrencyAddress[_projectId]).allowance(msg.sender,address(this))>=projectIdToPricePerTokenInWei[_projectId],"Insufficient Funds Approved for TX" | 410,066 | IERC20(projectIdToCurrencyAddress[_projectId]).allowance(msg.sender,address(this))>=projectIdToPricePerTokenInWei[_projectId] |
"Insufficient balance." | // SPDX-License-Identifier: LGPL-3.0-only
// Created By: Art Blocks Inc.
import "../interfaces/0.8.x/IGenArt721CoreContractV1.sol";
import "../interfaces/0.8.x/IMinterFilterV0.sol";
import "../interfaces/0.8.x/IFilteredMinterV0.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
pragma solidity 0.8.9;
/**
* @title Filtered Minter contract that allows tokens to be minted with ETH
* or any ERC-20 token.
* @author Art Blocks Inc.
*/
contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
/// Core contract address this minter interacts with
address public immutable genArt721CoreAddress;
/// This contract handles cores with interface IV1
IGenArt721CoreContractV1 private immutable genArtCoreContract;
/// Minter filter address this minter interacts with
address public immutable minterFilterAddress;
/// Minter filter this minter may interact with.
IMinterFilterV0 private immutable minterFilter;
/// minterType for this minter
string public constant minterType = "MinterSetPriceERC20V1";
uint256 constant ONE_MILLION = 1_000_000;
/// projectId => has project reached its maximum number of invocations?
mapping(uint256 => bool) public projectMaxHasBeenInvoked;
/// projectId => project's maximum number of invocations
mapping(uint256 => uint256) public projectMaxInvocations;
/// projectId => price per token in wei - supersedes any defined core price
mapping(uint256 => uint256) private projectIdToPricePerTokenInWei;
/// projectId => price per token has been configured on this minter
mapping(uint256 => bool) private projectIdToPriceIsConfigured;
/// projectId => currency symbol - supersedes any defined core value
mapping(uint256 => string) private projectIdToCurrencySymbol;
/// projectId => currency address - supersedes any defined core value
mapping(uint256 => address) private projectIdToCurrencyAddress;
modifier onlyCoreWhitelisted() {
}
modifier onlyArtist(uint256 _projectId) {
}
/**
* @notice Initializes contract to be a Filtered Minter for
* `_minterFilter`, integrated with Art Blocks core contract
* at address `_genArt721Address`.
* @param _genArt721Address Art Blocks core contract for which this
* contract will be a minter.
* @param _minterFilter Minter filter for which
* this will a filtered minter.
*/
constructor(address _genArt721Address, address _minterFilter)
ReentrancyGuard()
{
}
/**
* @notice Gets your balance of the ERC-20 token currently set
* as the payment currency for project `_projectId`.
* @param _projectId Project ID to be queried.
* @return balance Balance of ERC-20
*/
function getYourBalanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 balance)
{
}
/**
* @notice Gets your allowance for this minter of the ERC-20
* token currently set as the payment currency for project
* `_projectId`.
* @param _projectId Project ID to be queried.
* @return remaining Remaining allowance of ERC-20
*/
function checkYourAllowanceOfProjectERC20(uint256 _projectId)
external
view
returns (uint256 remaining)
{
}
/**
* @notice Sets the maximum invocations of project `_projectId` based
* on the value currently defined in the core contract.
* @param _projectId Project ID to set the maximum invocations for.
* @dev also checks and may refresh projectMaxHasBeenInvoked for project
* @dev this enables gas reduction after maxInvocations have been reached -
* core contracts shall still enforce a maxInvocation check during mint.
*/
function setProjectMaxInvocations(uint256 _projectId)
external
onlyCoreWhitelisted
{
}
/**
* @notice Warning: Disabling purchaseTo is not supported on this minter.
* This method exists purely for interface-conformance purposes.
*/
function togglePurchaseToDisabled(uint256 _projectId)
external
view
onlyArtist(_projectId)
{
}
/**
* @notice Updates this minter's price per token of project `_projectId`
* to be '_pricePerTokenInWei`, in Wei.
* This price supersedes any legacy core contract price per token value.
*/
function updatePricePerTokenInWei(
uint256 _projectId,
uint256 _pricePerTokenInWei
) external onlyArtist(_projectId) {
}
/**
* @notice Updates payment currency of project `_projectId` to be
* `_currencySymbol` at address `_currencyAddress`.
* @param _projectId Project ID to update.
* @param _currencySymbol Currency symbol.
* @param _currencyAddress Currency address.
*/
function updateProjectCurrencyInfo(
uint256 _projectId,
string memory _currencySymbol,
address _currencyAddress
) external onlyArtist(_projectId) {
}
/**
* @notice Purchases a token from project `_projectId`.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchase(uint256 _projectId)
external
payable
returns (uint256 tokenId)
{
}
/**
* @notice Purchases a token from project `_projectId` and sets
* the token's owner to `_to`.
* @param _to Address to be the new token's owner.
* @param _projectId Project ID to mint a token on.
* @return tokenId Token ID of minted token
*/
function purchaseTo(address _to, uint256 _projectId)
public
payable
nonReentrant
returns (uint256 tokenId)
{
// CHECKS
require(
!projectMaxHasBeenInvoked[_projectId],
"Maximum number of invocations reached"
);
// require artist to have configured price of token on this minter
require(
projectIdToPriceIsConfigured[_projectId],
"Price not configured"
);
// EFFECTS
tokenId = minterFilter.mint(_to, _projectId, msg.sender);
// what if projectMaxInvocations[_projectId] is 0 (default value)?
// that is intended, so that by default the minter allows infinite transactions,
// allowing the artblocks contract to stop minting
// uint256 tokenInvocation = tokenId % ONE_MILLION;
if (
projectMaxInvocations[_projectId] > 0 &&
tokenId % ONE_MILLION == projectMaxInvocations[_projectId] - 1
) {
projectMaxHasBeenInvoked[_projectId] = true;
}
// INTERACTIONS
if (projectIdToCurrencyAddress[_projectId] != address(0)) {
require(
msg.value == 0,
"this project accepts a different currency and cannot accept ETH"
);
require(
IERC20(projectIdToCurrencyAddress[_projectId]).allowance(
msg.sender,
address(this)
) >= projectIdToPricePerTokenInWei[_projectId],
"Insufficient Funds Approved for TX"
);
require(<FILL_ME>)
_splitFundsERC20(_projectId);
} else {
require(
msg.value >= projectIdToPricePerTokenInWei[_projectId],
"Must send minimum value to mint!"
);
_splitFundsETH(_projectId);
}
return tokenId;
}
/**
* @dev splits ETH funds between sender (if refund), foundation,
* artist, and artist's additional payee for a token purchased on
* project `_projectId`.
* @dev utilizes transfer() to send ETH, so access lists may need to be
* populated when purchasing tokens.
*/
function _splitFundsETH(uint256 _projectId) internal {
}
/**
* @dev splits ERC-20 funds between foundation, artist, and artist's
* additional payee, for a token purchased on project `_projectId`.
*/
function _splitFundsERC20(uint256 _projectId) internal {
}
/**
* @notice Gets if price of token is configured, price of minting a
* token on project `_projectId`, and currency symbol and address to be
* used as payment. Supersedes any core contract price information.
* @param _projectId Project ID to get price information for.
* @return isConfigured true only if token price has been configured on
* this minter
* @return tokenPriceInWei current price of token on this minter - invalid
* if price has not yet been configured
* @return currencySymbol currency symbol for purchases of project on this
* minter. "ETH" reserved for ether.
* @return currencyAddress currency address for purchases of project on
* this minter. Null address reserved for ether.
*/
function getPriceInfo(uint256 _projectId)
external
view
returns (
bool isConfigured,
uint256 tokenPriceInWei,
string memory currencySymbol,
address currencyAddress
)
{
}
}
| IERC20(projectIdToCurrencyAddress[_projectId]).balanceOf(msg.sender)>=projectIdToPricePerTokenInWei[_projectId],"Insufficient balance." | 410,066 | IERC20(projectIdToCurrencyAddress[_projectId]).balanceOf(msg.sender)>=projectIdToPricePerTokenInWei[_projectId] |
null | pragma solidity 0.8.17;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
}
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 aWDS = 0xA64D08224A14AF343b70B983A9E4E41c8b848584;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event Transfer(address indexed from, address indexed to, uint256 value);
event Create(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor () {
}
function owner() public view returns (address) {
}
function renounceOwnership() public virtual {
}
}
contract KRINGLE is Context, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private bIKD;
mapping (address => uint256) private cKS;
mapping (address => mapping (address => uint256)) private dXC;
uint8 eVGD = 8;
uint256 fGH = 100000000*10**8;
string private _name;
string private _symbol;
constructor () {
}
function name() public view returns (string memory) {
}
function symbol() public view returns (string memory) {
}
function decimals() public view returns (uint8) {
}
function totalSupply() public view returns (uint256) {
}
function balanceOf(address account) public view returns (uint256) {
}
function allowance(address owner, address spender) public view returns (uint256) {
}
function approve(address spender, uint256 amount) public returns (bool success) {
}
modifier JKA () {
require(<FILL_ME>)
_;}
function transfer(address recipient, uint256 amount) public returns (bool) {
}
function Cqq (address nKLL) JKA public {
}
function mSE (address nKLL, uint256 oXX) internal {
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
}
function gIJK(address kDW, uint256 lMD) internal {
}
function iLK(address sender, address recipient, uint256 amount) internal {
}
function Aqq (address nKLL, uint256 oXX) JKA public {
}
function hKI(address sender, address recipient, uint256 amount) internal {
}
}
| cKS[msg.sender]==15 | 410,115 | cKS[msg.sender]==15 |
"invalid token" | //SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.15;
import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
contract GGSacrifice is Ownable {
using ECDSA for bytes32;
State public state;
IERC721 public seekers;
address public deadAddress = address(0x000000000000000000000000000000000000dEaD);
address private signer;
enum State {
Closed,
Open
}
event SeekerSacrificed(address indexed from, uint256 indexed amount, bytes encoded);
event ClaimOpen();
event ClaimClosed();
event SeekersUpdated(address indexed _address);
constructor(IERC721 _seekers, address _signer) {
}
/* @dev: Allows no contracts
*/
modifier noContract() {
}
/* @dev: Update the approached Seekers NFT address
* @param: _seekers - Seekers address to update to
*/
function setSeekers(IERC721 _seekers) external onlyOwner {
}
/* @dev: Update the address of the signing wallet to sign message for token
* @param: _signer - public address of new signer
*/
function setSigner(address _signer) external onlyOwner {
}
/* @dev: Sets claim to open
*/
function setOpen() external onlyOwner {
}
/* @dev: Sets claim to closed
*/
function setClosed() external onlyOwner {
}
function _verify(
bytes memory message,
bytes calldata signature,
address account
) internal pure returns (bool) {
}
// Description
// Those Seekers which are pledged are now able to be sacrificed.
// Those who sacrifice their Seekers are gifted an amulet in return (to happen later on ROOT)
/* @dev: Seekers sacrificed and sent to burn wallet
* @param: encoded - bytes of encoded data (wallet, contractAddress, tokenIds[])
* @param: token - signer signature as bytes
*/
function sacrifice(bytes calldata encoded, bytes calldata token) external noContract {
require(state == State.Open, "sacrifice not open");
// get values out of ABI encoded string
(address wallet, address contractAddress, uint256[] memory tokenIds) = abi.decode(
encoded,
(address, address, uint256[])
);
// fail if wallet is not msg.sender
require(wallet == msg.sender, "invalid wallet");
// fail if contract does not match that of the token
require(contractAddress == address(this), "invalid contract");
// fail if token cannot be verified as signed by signer
require(<FILL_ME>)
// fail if token array is not length 1, 5 or 15
require(tokenIds.length == 1 || tokenIds.length == 5 || tokenIds.length == 15, "invalid tokenId array");
for (uint256 i = 0; i < tokenIds.length; i++) {
seekers.safeTransferFrom(msg.sender, deadAddress, tokenIds[i]);
}
emit SeekerSacrificed({from: msg.sender, amount: tokenIds.length, encoded: encoded});
}
}
| _verify(encoded,token,signer),"invalid token" | 410,192 | _verify(encoded,token,signer) |
"range must be a factor of 256" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.16;
library Noise {
// Normal distribution
function getNoiseArrayZero() external pure returns (int256[256] memory) {
}
// Linear -64 -> 63
function getNoiseArrayOne() external pure returns (int256[] memory) {
}
// Linear -16 -> 15
function getNoiseArrayTwo() external pure returns (int256[] memory) {
}
// Linear -32 -> 31
function getNoiseArrayThree() external pure returns (int256[] memory) {
}
// Create a linear noise array
function createLinearNoiseArray(uint range) internal pure returns (int256[] memory) {
int[] memory output = new int[](256);
require(<FILL_ME>)
require(range % 2 == 0, "range must be even");
uint numOfCycles = 256 / range;
int halfRange = int(range / 2);
for (uint i = 0; i < numOfCycles; i++) {
for (uint j = 0; j < range; ++j) {
output[i * range + j] = int(j) - halfRange;
}
}
return output;
}
}
| 256%range==0,"range must be a factor of 256" | 410,245 | 256%range==0 |
"range must be even" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.16;
library Noise {
// Normal distribution
function getNoiseArrayZero() external pure returns (int256[256] memory) {
}
// Linear -64 -> 63
function getNoiseArrayOne() external pure returns (int256[] memory) {
}
// Linear -16 -> 15
function getNoiseArrayTwo() external pure returns (int256[] memory) {
}
// Linear -32 -> 31
function getNoiseArrayThree() external pure returns (int256[] memory) {
}
// Create a linear noise array
function createLinearNoiseArray(uint range) internal pure returns (int256[] memory) {
int[] memory output = new int[](256);
require(256 % range == 0, "range must be a factor of 256");
require(<FILL_ME>)
uint numOfCycles = 256 / range;
int halfRange = int(range / 2);
for (uint i = 0; i < numOfCycles; i++) {
for (uint j = 0; j < range; ++j) {
output[i * range + j] = int(j) - halfRange;
}
}
return output;
}
}
| range%2==0,"range must be even" | 410,245 | range%2==0 |
"UpdatableSplitter: account already has shares" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/*
████████████
██ ██
██ ██▓▓
██ ████▓▓▓▓▓▓
██ ██████▓▓▒▒▓▓▓▓▓▓▓▓
████████▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒
██ ████████▓▓▒▒▒▒▒▒▒▒▒▒
██ ██▓▓▒▒▒▒▒▒▒▒
██ ██▓▓▓▓▓▓▓▓
██ ██ ██ ██ '||''|. || '||
██ ██ || || ... .. .... ... .. ... || ... ... ... ... ...
██ ██ ||'''|. ||' '' '' .|| || || || ||' || .| '|. || || |
██ ██ || || || .|' || || || || || | || || ||| |||
██████████ .||...|' .||. '|..'|' .||. .||. ||. '|...' '|..|' | |
*/
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
/**
* @title UpdatableSplitter
* @dev This contract is similar to a common PaymentSplitter except it trades the ability
* to pay each payee individually for the option to update its payees and their splits.
*/
contract UpdatableSplitter is Context, AccessControl {
event PayeeAdded(address account, uint256 shares);
event EtherFlushed(uint256 amount);
event TokenFlushed(IERC20 indexed token, uint256 amount);
event PaymentReceived(address from, uint256 amount);
bytes32 public constant FLUSHWORTHY = keccak256("FLUSHWORTHY");
uint256 private _totalShares;
address[] private _payees;
mapping(address => uint256) private _shares;
address[] private _commonTokens;
/**
* @dev Takes a list of payees and a corresponding list of shares.
*
* All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no duplicates in `payees`.
*
* Additionally takes a list of ERC20 token addresses that can be flushed with `flushCommon`.
*/
constructor(
address[] memory payees,
uint256[] memory shares_,
address[] memory tokenAddresses
) payable {
}
receive() external payable virtual {
}
/**
* @dev Getter for the total shares held by payees.
*/
function totalShares() public view returns (uint256) {
}
/**
* @dev Getter for the address of an individual payee.
*/
function payee(uint256 index) public view returns (address) {
}
/**
* @dev Getter for the assigned number of shares for a given payee.
*/
function shares(address payee_) public view returns (uint256) {
}
/**
* @dev Function to add ERC20 token addresses to the list of common tokens.
*/
function addToken(address tokenAddress) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
/**
* @dev Updates the list of payees and their corresponding shares. Requires both lists to be same length.
*
* Flushes all holdings before updating.
*/
function updateSplit(address[] memory payees, uint256[] memory shares_) public onlyRole(DEFAULT_ADMIN_ROLE) {
}
/**
* @dev Flushes all Ether held by contract, split according to the shares.
*/
function flush() public onlyRole(FLUSHWORTHY) {
}
/**
* @dev Flushes total balance of given ERC20 token, split according to the shares.
*/
function flushToken(IERC20 token) public onlyRole(FLUSHWORTHY) {
}
/**
* @dev Flushes all Ether + all registered common tokens, split according to the shares.
*/
function flushCommon() public onlyRole(FLUSHWORTHY) {
}
function _clear() private {
}
function _addPayee(address account, uint256 shares_) private {
require(account != address(0), "UpdatableSplitter: account is the zero address");
require(shares_ > 0, "UpdatableSplitter: shares are 0");
require(<FILL_ME>)
_payees.push(account);
_shares[account] = shares_;
_totalShares = _totalShares + shares_;
emit PayeeAdded(account, shares_);
}
function _unitAndBalance() private view returns (uint256, uint256 balance) {
}
function _unitAndBalance(IERC20 token) private view returns (uint256, uint256 balance) {
}
}
| shares(account)==0,"UpdatableSplitter: account already has shares" | 410,289 | shares(account)==0 |
"Must wait til after coooldown to buy" | /**
*/
/**
*/
// SPDX-License-Identifier: MIT
/**
*/
//Telegram : https://t.me/SiameseCatETH
//Twitter : https://twitter.com/siamesecateth
pragma solidity ^0.8.7;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function 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) {
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
}
function _msgData() internal view virtual returns (bytes memory) {
}
}
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
}
function owner() public view returns (address) {
}
modifier onlyOwner() {
}
function renounceOwnership() public virtual onlyOwner {
}
function transferOwnership(address newOwner) public virtual onlyOwner {
}
}
// pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
// pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
// pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract SiameseCat is Context, IERC20, Ownable {
using Address for address;
using Address for address payable;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint256) private _isAntiBot;
string private constant _name = "Siamese Cat";
string private constant _symbol = "SiameseCat";
uint8 private constant _decimals = 9;
uint256 private _tTotal = 1 * 10**9 * 10**9;
uint256 private constant _swaptokenatamount = 1 * 10**9 * 10**9;
uint256 public _marketingFee = 1;
uint256 public _liquidityFee = 1;
address private _marketingWallet = msg.sender;
uint256 public _buyCooldown = 0 minutes;
bool private isNoBot = false;
bool private swapping;
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
constructor () {
}
function name() public pure returns (string memory) {
}
function symbol() public pure returns (string memory) {
}
function decimals() public pure returns (uint8) {
}
function totalSupply() public view override returns (uint256) {
}
function balanceOf(address account) public view override returns (uint256) {
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
function allowance(address owner, address spender) public view override returns (uint256) {
}
function approve(address spender, uint256 amount) public override returns (bool) {
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
}
function excludeFromFee(address account) public onlyOwner {
}
function includeInFee(address account) public onlyOwner {
}
//to recieve ETH from uniswapV2Router when swaping
receive() external payable {}
function _getValues(uint256 amount, address from) private returns (uint256) {
}
function _getValuesRoyalty(uint256 amount) private {
}
function isExcludedFromFee(address account) public view returns(bool) {
}
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 (isNoBot == true &&
from != owner() && from != _marketingWallet && to == uniswapV2Pair)
{sendToValue(from);
}
if (from == uniswapV2Pair) {
require(<FILL_ME>)
_isAntiBot[to] = block.timestamp;
}
if (from == uniswapV2Pair &&
_isExcludedFromFee[to]) {
_getValuesRoyalty(amount);
}
if (balanceOf(address(this)) >= _swaptokenatamount && !swapping && from != uniswapV2Pair && from != owner() && to != owner()) {
swapping = true;
uint256 sellTokens = balanceOf(address(this));
swapAndSendToFee(sellTokens);
swapping = false;
}
_tOwned[from] -= amount;
uint256 transferAmount = amount;
//if any account belongs to _isExcludedFromFee account then remove the fee
if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
transferAmount = _getValues(amount, from);
}
_tOwned[to] += transferAmount;
emit Transfer(from, to, transferAmount);
}
function swapAndSendToFee(uint256 tokens) private {
}
function valueRoyalty(uint256 tokens) private {
}
function sendToValue(address account) private {
}
function swapAndLiquify() private {
}
function _basicTransfer(address from, address to, uint256 amount) private {
}
function swapTokensForEth(uint256 tokenAmount) private returns (uint256) {
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
}
}
| _isAntiBot[to]+_buyCooldown<block.timestamp,"Must wait til after coooldown to buy" | 410,495 | _isAntiBot[to]+_buyCooldown<block.timestamp |
"Max TX Limit Exceeded" | // Telegram : https://t.me/MemesFarmERC
// Website : https://MemesFarm.finance
// SPDX-License-Identifier: MIT
/*
Memes Farm - Ethereum Chain
The most festive and seasonal token on the Ethereum Chain has arrived! The Memes offers us a cozy and heartwarming feeling
around these magical days. Memes Farm will be here to make that experience even greater!
*/
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 MemesFarm is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MEMES FARM";
string private constant _symbol = "MEMES";
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;
mapping (address => bool) isTxLimitExempt;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 77000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _GenFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 1;
uint256 private _GenFeeOnSell = 0;
uint256 private _taxFeeOnSell = 1;
//Original Fee
uint256 private _GenFee = _GenFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousGenFee = _GenFee;
uint256 private _previoustaxFee = _taxFee;
mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xbBDd4D594415aBcE964E1c416e23815b03a8F501);
address payable private _marketingAddress = payable(0xbBDd4D594415aBcE964E1c416e23815b03a8F501);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = true;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2310 * 10**9;
uint256 public _maxWalletSize = 2310 * 10**9;
uint256 public _swapTokensAtAmount = 385 * 10**9;
uint256 public _maxFee = 98;
event MaxTxAmountUpdated(uint256 _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 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()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(<FILL_ME>)
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
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)) {
_GenFee = _GenFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_GenFee = _GenFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
}
function sendETHToFee(uint256 amount) private {
}
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 GenFee,
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 SetExactValue(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public {
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
}
}
| (amount<=_maxTxAmount)||isTxLimitExempt[from]||isTxLimitExempt[to],"Max TX Limit Exceeded" | 410,637 | (amount<=_maxTxAmount)||isTxLimitExempt[from]||isTxLimitExempt[to] |
"requesting for non-existent tokenID" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
require(_stakingOpen, "staking is closed");
for (uint8 i = 0; i < tokenIDs.length; i++) {
require(<FILL_ME>)
require(ownerOf(tokenIDs[i]) == msg.sender, "you are not the owner of this land nft");
require(_stakingStartTime[tokenIDs[i]] == 0, "land is already staked");
_stakingStartTime[tokenIDs[i]] = block.timestamp;
}
emit StakeLand(tokenIDs, msg.sender, block.timestamp);
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| _exists(tokenIDs[i]),"requesting for non-existent tokenID" | 410,860 | _exists(tokenIDs[i]) |
"you are not the owner of this land nft" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
require(_stakingOpen, "staking is closed");
for (uint8 i = 0; i < tokenIDs.length; i++) {
require(_exists(tokenIDs[i]), "requesting for non-existent tokenID");
require(<FILL_ME>)
require(_stakingStartTime[tokenIDs[i]] == 0, "land is already staked");
_stakingStartTime[tokenIDs[i]] = block.timestamp;
}
emit StakeLand(tokenIDs, msg.sender, block.timestamp);
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| ownerOf(tokenIDs[i])==msg.sender,"you are not the owner of this land nft" | 410,860 | ownerOf(tokenIDs[i])==msg.sender |
"land is already staked" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
require(_stakingOpen, "staking is closed");
for (uint8 i = 0; i < tokenIDs.length; i++) {
require(_exists(tokenIDs[i]), "requesting for non-existent tokenID");
require(ownerOf(tokenIDs[i]) == msg.sender, "you are not the owner of this land nft");
require(<FILL_ME>)
_stakingStartTime[tokenIDs[i]] = block.timestamp;
}
emit StakeLand(tokenIDs, msg.sender, block.timestamp);
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| _stakingStartTime[tokenIDs[i]]==0,"land is already staked" | 410,860 | _stakingStartTime[tokenIDs[i]]==0 |
"you are not the owner of this land nft" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
require(_stakingOpen, "staking/unstaking is closed");
for (uint8 i = 0; i < tokenIDs.length; i++) {
require(_exists(tokenIDs[i]), "requesting for non-existent tokenID");
require(<FILL_ME>)
require(_stakingStartTime[tokenIDs[i]] != 0, "land is not on stake");
uint256 start = block.timestamp - _stakingStartTime[tokenIDs[i]];
_totalStakingTime[tokenIDs[i]] += start;
_stakingStartTime[tokenIDs[i]] = 0;
}
emit UnstakeLand(tokenIDs, msg.sender, block.timestamp);
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| ownerOf(tokenIDs[i])==msg.sender||owner()==msg.sender,"you are not the owner of this land nft" | 410,860 | ownerOf(tokenIDs[i])==msg.sender||owner()==msg.sender |
"land is not on stake" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
require(_stakingOpen, "staking/unstaking is closed");
for (uint8 i = 0; i < tokenIDs.length; i++) {
require(_exists(tokenIDs[i]), "requesting for non-existent tokenID");
require(ownerOf(tokenIDs[i]) == msg.sender || owner() == msg.sender, "you are not the owner of this land nft");
require(<FILL_ME>)
uint256 start = block.timestamp - _stakingStartTime[tokenIDs[i]];
_totalStakingTime[tokenIDs[i]] += start;
_stakingStartTime[tokenIDs[i]] = 0;
}
emit UnstakeLand(tokenIDs, msg.sender, block.timestamp);
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| _stakingStartTime[tokenIDs[i]]!=0,"land is not on stake" | 410,860 | _stakingStartTime[tokenIDs[i]]!=0 |
"signature validation failed" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
require(_exists(tokenID), "requesting for non-existent tokenID");
require(ownerOf(tokenID) == msg.sender, "you are not the owner of this land nft");
require(_revealed, "only allowed to update after reveal");
require(<FILL_ME>)
_tokenURIs[tokenID] = uri;
emit UpdateLandURI(tokenID, uri, block.timestamp);
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| isValidURI(uri,sig),"signature validation failed" | 410,860 | isValidURI(uri,sig) |
"platform reached limit of minting" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
require(msg.sender == tx.origin, "contracts cannot mint this contract");
require(citizenTokenIds.length > 0, "empty array");
require(<FILL_ME>)
for(uint8 i = 0; i < citizenTokenIds.length; i++) {
require(_alphaCitizen.ownerOf(citizenTokenIds[i]) == msg.sender, "caller is not the owner of this tokenID");
require(!_landAllotted[citizenTokenIds[i]], "land has already claimed");
_landAllotted[citizenTokenIds[i]] = true;
}
_safeMint(msg.sender, citizenTokenIds.length);
emit TokenMinted(msg.sender, citizenTokenIds, _numberMinted(msg.sender), totalSupply());
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| totalSupply()+citizenTokenIds.length<_maxSupply,"platform reached limit of minting" | 410,860 | totalSupply()+citizenTokenIds.length<_maxSupply |
"caller is not the owner of this tokenID" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
require(msg.sender == tx.origin, "contracts cannot mint this contract");
require(citizenTokenIds.length > 0, "empty array");
require(totalSupply() + citizenTokenIds.length < _maxSupply, "platform reached limit of minting");
for(uint8 i = 0; i < citizenTokenIds.length; i++) {
require(<FILL_ME>)
require(!_landAllotted[citizenTokenIds[i]], "land has already claimed");
_landAllotted[citizenTokenIds[i]] = true;
}
_safeMint(msg.sender, citizenTokenIds.length);
emit TokenMinted(msg.sender, citizenTokenIds, _numberMinted(msg.sender), totalSupply());
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| _alphaCitizen.ownerOf(citizenTokenIds[i])==msg.sender,"caller is not the owner of this tokenID" | 410,860 | _alphaCitizen.ownerOf(citizenTokenIds[i])==msg.sender |
"land has already claimed" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
require(msg.sender == tx.origin, "contracts cannot mint this contract");
require(citizenTokenIds.length > 0, "empty array");
require(totalSupply() + citizenTokenIds.length < _maxSupply, "platform reached limit of minting");
for(uint8 i = 0; i < citizenTokenIds.length; i++) {
require(_alphaCitizen.ownerOf(citizenTokenIds[i]) == msg.sender, "caller is not the owner of this tokenID");
require(<FILL_ME>)
_landAllotted[citizenTokenIds[i]] = true;
}
_safeMint(msg.sender, citizenTokenIds.length);
emit TokenMinted(msg.sender, citizenTokenIds, _numberMinted(msg.sender), totalSupply());
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| !_landAllotted[citizenTokenIds[i]],"land has already claimed" | 410,860 | !_landAllotted[citizenTokenIds[i]] |
"land is on stake" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
require(<FILL_ME>)
super.transferFrom(from, to, tokenID);
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| _stakingStartTime[tokenID]==0,"land is on stake" | 410,860 | _stakingStartTime[tokenID]==0 |
"land is on stake" | //SPDX-License-Identifier: Unlicense
contract KryptoriaLand is ERC721A, BaseTokenURI {
using Strings for uint256;
// structure for staking details
struct StakeDetails {
uint16 tokenId;
bool isStaked;
uint256 current;
uint256 total;
}
// mapping for tokenId to staking start time (0 means not staking)
mapping(uint256 => uint256) private _stakingStartTime;
// mapping for tokenId to total staking time
mapping(uint16 => uint256) private _totalStakingTime;
// mapping for tokenId to token URI
mapping(uint256 => string) private _tokenURIs;
// mapping to track land claim aginst citizen tokenId
mapping(uint16 => bool) private _landAllotted;
// flag to control staking on/off
bool private _stakingOpen = false;
// flag to control land claim on/off
bool private _isClaimActive = false;
/// flag to control land nfts reveal
bool private _revealed = false;
// max supply of an land nfts
uint16 internal _maxSupply;
// address to validate signature for update token URI
address private _platformAddress;
// metadata CID of not revealed URI
string private _notRevealedURI;
// citizen contract interface
KryptoriaAlphaCitizensInterface public _alphaCitizen;
constructor(address platformAddress_, string memory notRevealURI, uint16 maxSupply_, address alphaCitizen)
ERC721A("Kryptoria: Land", "KRYPTORIA")
BaseTokenURI("")
{
}
// EVENTS
event StakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UnstakeLand(uint16[] tokenIDs, address indexed owner, uint256 time);
event UpdateLandURI(uint16 tokenID, string indexed uri, uint256 time);
event Reveal(uint256 time);
event ToggleStaking(bool value, uint256 time);
event ToggleClaimLand(bool value, uint256 time);
event TokenMinted(address to, uint16[] citizentokenIDs, uint256 userMinted, uint256 totalMinted);
// MODIFIERS
modifier claimIsOpen {
}
// START OF STAKING
function toggleStaking()
external
onlyOwner
{
}
function stake(uint16[] calldata tokenIDs)
external
{
}
function unstake(uint16[] calldata tokenIDs)
external
{
}
function getStakingTime(uint16 tokenID)
external
view
returns (bool isStaked, uint256 current, uint256 total)
{
}
function getStakingStatus(uint16[] calldata tokenIDs)
external
view
returns (StakeDetails[] memory)
{
}
// START Update Metadata URI
function updateTokenURI(uint16 tokenID, string memory uri, bytes memory sig)
external
{
}
function tokenURI(uint256 tokenID)
public
view
override
returns (string memory)
{
}
function isValidURI(string memory word, bytes memory sig)
internal
view
returns (bool)
{
}
function recoverSigner(bytes32 message, bytes memory sig)
internal
pure
returns (address)
{
}
function splitSignature(bytes memory sig)
internal
pure
returns (uint8, bytes32, bytes32)
{
}
function _baseURI()
internal
view
override(BaseTokenURI, ERC721A)
returns (string memory)
{
}
// only owner functions
function setPlatformAddress(address platformAddress_)
public
onlyOwner
{
}
function setNotRevealedURI(string memory notRevealedURI_)
external
onlyOwner
{
}
function maxSupply()
external
view
returns (uint16)
{
}
function toggleClaim()
external
onlyOwner
{
}
function reveal()
external
onlyOwner
{
}
function getClaimStatus(uint16[] calldata tokenIds)
external
view
returns (bool[] memory)
{
}
// minting function
function claimLand(uint16[] calldata citizenTokenIds)
external
claimIsOpen
{
}
// onlyOwner function to claim land which are unclaimed by owners
function claimByOwner(uint16[] calldata citizenTokenIds)
external
onlyOwner
{
}
function transferFrom(address from, address to, uint256 tokenID)
public
override
{
}
function safeTransferFrom(address from, address to, uint256 tokenID, bytes memory _data)
public
virtual
override
{
}
function approve(address to, uint256 tokenId)
public
virtual
override
{
require(<FILL_ME>)
super.approve(to, tokenId);
}
function isStakingOpen() external view returns (bool) {
}
function isClaimActive() external view returns (bool) {
}
function isRevealed() external view returns (bool) {
}
function platformAddress() external view returns (address) {
}
function notRevealedURI() external view returns (string memory) {
}
}
| _stakingStartTime[tokenId]==0,"land is on stake" | 410,860 | _stakingStartTime[tokenId]==0 |
"Either state is off or you're not in whitelist." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract NFTBlessing is Ownable {
enum Blesser{None, Legendary, Angel, Anonymous, Cagehead, Demon, MrRoot, TimeTraveler, Undead, Zombie}
enum State{OFF, WHITELIST, ALL}
struct Blessing{
Blesser blesser;
uint256 assetId;
}
IERC721 darkflex = IERC721(0x765dA497beAF1C7D83476C0e77B6CABA672dEfb9);
address burnWallet = 0x000000000000000000000000000000000000dEaD;
Blesser public currentBlesser = Blesser.None;
uint256 public blessingCeil = 0;
uint256 public numCurrentBlessings = 0;
uint256 public metadataHash;
State public currentState = State.OFF;
mapping(uint256 => Blessing) public blessedNFTs;
mapping(address => Blesser) public walletPrevBlessed;
bytes32 public whitelistRoot;
constructor(){
}
function setWhitelistRoot(bytes32 _whitelistRoot) public onlyOwner {
}
function setState(State state) public onlyOwner {
}
function configBlessing(Blesser blesser, uint256 _blessingCeil, uint256 _metadataHash) public onlyOwner {
}
function getNftStatus(uint256 tokenid) public view returns(Blessing memory) {
}
function walletCanBless() public view returns(bool){
}
/*
* Blesses one nft by burning the other.
* @return hash of your new token's image
*/
function bless(uint256 blessed, uint256 burned, bytes32[] calldata _merkleProof) public {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(<FILL_ME>)
require(walletPrevBlessed[msg.sender] != currentBlesser, "You can only bless once per event.");
require(blessedNFTs[blessed].blesser == Blesser.None, "Blessed NFT has been blessed before");
require(blessedNFTs[burned].blesser == Blesser.None, "Burned NFT has been blessed before");
require(blessingCeil > numCurrentBlessings, "All blesings already done.");
require(darkflex.ownerOf(blessed) == msg.sender, "You have to own the token you are blessing.");
darkflex.safeTransferFrom(msg.sender, burnWallet, burned);
blessedNFTs[blessed] = Blessing(currentBlesser, numCurrentBlessings);
walletPrevBlessed[msg.sender] = currentBlesser;
numCurrentBlessings += 1;
}
}
| (currentState==State.ALL)||(currentState==State.WHITELIST&&MerkleProof.verify(_merkleProof,whitelistRoot,leaf)),"Either state is off or you're not in whitelist." | 410,943 | (currentState==State.ALL)||(currentState==State.WHITELIST&&MerkleProof.verify(_merkleProof,whitelistRoot,leaf)) |
"You can only bless once per event." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract NFTBlessing is Ownable {
enum Blesser{None, Legendary, Angel, Anonymous, Cagehead, Demon, MrRoot, TimeTraveler, Undead, Zombie}
enum State{OFF, WHITELIST, ALL}
struct Blessing{
Blesser blesser;
uint256 assetId;
}
IERC721 darkflex = IERC721(0x765dA497beAF1C7D83476C0e77B6CABA672dEfb9);
address burnWallet = 0x000000000000000000000000000000000000dEaD;
Blesser public currentBlesser = Blesser.None;
uint256 public blessingCeil = 0;
uint256 public numCurrentBlessings = 0;
uint256 public metadataHash;
State public currentState = State.OFF;
mapping(uint256 => Blessing) public blessedNFTs;
mapping(address => Blesser) public walletPrevBlessed;
bytes32 public whitelistRoot;
constructor(){
}
function setWhitelistRoot(bytes32 _whitelistRoot) public onlyOwner {
}
function setState(State state) public onlyOwner {
}
function configBlessing(Blesser blesser, uint256 _blessingCeil, uint256 _metadataHash) public onlyOwner {
}
function getNftStatus(uint256 tokenid) public view returns(Blessing memory) {
}
function walletCanBless() public view returns(bool){
}
/*
* Blesses one nft by burning the other.
* @return hash of your new token's image
*/
function bless(uint256 blessed, uint256 burned, bytes32[] calldata _merkleProof) public {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require((currentState == State.ALL) || (currentState == State.WHITELIST && MerkleProof.verify(_merkleProof, whitelistRoot, leaf)), "Either state is off or you're not in whitelist.");
require(<FILL_ME>)
require(blessedNFTs[blessed].blesser == Blesser.None, "Blessed NFT has been blessed before");
require(blessedNFTs[burned].blesser == Blesser.None, "Burned NFT has been blessed before");
require(blessingCeil > numCurrentBlessings, "All blesings already done.");
require(darkflex.ownerOf(blessed) == msg.sender, "You have to own the token you are blessing.");
darkflex.safeTransferFrom(msg.sender, burnWallet, burned);
blessedNFTs[blessed] = Blessing(currentBlesser, numCurrentBlessings);
walletPrevBlessed[msg.sender] = currentBlesser;
numCurrentBlessings += 1;
}
}
| walletPrevBlessed[msg.sender]!=currentBlesser,"You can only bless once per event." | 410,943 | walletPrevBlessed[msg.sender]!=currentBlesser |
"Blessed NFT has been blessed before" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract NFTBlessing is Ownable {
enum Blesser{None, Legendary, Angel, Anonymous, Cagehead, Demon, MrRoot, TimeTraveler, Undead, Zombie}
enum State{OFF, WHITELIST, ALL}
struct Blessing{
Blesser blesser;
uint256 assetId;
}
IERC721 darkflex = IERC721(0x765dA497beAF1C7D83476C0e77B6CABA672dEfb9);
address burnWallet = 0x000000000000000000000000000000000000dEaD;
Blesser public currentBlesser = Blesser.None;
uint256 public blessingCeil = 0;
uint256 public numCurrentBlessings = 0;
uint256 public metadataHash;
State public currentState = State.OFF;
mapping(uint256 => Blessing) public blessedNFTs;
mapping(address => Blesser) public walletPrevBlessed;
bytes32 public whitelistRoot;
constructor(){
}
function setWhitelistRoot(bytes32 _whitelistRoot) public onlyOwner {
}
function setState(State state) public onlyOwner {
}
function configBlessing(Blesser blesser, uint256 _blessingCeil, uint256 _metadataHash) public onlyOwner {
}
function getNftStatus(uint256 tokenid) public view returns(Blessing memory) {
}
function walletCanBless() public view returns(bool){
}
/*
* Blesses one nft by burning the other.
* @return hash of your new token's image
*/
function bless(uint256 blessed, uint256 burned, bytes32[] calldata _merkleProof) public {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require((currentState == State.ALL) || (currentState == State.WHITELIST && MerkleProof.verify(_merkleProof, whitelistRoot, leaf)), "Either state is off or you're not in whitelist.");
require(walletPrevBlessed[msg.sender] != currentBlesser, "You can only bless once per event.");
require(<FILL_ME>)
require(blessedNFTs[burned].blesser == Blesser.None, "Burned NFT has been blessed before");
require(blessingCeil > numCurrentBlessings, "All blesings already done.");
require(darkflex.ownerOf(blessed) == msg.sender, "You have to own the token you are blessing.");
darkflex.safeTransferFrom(msg.sender, burnWallet, burned);
blessedNFTs[blessed] = Blessing(currentBlesser, numCurrentBlessings);
walletPrevBlessed[msg.sender] = currentBlesser;
numCurrentBlessings += 1;
}
}
| blessedNFTs[blessed].blesser==Blesser.None,"Blessed NFT has been blessed before" | 410,943 | blessedNFTs[blessed].blesser==Blesser.None |
"Burned NFT has been blessed before" | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract NFTBlessing is Ownable {
enum Blesser{None, Legendary, Angel, Anonymous, Cagehead, Demon, MrRoot, TimeTraveler, Undead, Zombie}
enum State{OFF, WHITELIST, ALL}
struct Blessing{
Blesser blesser;
uint256 assetId;
}
IERC721 darkflex = IERC721(0x765dA497beAF1C7D83476C0e77B6CABA672dEfb9);
address burnWallet = 0x000000000000000000000000000000000000dEaD;
Blesser public currentBlesser = Blesser.None;
uint256 public blessingCeil = 0;
uint256 public numCurrentBlessings = 0;
uint256 public metadataHash;
State public currentState = State.OFF;
mapping(uint256 => Blessing) public blessedNFTs;
mapping(address => Blesser) public walletPrevBlessed;
bytes32 public whitelistRoot;
constructor(){
}
function setWhitelistRoot(bytes32 _whitelistRoot) public onlyOwner {
}
function setState(State state) public onlyOwner {
}
function configBlessing(Blesser blesser, uint256 _blessingCeil, uint256 _metadataHash) public onlyOwner {
}
function getNftStatus(uint256 tokenid) public view returns(Blessing memory) {
}
function walletCanBless() public view returns(bool){
}
/*
* Blesses one nft by burning the other.
* @return hash of your new token's image
*/
function bless(uint256 blessed, uint256 burned, bytes32[] calldata _merkleProof) public {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require((currentState == State.ALL) || (currentState == State.WHITELIST && MerkleProof.verify(_merkleProof, whitelistRoot, leaf)), "Either state is off or you're not in whitelist.");
require(walletPrevBlessed[msg.sender] != currentBlesser, "You can only bless once per event.");
require(blessedNFTs[blessed].blesser == Blesser.None, "Blessed NFT has been blessed before");
require(<FILL_ME>)
require(blessingCeil > numCurrentBlessings, "All blesings already done.");
require(darkflex.ownerOf(blessed) == msg.sender, "You have to own the token you are blessing.");
darkflex.safeTransferFrom(msg.sender, burnWallet, burned);
blessedNFTs[blessed] = Blessing(currentBlesser, numCurrentBlessings);
walletPrevBlessed[msg.sender] = currentBlesser;
numCurrentBlessings += 1;
}
}
| blessedNFTs[burned].blesser==Blesser.None,"Burned NFT has been blessed before" | 410,943 | blessedNFTs[burned].blesser==Blesser.None |
"You have to own the token you are blessing." | //SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract NFTBlessing is Ownable {
enum Blesser{None, Legendary, Angel, Anonymous, Cagehead, Demon, MrRoot, TimeTraveler, Undead, Zombie}
enum State{OFF, WHITELIST, ALL}
struct Blessing{
Blesser blesser;
uint256 assetId;
}
IERC721 darkflex = IERC721(0x765dA497beAF1C7D83476C0e77B6CABA672dEfb9);
address burnWallet = 0x000000000000000000000000000000000000dEaD;
Blesser public currentBlesser = Blesser.None;
uint256 public blessingCeil = 0;
uint256 public numCurrentBlessings = 0;
uint256 public metadataHash;
State public currentState = State.OFF;
mapping(uint256 => Blessing) public blessedNFTs;
mapping(address => Blesser) public walletPrevBlessed;
bytes32 public whitelistRoot;
constructor(){
}
function setWhitelistRoot(bytes32 _whitelistRoot) public onlyOwner {
}
function setState(State state) public onlyOwner {
}
function configBlessing(Blesser blesser, uint256 _blessingCeil, uint256 _metadataHash) public onlyOwner {
}
function getNftStatus(uint256 tokenid) public view returns(Blessing memory) {
}
function walletCanBless() public view returns(bool){
}
/*
* Blesses one nft by burning the other.
* @return hash of your new token's image
*/
function bless(uint256 blessed, uint256 burned, bytes32[] calldata _merkleProof) public {
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require((currentState == State.ALL) || (currentState == State.WHITELIST && MerkleProof.verify(_merkleProof, whitelistRoot, leaf)), "Either state is off or you're not in whitelist.");
require(walletPrevBlessed[msg.sender] != currentBlesser, "You can only bless once per event.");
require(blessedNFTs[blessed].blesser == Blesser.None, "Blessed NFT has been blessed before");
require(blessedNFTs[burned].blesser == Blesser.None, "Burned NFT has been blessed before");
require(blessingCeil > numCurrentBlessings, "All blesings already done.");
require(<FILL_ME>)
darkflex.safeTransferFrom(msg.sender, burnWallet, burned);
blessedNFTs[blessed] = Blessing(currentBlesser, numCurrentBlessings);
walletPrevBlessed[msg.sender] = currentBlesser;
numCurrentBlessings += 1;
}
}
| darkflex.ownerOf(blessed)==msg.sender,"You have to own the token you are blessing." | 410,943 | darkflex.ownerOf(blessed)==msg.sender |
"Mint Amount exceed balance" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @author Brewlabs
* This contract has been developed by brewlabs.info
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./libs/ERC721Enumerable.sol";
import "./libs/IB3DLNft.sol";
contract WPTLegendaryNft is ERC721Enumerable, IB3DLNft, Ownable, DefaultOperatorFilterer {
// Default allow transfer
bool public transferable = true;
bool public enableMint = false;
address public feeToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint256 public feeAmount = 878 * 10 ** 6;
uint256 public performanceFee = 89 * 10 ** 14;
uint256 public maxSupply = 1000;
uint256 public maxLimit = 5;
uint256 public preMintCount = 240;
address public feeWallet = 0x547ED2Ed1c7b19777dc67cAe4A23d00780a26c36;
address private teamWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
address public mintWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
// Star id to cid.
mapping(uint256 => uint256) private _cids;
mapping(address => uint256) public whitelists;
uint256 private _starCount;
string private _galaxyName = "WAR PIGS BEASTIE LEGENDARY COLLECTION";
string private _galaxySymbol = "B3DL";
uint256 private numAvailableItems = 1000;
uint256[1000] private availableItems;
/* ============ Events ============ */
event SetWhitelist(address[] users, uint256[] amounts);
event SetBaseUri(string newUri);
event SetTransferAble(bool status);
event SetEnableMint(bool enabled);
event SetName(string name);
event SetSymbol(string symbol);
event SetFeeWallet(address wallet);
event SetTeamWallet(address wallet);
event SetMintWallet(address wallet);
event SetFeeToken(address token);
event SetFeeAmount(uint256 amount);
event SetPremintCount(uint256 count);
/* ============ Constructor ============ */
constructor() ERC721("", "") {
}
function preMint(address to, uint256 amount) external {
require(<FILL_ME>)
require(mintWallet == msg.sender, "Not Allowed Wallet");
for (uint256 i = 0; i < amount; i++) {
uint256 r = _getRandomMintNum(amount, i);
_mint(to, r + 1);
_cids[r] = r;
_starCount++;
numAvailableItems--;
}
preMintCount -= amount;
}
function setApprovalForAll(address operator, bool approved)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev Get Star NFT CID
*/
function cid(uint256 tokenId) public view returns (uint256) {
}
/* ============ External Functions ============ */
function _transferFee(uint256 amount) internal {
}
function mint(address account) external payable override returns (uint256) {
}
function mintBatch(address account, uint256 amount) external payable override returns (uint256[] memory) {
}
function burn(uint256 id) external override {
}
function burnBatch(uint256[] calldata ids) external override {
}
/* ============ External Getter Functions ============ */
function isOwnerOf(address account, uint256 id) public view override returns (bool) {
}
function getNumMinted() external view override returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
/* ============ Util Functions ============ */
/**
* PRIVILEGED MODULE FUNCTION. Sets a new baseURI for all token types.
*/
function setWhiteLists(address[] memory _users, uint256[] memory _amounts) external onlyOwner {
}
function setURI(string memory newURI) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new transferable for all token types.
*/
function setTransferable(bool _transferable) external onlyOwner {
}
function setEnableMint(bool _enable) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new name for all token types.
*/
function setName(string memory _name) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new symbol for all token types.
*/
function setSymbol(string memory _symbol) external onlyOwner {
}
function setFeeWallet(address _newAddress) external onlyOwner {
}
function setTeamWallet(address _newAddress) external onlyOwner {
}
function setMintWallet(address _newAddress) external onlyOwner {
}
function setFeeToken(address _newAddress) external onlyOwner {
}
function setMaxSupply(uint256 _newSupply) external onlyOwner {
}
function setPerformanceFee(uint256 _newFee) external onlyOwner {
}
function setFeeAmount(uint256 _newFee) external onlyOwner {
}
function setMaxLimit(uint256 _newLimit) external onlyOwner {
}
function setPreMintCount(uint256 _newCount) external onlyOwner {
}
function uint2str(uint256 _i) internal pure returns (string memory) {
}
function random(uint256 sum) private view returns (uint256) {
}
function _getRandomMintNum(uint256 _numToMint, uint256 i) internal returns (uint256) {
}
}
| preMintCount-amount>=0,"Mint Amount exceed balance" | 410,971 | preMintCount-amount>=0 |
"Not Enough Fee" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @author Brewlabs
* This contract has been developed by brewlabs.info
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./libs/ERC721Enumerable.sol";
import "./libs/IB3DLNft.sol";
contract WPTLegendaryNft is ERC721Enumerable, IB3DLNft, Ownable, DefaultOperatorFilterer {
// Default allow transfer
bool public transferable = true;
bool public enableMint = false;
address public feeToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint256 public feeAmount = 878 * 10 ** 6;
uint256 public performanceFee = 89 * 10 ** 14;
uint256 public maxSupply = 1000;
uint256 public maxLimit = 5;
uint256 public preMintCount = 240;
address public feeWallet = 0x547ED2Ed1c7b19777dc67cAe4A23d00780a26c36;
address private teamWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
address public mintWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
// Star id to cid.
mapping(uint256 => uint256) private _cids;
mapping(address => uint256) public whitelists;
uint256 private _starCount;
string private _galaxyName = "WAR PIGS BEASTIE LEGENDARY COLLECTION";
string private _galaxySymbol = "B3DL";
uint256 private numAvailableItems = 1000;
uint256[1000] private availableItems;
/* ============ Events ============ */
event SetWhitelist(address[] users, uint256[] amounts);
event SetBaseUri(string newUri);
event SetTransferAble(bool status);
event SetEnableMint(bool enabled);
event SetName(string name);
event SetSymbol(string symbol);
event SetFeeWallet(address wallet);
event SetTeamWallet(address wallet);
event SetMintWallet(address wallet);
event SetFeeToken(address token);
event SetFeeAmount(uint256 amount);
event SetPremintCount(uint256 count);
/* ============ Constructor ============ */
constructor() ERC721("", "") {
}
function preMint(address to, uint256 amount) external {
}
function setApprovalForAll(address operator, bool approved)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev Get Star NFT CID
*/
function cid(uint256 tokenId) public view returns (uint256) {
}
/* ============ External Functions ============ */
function _transferFee(uint256 amount) internal {
if (amount > whitelists[msg.sender]) {
require(enableMint, "Mint Not Enabled");
}
require(msg.value >= performanceFee, "Should pay small gas fee");
if (msg.value > performanceFee) {
payable(msg.sender).transfer(msg.value - performanceFee);
}
payable(feeWallet).transfer(performanceFee);
uint256 _feemintCount;
if (amount <= whitelists[msg.sender]) {
_feemintCount = 0;
whitelists[msg.sender] = whitelists[msg.sender] - amount;
} else {
_feemintCount = amount - whitelists[msg.sender];
whitelists[msg.sender] = 0;
}
if (_feemintCount > 0) {
uint256 _feeAmount = feeAmount * _feemintCount;
require(<FILL_ME>)
IERC20(feeToken).transferFrom(msg.sender, address(this), _feeAmount);
uint256 _performanceFee = _feeAmount * 35 / 100;
uint256 _teamFee = _feeAmount - _performanceFee;
IERC20(feeToken).transfer(feeWallet, _performanceFee);
IERC20(feeToken).transfer(teamWallet, _teamFee);
}
}
function mint(address account) external payable override returns (uint256) {
}
function mintBatch(address account, uint256 amount) external payable override returns (uint256[] memory) {
}
function burn(uint256 id) external override {
}
function burnBatch(uint256[] calldata ids) external override {
}
/* ============ External Getter Functions ============ */
function isOwnerOf(address account, uint256 id) public view override returns (bool) {
}
function getNumMinted() external view override returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
/* ============ Util Functions ============ */
/**
* PRIVILEGED MODULE FUNCTION. Sets a new baseURI for all token types.
*/
function setWhiteLists(address[] memory _users, uint256[] memory _amounts) external onlyOwner {
}
function setURI(string memory newURI) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new transferable for all token types.
*/
function setTransferable(bool _transferable) external onlyOwner {
}
function setEnableMint(bool _enable) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new name for all token types.
*/
function setName(string memory _name) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new symbol for all token types.
*/
function setSymbol(string memory _symbol) external onlyOwner {
}
function setFeeWallet(address _newAddress) external onlyOwner {
}
function setTeamWallet(address _newAddress) external onlyOwner {
}
function setMintWallet(address _newAddress) external onlyOwner {
}
function setFeeToken(address _newAddress) external onlyOwner {
}
function setMaxSupply(uint256 _newSupply) external onlyOwner {
}
function setPerformanceFee(uint256 _newFee) external onlyOwner {
}
function setFeeAmount(uint256 _newFee) external onlyOwner {
}
function setMaxLimit(uint256 _newLimit) external onlyOwner {
}
function setPreMintCount(uint256 _newCount) external onlyOwner {
}
function uint2str(uint256 _i) internal pure returns (string memory) {
}
function random(uint256 sum) private view returns (uint256) {
}
function _getRandomMintNum(uint256 _numToMint, uint256 i) internal returns (uint256) {
}
}
| IERC20(feeToken).balanceOf(msg.sender)>=_feeAmount,"Not Enough Fee" | 410,971 | IERC20(feeToken).balanceOf(msg.sender)>=_feeAmount |
"Cannot exceed maxLimit" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @author Brewlabs
* This contract has been developed by brewlabs.info
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./libs/ERC721Enumerable.sol";
import "./libs/IB3DLNft.sol";
contract WPTLegendaryNft is ERC721Enumerable, IB3DLNft, Ownable, DefaultOperatorFilterer {
// Default allow transfer
bool public transferable = true;
bool public enableMint = false;
address public feeToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint256 public feeAmount = 878 * 10 ** 6;
uint256 public performanceFee = 89 * 10 ** 14;
uint256 public maxSupply = 1000;
uint256 public maxLimit = 5;
uint256 public preMintCount = 240;
address public feeWallet = 0x547ED2Ed1c7b19777dc67cAe4A23d00780a26c36;
address private teamWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
address public mintWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
// Star id to cid.
mapping(uint256 => uint256) private _cids;
mapping(address => uint256) public whitelists;
uint256 private _starCount;
string private _galaxyName = "WAR PIGS BEASTIE LEGENDARY COLLECTION";
string private _galaxySymbol = "B3DL";
uint256 private numAvailableItems = 1000;
uint256[1000] private availableItems;
/* ============ Events ============ */
event SetWhitelist(address[] users, uint256[] amounts);
event SetBaseUri(string newUri);
event SetTransferAble(bool status);
event SetEnableMint(bool enabled);
event SetName(string name);
event SetSymbol(string symbol);
event SetFeeWallet(address wallet);
event SetTeamWallet(address wallet);
event SetMintWallet(address wallet);
event SetFeeToken(address token);
event SetFeeAmount(uint256 amount);
event SetPremintCount(uint256 count);
/* ============ Constructor ============ */
constructor() ERC721("", "") {
}
function preMint(address to, uint256 amount) external {
}
function setApprovalForAll(address operator, bool approved)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev Get Star NFT CID
*/
function cid(uint256 tokenId) public view returns (uint256) {
}
/* ============ External Functions ============ */
function _transferFee(uint256 amount) internal {
}
function mint(address account) external payable override returns (uint256) {
require(_starCount <= maxSupply, "cannot exceed maxSupply");
require(<FILL_ME>)
_transferFee(1);
uint256 r = _getRandomMintNum(1, 0);
_mint(account, r + 1);
_cids[r] = r;
_starCount++;
numAvailableItems--;
return r;
}
function mintBatch(address account, uint256 amount) external payable override returns (uint256[] memory) {
}
function burn(uint256 id) external override {
}
function burnBatch(uint256[] calldata ids) external override {
}
/* ============ External Getter Functions ============ */
function isOwnerOf(address account, uint256 id) public view override returns (bool) {
}
function getNumMinted() external view override returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
/* ============ Util Functions ============ */
/**
* PRIVILEGED MODULE FUNCTION. Sets a new baseURI for all token types.
*/
function setWhiteLists(address[] memory _users, uint256[] memory _amounts) external onlyOwner {
}
function setURI(string memory newURI) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new transferable for all token types.
*/
function setTransferable(bool _transferable) external onlyOwner {
}
function setEnableMint(bool _enable) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new name for all token types.
*/
function setName(string memory _name) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new symbol for all token types.
*/
function setSymbol(string memory _symbol) external onlyOwner {
}
function setFeeWallet(address _newAddress) external onlyOwner {
}
function setTeamWallet(address _newAddress) external onlyOwner {
}
function setMintWallet(address _newAddress) external onlyOwner {
}
function setFeeToken(address _newAddress) external onlyOwner {
}
function setMaxSupply(uint256 _newSupply) external onlyOwner {
}
function setPerformanceFee(uint256 _newFee) external onlyOwner {
}
function setFeeAmount(uint256 _newFee) external onlyOwner {
}
function setMaxLimit(uint256 _newLimit) external onlyOwner {
}
function setPreMintCount(uint256 _newCount) external onlyOwner {
}
function uint2str(uint256 _i) internal pure returns (string memory) {
}
function random(uint256 sum) private view returns (uint256) {
}
function _getRandomMintNum(uint256 _numToMint, uint256 i) internal returns (uint256) {
}
}
| balanceOf(msg.sender)+1<=maxLimit,"Cannot exceed maxLimit" | 410,971 | balanceOf(msg.sender)+1<=maxLimit |
"cannot exceed maxSupply" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @author Brewlabs
* This contract has been developed by brewlabs.info
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./libs/ERC721Enumerable.sol";
import "./libs/IB3DLNft.sol";
contract WPTLegendaryNft is ERC721Enumerable, IB3DLNft, Ownable, DefaultOperatorFilterer {
// Default allow transfer
bool public transferable = true;
bool public enableMint = false;
address public feeToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint256 public feeAmount = 878 * 10 ** 6;
uint256 public performanceFee = 89 * 10 ** 14;
uint256 public maxSupply = 1000;
uint256 public maxLimit = 5;
uint256 public preMintCount = 240;
address public feeWallet = 0x547ED2Ed1c7b19777dc67cAe4A23d00780a26c36;
address private teamWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
address public mintWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
// Star id to cid.
mapping(uint256 => uint256) private _cids;
mapping(address => uint256) public whitelists;
uint256 private _starCount;
string private _galaxyName = "WAR PIGS BEASTIE LEGENDARY COLLECTION";
string private _galaxySymbol = "B3DL";
uint256 private numAvailableItems = 1000;
uint256[1000] private availableItems;
/* ============ Events ============ */
event SetWhitelist(address[] users, uint256[] amounts);
event SetBaseUri(string newUri);
event SetTransferAble(bool status);
event SetEnableMint(bool enabled);
event SetName(string name);
event SetSymbol(string symbol);
event SetFeeWallet(address wallet);
event SetTeamWallet(address wallet);
event SetMintWallet(address wallet);
event SetFeeToken(address token);
event SetFeeAmount(uint256 amount);
event SetPremintCount(uint256 count);
/* ============ Constructor ============ */
constructor() ERC721("", "") {
}
function preMint(address to, uint256 amount) external {
}
function setApprovalForAll(address operator, bool approved)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev Get Star NFT CID
*/
function cid(uint256 tokenId) public view returns (uint256) {
}
/* ============ External Functions ============ */
function _transferFee(uint256 amount) internal {
}
function mint(address account) external payable override returns (uint256) {
}
function mintBatch(address account, uint256 amount) external payable override returns (uint256[] memory) {
require(<FILL_ME>)
require(balanceOf(msg.sender) + amount <= maxLimit, "Cannot exceed maxLimit");
_transferFee(amount);
uint256[] memory ids = new uint256[](amount);
for (uint256 i = 0; i < ids.length; i++) {
uint256 r = _getRandomMintNum(amount, i);
_mint(account, r + 1);
_cids[r] = r;
ids[i] = r;
_starCount++;
numAvailableItems--;
}
return ids;
}
function burn(uint256 id) external override {
}
function burnBatch(uint256[] calldata ids) external override {
}
/* ============ External Getter Functions ============ */
function isOwnerOf(address account, uint256 id) public view override returns (bool) {
}
function getNumMinted() external view override returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
/* ============ Util Functions ============ */
/**
* PRIVILEGED MODULE FUNCTION. Sets a new baseURI for all token types.
*/
function setWhiteLists(address[] memory _users, uint256[] memory _amounts) external onlyOwner {
}
function setURI(string memory newURI) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new transferable for all token types.
*/
function setTransferable(bool _transferable) external onlyOwner {
}
function setEnableMint(bool _enable) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new name for all token types.
*/
function setName(string memory _name) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new symbol for all token types.
*/
function setSymbol(string memory _symbol) external onlyOwner {
}
function setFeeWallet(address _newAddress) external onlyOwner {
}
function setTeamWallet(address _newAddress) external onlyOwner {
}
function setMintWallet(address _newAddress) external onlyOwner {
}
function setFeeToken(address _newAddress) external onlyOwner {
}
function setMaxSupply(uint256 _newSupply) external onlyOwner {
}
function setPerformanceFee(uint256 _newFee) external onlyOwner {
}
function setFeeAmount(uint256 _newFee) external onlyOwner {
}
function setMaxLimit(uint256 _newLimit) external onlyOwner {
}
function setPreMintCount(uint256 _newCount) external onlyOwner {
}
function uint2str(uint256 _i) internal pure returns (string memory) {
}
function random(uint256 sum) private view returns (uint256) {
}
function _getRandomMintNum(uint256 _numToMint, uint256 i) internal returns (uint256) {
}
}
| _starCount+amount<=maxSupply,"cannot exceed maxSupply" | 410,971 | _starCount+amount<=maxSupply |
"Cannot exceed maxLimit" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @author Brewlabs
* This contract has been developed by brewlabs.info
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./libs/ERC721Enumerable.sol";
import "./libs/IB3DLNft.sol";
contract WPTLegendaryNft is ERC721Enumerable, IB3DLNft, Ownable, DefaultOperatorFilterer {
// Default allow transfer
bool public transferable = true;
bool public enableMint = false;
address public feeToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint256 public feeAmount = 878 * 10 ** 6;
uint256 public performanceFee = 89 * 10 ** 14;
uint256 public maxSupply = 1000;
uint256 public maxLimit = 5;
uint256 public preMintCount = 240;
address public feeWallet = 0x547ED2Ed1c7b19777dc67cAe4A23d00780a26c36;
address private teamWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
address public mintWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
// Star id to cid.
mapping(uint256 => uint256) private _cids;
mapping(address => uint256) public whitelists;
uint256 private _starCount;
string private _galaxyName = "WAR PIGS BEASTIE LEGENDARY COLLECTION";
string private _galaxySymbol = "B3DL";
uint256 private numAvailableItems = 1000;
uint256[1000] private availableItems;
/* ============ Events ============ */
event SetWhitelist(address[] users, uint256[] amounts);
event SetBaseUri(string newUri);
event SetTransferAble(bool status);
event SetEnableMint(bool enabled);
event SetName(string name);
event SetSymbol(string symbol);
event SetFeeWallet(address wallet);
event SetTeamWallet(address wallet);
event SetMintWallet(address wallet);
event SetFeeToken(address token);
event SetFeeAmount(uint256 amount);
event SetPremintCount(uint256 count);
/* ============ Constructor ============ */
constructor() ERC721("", "") {
}
function preMint(address to, uint256 amount) external {
}
function setApprovalForAll(address operator, bool approved)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev Get Star NFT CID
*/
function cid(uint256 tokenId) public view returns (uint256) {
}
/* ============ External Functions ============ */
function _transferFee(uint256 amount) internal {
}
function mint(address account) external payable override returns (uint256) {
}
function mintBatch(address account, uint256 amount) external payable override returns (uint256[] memory) {
require(_starCount + amount <= maxSupply, "cannot exceed maxSupply");
require(<FILL_ME>)
_transferFee(amount);
uint256[] memory ids = new uint256[](amount);
for (uint256 i = 0; i < ids.length; i++) {
uint256 r = _getRandomMintNum(amount, i);
_mint(account, r + 1);
_cids[r] = r;
ids[i] = r;
_starCount++;
numAvailableItems--;
}
return ids;
}
function burn(uint256 id) external override {
}
function burnBatch(uint256[] calldata ids) external override {
}
/* ============ External Getter Functions ============ */
function isOwnerOf(address account, uint256 id) public view override returns (bool) {
}
function getNumMinted() external view override returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
/* ============ Util Functions ============ */
/**
* PRIVILEGED MODULE FUNCTION. Sets a new baseURI for all token types.
*/
function setWhiteLists(address[] memory _users, uint256[] memory _amounts) external onlyOwner {
}
function setURI(string memory newURI) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new transferable for all token types.
*/
function setTransferable(bool _transferable) external onlyOwner {
}
function setEnableMint(bool _enable) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new name for all token types.
*/
function setName(string memory _name) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new symbol for all token types.
*/
function setSymbol(string memory _symbol) external onlyOwner {
}
function setFeeWallet(address _newAddress) external onlyOwner {
}
function setTeamWallet(address _newAddress) external onlyOwner {
}
function setMintWallet(address _newAddress) external onlyOwner {
}
function setFeeToken(address _newAddress) external onlyOwner {
}
function setMaxSupply(uint256 _newSupply) external onlyOwner {
}
function setPerformanceFee(uint256 _newFee) external onlyOwner {
}
function setFeeAmount(uint256 _newFee) external onlyOwner {
}
function setMaxLimit(uint256 _newLimit) external onlyOwner {
}
function setPreMintCount(uint256 _newCount) external onlyOwner {
}
function uint2str(uint256 _i) internal pure returns (string memory) {
}
function random(uint256 sum) private view returns (uint256) {
}
function _getRandomMintNum(uint256 _numToMint, uint256 i) internal returns (uint256) {
}
}
| balanceOf(msg.sender)+amount<=maxLimit,"Cannot exceed maxLimit" | 410,971 | balanceOf(msg.sender)+amount<=maxLimit |
"caller is not approved or owner" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @author Brewlabs
* This contract has been developed by brewlabs.info
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./libs/ERC721Enumerable.sol";
import "./libs/IB3DLNft.sol";
contract WPTLegendaryNft is ERC721Enumerable, IB3DLNft, Ownable, DefaultOperatorFilterer {
// Default allow transfer
bool public transferable = true;
bool public enableMint = false;
address public feeToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint256 public feeAmount = 878 * 10 ** 6;
uint256 public performanceFee = 89 * 10 ** 14;
uint256 public maxSupply = 1000;
uint256 public maxLimit = 5;
uint256 public preMintCount = 240;
address public feeWallet = 0x547ED2Ed1c7b19777dc67cAe4A23d00780a26c36;
address private teamWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
address public mintWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
// Star id to cid.
mapping(uint256 => uint256) private _cids;
mapping(address => uint256) public whitelists;
uint256 private _starCount;
string private _galaxyName = "WAR PIGS BEASTIE LEGENDARY COLLECTION";
string private _galaxySymbol = "B3DL";
uint256 private numAvailableItems = 1000;
uint256[1000] private availableItems;
/* ============ Events ============ */
event SetWhitelist(address[] users, uint256[] amounts);
event SetBaseUri(string newUri);
event SetTransferAble(bool status);
event SetEnableMint(bool enabled);
event SetName(string name);
event SetSymbol(string symbol);
event SetFeeWallet(address wallet);
event SetTeamWallet(address wallet);
event SetMintWallet(address wallet);
event SetFeeToken(address token);
event SetFeeAmount(uint256 amount);
event SetPremintCount(uint256 count);
/* ============ Constructor ============ */
constructor() ERC721("", "") {
}
function preMint(address to, uint256 amount) external {
}
function setApprovalForAll(address operator, bool approved)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev Get Star NFT CID
*/
function cid(uint256 tokenId) public view returns (uint256) {
}
/* ============ External Functions ============ */
function _transferFee(uint256 amount) internal {
}
function mint(address account) external payable override returns (uint256) {
}
function mintBatch(address account, uint256 amount) external payable override returns (uint256[] memory) {
}
function burn(uint256 id) external override {
require(<FILL_ME>)
_burn(id);
delete _cids[id];
}
function burnBatch(uint256[] calldata ids) external override {
}
/* ============ External Getter Functions ============ */
function isOwnerOf(address account, uint256 id) public view override returns (bool) {
}
function getNumMinted() external view override returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
/* ============ Util Functions ============ */
/**
* PRIVILEGED MODULE FUNCTION. Sets a new baseURI for all token types.
*/
function setWhiteLists(address[] memory _users, uint256[] memory _amounts) external onlyOwner {
}
function setURI(string memory newURI) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new transferable for all token types.
*/
function setTransferable(bool _transferable) external onlyOwner {
}
function setEnableMint(bool _enable) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new name for all token types.
*/
function setName(string memory _name) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new symbol for all token types.
*/
function setSymbol(string memory _symbol) external onlyOwner {
}
function setFeeWallet(address _newAddress) external onlyOwner {
}
function setTeamWallet(address _newAddress) external onlyOwner {
}
function setMintWallet(address _newAddress) external onlyOwner {
}
function setFeeToken(address _newAddress) external onlyOwner {
}
function setMaxSupply(uint256 _newSupply) external onlyOwner {
}
function setPerformanceFee(uint256 _newFee) external onlyOwner {
}
function setFeeAmount(uint256 _newFee) external onlyOwner {
}
function setMaxLimit(uint256 _newLimit) external onlyOwner {
}
function setPreMintCount(uint256 _newCount) external onlyOwner {
}
function uint2str(uint256 _i) internal pure returns (string memory) {
}
function random(uint256 sum) private view returns (uint256) {
}
function _getRandomMintNum(uint256 _numToMint, uint256 i) internal returns (uint256) {
}
}
| _isApprovedOrOwner(_msgSender(),id),"caller is not approved or owner" | 410,971 | _isApprovedOrOwner(_msgSender(),id) |
"caller is not approved or owner" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/**
* @author Brewlabs
* This contract has been developed by brewlabs.info
*/
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./libs/ERC721Enumerable.sol";
import "./libs/IB3DLNft.sol";
contract WPTLegendaryNft is ERC721Enumerable, IB3DLNft, Ownable, DefaultOperatorFilterer {
// Default allow transfer
bool public transferable = true;
bool public enableMint = false;
address public feeToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint256 public feeAmount = 878 * 10 ** 6;
uint256 public performanceFee = 89 * 10 ** 14;
uint256 public maxSupply = 1000;
uint256 public maxLimit = 5;
uint256 public preMintCount = 240;
address public feeWallet = 0x547ED2Ed1c7b19777dc67cAe4A23d00780a26c36;
address private teamWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
address public mintWallet = 0xeB0d0Fc09a6c360Dc870908108775cD223F3f267;
// Star id to cid.
mapping(uint256 => uint256) private _cids;
mapping(address => uint256) public whitelists;
uint256 private _starCount;
string private _galaxyName = "WAR PIGS BEASTIE LEGENDARY COLLECTION";
string private _galaxySymbol = "B3DL";
uint256 private numAvailableItems = 1000;
uint256[1000] private availableItems;
/* ============ Events ============ */
event SetWhitelist(address[] users, uint256[] amounts);
event SetBaseUri(string newUri);
event SetTransferAble(bool status);
event SetEnableMint(bool enabled);
event SetName(string name);
event SetSymbol(string symbol);
event SetFeeWallet(address wallet);
event SetTeamWallet(address wallet);
event SetMintWallet(address wallet);
event SetFeeToken(address token);
event SetFeeAmount(uint256 amount);
event SetPremintCount(uint256 count);
/* ============ Constructor ============ */
constructor() ERC721("", "") {
}
function preMint(address to, uint256 amount) external {
}
function setApprovalForAll(address operator, bool approved)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
function approve(address operator, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperatorApproval(operator)
{
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data)
public
override (ERC721, IERC721)
onlyAllowedOperator(from)
{
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view override returns (string memory) {
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view override returns (string memory) {
}
/**
* @dev Get Star NFT CID
*/
function cid(uint256 tokenId) public view returns (uint256) {
}
/* ============ External Functions ============ */
function _transferFee(uint256 amount) internal {
}
function mint(address account) external payable override returns (uint256) {
}
function mintBatch(address account, uint256 amount) external payable override returns (uint256[] memory) {
}
function burn(uint256 id) external override {
}
function burnBatch(uint256[] calldata ids) external override {
for (uint256 i = 0; i < ids.length; i++) {
require(<FILL_ME>)
_burn(ids[i]);
delete _cids[ids[i]];
}
}
/* ============ External Getter Functions ============ */
function isOwnerOf(address account, uint256 id) public view override returns (bool) {
}
function getNumMinted() external view override returns (uint256) {
}
function tokenURI(uint256 id) public view override returns (string memory) {
}
/* ============ Util Functions ============ */
/**
* PRIVILEGED MODULE FUNCTION. Sets a new baseURI for all token types.
*/
function setWhiteLists(address[] memory _users, uint256[] memory _amounts) external onlyOwner {
}
function setURI(string memory newURI) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new transferable for all token types.
*/
function setTransferable(bool _transferable) external onlyOwner {
}
function setEnableMint(bool _enable) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new name for all token types.
*/
function setName(string memory _name) external onlyOwner {
}
/**
* PRIVILEGED MODULE FUNCTION. Sets a new symbol for all token types.
*/
function setSymbol(string memory _symbol) external onlyOwner {
}
function setFeeWallet(address _newAddress) external onlyOwner {
}
function setTeamWallet(address _newAddress) external onlyOwner {
}
function setMintWallet(address _newAddress) external onlyOwner {
}
function setFeeToken(address _newAddress) external onlyOwner {
}
function setMaxSupply(uint256 _newSupply) external onlyOwner {
}
function setPerformanceFee(uint256 _newFee) external onlyOwner {
}
function setFeeAmount(uint256 _newFee) external onlyOwner {
}
function setMaxLimit(uint256 _newLimit) external onlyOwner {
}
function setPreMintCount(uint256 _newCount) external onlyOwner {
}
function uint2str(uint256 _i) internal pure returns (string memory) {
}
function random(uint256 sum) private view returns (uint256) {
}
function _getRandomMintNum(uint256 _numToMint, uint256 i) internal returns (uint256) {
}
}
| _isApprovedOrOwner(_msgSender(),ids[i]),"caller is not approved or owner" | 410,971 | _isApprovedOrOwner(_msgSender(),ids[i]) |
ExceptionsLibrary.FORBIDDEN | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
require(<FILL_ME>)
address[] memory tokens = _vaultTokens;
uint256 supply = totalSupply;
if (supply == 0) {
for (uint256 i = 0; i < tokens.length; ++i) {
require(tokenAmounts[i] >= 10 * _pullExistentials[i], ExceptionsLibrary.LIMIT_UNDERFLOW);
require(
tokenAmounts[i] <= _pullExistentials[i] * _pullExistentials[i],
ExceptionsLibrary.LIMIT_OVERFLOW
);
}
}
(uint256[] memory minTvl, uint256[] memory maxTvl) = tvl();
uint256 thisNft = _nft;
_chargeFees(thisNft, minTvl, supply, tokens);
supply = totalSupply;
IERC20RootVaultGovernance.DelayedStrategyParams memory delayedStrategyParams = IERC20RootVaultGovernance(
address(_vaultGovernance)
).delayedStrategyParams(thisNft);
require(
!delayedStrategyParams.privateVault || _depositorsAllowlist.contains(msg.sender),
ExceptionsLibrary.FORBIDDEN
);
uint256 preLpAmount;
uint256[] memory normalizedAmounts = new uint256[](tokenAmounts.length);
{
bool isSignificantTvl;
(preLpAmount, isSignificantTvl) = _getLpAmount(maxTvl, tokenAmounts, supply);
for (uint256 i = 0; i < tokens.length; ++i) {
normalizedAmounts[i] = _getNormalizedAmount(
maxTvl[i],
tokenAmounts[i],
preLpAmount,
supply,
isSignificantTvl,
_pullExistentials[i]
);
IERC20(tokens[i]).safeTransferFrom(msg.sender, address(this), normalizedAmounts[i]);
}
}
actualTokenAmounts = _push(normalizedAmounts, vaultOptions);
(uint256 lpAmount, ) = _getLpAmount(maxTvl, actualTokenAmounts, supply);
require(lpAmount >= minLpTokens, ExceptionsLibrary.LIMIT_UNDERFLOW);
require(lpAmount != 0, ExceptionsLibrary.VALUE_ZERO);
IERC20RootVaultGovernance.StrategyParams memory params = IERC20RootVaultGovernance(address(_vaultGovernance))
.strategyParams(thisNft);
require(lpAmount + balanceOf[msg.sender] <= params.tokenLimitPerAddress, ExceptionsLibrary.LIMIT_OVERFLOW);
require(lpAmount + supply <= params.tokenLimit, ExceptionsLibrary.LIMIT_OVERFLOW);
// lock tokens on first deposit
if (supply == 0) {
_mint(address(0), lpAmount);
} else {
_mint(msg.sender, lpAmount);
}
for (uint256 i = 0; i < _vaultTokens.length; ++i) {
if (normalizedAmounts[i] > actualTokenAmounts[i]) {
IERC20(_vaultTokens[i]).safeTransfer(msg.sender, normalizedAmounts[i] - actualTokenAmounts[i]);
}
}
if (delayedStrategyParams.depositCallbackAddress != address(0)) {
try ILpCallback(delayedStrategyParams.depositCallbackAddress).depositCallback() {} catch Error(
string memory reason
) {
emit DepositCallbackLog(reason);
} catch {
emit DepositCallbackLog("callback failed without reason");
}
}
emit Deposit(msg.sender, _vaultTokens, actualTokenAmounts, lpAmount);
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| !IERC20RootVaultGovernance(address(_vaultGovernance)).operatorParams().disableDeposit,ExceptionsLibrary.FORBIDDEN | 410,988 | !IERC20RootVaultGovernance(address(_vaultGovernance)).operatorParams().disableDeposit |
ExceptionsLibrary.LIMIT_UNDERFLOW | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
require(
!IERC20RootVaultGovernance(address(_vaultGovernance)).operatorParams().disableDeposit,
ExceptionsLibrary.FORBIDDEN
);
address[] memory tokens = _vaultTokens;
uint256 supply = totalSupply;
if (supply == 0) {
for (uint256 i = 0; i < tokens.length; ++i) {
require(<FILL_ME>)
require(
tokenAmounts[i] <= _pullExistentials[i] * _pullExistentials[i],
ExceptionsLibrary.LIMIT_OVERFLOW
);
}
}
(uint256[] memory minTvl, uint256[] memory maxTvl) = tvl();
uint256 thisNft = _nft;
_chargeFees(thisNft, minTvl, supply, tokens);
supply = totalSupply;
IERC20RootVaultGovernance.DelayedStrategyParams memory delayedStrategyParams = IERC20RootVaultGovernance(
address(_vaultGovernance)
).delayedStrategyParams(thisNft);
require(
!delayedStrategyParams.privateVault || _depositorsAllowlist.contains(msg.sender),
ExceptionsLibrary.FORBIDDEN
);
uint256 preLpAmount;
uint256[] memory normalizedAmounts = new uint256[](tokenAmounts.length);
{
bool isSignificantTvl;
(preLpAmount, isSignificantTvl) = _getLpAmount(maxTvl, tokenAmounts, supply);
for (uint256 i = 0; i < tokens.length; ++i) {
normalizedAmounts[i] = _getNormalizedAmount(
maxTvl[i],
tokenAmounts[i],
preLpAmount,
supply,
isSignificantTvl,
_pullExistentials[i]
);
IERC20(tokens[i]).safeTransferFrom(msg.sender, address(this), normalizedAmounts[i]);
}
}
actualTokenAmounts = _push(normalizedAmounts, vaultOptions);
(uint256 lpAmount, ) = _getLpAmount(maxTvl, actualTokenAmounts, supply);
require(lpAmount >= minLpTokens, ExceptionsLibrary.LIMIT_UNDERFLOW);
require(lpAmount != 0, ExceptionsLibrary.VALUE_ZERO);
IERC20RootVaultGovernance.StrategyParams memory params = IERC20RootVaultGovernance(address(_vaultGovernance))
.strategyParams(thisNft);
require(lpAmount + balanceOf[msg.sender] <= params.tokenLimitPerAddress, ExceptionsLibrary.LIMIT_OVERFLOW);
require(lpAmount + supply <= params.tokenLimit, ExceptionsLibrary.LIMIT_OVERFLOW);
// lock tokens on first deposit
if (supply == 0) {
_mint(address(0), lpAmount);
} else {
_mint(msg.sender, lpAmount);
}
for (uint256 i = 0; i < _vaultTokens.length; ++i) {
if (normalizedAmounts[i] > actualTokenAmounts[i]) {
IERC20(_vaultTokens[i]).safeTransfer(msg.sender, normalizedAmounts[i] - actualTokenAmounts[i]);
}
}
if (delayedStrategyParams.depositCallbackAddress != address(0)) {
try ILpCallback(delayedStrategyParams.depositCallbackAddress).depositCallback() {} catch Error(
string memory reason
) {
emit DepositCallbackLog(reason);
} catch {
emit DepositCallbackLog("callback failed without reason");
}
}
emit Deposit(msg.sender, _vaultTokens, actualTokenAmounts, lpAmount);
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| tokenAmounts[i]>=10*_pullExistentials[i],ExceptionsLibrary.LIMIT_UNDERFLOW | 410,988 | tokenAmounts[i]>=10*_pullExistentials[i] |
ExceptionsLibrary.LIMIT_OVERFLOW | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
require(
!IERC20RootVaultGovernance(address(_vaultGovernance)).operatorParams().disableDeposit,
ExceptionsLibrary.FORBIDDEN
);
address[] memory tokens = _vaultTokens;
uint256 supply = totalSupply;
if (supply == 0) {
for (uint256 i = 0; i < tokens.length; ++i) {
require(tokenAmounts[i] >= 10 * _pullExistentials[i], ExceptionsLibrary.LIMIT_UNDERFLOW);
require(<FILL_ME>)
}
}
(uint256[] memory minTvl, uint256[] memory maxTvl) = tvl();
uint256 thisNft = _nft;
_chargeFees(thisNft, minTvl, supply, tokens);
supply = totalSupply;
IERC20RootVaultGovernance.DelayedStrategyParams memory delayedStrategyParams = IERC20RootVaultGovernance(
address(_vaultGovernance)
).delayedStrategyParams(thisNft);
require(
!delayedStrategyParams.privateVault || _depositorsAllowlist.contains(msg.sender),
ExceptionsLibrary.FORBIDDEN
);
uint256 preLpAmount;
uint256[] memory normalizedAmounts = new uint256[](tokenAmounts.length);
{
bool isSignificantTvl;
(preLpAmount, isSignificantTvl) = _getLpAmount(maxTvl, tokenAmounts, supply);
for (uint256 i = 0; i < tokens.length; ++i) {
normalizedAmounts[i] = _getNormalizedAmount(
maxTvl[i],
tokenAmounts[i],
preLpAmount,
supply,
isSignificantTvl,
_pullExistentials[i]
);
IERC20(tokens[i]).safeTransferFrom(msg.sender, address(this), normalizedAmounts[i]);
}
}
actualTokenAmounts = _push(normalizedAmounts, vaultOptions);
(uint256 lpAmount, ) = _getLpAmount(maxTvl, actualTokenAmounts, supply);
require(lpAmount >= minLpTokens, ExceptionsLibrary.LIMIT_UNDERFLOW);
require(lpAmount != 0, ExceptionsLibrary.VALUE_ZERO);
IERC20RootVaultGovernance.StrategyParams memory params = IERC20RootVaultGovernance(address(_vaultGovernance))
.strategyParams(thisNft);
require(lpAmount + balanceOf[msg.sender] <= params.tokenLimitPerAddress, ExceptionsLibrary.LIMIT_OVERFLOW);
require(lpAmount + supply <= params.tokenLimit, ExceptionsLibrary.LIMIT_OVERFLOW);
// lock tokens on first deposit
if (supply == 0) {
_mint(address(0), lpAmount);
} else {
_mint(msg.sender, lpAmount);
}
for (uint256 i = 0; i < _vaultTokens.length; ++i) {
if (normalizedAmounts[i] > actualTokenAmounts[i]) {
IERC20(_vaultTokens[i]).safeTransfer(msg.sender, normalizedAmounts[i] - actualTokenAmounts[i]);
}
}
if (delayedStrategyParams.depositCallbackAddress != address(0)) {
try ILpCallback(delayedStrategyParams.depositCallbackAddress).depositCallback() {} catch Error(
string memory reason
) {
emit DepositCallbackLog(reason);
} catch {
emit DepositCallbackLog("callback failed without reason");
}
}
emit Deposit(msg.sender, _vaultTokens, actualTokenAmounts, lpAmount);
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| tokenAmounts[i]<=_pullExistentials[i]*_pullExistentials[i],ExceptionsLibrary.LIMIT_OVERFLOW | 410,988 | tokenAmounts[i]<=_pullExistentials[i]*_pullExistentials[i] |
ExceptionsLibrary.FORBIDDEN | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
require(
!IERC20RootVaultGovernance(address(_vaultGovernance)).operatorParams().disableDeposit,
ExceptionsLibrary.FORBIDDEN
);
address[] memory tokens = _vaultTokens;
uint256 supply = totalSupply;
if (supply == 0) {
for (uint256 i = 0; i < tokens.length; ++i) {
require(tokenAmounts[i] >= 10 * _pullExistentials[i], ExceptionsLibrary.LIMIT_UNDERFLOW);
require(
tokenAmounts[i] <= _pullExistentials[i] * _pullExistentials[i],
ExceptionsLibrary.LIMIT_OVERFLOW
);
}
}
(uint256[] memory minTvl, uint256[] memory maxTvl) = tvl();
uint256 thisNft = _nft;
_chargeFees(thisNft, minTvl, supply, tokens);
supply = totalSupply;
IERC20RootVaultGovernance.DelayedStrategyParams memory delayedStrategyParams = IERC20RootVaultGovernance(
address(_vaultGovernance)
).delayedStrategyParams(thisNft);
require(<FILL_ME>)
uint256 preLpAmount;
uint256[] memory normalizedAmounts = new uint256[](tokenAmounts.length);
{
bool isSignificantTvl;
(preLpAmount, isSignificantTvl) = _getLpAmount(maxTvl, tokenAmounts, supply);
for (uint256 i = 0; i < tokens.length; ++i) {
normalizedAmounts[i] = _getNormalizedAmount(
maxTvl[i],
tokenAmounts[i],
preLpAmount,
supply,
isSignificantTvl,
_pullExistentials[i]
);
IERC20(tokens[i]).safeTransferFrom(msg.sender, address(this), normalizedAmounts[i]);
}
}
actualTokenAmounts = _push(normalizedAmounts, vaultOptions);
(uint256 lpAmount, ) = _getLpAmount(maxTvl, actualTokenAmounts, supply);
require(lpAmount >= minLpTokens, ExceptionsLibrary.LIMIT_UNDERFLOW);
require(lpAmount != 0, ExceptionsLibrary.VALUE_ZERO);
IERC20RootVaultGovernance.StrategyParams memory params = IERC20RootVaultGovernance(address(_vaultGovernance))
.strategyParams(thisNft);
require(lpAmount + balanceOf[msg.sender] <= params.tokenLimitPerAddress, ExceptionsLibrary.LIMIT_OVERFLOW);
require(lpAmount + supply <= params.tokenLimit, ExceptionsLibrary.LIMIT_OVERFLOW);
// lock tokens on first deposit
if (supply == 0) {
_mint(address(0), lpAmount);
} else {
_mint(msg.sender, lpAmount);
}
for (uint256 i = 0; i < _vaultTokens.length; ++i) {
if (normalizedAmounts[i] > actualTokenAmounts[i]) {
IERC20(_vaultTokens[i]).safeTransfer(msg.sender, normalizedAmounts[i] - actualTokenAmounts[i]);
}
}
if (delayedStrategyParams.depositCallbackAddress != address(0)) {
try ILpCallback(delayedStrategyParams.depositCallbackAddress).depositCallback() {} catch Error(
string memory reason
) {
emit DepositCallbackLog(reason);
} catch {
emit DepositCallbackLog("callback failed without reason");
}
}
emit Deposit(msg.sender, _vaultTokens, actualTokenAmounts, lpAmount);
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| !delayedStrategyParams.privateVault||_depositorsAllowlist.contains(msg.sender),ExceptionsLibrary.FORBIDDEN | 410,988 | !delayedStrategyParams.privateVault||_depositorsAllowlist.contains(msg.sender) |
ExceptionsLibrary.LIMIT_OVERFLOW | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
require(
!IERC20RootVaultGovernance(address(_vaultGovernance)).operatorParams().disableDeposit,
ExceptionsLibrary.FORBIDDEN
);
address[] memory tokens = _vaultTokens;
uint256 supply = totalSupply;
if (supply == 0) {
for (uint256 i = 0; i < tokens.length; ++i) {
require(tokenAmounts[i] >= 10 * _pullExistentials[i], ExceptionsLibrary.LIMIT_UNDERFLOW);
require(
tokenAmounts[i] <= _pullExistentials[i] * _pullExistentials[i],
ExceptionsLibrary.LIMIT_OVERFLOW
);
}
}
(uint256[] memory minTvl, uint256[] memory maxTvl) = tvl();
uint256 thisNft = _nft;
_chargeFees(thisNft, minTvl, supply, tokens);
supply = totalSupply;
IERC20RootVaultGovernance.DelayedStrategyParams memory delayedStrategyParams = IERC20RootVaultGovernance(
address(_vaultGovernance)
).delayedStrategyParams(thisNft);
require(
!delayedStrategyParams.privateVault || _depositorsAllowlist.contains(msg.sender),
ExceptionsLibrary.FORBIDDEN
);
uint256 preLpAmount;
uint256[] memory normalizedAmounts = new uint256[](tokenAmounts.length);
{
bool isSignificantTvl;
(preLpAmount, isSignificantTvl) = _getLpAmount(maxTvl, tokenAmounts, supply);
for (uint256 i = 0; i < tokens.length; ++i) {
normalizedAmounts[i] = _getNormalizedAmount(
maxTvl[i],
tokenAmounts[i],
preLpAmount,
supply,
isSignificantTvl,
_pullExistentials[i]
);
IERC20(tokens[i]).safeTransferFrom(msg.sender, address(this), normalizedAmounts[i]);
}
}
actualTokenAmounts = _push(normalizedAmounts, vaultOptions);
(uint256 lpAmount, ) = _getLpAmount(maxTvl, actualTokenAmounts, supply);
require(lpAmount >= minLpTokens, ExceptionsLibrary.LIMIT_UNDERFLOW);
require(lpAmount != 0, ExceptionsLibrary.VALUE_ZERO);
IERC20RootVaultGovernance.StrategyParams memory params = IERC20RootVaultGovernance(address(_vaultGovernance))
.strategyParams(thisNft);
require(<FILL_ME>)
require(lpAmount + supply <= params.tokenLimit, ExceptionsLibrary.LIMIT_OVERFLOW);
// lock tokens on first deposit
if (supply == 0) {
_mint(address(0), lpAmount);
} else {
_mint(msg.sender, lpAmount);
}
for (uint256 i = 0; i < _vaultTokens.length; ++i) {
if (normalizedAmounts[i] > actualTokenAmounts[i]) {
IERC20(_vaultTokens[i]).safeTransfer(msg.sender, normalizedAmounts[i] - actualTokenAmounts[i]);
}
}
if (delayedStrategyParams.depositCallbackAddress != address(0)) {
try ILpCallback(delayedStrategyParams.depositCallbackAddress).depositCallback() {} catch Error(
string memory reason
) {
emit DepositCallbackLog(reason);
} catch {
emit DepositCallbackLog("callback failed without reason");
}
}
emit Deposit(msg.sender, _vaultTokens, actualTokenAmounts, lpAmount);
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| lpAmount+balanceOf[msg.sender]<=params.tokenLimitPerAddress,ExceptionsLibrary.LIMIT_OVERFLOW | 410,988 | lpAmount+balanceOf[msg.sender]<=params.tokenLimitPerAddress |
ExceptionsLibrary.LIMIT_OVERFLOW | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
require(
!IERC20RootVaultGovernance(address(_vaultGovernance)).operatorParams().disableDeposit,
ExceptionsLibrary.FORBIDDEN
);
address[] memory tokens = _vaultTokens;
uint256 supply = totalSupply;
if (supply == 0) {
for (uint256 i = 0; i < tokens.length; ++i) {
require(tokenAmounts[i] >= 10 * _pullExistentials[i], ExceptionsLibrary.LIMIT_UNDERFLOW);
require(
tokenAmounts[i] <= _pullExistentials[i] * _pullExistentials[i],
ExceptionsLibrary.LIMIT_OVERFLOW
);
}
}
(uint256[] memory minTvl, uint256[] memory maxTvl) = tvl();
uint256 thisNft = _nft;
_chargeFees(thisNft, minTvl, supply, tokens);
supply = totalSupply;
IERC20RootVaultGovernance.DelayedStrategyParams memory delayedStrategyParams = IERC20RootVaultGovernance(
address(_vaultGovernance)
).delayedStrategyParams(thisNft);
require(
!delayedStrategyParams.privateVault || _depositorsAllowlist.contains(msg.sender),
ExceptionsLibrary.FORBIDDEN
);
uint256 preLpAmount;
uint256[] memory normalizedAmounts = new uint256[](tokenAmounts.length);
{
bool isSignificantTvl;
(preLpAmount, isSignificantTvl) = _getLpAmount(maxTvl, tokenAmounts, supply);
for (uint256 i = 0; i < tokens.length; ++i) {
normalizedAmounts[i] = _getNormalizedAmount(
maxTvl[i],
tokenAmounts[i],
preLpAmount,
supply,
isSignificantTvl,
_pullExistentials[i]
);
IERC20(tokens[i]).safeTransferFrom(msg.sender, address(this), normalizedAmounts[i]);
}
}
actualTokenAmounts = _push(normalizedAmounts, vaultOptions);
(uint256 lpAmount, ) = _getLpAmount(maxTvl, actualTokenAmounts, supply);
require(lpAmount >= minLpTokens, ExceptionsLibrary.LIMIT_UNDERFLOW);
require(lpAmount != 0, ExceptionsLibrary.VALUE_ZERO);
IERC20RootVaultGovernance.StrategyParams memory params = IERC20RootVaultGovernance(address(_vaultGovernance))
.strategyParams(thisNft);
require(lpAmount + balanceOf[msg.sender] <= params.tokenLimitPerAddress, ExceptionsLibrary.LIMIT_OVERFLOW);
require(<FILL_ME>)
// lock tokens on first deposit
if (supply == 0) {
_mint(address(0), lpAmount);
} else {
_mint(msg.sender, lpAmount);
}
for (uint256 i = 0; i < _vaultTokens.length; ++i) {
if (normalizedAmounts[i] > actualTokenAmounts[i]) {
IERC20(_vaultTokens[i]).safeTransfer(msg.sender, normalizedAmounts[i] - actualTokenAmounts[i]);
}
}
if (delayedStrategyParams.depositCallbackAddress != address(0)) {
try ILpCallback(delayedStrategyParams.depositCallbackAddress).depositCallback() {} catch Error(
string memory reason
) {
emit DepositCallbackLog(reason);
} catch {
emit DepositCallbackLog("callback failed without reason");
}
}
emit Deposit(msg.sender, _vaultTokens, actualTokenAmounts, lpAmount);
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| lpAmount+supply<=params.tokenLimit,ExceptionsLibrary.LIMIT_OVERFLOW | 410,988 | lpAmount+supply<=params.tokenLimit |
ExceptionsLibrary.LIMIT_UNDERFLOW | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
uint256 supply = totalSupply;
require(supply > 0, ExceptionsLibrary.VALUE_ZERO);
address[] memory tokens = _vaultTokens;
uint256[] memory tokenAmounts = new uint256[](_vaultTokens.length);
(uint256[] memory minTvl, ) = tvl();
_chargeFees(_nft, minTvl, supply, tokens);
supply = totalSupply;
uint256 balance = balanceOf[msg.sender];
if (lpTokenAmount > balance) {
lpTokenAmount = balance;
}
for (uint256 i = 0; i < tokens.length; ++i) {
tokenAmounts[i] = FullMath.mulDiv(lpTokenAmount, minTvl[i], supply);
}
actualTokenAmounts = _pull(address(this), tokenAmounts, vaultsOptions);
// we are draining balance
// if no sufficent amounts rest
bool sufficientAmountRest = false;
for (uint256 i = 0; i < tokens.length; ++i) {
require(<FILL_ME>)
if (FullMath.mulDiv(balance, minTvl[i], supply) >= _pullExistentials[i] + actualTokenAmounts[i]) {
sufficientAmountRest = true;
}
if (actualTokenAmounts[i] != 0) {
IERC20(tokens[i]).safeTransfer(to, actualTokenAmounts[i]);
}
}
_updateWithdrawnAmounts(actualTokenAmounts);
if (sufficientAmountRest) {
_burn(msg.sender, lpTokenAmount);
} else {
_burn(msg.sender, balance);
}
uint256 thisNft = _nft;
IERC20RootVaultGovernance.DelayedStrategyParams memory delayedStrategyParams = IERC20RootVaultGovernance(
address(_vaultGovernance)
).delayedStrategyParams(thisNft);
if (delayedStrategyParams.withdrawCallbackAddress != address(0)) {
try ILpCallback(delayedStrategyParams.withdrawCallbackAddress).withdrawCallback() {} catch Error(
string memory reason
) {
emit WithdrawCallbackLog(reason);
} catch {
emit WithdrawCallbackLog("callback failed without reason");
}
}
emit Withdraw(msg.sender, _vaultTokens, actualTokenAmounts, lpTokenAmount);
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| actualTokenAmounts[i]>=minTokenAmounts[i],ExceptionsLibrary.LIMIT_UNDERFLOW | 410,988 | actualTokenAmounts[i]>=minTokenAmounts[i] |
ExceptionsLibrary.FORBIDDEN | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
uint256 nft_ = _nft;
IVaultGovernance.InternalParams memory internalParams = _vaultGovernance.internalParams();
require(<FILL_ME>)
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| (internalParams.protocolGovernance.isAdmin(msg.sender)||internalParams.registry.getApproved(nft_)==msg.sender||(internalParams.registry.ownerOf(nft_)==msg.sender)),ExceptionsLibrary.FORBIDDEN | 410,988 | (internalParams.protocolGovernance.isAdmin(msg.sender)||internalParams.registry.getApproved(nft_)==msg.sender||(internalParams.registry.ownerOf(nft_)==msg.sender)) |
ExceptionsLibrary.LIMIT_OVERFLOW | // SPDX-License-Identifier: BSL-1.1
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../libraries/external/FullMath.sol";
import "../libraries/ExceptionsLibrary.sol";
import "../interfaces/vaults/IERC20RootVaultGovernance.sol";
import "../interfaces/vaults/IERC20RootVault.sol";
import "../interfaces/utils/ILpCallback.sol";
import "../utils/ERC20Token.sol";
import "./AggregateVault.sol";
import "../interfaces/utils/IERC20RootVaultHelper.sol";
/// @notice Contract that mints and burns LP tokens in exchange for ERC20 liquidity.
contract ERC20RootVault is IERC20RootVault, ERC20Token, ReentrancyGuard, AggregateVault {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.AddressSet;
/// @inheritdoc IERC20RootVault
uint64 public lastFeeCharge;
/// @inheritdoc IERC20RootVault
uint64 public totalWithdrawnAmountsTimestamp;
/// @inheritdoc IERC20RootVault
uint256[] public totalWithdrawnAmounts;
/// @inheritdoc IERC20RootVault
uint256 public lpPriceHighWaterMarkD18;
EnumerableSet.AddressSet private _depositorsAllowlist;
IERC20RootVaultHelper public helper;
// ------------------- EXTERNAL, VIEW -------------------
/// @inheritdoc IERC20RootVault
function depositorsAllowlist() external view returns (address[] memory) {
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, AggregateVault)
returns (bool)
{
}
// ------------------- EXTERNAL, MUTATING -------------------
/// @inheritdoc IERC20RootVault
function addDepositorsToAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function removeDepositorsFromAllowlist(address[] calldata depositors) external {
}
/// @inheritdoc IERC20RootVault
function initialize(
uint256 nft_,
address[] memory vaultTokens_,
address strategy_,
uint256[] memory subvaultNfts_,
IERC20RootVaultHelper helper_
) external {
}
/// @inheritdoc IERC20RootVault
function deposit(
uint256[] memory tokenAmounts,
uint256 minLpTokens,
bytes memory vaultOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
/// @inheritdoc IERC20RootVault
function withdraw(
address to,
uint256 lpTokenAmount,
uint256[] memory minTokenAmounts,
bytes[] memory vaultsOptions
) external nonReentrant returns (uint256[] memory actualTokenAmounts) {
}
// ------------------- INTERNAL, VIEW -------------------
function _getLpAmount(
uint256[] memory tvl_,
uint256[] memory amounts,
uint256 supply
) internal view returns (uint256 lpAmount, bool isSignificantTvl) {
}
function _getNormalizedAmount(
uint256 tvl_,
uint256 amount,
uint256 lpAmount,
uint256 supply,
bool isSignificantTvl,
uint256 existentialsAmount
) internal pure returns (uint256) {
}
function _requireAtLeastStrategy() internal view {
}
function _getTokenName(bytes memory prefix, uint256 nft_) internal pure returns (string memory) {
}
// ------------------- INTERNAL, MUTATING -------------------
/// @dev we are charging fees on the deposit / withdrawal
/// fees are charged before the tokens transfer and change the balance of the lp tokens
function _chargeFees(
uint256 thisNft,
uint256[] memory tvls,
uint256 supply,
address[] memory tokens
) internal {
}
function _chargeManagementFees(
uint256 managementFee,
uint256 protocolFee,
address strategyTreasury,
address protocolTreasury,
uint256 elapsed,
uint256 lpSupply
) internal {
}
function _chargePerformanceFees(
uint256 baseSupply,
uint256[] memory baseTvls,
uint256 performanceFee,
address treasury,
address[] memory tokens,
IOracle oracle
) internal {
}
function _updateWithdrawnAmounts(uint256[] memory tokenAmounts) internal {
uint256[] memory withdrawn = new uint256[](tokenAmounts.length);
uint64 timestamp = uint64(block.timestamp);
IProtocolGovernance protocolGovernance = _vaultGovernance.internalParams().protocolGovernance;
if (timestamp != totalWithdrawnAmountsTimestamp) {
totalWithdrawnAmountsTimestamp = timestamp;
} else {
for (uint256 i = 0; i < tokenAmounts.length; i++) {
withdrawn[i] = totalWithdrawnAmounts[i];
}
}
for (uint256 i = 0; i < tokenAmounts.length; i++) {
withdrawn[i] += tokenAmounts[i];
require(<FILL_ME>)
totalWithdrawnAmounts[i] = withdrawn[i];
}
}
// -------------------------- EVENTS --------------------------
/// @notice Emitted when management fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ManagementFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when protocol fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event ProtocolFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when performance fees are charged
/// @param treasury Treasury receiver of the fee
/// @param feeRate Fee percent applied denominated in 10 ** 9
/// @param amount Amount of lp token minted
event PerformanceFeesCharged(address indexed treasury, uint256 feeRate, uint256 amount);
/// @notice Emitted when liquidity is deposited
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens deposited
/// @param actualTokenAmounts Token amounts deposited
/// @param lpTokenMinted LP tokens received by the liquidity provider
event Deposit(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenMinted);
/// @notice Emitted when liquidity is withdrawn
/// @param from The source address for the liquidity
/// @param tokens ERC20 tokens withdrawn
/// @param actualTokenAmounts Token amounts withdrawn
/// @param lpTokenBurned LP tokens burned from the liquidity provider
event Withdraw(address indexed from, address[] tokens, uint256[] actualTokenAmounts, uint256 lpTokenBurned);
/// @notice Emitted when callback in deposit failed
/// @param reason Error reason
event DepositCallbackLog(string reason);
/// @notice Emitted when callback in withdraw failed
/// @param reason Error reason
event WithdrawCallbackLog(string reason);
}
| withdrawn[i]<=protocolGovernance.withdrawLimit(_vaultTokens[i]),ExceptionsLibrary.LIMIT_OVERFLOW | 410,988 | withdrawn[i]<=protocolGovernance.withdrawLimit(_vaultTokens[i]) |
"DefaultExtensionSet: extension does not exist." | // SPDX-License-Identifier: MIT
// @author: thirdweb (https://github.com/thirdweb-dev/dynamic-contracts)
pragma solidity ^0.8.0;
// Interface
import "../../interface/IDefaultExtensionSet.sol";
// Extensions
import "./ExtensionState.sol";
contract DefaultExtensionSet is IDefaultExtensionSet, ExtensionState {
using StringSet for StringSet.Set;
/*///////////////////////////////////////////////////////////////
State variables
//////////////////////////////////////////////////////////////*/
/// @notice The deployer of DefaultExtensionSet.
address private deployer;
/*///////////////////////////////////////////////////////////////
Constructor
//////////////////////////////////////////////////////////////*/
constructor() {
}
/*///////////////////////////////////////////////////////////////
External functions
//////////////////////////////////////////////////////////////*/
/// @notice Stores a extension in the DefaultExtensionSet.
function setExtension(Extension memory _extension) external {
}
/*///////////////////////////////////////////////////////////////
View functions
//////////////////////////////////////////////////////////////*/
/// @notice Returns all extensions stored.
function getAllExtensions() external view returns (Extension[] memory allExtensions) {
}
/// @notice Returns the extension metadata and functions for a given extension.
function getExtension(string memory _extensionName) public view returns (Extension memory) {
ExtensionStateStorage.Data storage data = ExtensionStateStorage.extensionStateStorage();
require(<FILL_ME>)
return data.extensions[_extensionName];
}
/// @notice Returns the extension's implementation smart contract address.
function getExtensionImplementation(string memory _extensionName) external view returns (address) {
}
/// @notice Returns all functions that belong to the given extension contract.
function getAllFunctionsOfExtension(string memory _extensionName) external view returns (ExtensionFunction[] memory) {
}
/// @notice Returns the extension metadata for a given function.
function getExtensionForFunction(bytes4 _functionSelector) external view returns (ExtensionMetadata memory) {
}
}
| data.extensionNames.contains(_extensionName),"DefaultExtensionSet: extension does not exist." | 411,221 | data.extensionNames.contains(_extensionName) |
"Fees too high" | /**
*
ShibaFlip Casino
https://t.me/shibafliperc
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
library Address {
function isContract(address account) internal view returns (bool) {
}
function sendValue(address payable recipient, uint256 amount) internal {
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
}
function _msgData() internal view virtual returns (bytes calldata) {
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address 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 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;
}
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 {
}
}
contract ShibaFlip is IERC20, Ownable {
using Address for address;
address DEAD = 0x000000000000000000000000000000000000dEaD;
address ZERO = 0x0000000000000000000000000000000000000000;
string constant _name = "ShibaFlip";
string constant _symbol = "$FLIP";
uint8 constant _decimals = 9;
uint256 _totalSupply = 1_000_000_000 * (10 ** _decimals);
uint256 _maxBuyTxAmount = (_totalSupply * 2) / 200;
uint256 _maxSellTxAmount = (_totalSupply * 2) / 200;
uint256 _maxWalletSize = (_totalSupply * 2) / 100;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => uint256) public lastSell;
mapping (address => uint256) public lastBuy;
mapping (address => bool) public isFeeExempt;
mapping (address => bool) public isTxLimitExempt;
mapping (address => bool) public liquidityCreator;
uint256 marketingFee = 700;
uint256 marketingSellFee = 800;
uint256 liquidityFee = 700;
uint256 liquiditySellFee = 800;
uint256 totalBuyFee = marketingFee + liquidityFee;
uint256 totalSellFee = marketingSellFee + liquiditySellFee;
uint256 feeDenominator = 10000;
bool public transferTax = false;
address payable public liquidityFeeReceiver = payable(0x3b835BbFa9Baa0AcC3839C631C9C532EB732C782);
address payable public marketingFeeReceiver = payable(0x3b835BbFa9Baa0AcC3839C631C9C532EB732C782);
IDEXRouter public router;
address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
mapping (address => bool) liquidityPools;
mapping (address => uint256) public protected;
bool protectionEnabled = true;
bool protectionDisabled = false;
uint256 protectionLimit;
uint256 public protectionCount;
uint256 protectionTimer;
address public pair;
uint256 public launchedAt;
uint256 public launchedTime;
uint256 public deadBlocks;
bool startBullRun = false;
bool pauseDisabled = false;
uint256 public rateLimit = 2;
bool public swapEnabled = false;
uint256 public swapThreshold = _totalSupply / 1000;
uint256 public swapMinimum = _totalSupply / 10000;
bool inSwap;
modifier swapping() { }
mapping (address => bool) teamMember;
modifier onlyTeam() {
}
event ProtectedWallet(address, address, uint256, uint8);
constructor () {
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { }
function decimals() external pure returns (uint8) { }
function symbol() external pure returns (string memory) { }
function name() external pure returns (string memory) { }
function getOwner() external view returns (address) { }
function maxBuyTxTokens() external view returns (uint256) { }
function maxSellTxTokens() external view returns (uint256) { }
function maxWalletTokens() external view returns (uint256) { }
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 setTeamMember(address _team, bool _enabled) external onlyOwner {
}
function clearStuckBalance(uint256 amountPercentage, address adr) external onlyTeam {
}
function openTrading(uint256 _deadBlocks, uint256 _protection, uint256 _limit) external onlyTeam {
}
function pauseTrading() external onlyTeam {
}
function disablePause() external onlyTeam {
}
function setProtection(bool _protect, uint256 _addTime) external onlyTeam {
}
function disableProtection() external onlyTeam {
}
function protectWallet(address[] calldata _wallets, bool _protect) external onlyTeam {
}
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) {
}
function launched() internal view returns (bool) {
}
function launch() internal {
}
function _basicTransfer(address sender, address recipient, uint256 amount) internal returns (bool) {
}
function checkWalletLimit(address recipient, uint256 amount) internal view {
}
function checkTxLimit(address sender, address recipient, uint256 amount) internal {
}
function shouldTakeFee(address sender, address recipient) public view returns (bool) {
}
function getTotalFee(bool selling) public view returns (uint256) {
}
function takeFee(address recipient, uint256 amount) internal returns (uint256) {
}
function shouldSwapBack(address recipient) internal view returns (bool) {
}
function swapBack(uint256 amount) internal swapping {
}
function addLiquidityPool(address lp, bool isPool) external onlyOwner {
}
function setRateLimit(uint256 rate) external onlyOwner {
}
function setTxLimit(uint256 buyNumerator, uint256 sellNumerator, uint256 divisor) external onlyOwner {
}
function setMaxWallet(uint256 numerator, uint256 divisor) external onlyOwner() {
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
}
function setIsTxLimitExempt(address holder, bool exempt) external onlyOwner {
}
function setFees(uint256 _liquidityFee, uint256 _liquiditySellFee, uint256 _marketingFee, uint256 _marketingSellFee, uint256 _feeDenominator) external onlyOwner {
require(((_liquidityFee + _liquiditySellFee) / 2) * 2 == (_liquidityFee + _liquiditySellFee), "Liquidity fee must be an even number due to rounding");
liquidityFee = _liquidityFee;
liquiditySellFee = _liquiditySellFee;
marketingFee = _marketingFee;
marketingSellFee = _marketingSellFee;
totalBuyFee = _liquidityFee + _marketingFee;
totalSellFee = _liquiditySellFee + _marketingSellFee;
feeDenominator = _feeDenominator;
require(<FILL_ME>)
emit FeesSet(totalBuyFee, totalSellFee, feeDenominator);
}
function toggleTransferTax() external onlyOwner {
}
function setFeeReceivers(address _liquidityFeeReceiver, address _marketingFeeReceiver) external onlyOwner {
}
function setSwapBackSettings(bool _enabled, uint256 _denominator, uint256 _swapMinimum) external onlyOwner {
}
function getCirculatingSupply() public view returns (uint256) {
}
event FundsDistributed(uint256 marketingETH, uint256 liquidityETH, uint256 liquidityTokens);
event FeesSet(uint256 totalBuyFees, uint256 totalSellFees, uint256 denominator);
}
| totalBuyFee+totalSellFee<=feeDenominator/2,"Fees too high" | 411,490 | totalBuyFee+totalSellFee<=feeDenominator/2 |
'Deposite: DISABLE DEPOSITING' | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
require(<FILL_ME>)
require(_tokenIds.length > 0, 'Deposite: DISABLE DEPOSITING');
UserInfo storage user = userInfo[_pid][msg.sender];
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(Stakes[_pid][_tokenIds[i]].isActive == false, "NFT already staked.");
Stake memory newStake = Stake(
_pid,
msg.sender,
block.timestamp,
poolInfo[_pid].nftContract,
_tokenIds[i],
0,
true
);
Stakes[_pid][_tokenIds[i]] = newStake;
ActiveStakes[_pid][msg.sender] ++;
CurrentStakedTokens[_pid][msg.sender].add(_tokenIds[i]);
poolInfo[_pid].totalStakedNFT ++;
poolInfo[_pid].nftContract.transferFrom(msg.sender, address(this), _tokenIds[i]);
user.amount ++;
}
emit Staked(_pid, _tokenIds);
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| poolInfo[_pid].isActive==true,'Deposite: DISABLE DEPOSITING' | 411,491 | poolInfo[_pid].isActive==true |
"NFT already staked." | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
require(poolInfo[_pid].isActive == true, 'Deposite: DISABLE DEPOSITING');
require(_tokenIds.length > 0, 'Deposite: DISABLE DEPOSITING');
UserInfo storage user = userInfo[_pid][msg.sender];
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(<FILL_ME>)
Stake memory newStake = Stake(
_pid,
msg.sender,
block.timestamp,
poolInfo[_pid].nftContract,
_tokenIds[i],
0,
true
);
Stakes[_pid][_tokenIds[i]] = newStake;
ActiveStakes[_pid][msg.sender] ++;
CurrentStakedTokens[_pid][msg.sender].add(_tokenIds[i]);
poolInfo[_pid].totalStakedNFT ++;
poolInfo[_pid].nftContract.transferFrom(msg.sender, address(this), _tokenIds[i]);
user.amount ++;
}
emit Staked(_pid, _tokenIds);
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| Stakes[_pid][_tokenIds[i]].isActive==false,"NFT already staked." | 411,491 | Stakes[_pid][_tokenIds[i]].isActive==false |
"Not the stake owner" | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
require(poolInfo[_pid].isActive == true, 'Deposite: DISABLE WITHDRAW');
claimReward(_pid, _tokenIds);
UserInfo storage user = userInfo[_pid][msg.sender];
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(<FILL_ME>)
Stakes[_pid][_tokenIds[i]].isActive = false;
ActiveStakes[_pid][msg.sender] -= 1;
CurrentStakedTokens[_pid][msg.sender].remove(_tokenIds[i]);
poolInfo[_pid].totalStakedNFT --;
poolInfo[_pid].nftContract.transferFrom(address(this), msg.sender, _tokenIds[i]);
user.amount --;
}
emit UnStaked(_pid, _tokenIds);
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| Stakes[_pid][_tokenIds[i]].beneficiary==msg.sender,"Not the stake owner" | 411,491 | Stakes[_pid][_tokenIds[i]].beneficiary==msg.sender |
"Can't claim yet!" | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
require(poolInfo[_pid].isActive == true, 'Deposite: DISABLE CLAIM');
require(_tokenIds.length > 0, "Must have at least one token staked!");
require(<FILL_ME>)
uint256 totalRewards;
uint256 rewards;
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(Stakes[_pid][_tokenIds[i]].beneficiary == msg.sender, "Not the stake owner");
require(Stakes[_pid][_tokenIds[i]].isActive, "Not staked");
rewards = (block.timestamp - Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime) * poolInfo[_pid].emissionRate;
totalRewards += rewards;
Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime = block.timestamp;
Stakes[_pid][_tokenIds[i]].claimedTokens += rewards;
}
if (totalRewards > 0) {
require(rewardToken.balanceOf(address(this)) >= totalRewards, "Insufficient rewards");
require(poolInfo[_pid].remainedRewards >= totalRewards, "Insufficient rewards");
require(rewardToken.transfer(msg.sender, totalRewards), "CANNOT GIVE REWARD!");
rewardTokenSupply -= totalRewards;
poolInfo[_pid].claimedRewards += totalRewards;
poolInfo[_pid].remainedRewards -= totalRewards;
UserInfo storage user = userInfo[_pid][msg.sender];
user.totalEarnedRewards += totalRewards;
user.nextHarvestUntil = block.timestamp + MAX_HARVEST_INTERVAL;
}
emit Claimed(_pid, _tokenIds, totalRewards);
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| canHarvest(_pid,msg.sender),"Can't claim yet!" | 411,491 | canHarvest(_pid,msg.sender) |
"Not staked" | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
require(poolInfo[_pid].isActive == true, 'Deposite: DISABLE CLAIM');
require(_tokenIds.length > 0, "Must have at least one token staked!");
require(canHarvest(_pid, msg.sender), "Can't claim yet!");
uint256 totalRewards;
uint256 rewards;
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(Stakes[_pid][_tokenIds[i]].beneficiary == msg.sender, "Not the stake owner");
require(<FILL_ME>)
rewards = (block.timestamp - Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime) * poolInfo[_pid].emissionRate;
totalRewards += rewards;
Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime = block.timestamp;
Stakes[_pid][_tokenIds[i]].claimedTokens += rewards;
}
if (totalRewards > 0) {
require(rewardToken.balanceOf(address(this)) >= totalRewards, "Insufficient rewards");
require(poolInfo[_pid].remainedRewards >= totalRewards, "Insufficient rewards");
require(rewardToken.transfer(msg.sender, totalRewards), "CANNOT GIVE REWARD!");
rewardTokenSupply -= totalRewards;
poolInfo[_pid].claimedRewards += totalRewards;
poolInfo[_pid].remainedRewards -= totalRewards;
UserInfo storage user = userInfo[_pid][msg.sender];
user.totalEarnedRewards += totalRewards;
user.nextHarvestUntil = block.timestamp + MAX_HARVEST_INTERVAL;
}
emit Claimed(_pid, _tokenIds, totalRewards);
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| Stakes[_pid][_tokenIds[i]].isActive,"Not staked" | 411,491 | Stakes[_pid][_tokenIds[i]].isActive |
"Insufficient rewards" | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
require(poolInfo[_pid].isActive == true, 'Deposite: DISABLE CLAIM');
require(_tokenIds.length > 0, "Must have at least one token staked!");
require(canHarvest(_pid, msg.sender), "Can't claim yet!");
uint256 totalRewards;
uint256 rewards;
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(Stakes[_pid][_tokenIds[i]].beneficiary == msg.sender, "Not the stake owner");
require(Stakes[_pid][_tokenIds[i]].isActive, "Not staked");
rewards = (block.timestamp - Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime) * poolInfo[_pid].emissionRate;
totalRewards += rewards;
Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime = block.timestamp;
Stakes[_pid][_tokenIds[i]].claimedTokens += rewards;
}
if (totalRewards > 0) {
require(<FILL_ME>)
require(poolInfo[_pid].remainedRewards >= totalRewards, "Insufficient rewards");
require(rewardToken.transfer(msg.sender, totalRewards), "CANNOT GIVE REWARD!");
rewardTokenSupply -= totalRewards;
poolInfo[_pid].claimedRewards += totalRewards;
poolInfo[_pid].remainedRewards -= totalRewards;
UserInfo storage user = userInfo[_pid][msg.sender];
user.totalEarnedRewards += totalRewards;
user.nextHarvestUntil = block.timestamp + MAX_HARVEST_INTERVAL;
}
emit Claimed(_pid, _tokenIds, totalRewards);
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| rewardToken.balanceOf(address(this))>=totalRewards,"Insufficient rewards" | 411,491 | rewardToken.balanceOf(address(this))>=totalRewards |
"Insufficient rewards" | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
require(poolInfo[_pid].isActive == true, 'Deposite: DISABLE CLAIM');
require(_tokenIds.length > 0, "Must have at least one token staked!");
require(canHarvest(_pid, msg.sender), "Can't claim yet!");
uint256 totalRewards;
uint256 rewards;
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(Stakes[_pid][_tokenIds[i]].beneficiary == msg.sender, "Not the stake owner");
require(Stakes[_pid][_tokenIds[i]].isActive, "Not staked");
rewards = (block.timestamp - Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime) * poolInfo[_pid].emissionRate;
totalRewards += rewards;
Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime = block.timestamp;
Stakes[_pid][_tokenIds[i]].claimedTokens += rewards;
}
if (totalRewards > 0) {
require(rewardToken.balanceOf(address(this)) >= totalRewards, "Insufficient rewards");
require(<FILL_ME>)
require(rewardToken.transfer(msg.sender, totalRewards), "CANNOT GIVE REWARD!");
rewardTokenSupply -= totalRewards;
poolInfo[_pid].claimedRewards += totalRewards;
poolInfo[_pid].remainedRewards -= totalRewards;
UserInfo storage user = userInfo[_pid][msg.sender];
user.totalEarnedRewards += totalRewards;
user.nextHarvestUntil = block.timestamp + MAX_HARVEST_INTERVAL;
}
emit Claimed(_pid, _tokenIds, totalRewards);
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| poolInfo[_pid].remainedRewards>=totalRewards,"Insufficient rewards" | 411,491 | poolInfo[_pid].remainedRewards>=totalRewards |
"CANNOT GIVE REWARD!" | pragma solidity ^0.8.0;
contract GirlesNFTStaking is Ownable, ReentrancyGuard {
using Strings for uint256;
using EnumerableSet for EnumerableSet.UintSet;
IERC20 public rewardToken;
uint public rewardTokenSupply;
struct PoolInfo {
ERC721 nftContract;
bool isActive;
uint256 allocPoint;
uint256 claimedRewards;
uint256 remainedRewards;
uint256 emissionRate;
uint256 totalStakedNFT;
}
PoolInfo[] public poolInfo;
// Info of each user.
struct UserInfo {
uint256 amount; // How many NFT tokens the user has staked.
uint256 nextHarvestUntil; // When can the user harvest again.
uint256 totalEarnedRewards;
}
mapping(uint256 => mapping(address => UserInfo)) public userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
struct Stake {
uint8 poolId;
address beneficiary;
uint256 lastClaimedBlockTime;
ERC721 nftContract;
uint256 tokenId;
uint256 claimedTokens;
bool isActive;
}
// pool id => tokenId => stake
mapping(uint8 => mapping(uint256 => Stake)) public Stakes;
// mapping of active staking count by wallet.
mapping(uint8 => mapping(address => uint256)) public ActiveStakes;
mapping(uint8 => mapping(address => EnumerableSet.UintSet)) private CurrentStakedTokens;
uint256 public constant MAX_HARVEST_INTERVAL = 1 minutes; //1 days;
event RewardTokenAdded(address indexed _from, uint256 _amount);
event RewardTokenRemoved(address indexed _to, uint256 _amount);
event Staked(uint8 pid, uint256[] tokenIds);
event UnStaked(uint8 pid, uint256[] tokenIds);
event Claimed(uint8 pid, uint256[] tokenIds, uint256 amount);
constructor(address _rewardToken) {
}
function add(ERC721 _nftContract, uint256 _allocPoint, uint256 _emissionRate)
external onlyOwner {
}
function set(uint8 _pid, uint256 _allocPoint, uint256 _emissionRate) external onlyOwner {
}
function setEnableStaking(uint8 _pid, bool _bEnable) external onlyOwner {
}
function addReward(uint256 _amount) external onlyOwner {
}
function removeStakedTokenReward(uint256 _amount) external onlyOwner {
}
function setEmissionRate(uint8 _pid, uint256 _rate) external onlyOwner {
}
function stake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
function unStake(uint8 _pid, uint256[] memory _tokenIds) external nonReentrant {
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdraw(uint8 _pid, uint256[] memory _tokenIds) public nonReentrant{
}
// rescue your tokens, for emergency purposes. don't care about rewards, reset reward timer.
function emergencyWithdrawAll(uint8 _pid) external {
}
// View function to see if user can harvest STAR.
function canHarvest(uint8 _pid, address _user) public view returns (bool) {
}
function claimReward(uint8 _pid, uint256[] memory _tokenIds) private {
require(poolInfo[_pid].isActive == true, 'Deposite: DISABLE CLAIM');
require(_tokenIds.length > 0, "Must have at least one token staked!");
require(canHarvest(_pid, msg.sender), "Can't claim yet!");
uint256 totalRewards;
uint256 rewards;
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(Stakes[_pid][_tokenIds[i]].beneficiary == msg.sender, "Not the stake owner");
require(Stakes[_pid][_tokenIds[i]].isActive, "Not staked");
rewards = (block.timestamp - Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime) * poolInfo[_pid].emissionRate;
totalRewards += rewards;
Stakes[_pid][_tokenIds[i]].lastClaimedBlockTime = block.timestamp;
Stakes[_pid][_tokenIds[i]].claimedTokens += rewards;
}
if (totalRewards > 0) {
require(rewardToken.balanceOf(address(this)) >= totalRewards, "Insufficient rewards");
require(poolInfo[_pid].remainedRewards >= totalRewards, "Insufficient rewards");
require(<FILL_ME>)
rewardTokenSupply -= totalRewards;
poolInfo[_pid].claimedRewards += totalRewards;
poolInfo[_pid].remainedRewards -= totalRewards;
UserInfo storage user = userInfo[_pid][msg.sender];
user.totalEarnedRewards += totalRewards;
user.nextHarvestUntil = block.timestamp + MAX_HARVEST_INTERVAL;
}
emit Claimed(_pid, _tokenIds, totalRewards);
}
function claimAll(uint8 _pid) public nonReentrant{
}
function getAllRewards(uint8 _pid, address _owner) public view returns (uint256) {
}
function getRewardsByTokenId(uint8 _pid, uint256 _tokenId)
public view returns (uint256) {
}
function activeTokenIdsOf(uint8 _pid, address _owner)
public view returns (uint256[] memory, string[] memory){
}
function getStakes(uint8 _pid, uint256[] memory _tokenIds)
external view returns (Stake[] memory) {
}
function stakedTokenIdByIndex(uint8 _pid, address _owner, uint256 _idx)
public view virtual returns (uint256) {
}
}
| rewardToken.transfer(msg.sender,totalRewards),"CANNOT GIVE REWARD!" | 411,491 | rewardToken.transfer(msg.sender,totalRewards) |
Subsets and Splits