ETH Price: $3,113.33 (-13.55%)

Contract

0x92b15455C033264A1536b3d3CC5a0BC7b73A6b63
 

Overview

ETH Balance

0.000938453884795893 ETH

Eth Value

$2.92 (@ $3,113.33/ETH)

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Deactivate Presa...234133152025-09-21 18:49:2344 days ago1758480563IN
0x92b15455...7b73A6b63
0 ETH0.000033121.12570691
Initialize Pool234133012025-09-21 18:46:2344 days ago1758480383IN
0x92b15455...7b73A6b63
0 ETH0.000003490.1251228
Approve234039012025-09-20 11:11:5945 days ago1758366719IN
0x92b15455...7b73A6b63
0 ETH0.000054951.19404465
Unlock Tokens234038872025-09-20 11:09:1145 days ago1758366551IN
0x92b15455...7b73A6b63
0 ETH0.000032921.17503192
Activate Presale234038782025-09-20 11:07:2345 days ago1758366443IN
0x92b15455...7b73A6b63
0 ETH0.000043521.20333186
Set Uniswap Fee ...234035042025-09-20 9:51:4745 days ago1758361907IN
0x92b15455...7b73A6b63
0 ETH0.000043581.20398177
Unlock Tokens234035022025-09-20 9:51:2345 days ago1758361883IN
0x92b15455...7b73A6b63
0 ETH0.000056281.17456853
Purchase Tokens234034232025-09-20 9:35:2345 days ago1758360923IN
0x92b15455...7b73A6b63
0.00009999 ETH0.000031441.28780289
Purchase Tokens234034172025-09-20 9:34:1145 days ago1758360851IN
0x92b15455...7b73A6b63
0.00019999 ETH0.000031391.28547951
Deactivate Presa...234034092025-09-20 9:32:3545 days ago1758360755IN
0x92b15455...7b73A6b63
0 ETH0.000030951.25669727
Purchase Tokens234033102025-09-20 9:12:3545 days ago1758359555IN
0x92b15455...7b73A6b63
0.00009999 ETH0.00008041.23713046
Buy Opepen Floor234030912025-09-20 8:28:2345 days ago1758356903IN
0x92b15455...7b73A6b63
0 ETH0.000008130.24764789
Buy Opepen Floor234030782025-09-20 8:25:4745 days ago1758356747IN
0x92b15455...7b73A6b63
0 ETH0.000009270.28227247
Buy Opepen Floor234030652025-09-20 8:22:5945 days ago1758356579IN
0x92b15455...7b73A6b63
0 ETH0.000008160.24845864
Transfer234028992025-09-20 7:49:4745 days ago1758354587IN
0x92b15455...7b73A6b63
0.00060134 ETH0.000026391.15901678
Activate Presale234021352025-09-20 5:16:2345 days ago1758345383IN
0x92b15455...7b73A6b63
0 ETH0.000008490.16830991
Buy Opepen Floor234020352025-09-20 4:56:1145 days ago1758344171IN
0x92b15455...7b73A6b63
0 ETH0.000004290.1306568
Transfer234018672025-09-20 4:22:2345 days ago1758342143IN
0x92b15455...7b73A6b63
0.000016 ETH0.000026781.17596928
Transfer234017912025-09-20 4:07:1145 days ago1758341231IN
0x92b15455...7b73A6b63
0.0004 ETH0.000027521.2086719
Transfer234016002025-09-20 3:28:4745 days ago1758338927IN
0x92b15455...7b73A6b63
0.002 ETH0.000026541.16527092
Buy Opepen Floor234015872025-09-20 3:26:1145 days ago1758338771IN
0x92b15455...7b73A6b63
0 ETH0.000005840.17783157
Buy Opepen Floor234015792025-09-20 3:24:3545 days ago1758338675IN
0x92b15455...7b73A6b63
0 ETH0.000005480.166896
Buy Opepen Floor234015782025-09-20 3:24:2345 days ago1758338663IN
0x92b15455...7b73A6b63
0 ETH0.000005480.166896
Transfer234015122025-09-20 3:11:1145 days ago1758337871IN
0x92b15455...7b73A6b63
0.0023 ETH0.000026871.17985994
Buy Opepen Floor234014502025-09-20 2:58:3545 days ago1758337115IN
0x92b15455...7b73A6b63
0 ETH0.000005570.16960845
View all transactions

Latest 20 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer234030912025-09-20 8:28:2345 days ago1758356903
0x92b15455...7b73A6b63
0.00000927 ETH
Transfer234030782025-09-20 8:25:4745 days ago1758356747
0x92b15455...7b73A6b63
0.00000816 ETH
Transfer234030652025-09-20 8:22:5945 days ago1758356579
0x92b15455...7b73A6b63
0.00242 ETH
Transfer234020352025-09-20 4:56:1145 days ago1758344171
0x92b15455...7b73A6b63
0.000011 ETH
Transfer234015872025-09-20 3:26:1145 days ago1758338771
0x92b15455...7b73A6b63
0.00156903 ETH
Transfer234015792025-09-20 3:24:3545 days ago1758338675
0x92b15455...7b73A6b63
0.00000548 ETH
Transfer234015782025-09-20 3:24:2345 days ago1758338663
0x92b15455...7b73A6b63
0.00106521 ETH
Transfer234014502025-09-20 2:58:3545 days ago1758337115
0x92b15455...7b73A6b63
0.00000579 ETH
Transfer234014482025-09-20 2:58:1145 days ago1758337091
0x92b15455...7b73A6b63
0.00000579 ETH
Transfer234014472025-09-20 2:57:5945 days ago1758337079
0x92b15455...7b73A6b63
0.00223195 ETH
Transfer234014212025-09-20 2:52:4745 days ago1758336767
0x92b15455...7b73A6b63
0.0000058 ETH
Transfer234014192025-09-20 2:52:2345 days ago1758336743
0x92b15455...7b73A6b63
0.00000538 ETH
Transfer234014172025-09-20 2:51:5945 days ago1758336719
0x92b15455...7b73A6b63
0.00000532 ETH
Transfer234014132025-09-20 2:51:1145 days ago1758336671
0x92b15455...7b73A6b63
0.00000533 ETH
Transfer234013822025-09-20 2:44:5945 days ago1758336299
0x92b15455...7b73A6b63
0.00213269 ETH
Transfer234013132025-09-20 2:31:1145 days ago1758335471
0x92b15455...7b73A6b63
0.00223563 ETH
Transfer234011932025-09-20 2:07:1145 days ago1758334031
0x92b15455...7b73A6b63
0.0022336 ETH
Transfer234011462025-09-20 1:57:4745 days ago1758333467
0x92b15455...7b73A6b63
0.00000594 ETH
Transfer234011352025-09-20 1:55:3545 days ago1758333335
0x92b15455...7b73A6b63
0.00201742 ETH
Transfer234008912025-09-20 1:06:3545 days ago1758330395
0x92b15455...7b73A6b63
0.0001 ETH
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OpepenStrategy

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 23 : OpepenStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@uniswap/universal-router/contracts/interfaces/IUniversalRouter.sol";
import "lib/v4-core/src/interfaces/IPoolManager.sol";
import "lib/v4-core/src/types/PoolId.sol";
import "lib/v4-core/src/types/PoolKey.sol";
import "lib/v4-core/src/types/Currency.sol";
import "lib/v4-core/src/interfaces/IHooks.sol";

// OpenSea integration interfaces
interface IOpenSeaSeaport {
    function fulfillOrder(
        Order calldata order,
        bytes32 fulfillerConduitKey,
        address recipient,
        uint256 maximumFulfilled
    ) external payable returns (bool fulfilled);
    
    function createOrder(
        OrderParameters calldata parameters,
        bytes calldata signature
    ) external returns (bytes32 orderHash);
    
    function getOrderHash(OrderParameters calldata parameters) external view returns (bytes32);
}

interface IERC721 {
    function safeTransferFrom(address from, address to, uint256 tokenId) external;
    function ownerOf(uint256 tokenId) external view returns (address);
    function approve(address to, uint256 tokenId) external;
    function getApproved(uint256 tokenId) external view returns (address);
    function setApprovalForAll(address operator, bool approved) external;
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

interface IERC1155 {
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
    function balanceOf(address account, uint256 id) external view returns (uint256);
    function setApprovalForAll(address operator, bool approved) external;
    function isApprovedForAll(address account, address operator) external view returns (bool);
}

// OpenSea Seaport Order structure
struct Order {
    address offerer;
    address zone;
    OfferItem[] offer;
    ConsiderationItem[] consideration;
    OrderType orderType;
    uint256 startTime;
    uint256 endTime;
    bytes32 zoneHash;
    uint256 salt;
    bytes32 conduitKey;
    uint256 totalOriginalConsiderationItems;
}

// OpenSea Seaport OrderParameters structure
struct OrderParameters {
    address offerer;
    address zone;
    OfferItem[] offer;
    ConsiderationItem[] consideration;
    OrderType orderType;
    uint256 startTime;
    uint256 endTime;
    bytes32 zoneHash;
    uint256 salt;
    bytes32 conduitKey;
    uint256 totalOriginalConsiderationItems;
}

struct OfferItem {
    ItemType itemType;
    address token;
    uint256 identifierOrCriteria;
    uint256 startAmount;
    uint256 endAmount;
    address recipient;
}

struct ConsiderationItem {
    ItemType itemType;
    address token;
    uint256 identifierOrCriteria;
    uint256 startAmount;
    uint256 endAmount;
    address recipient;
}

enum OrderType {
    FULL_OPEN,
    PARTIAL_OPEN,
    FULL_RESTRICTED,
    PARTIAL_RESTRICTED
}

enum ItemType {
    NATIVE,
    ERC20,
    ERC721,
    ERC1155,
    ERC721_WITH_CRITERIA,
    ERC1155_WITH_CRITERIA
}

contract OpepenStrategy is ERC20, Ownable, ReentrancyGuard {
	// State variables
	bool public isPresaleActive;
	bool public isUnlocked;
	// Price in wei per whole token (1e18 base units)
	uint256 public presalePrice;
	uint256 public constant TREASURY_FEE_PERCENT = 8;
	uint256 public constant DEV_FEE_PERCENT = 1;
	uint256 public constant BURN_FEE_PERCENT = 1;
	uint256 public constant TOTAL_FEE_PERCENT = 10;
	
	address public treasury;
	address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
	address public devWallet;
	
	// OpenSea integration
	address public openseaSeaport;
	address public opepenContract;
	address public backendAPI;
	
	// Opepen floor configuration
	bool public isOpepenFloorEnabled;
	uint256 public opepenFloorSlippage;
	
	// Uniswap Universal Router integration
	IUniversalRouter public immutable universalRouter;
	IPoolManager public immutable poolManager;
	PoolId public immutable poolId;
	address public uniswapFeeReceiver; // Wallet to receive swapped ETH
	uint256 public swapThreshold; // Minimum tokens to trigger swap
	uint256 public sellFeePercent; // Fee percentage on sells
	bool private inSwap; // Prevent recursion during swaps

	
	// Enhanced Opepen functionality
	mapping(uint256 => uint256) public buyPrices;
	mapping(uint256 => uint256) public purchaseTimes;
	mapping(uint256 => address) public purchasers;
	mapping(uint256 => bytes32) public purchaseOrderHashes;
	mapping(uint256 => bool) public isTokenOwned;
	mapping(uint256 => bool) public isListed;
	mapping(uint256 => uint256) public listingPrices;
	mapping(uint256 => bytes32) public listingOrderHashes;
	mapping(uint256 => uint256) public listingStartTimes;
	mapping(uint256 => uint256) public listingEndTimes;
	mapping(address => bool) public authorizedCallers;
	
	uint256 public totalPurchased;
	uint256 public totalSpent;
	uint256 public averageBuyPrice;
	
	// Events
	event PresaleActivated(uint256 price);
	event PresaleDeactivated();
	event TokensUnlocked();
	event TokensPurchased(address indexed buyer, uint256 amount, uint256 cost);
	event FeesCollected(uint256 treasuryAmount, uint256 devAmount, uint256 burnAmount);
	event BackendAPICalled(address indexed buyer, uint256 tokenId, bool success);
	event BuyPriceSet(uint256 indexed tokenId, uint256 buyPrice, uint256 timestamp);
	event PurchaseValidated(uint256 indexed tokenId, uint256 price, bool isValid, uint256 timestamp);
	event PurchaseOrderCreated(uint256 indexed tokenId, uint256 price, bytes32 orderHash, uint256 timestamp);
	event ListingCreated(uint256 indexed tokenId, uint256 buyPrice, uint256 listingPrice, uint256 startTime, uint256 endTime, bytes32 orderHash);
	event ListingFulfilled(uint256 indexed tokenId, address indexed buyer, uint256 price, uint256 timestamp);
	event NFTReceived(address indexed from, uint256 indexed tokenId, uint256 amount, uint256 timestamp);
	event ETHReceived(address indexed from, uint256 amount, uint256 timestamp);
	event AuthorizedCallerAdded(address indexed caller);
	event AuthorizedCallerRemoved(address indexed caller);
	event DevWalletUpdated(address indexed oldWallet, address indexed newWallet);
	event OpepenFloorBought(address indexed to, uint256 amount, uint256 timestamp);
	event TokensSwappedForETH(uint256 tokenAmount, uint256 ethAmount, uint256 timestamp);
	event SellFeeCollected(address indexed from, uint256 feeAmount, uint256 timestamp);
	event UniswapConfigUpdated(address indexed feeReceiver, uint256 swapThreshold, uint256 sellFeePercent);
	
	// Modifiers
	modifier presaleActive() {
		require(isPresaleActive, "Presale is not active");
		_;
	}
	
	modifier tokensUnlocked() {
		require(isUnlocked, "Tokens are still locked");
		_;
	}
	
	modifier onlyAuthorized() {
		require(authorizedCallers[msg.sender] || msg.sender == owner(), "Not authorized");
		_;
	}
	
	constructor(
		string memory name,
		string memory symbol,
		uint256 initialSupply,
		address _treasury,
		address _devWallet,
		address _openseaSeaport,
		address _opepenContract,
		address _backendAPI,
		address _universalRouter,
		address _poolManager,
		uint256 _swapThreshold,
		uint256 _sellFeePercent
	) ERC20(name, symbol) Ownable(msg.sender) {
		require(_treasury != address(0), "Treasury address cannot be zero");
		require(_devWallet != address(0), "Dev wallet address cannot be zero");
		require(_openseaSeaport != address(0), "OpenSea Seaport address cannot be zero");
		require(_opepenContract != address(0), "Opepen contract address cannot be zero");
		require(_backendAPI != address(0), "Backend API address cannot be zero");
		require(_universalRouter != address(0), "Universal router address cannot be zero");
		require(_poolManager != address(0), "Pool manager address cannot be zero");
		require(_swapThreshold > 0, "Swap threshold must be greater than zero");
		require(_sellFeePercent <= 100, "Sell fee percent cannot exceed 100%");
		
		treasury = _treasury;
		devWallet = _devWallet;
		openseaSeaport = _openseaSeaport;
		opepenContract = _opepenContract;
		backendAPI = _backendAPI;
		
		// Initialize Uniswap Universal Router and V4 PoolManager
		universalRouter = IUniversalRouter(_universalRouter);
		poolManager = IPoolManager(_poolManager);
		
		// Create V4 pool for this token with ETH
		PoolKey memory poolKey = PoolKey({
			currency0: Currency.wrap(address(this)),
			currency1: Currency.wrap(address(0)), // Native ETH
			fee: 3000, // 0.3% fee tier
			tickSpacing: 60,
			hooks: IHooks(address(0)) // No hooks for now
		});
		poolId = PoolIdLibrary.toId(poolKey);
		
		// Initialize the pool (this will be called after deployment)
		// Note: Pool initialization needs to be done separately as it requires ETH
		
		uniswapFeeReceiver = msg.sender; // Set owner as initial fee receiver
		swapThreshold = _swapThreshold;
		sellFeePercent = _sellFeePercent;
		
		// Set default presale price to 0.000000011 ETH (11 gwei)
		presalePrice = 11000000000; // 0.000000011 ETH in wei
		
		// Initialize Opepen floor configuration
		isOpepenFloorEnabled = false;
		opepenFloorSlippage = 500; // 5% default slippage (500 basis points)
		
		// Mint initial supply to owner (admin)
		_mint(msg.sender, initialSupply);
		
		// Pre-approve Universal Router for maximum token allowance
		_approve(address(this), _universalRouter, type(uint256).max);
	}
	
	/**
	 * @dev Activate presale with specified price per whole token (wei)
	 * @param priceWei Price in wei per 1 whole token (1e18 units)
	 */
	function activatePresale(uint256 priceWei) external onlyOwner {
		require(priceWei > 0, "Price must be greater than zero");
		presalePrice = priceWei;
		isPresaleActive = true;
		emit PresaleActivated(priceWei);
	}
	
	/**
	 * @dev Deactivate presale
	 */
	function deactivatePresale() external onlyOwner {
		isPresaleActive = false;
		emit PresaleDeactivated();
	}
	
	/**
	 * @dev Unlock tokens to allow transfers
	 */
	function unlockTokens() external onlyOwner {
		isUnlocked = true;
		emit TokensUnlocked();
	}
	
	/**
	 * @dev Purchase tokens during presale
	 * @param amount Number of tokens to purchase (in base units, 18 decimals)
	 */
	function purchaseTokens(uint256 amount) external payable presaleActive nonReentrant {
		require(amount > 0, "Amount must be greater than zero");
		// requiredETH = amount * presalePrice / 1e18 (price is per whole token)
		uint256 requiredETH = (amount * presalePrice) / 1e18;
		require(msg.value >= requiredETH, "Insufficient ETH sent");
		
		// Check if owner has enough tokens
		require(balanceOf(owner()) >= amount, "Insufficient tokens available for sale");
		
		// Transfer tokens from owner to buyer
		_transfer(owner(), msg.sender, amount);
		
		// Refund excess ETH
		if (msg.value > requiredETH) {
			payable(msg.sender).transfer(msg.value - requiredETH);
		}
		
		emit TokensPurchased(msg.sender, amount, requiredETH);
	}
	
	/**
	 * @dev Override transfer function to add fees and check unlock status
	 */
	function _update(address from, address to, uint256 amount) internal override {
		// Allow minting (from == address(0)) and burning (to == address(0))
		if (from == address(0) || to == address(0)) {
			super._update(from, to, amount);
			return;
		}
		
		// During presale, only allow transfers from owner (for purchases)
		if (!isUnlocked && from != owner()) {
			revert("Tokens are locked and cannot be transferred");
		}
		
		// Check if this is a sell to Uniswap pool (V4 doesn't have a specific pair address)
		// We'll detect sells by checking if the recipient is the pool manager
		bool isSellToUniswap = !inSwap && isUnlocked && to == address(poolManager) && from != owner();
		
		// Apply regular fees for all transfers (not presale purchases)
		if (isUnlocked && from != owner() && to != owner()) {
			uint256 feeAmount = (amount * TOTAL_FEE_PERCENT) / 100;
			uint256 treasuryFee = (amount * TREASURY_FEE_PERCENT) / 100;
			uint256 devFee = (amount * DEV_FEE_PERCENT) / 100;
			uint256 burnFee = (amount * BURN_FEE_PERCENT) / 100;
			
			// Transfer tokens minus fees
			super._update(from, to, amount - feeAmount);
			
			// Transfer treasury fee (goes to treasury wallet)
			super._update(from, treasury, treasuryFee);
			
			// Transfer dev fee (goes to dev wallet)
			super._update(from, devWallet, devFee);
			
			// Burn tokens (transfer to burn address)
			super._update(from, BURN_ADDRESS, burnFee);
			
			emit FeesCollected(treasuryFee, devFee, burnFee);
			
			// Trigger swap if this is a sell to Uniswap pair and threshold is met
			if (isSellToUniswap) {
				uint256 contractBalance = balanceOf(address(this));
				if (contractBalance >= swapThreshold && !inSwap) {
					inSwap = true;
					_swapTokensForETH(contractBalance);
					inSwap = false;
				}
			}
		} else {
			// No fees for presale purchases or owner transfers
			super._update(from, to, amount);
		}
	}
	
	/**
	 * @dev Update treasury address
	 */
	function setTreasury(address _treasury) external onlyOwner {
		require(_treasury != address(0), "Treasury address cannot be zero");
		treasury = _treasury;
	}
	
	/**
	 * @dev Update dev wallet address
	 */
	function setDevWallet(address _devWallet) external onlyOwner {
		require(_devWallet != address(0), "Dev wallet address cannot be zero");
		address oldWallet = devWallet;
		devWallet = _devWallet;
		emit DevWalletUpdated(oldWallet, _devWallet);
	}
	
	/**
	 * @dev Buy Opepen floor with specific amount of ETH (only owner)
	 * @param amount Amount of ETH to use for buying Opepen floor in wei
	 */
	function BuyOpepenFloor(uint256 amount) external onlyOwner {
		require(amount > 0, "Amount must be greater than zero");
		require(address(this).balance >= amount, "Insufficient ETH balance");
		payable(owner()).transfer(amount);
		emit OpepenFloorBought(owner(), amount, block.timestamp);
	}
	
	/**
	 * @dev Buy Opepen floor with all ETH from contract (only owner) - emergency function
	 */
	function BuyOpepenFloorAll() external onlyOwner {
		uint256 balance = address(this).balance;
		require(balance > 0, "No ETH to buy Opepen floor");
		payable(owner()).transfer(balance);
		emit OpepenFloorBought(owner(), balance, block.timestamp);
	}
	
	/**
	 * @dev Get presale status
	 */
	function getPresaleStatus() external view returns (bool active, bool unlocked, uint256 price) {
		return (isPresaleActive, isUnlocked, presalePrice);
	}
	
	/**
	 * @dev Get available tokens for presale
	 */
	function getAvailableTokensForPresale() external view returns (uint256) {
		return balanceOf(owner());
	}
	
	/**
	 * @dev Update OpenSea Seaport address
	 */
	function setOpenSeaSeaport(address _seaport) external onlyOwner {
		require(_seaport != address(0), "Seaport address cannot be zero");
		openseaSeaport = _seaport;
	}
	
	/**
	 * @dev Update Opepen contract address
	 */
	function setOpepenContract(address _opepen) external onlyOwner {
		require(_opepen != address(0), "Opepen contract address cannot be zero");
		opepenContract = _opepen;
	}
	
	/**
	 * @dev Update backend API address
	 */
	function setBackendAPI(address _api) external onlyOwner {
		require(_api != address(0), "Backend API address cannot be zero");
		backendAPI = _api;
	}
	
	/**
	 * @dev Enable or disable Opepen floor functionality
	 */
	function setOpepenFloorEnabled(bool _enabled) external onlyOwner {
		isOpepenFloorEnabled = _enabled;
	}
	
	/**
	 * @dev Set Opepen floor slippage (in basis points, e.g., 500 = 5%)
	 */
	function setOpepenFloorSlippage(uint256 _slippage) external onlyOwner {
		require(_slippage <= 10000, "Slippage cannot exceed 100%");
		opepenFloorSlippage = _slippage;
	}
	
	/**
	 * @dev Update Uniswap fee receiver address
	 */
	function setUniswapFeeReceiver(address _feeReceiver) external onlyOwner {
		require(_feeReceiver != address(0), "Fee receiver address cannot be zero");
		uniswapFeeReceiver = _feeReceiver;
		emit UniswapConfigUpdated(_feeReceiver, swapThreshold, sellFeePercent);
	}
	
	/**
	 * @dev Update swap threshold
	 */
	function setSwapThreshold(uint256 _swapThreshold) external onlyOwner {
		require(_swapThreshold > 0, "Swap threshold must be greater than zero");
		swapThreshold = _swapThreshold;
		emit UniswapConfigUpdated(uniswapFeeReceiver, _swapThreshold, sellFeePercent);
	}
	
	/**
	 * @dev Update sell fee percentage
	 */
	function setSellFeePercent(uint256 _sellFeePercent) external onlyOwner {
		require(_sellFeePercent <= 100, "Sell fee percent cannot exceed 100%");
		sellFeePercent = _sellFeePercent;
		emit UniswapConfigUpdated(uniswapFeeReceiver, swapThreshold, _sellFeePercent);
	}
	
	/**
	 * @dev Initialize V4 pool with initial liquidity
	 * @param sqrtPriceX96 Initial price for the pool
	 */
	function initializePool(uint160 sqrtPriceX96) external onlyOwner {
		PoolKey memory poolKey = PoolKey({
			currency0: Currency.wrap(address(this)),
			currency1: Currency.wrap(address(0)), // Native ETH
			fee: 3000, // 0.3% fee tier
			tickSpacing: 60,
			hooks: IHooks(address(0)) // No hooks for now
		});
		
		poolManager.initialize(poolKey, sqrtPriceX96);
	}
	
	/**
	 * @dev Manually trigger token swap (emergency function)
	 */
	function manualSwap() external onlyOwner {
		uint256 contractBalance = balanceOf(address(this));
		require(contractBalance > 0, "No tokens to swap");
		require(!inSwap, "Swap already in progress");
		
		inSwap = true;
		_swapTokensForETH(contractBalance);
		inSwap = false;
	}
	
	/**
	 * @dev Add authorized caller (backend)
	 */
	function addAuthorizedCaller(address caller) external onlyOwner {
		require(caller != address(0), "Caller address cannot be zero");
		authorizedCallers[caller] = true;
		emit AuthorizedCallerAdded(caller);
	}
	
	/**
	 * @dev Remove authorized caller
	 */
	function removeAuthorizedCaller(address caller) external onlyOwner {
		authorizedCallers[caller] = false;
		emit AuthorizedCallerRemoved(caller);
	}
	
	/**
	 * @dev Receive ETH (for sales)
	 */
	receive() external payable {
		emit ETHReceived(msg.sender, msg.value, block.timestamp);
	}
	
	/**
	 * @dev Fallback function
	 */
	fallback() external payable {
		emit ETHReceived(msg.sender, msg.value, block.timestamp);
	}
	
	/**
	 * @dev Get listing information for a token
	 */
	function getListingInfo(uint256 tokenId) external view returns (
		bool listed,
		uint256 price,
		uint256 startTime,
		uint256 endTime,
		bytes32 orderHash
	) {
		return (
			isListed[tokenId],
			listingPrices[tokenId],
			listingStartTimes[tokenId],
			listingEndTimes[tokenId],
			listingOrderHashes[tokenId]
		);
	}
	
	/**
	 * @dev Check if address is authorized caller
	 */
	function isAuthorizedCaller(address caller) external view returns (bool) {
		return authorizedCallers[caller] || caller == owner();
	}
	
	/**
	 * @dev Get contract's ETH balance
	 */
	function getETHBalance() external view returns (uint256) {
		return address(this).balance;
	}
	
	/**
	 * @dev Emergency function to cancel a listing
	 */
	function cancelListing(uint256 tokenId) external onlyOwner {
		require(isListed[tokenId], "Token not listed");
		isListed[tokenId] = false;
		emit ListingCreated(tokenId, buyPrices[tokenId], 0, 0, 0, bytes32(0)); // Emit with 0 values to indicate cancellation
	}
	
	/**
	 * @dev Create Opepen listing (admin only)
	 * This function creates a listing on OpenSea for an NFT owned by the contract
	 */
	function createListing(
		uint256 tokenId,
		uint256 listingPrice,
		uint256 startTime,
		uint256 endTime,
		uint256 salt
	) external onlyOwner returns (bytes32 orderHash) {
		require(isTokenOwned[tokenId], "Token not owned by contract");
		require(buyPrices[tokenId] > 0, "Buy price not set");
		require(!isListed[tokenId], "Token already listed");
		require(listingPrice > 0, "Listing price must be greater than zero");
		require(endTime > startTime, "End time must be after start time");
		require(startTime >= block.timestamp, "Start time must be in the future");
		
		// Create OpenSea Seaport order parameters
		OrderParameters memory orderParams = OrderParameters({
			offerer: address(this),
			zone: address(0), // No zone restriction
			offer: _createOfferItems(tokenId),
			consideration: _createConsiderationItems(listingPrice),
			orderType: OrderType.FULL_OPEN,
			startTime: startTime,
			endTime: endTime,
			zoneHash: bytes32(0),
			salt: salt,
			conduitKey: bytes32(0),
			totalOriginalConsiderationItems: 1
		});
		
		// Get order hash from OpenSea Seaport
		orderHash = IOpenSeaSeaport(openseaSeaport).getOrderHash(orderParams);
		
		// Update listing status
		isListed[tokenId] = true;
		listingPrices[tokenId] = listingPrice;
		listingOrderHashes[tokenId] = orderHash;
		listingStartTimes[tokenId] = startTime;
		listingEndTimes[tokenId] = endTime;
		
		emit ListingCreated(tokenId, buyPrices[tokenId], listingPrice, startTime, endTime, orderHash);
	}
	
	/**
	 * @dev Fulfill a listing (when someone buys the NFT)
	 */
	function fulfillListing(
		uint256 tokenId,
		address buyer
	) external payable onlyAuthorized nonReentrant {
		require(isListed[tokenId], "Token not listed");
		require(block.timestamp >= listingStartTimes[tokenId], "Listing not started");
		require(block.timestamp <= listingEndTimes[tokenId], "Listing expired");
		require(msg.value >= listingPrices[tokenId], "Insufficient payment");
		
		// Transfer NFT to buyer
		IERC721(opepenContract).safeTransferFrom(address(this), buyer, tokenId);
		
		// Update ownership status
		isTokenOwned[tokenId] = false;
		isListed[tokenId] = false;
		
		// Distribute payment
		uint256 listingPrice = listingPrices[tokenId];
		uint256 excess = msg.value - listingPrice;
		
		// Send excess back to buyer
		if (excess > 0) {
			payable(buyer).transfer(excess);
		}
		
		emit ListingFulfilled(tokenId, buyer, listingPrice, block.timestamp);
	}
	
	/**
	 * @dev Receive NFT from user (for listing)
	 */
	function receiveNFT(
		uint256 tokenId,
		uint256 buyPrice
	) external {
		require(IERC721(opepenContract).ownerOf(tokenId) == address(this), "Contract doesn't own token");
		require(buyPrice > 0, "Buy price must be greater than zero");
		
		isTokenOwned[tokenId] = true;
		buyPrices[tokenId] = buyPrice;
		purchaseTimes[tokenId] = block.timestamp;
		purchasers[tokenId] = msg.sender;
		
		emit NFTReceived(msg.sender, tokenId, 1, block.timestamp);
	}
	
	/**
	 * @dev Create offer items for OpenSea order
	 */
	function _createOfferItems(uint256 tokenId) internal view returns (OfferItem[] memory) {
		OfferItem[] memory offer = new OfferItem[](1);
		offer[0] = OfferItem({
			itemType: ItemType.ERC721,
			token: opepenContract,
			identifierOrCriteria: tokenId,
			startAmount: 1,
			endAmount: 1,
			recipient: address(0)
		});
		return offer;
	}
	
	/**
	 * @dev Create consideration items for OpenSea order
	 */
	function _createConsiderationItems(uint256 price) internal view returns (ConsiderationItem[] memory) {
		ConsiderationItem[] memory consideration = new ConsiderationItem[](1);
		consideration[0] = ConsiderationItem({
			itemType: ItemType.NATIVE,
			token: address(0),
			identifierOrCriteria: 0,
			startAmount: price,
			endAmount: price,
			recipient: payable(address(this))
		});
		return consideration;
	}
	
	/**
	 * @dev Get fee configuration
	 */
	function getFeeConfig() external view returns (
		uint256 treasuryFeePercent,
		uint256 devFeePercent,
		uint256 burnFeePercent,
		uint256 totalFeePercent,
		address treasuryAddress,
		address devWalletAddress
	) {
		return (
			TREASURY_FEE_PERCENT,
			DEV_FEE_PERCENT,
			BURN_FEE_PERCENT,
			TOTAL_FEE_PERCENT,
			treasury,
			devWallet
		);
	}
	
	/**
	 * @dev Get Opepen floor configuration
	 */
	function getOpepenFloorConfig() external view returns (
		bool enabled,
		address seaport,
		address opepen,
		address api,
		uint256 slippage
	) {
		return (
			isOpepenFloorEnabled,
			openseaSeaport,
			opepenContract,
			backendAPI,
			opepenFloorSlippage
		);
	}
	
	/**
	 * @dev Get purchase statistics
	 */
	function getPurchaseStats() external view returns (
		uint256 total,
		uint256 spent,
		uint256 average
	) {
		return (
			totalPurchased,
			totalSpent,
			averageBuyPrice
		);
	}
	
	/**
	 * @dev Get purchase history for a token
	 */
	function getPurchaseHistory(uint256 tokenId) external view returns (
		address purchaser,
		uint256 purchaseTime,
		bool owned
	) {
		return (
			purchasers[tokenId],
			purchaseTimes[tokenId],
			isTokenOwned[tokenId]
		);
	}
	
	/**
	 * @dev Get Uniswap Universal Router configuration
	 */
	function getUniswapConfig() external view returns (
		address router,
		address poolManagerAddress,
		bytes32 poolIdValue,
		address feeReceiver,
		uint256 currentSwapThreshold,
		uint256 currentSellFeePercent,
		bool inSwapStatus
	) {
		return (
			address(universalRouter),
			address(poolManager),
			PoolId.unwrap(poolId),
			uniswapFeeReceiver,
			swapThreshold,
			sellFeePercent,
			inSwap
		);
	}
	
	/**
	 * @dev Get contract's token balance available for swapping
	 */
	function getSwapableTokenBalance() external view returns (uint256) {
		return balanceOf(address(this));
	}
	
	/**
	 * @dev Check if swap threshold is met
	 */
	function isSwapThresholdMet() external view returns (bool) {
		return balanceOf(address(this)) >= swapThreshold;
	}
	
	/**
	 * @dev Swap accumulated tokens for ETH using Universal Router with V4
	 * @param tokenAmount Amount of tokens to swap
	 */
	function _swapTokensForETH(uint256 tokenAmount) private nonReentrant {
		if (tokenAmount == 0) return;
		
		uint256 initialETHBalance = address(this).balance;
		
		// Universal Router command for V4 swap
		// Command 1 = V4_SWAP
		bytes memory commands = abi.encodePacked(uint8(1));
		
		// Encode the V4 swap parameters
		bytes memory input = abi.encode(
			poolId, // poolId
			true, // zeroForOne (token -> ETH)
			tokenAmount, // amountIn
			0, // amountOutMin (accept any amount)
			uniswapFeeReceiver // recipient
		);
		
		// Create inputs array
		bytes[] memory inputs = new bytes[](1);
		inputs[0] = input;
		
		// Execute the swap
		universalRouter.execute(commands, inputs, block.timestamp);
		
		uint256 ethReceived = address(this).balance - initialETHBalance;
		emit TokensSwappedForETH(tokenAmount, ethReceived, block.timestamp);
	}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC6093.sol)
pragma solidity >=0.8.4;

/**
 * @dev Standard ERC-20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC-721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC-1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC-20
 * applications.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

    mapping(address account => mapping(address spender => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * Both values are immutable: they can only be set once during construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /// @inheritdoc IERC20
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /// @inheritdoc IERC20
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /// @inheritdoc IERC20
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Skips emitting an {Approval} event indicating an allowance update. This is not
     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     *
     * ```solidity
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner`'s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance < type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity >=0.6.2;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.24;

interface IUniversalRouter {
    /// @notice Thrown when a required command has failed
    error ExecutionFailed(uint256 commandIndex, bytes message);

    /// @notice Thrown when attempting to send ETH directly to the contract
    error ETHNotAccepted();

    /// @notice Thrown when executing commands with an expired deadline
    error TransactionDeadlinePassed();

    /// @notice Thrown when attempting to execute commands and an incorrect number of inputs are provided
    error LengthMismatch();

    // @notice Thrown when an address that isn't WETH tries to send ETH to the router without calldata
    error InvalidEthSender();

    /// @notice Executes encoded commands along with provided inputs. Reverts if deadline has expired.
    /// @param commands A set of concatenated commands, each 1 byte in length
    /// @param inputs An array of byte strings containing abi encoded inputs for each command
    /// @param deadline The deadline by which the transaction must be executed
    function execute(bytes calldata commands, bytes[] calldata inputs, uint256 deadline) external payable;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Minimal ERC20 interface for Uniswap
/// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3
interface IERC20Minimal {
    /// @notice Returns an account's balance in the token
    /// @param account The account for which to look up the number of tokens it has, i.e. its balance
    /// @return The number of tokens held by the account
    function balanceOf(address account) external view returns (uint256);

    /// @notice Transfers the amount of token from the `msg.sender` to the recipient
    /// @param recipient The account that will receive the amount transferred
    /// @param amount The number of tokens to send from the sender to the recipient
    /// @return Returns true for a successful transfer, false for an unsuccessful transfer
    function transfer(address recipient, uint256 amount) external returns (bool);

    /// @notice Returns the current allowance given to a spender by an owner
    /// @param owner The account of the token owner
    /// @param spender The account of the token spender
    /// @return The current allowance granted by `owner` to `spender`
    function allowance(address owner, address spender) external view returns (uint256);

    /// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount`
    /// @param spender The account which will be allowed to spend a given amount of the owners tokens
    /// @param amount The amount of tokens allowed to be used by `spender`
    /// @return Returns true for a successful approval, false for unsuccessful
    function approve(address spender, uint256 amount) external returns (bool);

    /// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender`
    /// @param sender The account from which the transfer will be initiated
    /// @param recipient The recipient of the transfer
    /// @param amount The amount of the transfer
    /// @return Returns true for a successful transfer, false for unsuccessful
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`.
    /// @param from The account from which the tokens were sent, i.e. the balance decreased
    /// @param to The account to which the tokens were sent, i.e. the balance increased
    /// @param value The amount of tokens that were transferred
    event Transfer(address indexed from, address indexed to, uint256 value);

    /// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes.
    /// @param owner The account that approved spending of its tokens
    /// @param spender The account for which the spending allowance was modified
    /// @param value The new allowance from the owner to the spender
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @notice Interface for claims over a contract balance, wrapped as a ERC6909
interface IERC6909Claims {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event OperatorSet(address indexed owner, address indexed operator, bool approved);

    event Approval(address indexed owner, address indexed spender, uint256 indexed id, uint256 amount);

    event Transfer(address caller, address indexed from, address indexed to, uint256 indexed id, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                                 FUNCTIONS
    //////////////////////////////////////////////////////////////*/

    /// @notice Owner balance of an id.
    /// @param owner The address of the owner.
    /// @param id The id of the token.
    /// @return amount The balance of the token.
    function balanceOf(address owner, uint256 id) external view returns (uint256 amount);

    /// @notice Spender allowance of an id.
    /// @param owner The address of the owner.
    /// @param spender The address of the spender.
    /// @param id The id of the token.
    /// @return amount The allowance of the token.
    function allowance(address owner, address spender, uint256 id) external view returns (uint256 amount);

    /// @notice Checks if a spender is approved by an owner as an operator
    /// @param owner The address of the owner.
    /// @param spender The address of the spender.
    /// @return approved The approval status.
    function isOperator(address owner, address spender) external view returns (bool approved);

    /// @notice Transfers an amount of an id from the caller to a receiver.
    /// @param receiver The address of the receiver.
    /// @param id The id of the token.
    /// @param amount The amount of the token.
    /// @return bool True, always, unless the function reverts
    function transfer(address receiver, uint256 id, uint256 amount) external returns (bool);

    /// @notice Transfers an amount of an id from a sender to a receiver.
    /// @param sender The address of the sender.
    /// @param receiver The address of the receiver.
    /// @param id The id of the token.
    /// @param amount The amount of the token.
    /// @return bool True, always, unless the function reverts
    function transferFrom(address sender, address receiver, uint256 id, uint256 amount) external returns (bool);

    /// @notice Approves an amount of an id to a spender.
    /// @param spender The address of the spender.
    /// @param id The id of the token.
    /// @param amount The amount of the token.
    /// @return bool True, always
    function approve(address spender, uint256 id, uint256 amount) external returns (bool);

    /// @notice Sets or removes an operator for the caller.
    /// @param operator The address of the operator.
    /// @param approved The approval status.
    /// @return bool True, always
    function setOperator(address operator, bool approved) external returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @notice Interface for functions to access any storage slot in a contract
interface IExtsload {
    /// @notice Called by external contracts to access granular pool state
    /// @param slot Key of slot to sload
    /// @return value The value of the slot as bytes32
    function extsload(bytes32 slot) external view returns (bytes32 value);

    /// @notice Called by external contracts to access granular pool state
    /// @param startSlot Key of slot to start sloading from
    /// @param nSlots Number of slots to load into return value
    /// @return values List of loaded values.
    function extsload(bytes32 startSlot, uint256 nSlots) external view returns (bytes32[] memory values);

    /// @notice Called by external contracts to access sparse pool state
    /// @param slots List of slots to SLOAD from.
    /// @return values List of loaded values.
    function extsload(bytes32[] calldata slots) external view returns (bytes32[] memory values);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @notice Interface for functions to access any transient storage slot in a contract
interface IExttload {
    /// @notice Called by external contracts to access transient storage of the contract
    /// @param slot Key of slot to tload
    /// @return value The value of the slot as bytes32
    function exttload(bytes32 slot) external view returns (bytes32 value);

    /// @notice Called by external contracts to access sparse transient pool state
    /// @param slots List of slots to tload
    /// @return values List of loaded values
    function exttload(bytes32[] calldata slots) external view returns (bytes32[] memory values);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {PoolKey} from "../types/PoolKey.sol";
import {BalanceDelta} from "../types/BalanceDelta.sol";
import {IPoolManager} from "./IPoolManager.sol";
import {BeforeSwapDelta} from "../types/BeforeSwapDelta.sol";

/// @notice V4 decides whether to invoke specific hooks by inspecting the least significant bits
/// of the address that the hooks contract is deployed to.
/// For example, a hooks contract deployed to address: 0x0000000000000000000000000000000000002400
/// has the lowest bits '10 0100 0000 0000' which would cause the 'before initialize' and 'after add liquidity' hooks to be used.
/// See the Hooks library for the full spec.
/// @dev Should only be callable by the v4 PoolManager.
interface IHooks {
    /// @notice The hook called before the state of a pool is initialized
    /// @param sender The initial msg.sender for the initialize call
    /// @param key The key for the pool being initialized
    /// @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96
    /// @return bytes4 The function selector for the hook
    function beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96) external returns (bytes4);

    /// @notice The hook called after the state of a pool is initialized
    /// @param sender The initial msg.sender for the initialize call
    /// @param key The key for the pool being initialized
    /// @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96
    /// @param tick The current tick after the state of a pool is initialized
    /// @return bytes4 The function selector for the hook
    function afterInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96, int24 tick)
        external
        returns (bytes4);

    /// @notice The hook called before liquidity is added
    /// @param sender The initial msg.sender for the add liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for adding liquidity
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function beforeAddLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        bytes calldata hookData
    ) external returns (bytes4);

    /// @notice The hook called after liquidity is added
    /// @param sender The initial msg.sender for the add liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for adding liquidity
    /// @param delta The caller's balance delta after adding liquidity; the sum of principal delta, fees accrued, and hook delta
    /// @param feesAccrued The fees accrued since the last time fees were collected from this position
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return BalanceDelta The hook's delta in token0 and token1. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    function afterAddLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        BalanceDelta delta,
        BalanceDelta feesAccrued,
        bytes calldata hookData
    ) external returns (bytes4, BalanceDelta);

    /// @notice The hook called before liquidity is removed
    /// @param sender The initial msg.sender for the remove liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for removing liquidity
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function beforeRemoveLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        bytes calldata hookData
    ) external returns (bytes4);

    /// @notice The hook called after liquidity is removed
    /// @param sender The initial msg.sender for the remove liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for removing liquidity
    /// @param delta The caller's balance delta after removing liquidity; the sum of principal delta, fees accrued, and hook delta
    /// @param feesAccrued The fees accrued since the last time fees were collected from this position
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return BalanceDelta The hook's delta in token0 and token1. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    function afterRemoveLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        BalanceDelta delta,
        BalanceDelta feesAccrued,
        bytes calldata hookData
    ) external returns (bytes4, BalanceDelta);

    /// @notice The hook called before a swap
    /// @param sender The initial msg.sender for the swap call
    /// @param key The key for the pool
    /// @param params The parameters for the swap
    /// @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return BeforeSwapDelta The hook's delta in specified and unspecified currencies. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    /// @return uint24 Optionally override the lp fee, only used if three conditions are met: 1. the Pool has a dynamic fee, 2. the value's 2nd highest bit is set (23rd bit, 0x400000), and 3. the value is less than or equal to the maximum fee (1 million)
    function beforeSwap(
        address sender,
        PoolKey calldata key,
        IPoolManager.SwapParams calldata params,
        bytes calldata hookData
    ) external returns (bytes4, BeforeSwapDelta, uint24);

    /// @notice The hook called after a swap
    /// @param sender The initial msg.sender for the swap call
    /// @param key The key for the pool
    /// @param params The parameters for the swap
    /// @param delta The amount owed to the caller (positive) or owed to the pool (negative)
    /// @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return int128 The hook's delta in unspecified currency. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    function afterSwap(
        address sender,
        PoolKey calldata key,
        IPoolManager.SwapParams calldata params,
        BalanceDelta delta,
        bytes calldata hookData
    ) external returns (bytes4, int128);

    /// @notice The hook called before donate
    /// @param sender The initial msg.sender for the donate call
    /// @param key The key for the pool
    /// @param amount0 The amount of token0 being donated
    /// @param amount1 The amount of token1 being donated
    /// @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function beforeDonate(
        address sender,
        PoolKey calldata key,
        uint256 amount0,
        uint256 amount1,
        bytes calldata hookData
    ) external returns (bytes4);

    /// @notice The hook called after donate
    /// @param sender The initial msg.sender for the donate call
    /// @param key The key for the pool
    /// @param amount0 The amount of token0 being donated
    /// @param amount1 The amount of token1 being donated
    /// @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function afterDonate(
        address sender,
        PoolKey calldata key,
        uint256 amount0,
        uint256 amount1,
        bytes calldata hookData
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {Currency} from "../types/Currency.sol";
import {PoolKey} from "../types/PoolKey.sol";
import {IHooks} from "./IHooks.sol";
import {IERC6909Claims} from "./external/IERC6909Claims.sol";
import {IProtocolFees} from "./IProtocolFees.sol";
import {BalanceDelta} from "../types/BalanceDelta.sol";
import {PoolId} from "../types/PoolId.sol";
import {IExtsload} from "./IExtsload.sol";
import {IExttload} from "./IExttload.sol";

/// @notice Interface for the PoolManager
interface IPoolManager is IProtocolFees, IERC6909Claims, IExtsload, IExttload {
    /// @notice Thrown when a currency is not netted out after the contract is unlocked
    error CurrencyNotSettled();

    /// @notice Thrown when trying to interact with a non-initialized pool
    error PoolNotInitialized();

    /// @notice Thrown when unlock is called, but the contract is already unlocked
    error AlreadyUnlocked();

    /// @notice Thrown when a function is called that requires the contract to be unlocked, but it is not
    error ManagerLocked();

    /// @notice Pools are limited to type(int16).max tickSpacing in #initialize, to prevent overflow
    error TickSpacingTooLarge(int24 tickSpacing);

    /// @notice Pools must have a positive non-zero tickSpacing passed to #initialize
    error TickSpacingTooSmall(int24 tickSpacing);

    /// @notice PoolKey must have currencies where address(currency0) < address(currency1)
    error CurrenciesOutOfOrderOrEqual(address currency0, address currency1);

    /// @notice Thrown when a call to updateDynamicLPFee is made by an address that is not the hook,
    /// or on a pool that does not have a dynamic swap fee.
    error UnauthorizedDynamicLPFeeUpdate();

    /// @notice Thrown when trying to swap amount of 0
    error SwapAmountCannotBeZero();

    ///@notice Thrown when native currency is passed to a non native settlement
    error NonzeroNativeValue();

    /// @notice Thrown when `clear` is called with an amount that is not exactly equal to the open currency delta.
    error MustClearExactPositiveDelta();

    /// @notice Emitted when a new pool is initialized
    /// @param id The abi encoded hash of the pool key struct for the new pool
    /// @param currency0 The first currency of the pool by address sort order
    /// @param currency1 The second currency of the pool by address sort order
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @param tickSpacing The minimum number of ticks between initialized ticks
    /// @param hooks The hooks contract address for the pool, or address(0) if none
    /// @param sqrtPriceX96 The price of the pool on initialization
    /// @param tick The initial tick of the pool corresponding to the initialized price
    event Initialize(
        PoolId indexed id,
        Currency indexed currency0,
        Currency indexed currency1,
        uint24 fee,
        int24 tickSpacing,
        IHooks hooks,
        uint160 sqrtPriceX96,
        int24 tick
    );

    /// @notice Emitted when a liquidity position is modified
    /// @param id The abi encoded hash of the pool key struct for the pool that was modified
    /// @param sender The address that modified the pool
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param liquidityDelta The amount of liquidity that was added or removed
    /// @param salt The extra data to make positions unique
    event ModifyLiquidity(
        PoolId indexed id, address indexed sender, int24 tickLower, int24 tickUpper, int256 liquidityDelta, bytes32 salt
    );

    /// @notice Emitted for swaps between currency0 and currency1
    /// @param id The abi encoded hash of the pool key struct for the pool that was modified
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param amount0 The delta of the currency0 balance of the pool
    /// @param amount1 The delta of the currency1 balance of the pool
    /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
    /// @param liquidity The liquidity of the pool after the swap
    /// @param tick The log base 1.0001 of the price of the pool after the swap
    /// @param fee The swap fee in hundredths of a bip
    event Swap(
        PoolId indexed id,
        address indexed sender,
        int128 amount0,
        int128 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick,
        uint24 fee
    );

    /// @notice Emitted for donations
    /// @param id The abi encoded hash of the pool key struct for the pool that was donated to
    /// @param sender The address that initiated the donate call
    /// @param amount0 The amount donated in currency0
    /// @param amount1 The amount donated in currency1
    event Donate(PoolId indexed id, address indexed sender, uint256 amount0, uint256 amount1);

    /// @notice All interactions on the contract that account deltas require unlocking. A caller that calls `unlock` must implement
    /// `IUnlockCallback(msg.sender).unlockCallback(data)`, where they interact with the remaining functions on this contract.
    /// @dev The only functions callable without an unlocking are `initialize` and `updateDynamicLPFee`
    /// @param data Any data to pass to the callback, via `IUnlockCallback(msg.sender).unlockCallback(data)`
    /// @return The data returned by the call to `IUnlockCallback(msg.sender).unlockCallback(data)`
    function unlock(bytes calldata data) external returns (bytes memory);

    /// @notice Initialize the state for a given pool ID
    /// @dev A swap fee totaling MAX_SWAP_FEE (100%) makes exact output swaps impossible since the input is entirely consumed by the fee
    /// @param key The pool key for the pool to initialize
    /// @param sqrtPriceX96 The initial square root price
    /// @return tick The initial tick of the pool
    function initialize(PoolKey memory key, uint160 sqrtPriceX96) external returns (int24 tick);

    struct ModifyLiquidityParams {
        // the lower and upper tick of the position
        int24 tickLower;
        int24 tickUpper;
        // how to modify the liquidity
        int256 liquidityDelta;
        // a value to set if you want unique liquidity positions at the same range
        bytes32 salt;
    }

    /// @notice Modify the liquidity for the given pool
    /// @dev Poke by calling with a zero liquidityDelta
    /// @param key The pool to modify liquidity in
    /// @param params The parameters for modifying the liquidity
    /// @param hookData The data to pass through to the add/removeLiquidity hooks
    /// @return callerDelta The balance delta of the caller of modifyLiquidity. This is the total of both principal, fee deltas, and hook deltas if applicable
    /// @return feesAccrued The balance delta of the fees generated in the liquidity range. Returned for informational purposes
    /// @dev Note that feesAccrued can be artificially inflated by a malicious actor and integrators should be careful using the value
    /// For pools with a single liquidity position, actors can donate to themselves to inflate feeGrowthGlobal (and consequently feesAccrued)
    /// atomically donating and collecting fees in the same unlockCallback may make the inflated value more extreme
    function modifyLiquidity(PoolKey memory key, ModifyLiquidityParams memory params, bytes calldata hookData)
        external
        returns (BalanceDelta callerDelta, BalanceDelta feesAccrued);

    struct SwapParams {
        /// Whether to swap token0 for token1 or vice versa
        bool zeroForOne;
        /// The desired input amount if negative (exactIn), or the desired output amount if positive (exactOut)
        int256 amountSpecified;
        /// The sqrt price at which, if reached, the swap will stop executing
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swap against the given pool
    /// @param key The pool to swap in
    /// @param params The parameters for swapping
    /// @param hookData The data to pass through to the swap hooks
    /// @return swapDelta The balance delta of the address swapping
    /// @dev Swapping on low liquidity pools may cause unexpected swap amounts when liquidity available is less than amountSpecified.
    /// Additionally note that if interacting with hooks that have the BEFORE_SWAP_RETURNS_DELTA_FLAG or AFTER_SWAP_RETURNS_DELTA_FLAG
    /// the hook may alter the swap input/output. Integrators should perform checks on the returned swapDelta.
    function swap(PoolKey memory key, SwapParams memory params, bytes calldata hookData)
        external
        returns (BalanceDelta swapDelta);

    /// @notice Donate the given currency amounts to the in-range liquidity providers of a pool
    /// @dev Calls to donate can be frontrun adding just-in-time liquidity, with the aim of receiving a portion donated funds.
    /// Donors should keep this in mind when designing donation mechanisms.
    /// @dev This function donates to in-range LPs at slot0.tick. In certain edge-cases of the swap algorithm, the `sqrtPrice` of
    /// a pool can be at the lower boundary of tick `n`, but the `slot0.tick` of the pool is already `n - 1`. In this case a call to
    /// `donate` would donate to tick `n - 1` (slot0.tick) not tick `n` (getTickAtSqrtPrice(slot0.sqrtPriceX96)).
    /// Read the comments in `Pool.swap()` for more information about this.
    /// @param key The key of the pool to donate to
    /// @param amount0 The amount of currency0 to donate
    /// @param amount1 The amount of currency1 to donate
    /// @param hookData The data to pass through to the donate hooks
    /// @return BalanceDelta The delta of the caller after the donate
    function donate(PoolKey memory key, uint256 amount0, uint256 amount1, bytes calldata hookData)
        external
        returns (BalanceDelta);

    /// @notice Writes the current ERC20 balance of the specified currency to transient storage
    /// This is used to checkpoint balances for the manager and derive deltas for the caller.
    /// @dev This MUST be called before any ERC20 tokens are sent into the contract, but can be skipped
    /// for native tokens because the amount to settle is determined by the sent value.
    /// However, if an ERC20 token has been synced and not settled, and the caller instead wants to settle
    /// native funds, this function can be called with the native currency to then be able to settle the native currency
    function sync(Currency currency) external;

    /// @notice Called by the user to net out some value owed to the user
    /// @dev Will revert if the requested amount is not available, consider using `mint` instead
    /// @dev Can also be used as a mechanism for free flash loans
    /// @param currency The currency to withdraw from the pool manager
    /// @param to The address to withdraw to
    /// @param amount The amount of currency to withdraw
    function take(Currency currency, address to, uint256 amount) external;

    /// @notice Called by the user to pay what is owed
    /// @return paid The amount of currency settled
    function settle() external payable returns (uint256 paid);

    /// @notice Called by the user to pay on behalf of another address
    /// @param recipient The address to credit for the payment
    /// @return paid The amount of currency settled
    function settleFor(address recipient) external payable returns (uint256 paid);

    /// @notice WARNING - Any currency that is cleared, will be non-retrievable, and locked in the contract permanently.
    /// A call to clear will zero out a positive balance WITHOUT a corresponding transfer.
    /// @dev This could be used to clear a balance that is considered dust.
    /// Additionally, the amount must be the exact positive balance. This is to enforce that the caller is aware of the amount being cleared.
    function clear(Currency currency, uint256 amount) external;

    /// @notice Called by the user to move value into ERC6909 balance
    /// @param to The address to mint the tokens to
    /// @param id The currency address to mint to ERC6909s, as a uint256
    /// @param amount The amount of currency to mint
    /// @dev The id is converted to a uint160 to correspond to a currency address
    /// If the upper 12 bytes are not 0, they will be 0-ed out
    function mint(address to, uint256 id, uint256 amount) external;

    /// @notice Called by the user to move value from ERC6909 balance
    /// @param from The address to burn the tokens from
    /// @param id The currency address to burn from ERC6909s, as a uint256
    /// @param amount The amount of currency to burn
    /// @dev The id is converted to a uint160 to correspond to a currency address
    /// If the upper 12 bytes are not 0, they will be 0-ed out
    function burn(address from, uint256 id, uint256 amount) external;

    /// @notice Updates the pools lp fees for the a pool that has enabled dynamic lp fees.
    /// @dev A swap fee totaling MAX_SWAP_FEE (100%) makes exact output swaps impossible since the input is entirely consumed by the fee
    /// @param key The key of the pool to update dynamic LP fees for
    /// @param newDynamicLPFee The new dynamic pool LP fee
    function updateDynamicLPFee(PoolKey memory key, uint24 newDynamicLPFee) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Currency} from "../types/Currency.sol";
import {PoolId} from "../types/PoolId.sol";
import {PoolKey} from "../types/PoolKey.sol";

/// @notice Interface for all protocol-fee related functions in the pool manager
interface IProtocolFees {
    /// @notice Thrown when protocol fee is set too high
    error ProtocolFeeTooLarge(uint24 fee);

    /// @notice Thrown when collectProtocolFees or setProtocolFee is not called by the controller.
    error InvalidCaller();

    /// @notice Thrown when collectProtocolFees is attempted on a token that is synced.
    error ProtocolFeeCurrencySynced();

    /// @notice Emitted when the protocol fee controller address is updated in setProtocolFeeController.
    event ProtocolFeeControllerUpdated(address indexed protocolFeeController);

    /// @notice Emitted when the protocol fee is updated for a pool.
    event ProtocolFeeUpdated(PoolId indexed id, uint24 protocolFee);

    /// @notice Given a currency address, returns the protocol fees accrued in that currency
    /// @param currency The currency to check
    /// @return amount The amount of protocol fees accrued in the currency
    function protocolFeesAccrued(Currency currency) external view returns (uint256 amount);

    /// @notice Sets the protocol fee for the given pool
    /// @param key The key of the pool to set a protocol fee for
    /// @param newProtocolFee The fee to set
    function setProtocolFee(PoolKey memory key, uint24 newProtocolFee) external;

    /// @notice Sets the protocol fee controller
    /// @param controller The new protocol fee controller
    function setProtocolFeeController(address controller) external;

    /// @notice Collects the protocol fees for a given recipient and currency, returning the amount collected
    /// @dev This will revert if the contract is unlocked
    /// @param recipient The address to receive the protocol fees
    /// @param currency The currency to withdraw
    /// @param amount The amount of currency to withdraw
    /// @return amountCollected The amount of currency successfully withdrawn
    function collectProtocolFees(address recipient, Currency currency, uint256 amount)
        external
        returns (uint256 amountCollected);

    /// @notice Returns the current protocol fee controller address
    /// @return address The current protocol fee controller address
    function protocolFeeController() external view returns (address);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Library for reverting with custom errors efficiently
/// @notice Contains functions for reverting with custom errors with different argument types efficiently
/// @dev To use this library, declare `using CustomRevert for bytes4;` and replace `revert CustomError()` with
/// `CustomError.selector.revertWith()`
/// @dev The functions may tamper with the free memory pointer but it is fine since the call context is exited immediately
library CustomRevert {
    /// @dev ERC-7751 error for wrapping bubbled up reverts
    error WrappedError(address target, bytes4 selector, bytes reason, bytes details);

    /// @dev Reverts with the selector of a custom error in the scratch space
    function revertWith(bytes4 selector) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            revert(0, 0x04)
        }
    }

    /// @dev Reverts with a custom error with an address argument in the scratch space
    function revertWith(bytes4 selector, address addr) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            mstore(0x04, and(addr, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(0, 0x24)
        }
    }

    /// @dev Reverts with a custom error with an int24 argument in the scratch space
    function revertWith(bytes4 selector, int24 value) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            mstore(0x04, signextend(2, value))
            revert(0, 0x24)
        }
    }

    /// @dev Reverts with a custom error with a uint160 argument in the scratch space
    function revertWith(bytes4 selector, uint160 value) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            mstore(0x04, and(value, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(0, 0x24)
        }
    }

    /// @dev Reverts with a custom error with two int24 arguments
    function revertWith(bytes4 selector, int24 value1, int24 value2) internal pure {
        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(fmp, selector)
            mstore(add(fmp, 0x04), signextend(2, value1))
            mstore(add(fmp, 0x24), signextend(2, value2))
            revert(fmp, 0x44)
        }
    }

    /// @dev Reverts with a custom error with two uint160 arguments
    function revertWith(bytes4 selector, uint160 value1, uint160 value2) internal pure {
        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(fmp, selector)
            mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))
            mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(fmp, 0x44)
        }
    }

    /// @dev Reverts with a custom error with two address arguments
    function revertWith(bytes4 selector, address value1, address value2) internal pure {
        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(fmp, selector)
            mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))
            mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(fmp, 0x44)
        }
    }

    /// @notice bubble up the revert message returned by a call and revert with a wrapped ERC-7751 error
    /// @dev this method can be vulnerable to revert data bombs
    function bubbleUpAndRevertWith(
        address revertingContract,
        bytes4 revertingFunctionSelector,
        bytes4 additionalContext
    ) internal pure {
        bytes4 wrappedErrorSelector = WrappedError.selector;
        assembly ("memory-safe") {
            // Ensure the size of the revert data is a multiple of 32 bytes
            let encodedDataSize := mul(div(add(returndatasize(), 31), 32), 32)

            let fmp := mload(0x40)

            // Encode wrapped error selector, address, function selector, offset, additional context, size, revert reason
            mstore(fmp, wrappedErrorSelector)
            mstore(add(fmp, 0x04), and(revertingContract, 0xffffffffffffffffffffffffffffffffffffffff))
            mstore(
                add(fmp, 0x24),
                and(revertingFunctionSelector, 0xffffffff00000000000000000000000000000000000000000000000000000000)
            )
            // offset revert reason
            mstore(add(fmp, 0x44), 0x80)
            // offset additional context
            mstore(add(fmp, 0x64), add(0xa0, encodedDataSize))
            // size revert reason
            mstore(add(fmp, 0x84), returndatasize())
            // revert reason
            returndatacopy(add(fmp, 0xa4), 0, returndatasize())
            // size additional context
            mstore(add(fmp, add(0xa4, encodedDataSize)), 0x04)
            // additional context
            mstore(
                add(fmp, add(0xc4, encodedDataSize)),
                and(additionalContext, 0xffffffff00000000000000000000000000000000000000000000000000000000)
            )
            revert(fmp, add(0xe4, encodedDataSize))
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {CustomRevert} from "./CustomRevert.sol";

/// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library SafeCast {
    using CustomRevert for bytes4;

    error SafeCastOverflow();

    /// @notice Cast a uint256 to a uint160, revert on overflow
    /// @param x The uint256 to be downcasted
    /// @return y The downcasted integer, now type uint160
    function toUint160(uint256 x) internal pure returns (uint160 y) {
        y = uint160(x);
        if (y != x) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a uint256 to a uint128, revert on overflow
    /// @param x The uint256 to be downcasted
    /// @return y The downcasted integer, now type uint128
    function toUint128(uint256 x) internal pure returns (uint128 y) {
        y = uint128(x);
        if (x != y) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a int128 to a uint128, revert on overflow or underflow
    /// @param x The int128 to be casted
    /// @return y The casted integer, now type uint128
    function toUint128(int128 x) internal pure returns (uint128 y) {
        if (x < 0) SafeCastOverflow.selector.revertWith();
        y = uint128(x);
    }

    /// @notice Cast a int256 to a int128, revert on overflow or underflow
    /// @param x The int256 to be downcasted
    /// @return y The downcasted integer, now type int128
    function toInt128(int256 x) internal pure returns (int128 y) {
        y = int128(x);
        if (y != x) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a uint256 to a int256, revert on overflow
    /// @param x The uint256 to be casted
    /// @return y The casted integer, now type int256
    function toInt256(uint256 x) internal pure returns (int256 y) {
        y = int256(x);
        if (y < 0) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a uint256 to a int128, revert on overflow
    /// @param x The uint256 to be downcasted
    /// @return The downcasted integer, now type int128
    function toInt128(uint256 x) internal pure returns (int128) {
        if (x >= 1 << 127) SafeCastOverflow.selector.revertWith();
        return int128(int256(x));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {SafeCast} from "../libraries/SafeCast.sol";

/// @dev Two `int128` values packed into a single `int256` where the upper 128 bits represent the amount0
/// and the lower 128 bits represent the amount1.
type BalanceDelta is int256;

using {add as +, sub as -, eq as ==, neq as !=} for BalanceDelta global;
using BalanceDeltaLibrary for BalanceDelta global;
using SafeCast for int256;

function toBalanceDelta(int128 _amount0, int128 _amount1) pure returns (BalanceDelta balanceDelta) {
    assembly ("memory-safe") {
        balanceDelta := or(shl(128, _amount0), and(sub(shl(128, 1), 1), _amount1))
    }
}

function add(BalanceDelta a, BalanceDelta b) pure returns (BalanceDelta) {
    int256 res0;
    int256 res1;
    assembly ("memory-safe") {
        let a0 := sar(128, a)
        let a1 := signextend(15, a)
        let b0 := sar(128, b)
        let b1 := signextend(15, b)
        res0 := add(a0, b0)
        res1 := add(a1, b1)
    }
    return toBalanceDelta(res0.toInt128(), res1.toInt128());
}

function sub(BalanceDelta a, BalanceDelta b) pure returns (BalanceDelta) {
    int256 res0;
    int256 res1;
    assembly ("memory-safe") {
        let a0 := sar(128, a)
        let a1 := signextend(15, a)
        let b0 := sar(128, b)
        let b1 := signextend(15, b)
        res0 := sub(a0, b0)
        res1 := sub(a1, b1)
    }
    return toBalanceDelta(res0.toInt128(), res1.toInt128());
}

function eq(BalanceDelta a, BalanceDelta b) pure returns (bool) {
    return BalanceDelta.unwrap(a) == BalanceDelta.unwrap(b);
}

function neq(BalanceDelta a, BalanceDelta b) pure returns (bool) {
    return BalanceDelta.unwrap(a) != BalanceDelta.unwrap(b);
}

/// @notice Library for getting the amount0 and amount1 deltas from the BalanceDelta type
library BalanceDeltaLibrary {
    /// @notice A BalanceDelta of 0
    BalanceDelta public constant ZERO_DELTA = BalanceDelta.wrap(0);

    function amount0(BalanceDelta balanceDelta) internal pure returns (int128 _amount0) {
        assembly ("memory-safe") {
            _amount0 := sar(128, balanceDelta)
        }
    }

    function amount1(BalanceDelta balanceDelta) internal pure returns (int128 _amount1) {
        assembly ("memory-safe") {
            _amount1 := signextend(15, balanceDelta)
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Return type of the beforeSwap hook.
// Upper 128 bits is the delta in specified tokens. Lower 128 bits is delta in unspecified tokens (to match the afterSwap hook)
type BeforeSwapDelta is int256;

// Creates a BeforeSwapDelta from specified and unspecified
function toBeforeSwapDelta(int128 deltaSpecified, int128 deltaUnspecified)
    pure
    returns (BeforeSwapDelta beforeSwapDelta)
{
    assembly ("memory-safe") {
        beforeSwapDelta := or(shl(128, deltaSpecified), and(sub(shl(128, 1), 1), deltaUnspecified))
    }
}

/// @notice Library for getting the specified and unspecified deltas from the BeforeSwapDelta type
library BeforeSwapDeltaLibrary {
    /// @notice A BeforeSwapDelta of 0
    BeforeSwapDelta public constant ZERO_DELTA = BeforeSwapDelta.wrap(0);

    /// extracts int128 from the upper 128 bits of the BeforeSwapDelta
    /// returned by beforeSwap
    function getSpecifiedDelta(BeforeSwapDelta delta) internal pure returns (int128 deltaSpecified) {
        assembly ("memory-safe") {
            deltaSpecified := sar(128, delta)
        }
    }

    /// extracts int128 from the lower 128 bits of the BeforeSwapDelta
    /// returned by beforeSwap and afterSwap
    function getUnspecifiedDelta(BeforeSwapDelta delta) internal pure returns (int128 deltaUnspecified) {
        assembly ("memory-safe") {
            deltaUnspecified := signextend(15, delta)
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20Minimal} from "../interfaces/external/IERC20Minimal.sol";
import {CustomRevert} from "../libraries/CustomRevert.sol";

type Currency is address;

using {greaterThan as >, lessThan as <, greaterThanOrEqualTo as >=, equals as ==} for Currency global;
using CurrencyLibrary for Currency global;

function equals(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) == Currency.unwrap(other);
}

function greaterThan(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) > Currency.unwrap(other);
}

function lessThan(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) < Currency.unwrap(other);
}

function greaterThanOrEqualTo(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) >= Currency.unwrap(other);
}

/// @title CurrencyLibrary
/// @dev This library allows for transferring and holding native tokens and ERC20 tokens
library CurrencyLibrary {
    /// @notice Additional context for ERC-7751 wrapped error when a native transfer fails
    error NativeTransferFailed();

    /// @notice Additional context for ERC-7751 wrapped error when an ERC20 transfer fails
    error ERC20TransferFailed();

    /// @notice A constant to represent the native currency
    Currency public constant ADDRESS_ZERO = Currency.wrap(address(0));

    function transfer(Currency currency, address to, uint256 amount) internal {
        // altered from https://github.com/transmissions11/solmate/blob/44a9963d4c78111f77caa0e65d677b8b46d6f2e6/src/utils/SafeTransferLib.sol
        // modified custom error selectors

        bool success;
        if (currency.isAddressZero()) {
            assembly ("memory-safe") {
                // Transfer the ETH and revert if it fails.
                success := call(gas(), to, amount, 0, 0, 0, 0)
            }
            // revert with NativeTransferFailed, containing the bubbled up error as an argument
            if (!success) {
                CustomRevert.bubbleUpAndRevertWith(to, bytes4(0), NativeTransferFailed.selector);
            }
        } else {
            assembly ("memory-safe") {
                // Get a pointer to some free memory.
                let fmp := mload(0x40)

                // Write the abi-encoded calldata into memory, beginning with the function selector.
                mstore(fmp, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
                mstore(add(fmp, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
                mstore(add(fmp, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

                success :=
                    and(
                        // Set success to whether the call reverted, if not we check it either
                        // returned exactly 1 (can't just be non-zero data), or had no return data.
                        or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                        // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                        // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                        // Counterintuitively, this call must be positioned second to the or() call in the
                        // surrounding and() call or else returndatasize() will be zero during the computation.
                        call(gas(), currency, 0, fmp, 68, 0, 32)
                    )

                // Now clean the memory we used
                mstore(fmp, 0) // 4 byte `selector` and 28 bytes of `to` were stored here
                mstore(add(fmp, 0x20), 0) // 4 bytes of `to` and 28 bytes of `amount` were stored here
                mstore(add(fmp, 0x40), 0) // 4 bytes of `amount` were stored here
            }
            // revert with ERC20TransferFailed, containing the bubbled up error as an argument
            if (!success) {
                CustomRevert.bubbleUpAndRevertWith(
                    Currency.unwrap(currency), IERC20Minimal.transfer.selector, ERC20TransferFailed.selector
                );
            }
        }
    }

    function balanceOfSelf(Currency currency) internal view returns (uint256) {
        if (currency.isAddressZero()) {
            return address(this).balance;
        } else {
            return IERC20Minimal(Currency.unwrap(currency)).balanceOf(address(this));
        }
    }

    function balanceOf(Currency currency, address owner) internal view returns (uint256) {
        if (currency.isAddressZero()) {
            return owner.balance;
        } else {
            return IERC20Minimal(Currency.unwrap(currency)).balanceOf(owner);
        }
    }

    function isAddressZero(Currency currency) internal pure returns (bool) {
        return Currency.unwrap(currency) == Currency.unwrap(ADDRESS_ZERO);
    }

    function toId(Currency currency) internal pure returns (uint256) {
        return uint160(Currency.unwrap(currency));
    }

    // If the upper 12 bytes are non-zero, they will be zero-ed out
    // Therefore, fromId() and toId() are not inverses of each other
    function fromId(uint256 id) internal pure returns (Currency) {
        return Currency.wrap(address(uint160(id)));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {PoolKey} from "./PoolKey.sol";

type PoolId is bytes32;

/// @notice Library for computing the ID of a pool
library PoolIdLibrary {
    /// @notice Returns value equal to keccak256(abi.encode(poolKey))
    function toId(PoolKey memory poolKey) internal pure returns (PoolId poolId) {
        assembly ("memory-safe") {
            // 0xa0 represents the total size of the poolKey struct (5 slots of 32 bytes)
            poolId := keccak256(poolKey, 0xa0)
        }
    }
}

File 23 of 23 : PoolKey.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Currency} from "./Currency.sol";
import {IHooks} from "../interfaces/IHooks.sol";
import {PoolIdLibrary} from "./PoolId.sol";

using PoolIdLibrary for PoolKey global;

/// @notice Returns the key for identifying a pool
struct PoolKey {
    /// @notice The lower currency of the pool, sorted numerically
    Currency currency0;
    /// @notice The higher currency of the pool, sorted numerically
    Currency currency1;
    /// @notice The pool LP fee, capped at 1_000_000. If the highest bit is 1, the pool has a dynamic fee and must be exactly equal to 0x800000
    uint24 fee;
    /// @notice Ticks that involve positions must be a multiple of tick spacing
    int24 tickSpacing;
    /// @notice The hooks of the pool
    IHooks hooks;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "viaIR": true,
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"_devWallet","type":"address"},{"internalType":"address","name":"_openseaSeaport","type":"address"},{"internalType":"address","name":"_opepenContract","type":"address"},{"internalType":"address","name":"_backendAPI","type":"address"},{"internalType":"address","name":"_universalRouter","type":"address"},{"internalType":"address","name":"_poolManager","type":"address"},{"internalType":"uint256","name":"_swapThreshold","type":"uint256"},{"internalType":"uint256","name":"_sellFeePercent","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"AuthorizedCallerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"AuthorizedCallerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"}],"name":"BackendAPICalled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"buyPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"BuyPriceSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldWallet","type":"address"},{"indexed":true,"internalType":"address","name":"newWallet","type":"address"}],"name":"DevWalletUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ETHReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"treasuryAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"devAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnAmount","type":"uint256"}],"name":"FeesCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"buyPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"listingPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"name":"ListingCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ListingFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"NFTReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"OpepenFloorBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"PresaleActivated","type":"event"},{"anonymous":false,"inputs":[],"name":"PresaleDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"PurchaseOrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isValid","type":"bool"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"PurchaseValidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"SellFeeCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cost","type":"uint256"}],"name":"TokensPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"TokensSwappedForETH","type":"event"},{"anonymous":false,"inputs":[],"name":"TokensUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"feeReceiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"swapThreshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sellFeePercent","type":"uint256"}],"name":"UniswapConfigUpdated","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"BURN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BURN_FEE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BuyOpepenFloor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"BuyOpepenFloorAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"DEV_FEE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_FEE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY_FEE_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"priceWei","type":"uint256"}],"name":"activatePresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"addAuthorizedCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorizedCallers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"averageBuyPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"backendAPI","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"buyPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"cancelListing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"listingPrice","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"name":"createListing","outputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deactivatePresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"buyer","type":"address"}],"name":"fulfillListing","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getAvailableTokensForPresale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getETHBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFeeConfig","outputs":[{"internalType":"uint256","name":"treasuryFeePercent","type":"uint256"},{"internalType":"uint256","name":"devFeePercent","type":"uint256"},{"internalType":"uint256","name":"burnFeePercent","type":"uint256"},{"internalType":"uint256","name":"totalFeePercent","type":"uint256"},{"internalType":"address","name":"treasuryAddress","type":"address"},{"internalType":"address","name":"devWalletAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getListingInfo","outputs":[{"internalType":"bool","name":"listed","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"orderHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOpepenFloorConfig","outputs":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"address","name":"seaport","type":"address"},{"internalType":"address","name":"opepen","type":"address"},{"internalType":"address","name":"api","type":"address"},{"internalType":"uint256","name":"slippage","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPresaleStatus","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"bool","name":"unlocked","type":"bool"},{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPurchaseHistory","outputs":[{"internalType":"address","name":"purchaser","type":"address"},{"internalType":"uint256","name":"purchaseTime","type":"uint256"},{"internalType":"bool","name":"owned","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPurchaseStats","outputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"spent","type":"uint256"},{"internalType":"uint256","name":"average","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSwapableTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUniswapConfig","outputs":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"poolManagerAddress","type":"address"},{"internalType":"bytes32","name":"poolIdValue","type":"bytes32"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"currentSwapThreshold","type":"uint256"},{"internalType":"uint256","name":"currentSellFeePercent","type":"uint256"},{"internalType":"bool","name":"inSwapStatus","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"initializePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"isAuthorizedCaller","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isListed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOpepenFloorEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPresaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSwapThresholdMet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isTokenOwned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"listingEndTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"listingOrderHashes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"listingPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"listingStartTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manualSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openseaSeaport","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"opepenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"opepenFloorSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolId","outputs":[{"internalType":"PoolId","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolManager","outputs":[{"internalType":"contract IPoolManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"purchaseOrderHashes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"purchaseTimes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"purchaseTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"purchasers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"buyPrice","type":"uint256"}],"name":"receiveNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"removeAuthorizedCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_api","type":"address"}],"name":"setBackendAPI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devWallet","type":"address"}],"name":"setDevWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_seaport","type":"address"}],"name":"setOpenSeaSeaport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_opepen","type":"address"}],"name":"setOpepenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setOpepenFloorEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slippage","type":"uint256"}],"name":"setOpepenFloorSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sellFeePercent","type":"uint256"}],"name":"setSellFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_swapThreshold","type":"uint256"}],"name":"setSwapThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeReceiver","type":"address"}],"name":"setUniswapFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPurchased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSpent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapFeeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"universalRouter","outputs":[{"internalType":"contract IUniversalRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlockTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e060409080825234620009795762003e9e80380380916200002282856200097e565b833981019061018081830312620009795780516001600160401b03811162000979578262000052918301620009a2565b602082015190926001600160401b038211620009795762000075918301620009a2565b918382015191620000896060820162000a18565b91620000986080830162000a18565b91620000a760a0820162000a18565b620000b560c0830162000a18565b620000c360e0840162000a18565b91620000d3610100850162000a18565b96620000e3610120860162000a18565b996101606101408701519601519680519060018060401b0382116200043b5760035490600182811c921680156200096e575b6020831014620008445781601f849311620008fc575b50602090601f8311600114620008715760009262000865575b50508160011b916000199060031b1c1916176003555b8051906001600160401b0382116200043b5760045490600182811c921680156200085a575b6020831014620008445781601f849311620007d2575b50602090601f8311600114620007435760009262000737575b50508160011b916000199060031b1c1916176004555b33156200071f5760058054336001600160a01b031980831682179093558d519992969594936001600160a01b03939284929083167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600160065516988915620006dd575081169182156200068f5781169283156200063c578116938415620005e95781169889156200059a5781169a8b15620005465716968715620004f6578515620004a15760648711620004515784600954161760095583600a541617600a5582600b541617600b5581600c541617600c55600d54938760805260a052875160a081019080821060018060401b038311176200043b5760a0918a5230815260006020820152610bb88a820152603c6060820152600060808201522060c0523390600f541617600f5560105560115564028fa6ae0060085560018060a81b03191617600d556101f4600e55600254818101809111620004255760025533600052600060205282600020818154019055825190815260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203393a330156200040d57306000526001602052816000208160005260205260001980836000205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203092a351613470908162000a2e82396080518181816112f9015281816123810152612e57015260a0518181816111bb0152818161131d015281816115840152613289015260c051818181611344015281816122f60152612dd70152f35b815163e602df0560e01b815260006004820152602490fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8b5162461bcd60e51b815260206004820152602360248201527f53656c6c206665652070657263656e742063616e6e6f7420657863656564203160448201526230302560e81b6064820152608490fd5b8b5162461bcd60e51b815260206004820152602860248201527f53776170207468726573686f6c64206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608490fd5b8b5162461bcd60e51b815260206004820152602360248201527f506f6f6c206d616e6167657220616464726573732063616e6e6f74206265207a60448201526265726f60e81b6064820152608490fd5b8c5162461bcd60e51b815260206004820152602760248201527f556e6976657273616c20726f7574657220616464726573732063616e6e6f74206044820152666265207a65726f60c81b6064820152608490fd5b8c5162461bcd60e51b815260206004820152602260248201527f4261636b656e642041504920616464726573732063616e6e6f74206265207a65604482015261726f60f01b6064820152608490fd5b8c5162461bcd60e51b815260206004820152602660248201527f4f706570656e20636f6e747261637420616464726573732063616e6e6f74206260448201526565207a65726f60d01b6064820152608490fd5b8c5162461bcd60e51b815260206004820152602660248201527f4f70656e53656120536561706f727420616464726573732063616e6e6f74206260448201526565207a65726f60d01b6064820152608490fd5b8c5162461bcd60e51b815260206004820152602160248201527f4465762077616c6c657420616464726573732063616e6e6f74206265207a65726044820152606f60f81b6064820152608490fd5b62461bcd60e51b815260206004820152601f60248201527f547265617375727920616464726573732063616e6e6f74206265207a65726f006044820152606490fd5b8a51631e4fbdf760e01b815260006004820152602490fd5b015190503880620001ae565b6004600090815293507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b91905b601f1984168510620007b6576001945083601f198116106200079c575b505050811b01600455620001c4565b015160001960f88460031b161c191690553880806200078d565b8181015183556020948501946001909301929091019062000770565b60046000529091507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f840160051c8101602085106200083c575b90849392915b601f830160051c820181106200082c57505062000195565b6000815585945060010162000814565b50806200080e565b634e487b7160e01b600052602260045260246000fd5b91607f16916200017f565b01519050388062000144565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9350601f198516905b818110620008e35750908460019594939210620008c9575b505050811b016003556200015a565b015160001960f88460031b161c19169055388080620008ba565b92936020600181928786015181550195019301620008a2565b60036000529091507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f840160051c81016020851062000966575b90849392915b601f830160051c82018110620009565750506200012b565b600081558594506001016200093e565b508062000938565b91607f169162000115565b600080fd5b601f909101601f19168101906001600160401b038211908210176200043b57604052565b919080601f84011215620009795782516001600160401b0381116200043b5760209060405192620009dd83601f19601f85011601856200097e565b818452828287010111620009795760005b81811062000a0457508260009394955001015290565b8581018301518482018401528201620009ee565b51906001600160a01b0382168203620009795756fe6080806040526004361015610028575b5036156100205761001e612cc4565b005b61001e612cc4565b600090813560e01c9081620e7fa814612a9e575080630445b66714612a8057806306fdde03146129bc578063095ea7b3146129095780630a120868146128d75780630ec63db81461284057806312923b651461280d57806313a155ea1461275957806318160ddd1461273b5780631a00bdc1146126865780631f53ac02146125c657806323b872dd146124d857806328e85856146124ae578063290fd84314612464578063305a67a8146123cc578063313ce567146123b057806335a9e4df1461236b57806336296d81146123425780633af6a4f2146123195780633e0dc34e146122de578063425f375e14612208578063475e28b5146121de5780634e0aac871461218c57806351bc3c85146120ab578063536fff6c1461206c57806359d14b41146120135780635e6a645e14610a075780635fbbc0d214611fc657806360d938dc14611fa357806361d027b314611f7a5780636992dac714611f4f5780636e94729814611f3357806370a0823114611ef9578063715018a614611e9c57806377c12b1714611e105780637b97008d14611c3c5780637c4c069c14611c1e5780637d2ab1de14611bad5780638380edb714611b875780638547655914611b5e5780638da5cb5b14611b355780638ea5220f14611b0c57806393d5407914611aef57806395d89b41146119e05780639804767f146119b65780639d0014b1146118f9578063a18e5e781461173d578063a2b8a94714611682578063a9059cbb14611650578063a90d6de314611626578063a9f776841461160a578063ab48b09e146114c6578063abc6184c14611497578063b7aa023114611431578063b9314135146113c7578063b99be74014611380578063ba0a3533146112c5578063bb81d1cb1461129b578063bf6c1c5814611275578063c643929e1461124c578063d3f4e8d714611222578063d7517caa146111ea578063dc4c90d3146111a5578063dd62ed3e1461115a578063e0d30d9b1461113c578063e0fdc2f71461106f578063e111703a14611053578063e4463f4814610fb8578063e5da20de14610f8e578063e632c2f314610f70578063eb033c7514610ec9578063ed3f60aa14610e94578063f0f4426014610e08578063f19f7a7414610b69578063f2fde38b14610ade578063f4bf28a014610a86578063f968f49314610a37578063fa4ea78f14610a0c578063fad5c5b314610a07578063fb346eab146109e9578063fccc2813146109cc578063fcce48831461099d5763fdb3d7c50361000f573461099a5760a036600319011261099a576103da612cf8565b6004358152601760205260ff60408220541615610955576004358152601360205260408120541561091c576004358152601860205260ff6040822054166108e0576024351561088b57604435606435111561083c5742604435106107f85760405161044481612b77565b60018152815b602081106107e15750600c54604051906001600160a01b031661046c82612b5b565b600282526020820152600435604082015260016060820152600160808201528260a082015261049a82612d7a565b526104a481612d7a565b506040516104b181612b77565b60018152825b602081106107ca57506040516104cc81612b5b565b838152836020820152836040820152602435606082015260243560808201523060a08201526104fa82612d7a565b5261050481612d7a565b50604051918261016081011067ffffffffffffffff610160850111176107b45761016083016040523083528360208401526040830152606082015281608082015260443560a082015260643560c08201528160e082015260843561010082015281610120820152600161014082015260018060a01b03600b541660405191635bbabad760e11b83526020600484015261018483019060018060a01b03815116602485015260018060a01b0360208201511660448501526040810151916101606064860152825180915260206101a48601930190865b8181106107945750505060608101519160231985820301608486015260208084519283815201930190865b81811061077457505050608081015160048110156107605784809361014060209694839460a485015260a081015160c485015260c081015160e485015260e0810151610104850152610100810151610124850152610120810151610144850152015161016483015203915afa90811561075557829161071e575b506040602092600435815260188452818120600160ff198254161790556019845260243582822055601a84528282822055601b845260443582822055601c84526064358282205560138452205460405190815260243583820152604435604082015260643560608201528160808201527fd925f48a4bdadc5aa560d87d26859723a16dae3571e73b39eef796fadff2118960a060043592a2604051908152f35b90506020813d60201161074d575b8161073960209383612b93565b810103126107495751604061067e565b5080fd5b3d915061072c565b6040513d84823e3d90fd5b634e487b7160e01b86526021600452602486fd5b909193602060c0826107896001948951612c62565b019501929101610604565b909193602060c0826107a96001948951612c62565b0195019291016105d9565b634e487b7160e01b600052604160045260246000fd5b6020906107d5612fd6565b828285010152016104b7565b6020906107ec612fd6565b8282850101520161044a565b606460405162461bcd60e51b815260206004820152602060248201527f53746172742074696d65206d75737420626520696e20746865206675747572656044820152fd5b60405162461bcd60e51b815260206004820152602160248201527f456e642074696d65206d7573742062652061667465722073746172742074696d6044820152606560f81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602760248201527f4c697374696e67207072696365206d7573742062652067726561746572207468604482015266616e207a65726f60c81b6064820152608490fd5b60405162461bcd60e51b8152602060048201526014602482015273151bdad95b88185b1c9958591e481b1a5cdd195960621b6044820152606490fd5b60405162461bcd60e51b8152602060048201526011602482015270109d5e481c1c9a58d9481b9bdd081cd95d607a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152601b60248201527f546f6b656e206e6f74206f776e656420627920636f6e747261637400000000006044820152606490fd5b80fd5b503461099a57602036600319011261099a5760ff60406020926004358152601884522054166040519015158152f35b503461099a578060031936011261099a57602060405161dead8152f35b503461099a578060031936011261099a576020601f54604051908152f35b612b2b565b503461099a578060031936011261099a5730600090815260208181526040909120545b604051908152f35b503461099a578060031936011261099a57610a50612cf8565b61010061ff001960075416176007557f27591baca3ab78e62a0cbf3b92bae5a04d5a1768b720a980d1f4671374c93c4c8180a180f35b503461099a57602036600319011261099a576060906004358152601560205260018060a01b0360408220541690601460205260ff60408083205492601760205220541690604051928352602083015215156040820152f35b503461099a57602036600319011261099a57610af8612afa565b610b00612cf8565b6001600160a01b03908116908115610b5057600554826001600160601b0360a01b821617600555167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b50604036600319011261099a57600435610b81612b15565b903383526020601d815260ff6040852054168015610df4575b15610dbf57610ba7612fb3565b81845260188152610bbe60ff604086205416612bb5565b818452601b815260408420544210610d8557818452601c815260408420544211610d4f578184526019815260408420543410610d1457600c546001600160a01b03908116938591853b15610d1057606483926040519485938492632142170760e11b845230600485015216988960248401528860448401525af18015610d0557610cf2575b50818452601781526040842060ff199081815416905560188252604085209081541690556019815260408420549084610c7c8334612c3f565b8581158015610cc2575b505050507fc9c6b35011605bab9e8a5d7dce8f56664644b07b52c30022666c415dd4c93fc29160409182519182524290820152a3600160065580f35b8392839283928390610ce9575bf115610cde5784388581610c86565b6040513d86823e3d90fd5b506108fc610ccf565b610cfe90949194612b47565b9238610c43565b6040513d87823e3d90fd5b8280fd5b6064906040519062461bcd60e51b825260048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152fd5b6064906040519062461bcd60e51b82526004820152600f60248201526e131a5cdd1a5b99c8195e1c1a5c9959608a1b6044820152fd5b6064906040519062461bcd60e51b825260048201526013602482015272131a5cdd1a5b99c81b9bdd081cdd185c9d1959606a1b6044820152fd5b6064906040519062461bcd60e51b82526004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152fd5b506005546001600160a01b03163314610b9a565b503461099a57602036600319011261099a57610e22612afa565b610e2a612cf8565b6001600160a01b03168015610e4f576001600160601b0360a01b600954161760095580f35b60405162461bcd60e51b815260206004820152601f60248201527f547265617375727920616464726573732063616e6e6f74206265207a65726f006044820152606490fd5b503461099a578060031936011261099a57601e54601f54602080546040805194855291840192909252820152606090f35b0390f35b503461099a57602036600319011261099a57600435610ee6612cf8565b8015610f2b576020817f365bbb1b82a908cf64c94e1303370522345bd773d3f215e83443d836019bd7e492600855600160ff196007541617600755604051908152a180f35b60405162461bcd60e51b815260206004820152601f60248201527f5072696365206d7573742062652067726561746572207468616e207a65726f006044820152606490fd5b503461099a578060031936011261099a576020601e54604051908152f35b503461099a57602036600319011261099a5760406020916004358152601983522054604051908152f35b503461099a57602036600319011261099a57610fd2612afa565b610fda612cf8565b6001600160a01b03168015610fff576001600160601b0360a01b600c541617600c5580f35b60405162461bcd60e51b815260206004820152602660248201527f4f706570656e20636f6e747261637420616464726573732063616e6e6f74206260448201526565207a65726f60d01b6064820152608490fd5b503461099a578060031936011261099a57602060405160088152f35b503461099a57602036600319011261099a57611089612afa565b611091612cf8565b6001600160a01b031680156110eb57806001600160601b0360a01b600f541617600f557f6ac7f1172beb46365765e274b4a159dea9d9a7f85a64571d179671087a948073604060105460115482519182526020820152a280f35b60405162461bcd60e51b815260206004820152602360248201527f46656520726563656976657220616464726573732063616e6e6f74206265207a60448201526265726f60e81b6064820152608490fd5b503461099a578060031936011261099a576020601154604051908152f35b503461099a57604036600319011261099a576040602091611179612afa565b611181612b15565b6001600160a01b039182168352600185528383209116825283522054604051908152f35b503461099a578060031936011261099a576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461099a578060031936011261099a57606060075460085460ff604051928181161515845260081c16151560208301526040820152f35b503461099a57602036600319011261099a5760406020916004358152601b83522054604051908152f35b503461099a578060031936011261099a57600f546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57602060ff600d5460a01c166040519015158152f35b503461099a57602036600319011261099a5760406020916004358152601483522054604051908152f35b503461099a578060031936011261099a5760e060018060a01b0380600f54166010546011549060ff601254169260405194807f00000000000000000000000000000000000000000000000000000000000000001686527f00000000000000000000000000000000000000000000000000000000000000001660208601527f000000000000000000000000000000000000000000000000000000000000000060408601526060850152608084015260a0830152151560c0820152f35b503461099a57602036600319011261099a57600435801515809103610749576113a7612cf8565b600d805460ff60a01b191660a09290921b60ff60a01b1691909117905580f35b503461099a57602080600319360112610749579060a09160043582526018815260ff60408320541691601982526040812054601b8352604082205490601c845260408084205493601a86522054936040519515158652850152604084015260608301526080820152f35b503461099a57602036600319011261099a5761144b612afa565b611453612cf8565b6001600160a01b0316808252601d60205260408220805460ff191690557fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775808280a280f35b503461099a57602036600319011261099a5760ff60406020926004358152601784522054166040519015158152f35b503461099a57602080600319360112610749576004356001600160a01b038181169291839003611606576114f8612cf8565b60405160a0810181811067ffffffffffffffff8211176115f25783929160c4916040523081528683858301978289528160408501610bb8815260608601603c815262ffffff6080880192878452846040519e8f9c8d9b63313b65df60e11b8d52511660048c0152511660248a0152511660448801525160020b60648701525116608485015260a48401527f0000000000000000000000000000000000000000000000000000000000000000165af180156115e7576115b4578280f35b81813d83116115e0575b6115c88183612b93565b8101031261074957518060020b0361099a5738808280f35b503d6115be565b6040513d85823e3d90fd5b634e487b7160e01b86526041600452602486fd5b8380fd5b503461099a578060031936011261099a576020604051600a8152f35b503461099a57602036600319011261099a5760406020916004358152601383522054604051908152f35b503461099a57604036600319011261099a5761167761166d612afa565b6024359033612d24565b602060405160018152f35b503461099a57602036600319011261099a5760043561169f612cf8565b606481116116ec57806011557f6ac7f1172beb46365765e274b4a159dea9d9a7f85a64571d179671087a948073604060018060a01b03600f5416926010549082519182526020820152a280f35b60405162461bcd60e51b815260206004820152602360248201527f53656c6c206665652070657263656e742063616e6e6f7420657863656564203160448201526230302560e81b6064820152608490fd5b503461099a57604036600319011261099a57600c546040516331a9108f60e11b8152600480359082018190529160209160248035926001600160a01b03918591849190829085165afa9182156118ee5786926118b2575b503091160361186d57801561181c578284526017825260408420600160ff19825416179055601382526040842055601481524260408420556015815260408320336001600160601b0360a01b825416179055604051906001825242908201527f0c8a6212f55b43783fb313e7036ac0f37beb5217118d4f3970e7d2105740f75360403392a380f35b60405162461bcd60e51b815260048101839052602360248201527f427579207072696365206d7573742062652067726561746572207468616e207a60448201526265726f60e81b6064820152608490fd5b60405162461bcd60e51b815260048101839052601a60248201527f436f6e747261637420646f65736e2774206f776e20746f6b656e0000000000006044820152606490fd5b9091508381813d83116118e7575b6118ca8183612b93565b810103126118e3575181811681036118e3579038611794565b8580fd5b503d6118c0565b6040513d88823e3d90fd5b503461099a57602036600319011261099a57600435611916612cf8565b801561196057806010557f6ac7f1172beb46365765e274b4a159dea9d9a7f85a64571d179671087a948073604060018060a01b03600f54169260115482519182526020820152a280f35b60405162461bcd60e51b815260206004820152602860248201527f53776170207468726573686f6c64206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608490fd5b503461099a57602036600319011261099a5760406020916004358152601683522054604051908152f35b503461099a578060031936011261099a5760405190806004549160018360011c9260018516948515611ae5575b6020958686108114611ad157858852879493929187908215611aaf575050600114611a55575b5050611a4192500383612b93565b610ec5604051928284938452830190612aba565b90859250600482527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b858310611a97575050611a4193508201013880611a33565b80548389018501528794508693909201918101611a7f565b9250935050611a4194915060ff191682840152151560051b8201013880611a33565b634e487b7160e01b83526022600452602483fd5b93607f1693611a0d565b503461099a578060031936011261099a5760208054604051908152f35b503461099a578060031936011261099a57600a546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a576005546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57600b546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57602060ff60075460081c166040519015158152f35b503461099a57602036600319011261099a57600435611bca612cf8565b6127108111611bd957600e5580f35b60405162461bcd60e51b815260206004820152601b60248201527f536c6970706167652063616e6e6f7420657863656564203130302500000000006044820152606490fd5b503461099a578060031936011261099a576020600e54604051908152f35b50602036600319011261099a5760043560ff6007541615611dd357611c5f612fb3565b8015611c6b8115612bf4565b6008549081830291838304141715611dbf57670de0b6b3a76400009004803410611d82576005546001600160a01b03166000818152602081905260409020548311611d2e5782611cbc913390612d24565b803411611cfd575b60405191825260208201527f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f3360403392a2600160065580f35b82808080611d0b8534612c3f565b818115611d25575b3390f1611cc4576040513d84823e3d90fd5b506108fc611d13565b60405162461bcd60e51b815260206004820152602660248201527f496e73756666696369656e7420746f6b656e7320617661696c61626c6520666f604482015265722073616c6560d01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526015602482015274125b9cdd59999a58da595b9d08115512081cd95b9d605a1b6044820152606490fd5b634e487b7160e01b83526011600452602483fd5b60405162461bcd60e51b815260206004820152601560248201527450726573616c65206973206e6f742061637469766560581b6044820152606490fd5b503461099a57602036600319011261099a57611e2a612afa565b611e32612cf8565b6001600160a01b03168015611e57576001600160601b0360a01b600b541617600b5580f35b60405162461bcd60e51b815260206004820152601e60248201527f536561706f727420616464726573732063616e6e6f74206265207a65726f00006044820152606490fd5b503461099a578060031936011261099a57611eb5612cf8565b600580546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461099a57602036600319011261099a576020610a2f611f18612afa565b6001600160a01b031660009081526020819052604090205490565b503461099a578060031936011261099a57602047604051908152f35b503461099a578060031936011261099a57604060209130815280835220546010541115604051908152f35b503461099a578060031936011261099a576009546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57602060ff600754166040519015158152f35b503461099a578060031936011261099a5760c060018060a01b03806009541690600a541660405191600883526001602084015260016040840152600a6060840152608083015260a0820152f35b503461099a57602036600319011261099a576020906001600160a01b039060ff60408361203e612afa565b1692838152601d865220541691821561205e575b50506040519015158152f35b600554161490503880612052565b503461099a57602036600319011261099a5760209060ff906040906001600160a01b03612097612afa565b168152601d84522054166040519015158152f35b503461099a578060031936011261099a576120c4612cf8565b3081528060205260408120548015612153576012549060ff821661210e5760ff199182166001176012556120ff906120fa612fb3565b612d9d565b60016006556012541660125580f35b60405162461bcd60e51b815260206004820152601860248201527f5377617020616c726561647920696e2070726f677265737300000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601160248201527004e6f20746f6b656e7320746f207377617607c1b6044820152606490fd5b503461099a578060031936011261099a5760a0600d54600180831b039081600b54169180600c541691600e54926040519460ff83881c1615158652602086015260408501521660608301526080820152f35b503461099a57602036600319011261099a5760406020916004358152601a83522054604051908152f35b503461099a57602036600319011261099a57600435612225612cf8565b80156122318115612bf4565b81471061229957828080808560018060a01b03958660055416908390612290575bf1156107555760407f28edec7a6a65e8fa9c6513c03b816f03352dd0557fde05b2a52aba6e627ec9b39160055416928151908152426020820152a280f35b506108fc612252565b60405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e74204554482062616c616e636500000000000000006044820152606490fd5b503461099a578060031936011261099a5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461099a578060031936011261099a57600d546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57600c546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461099a578060031936011261099a57602060405160128152f35b503461099a57602036600319011261099a576004356123e9612cf8565b808252601860205261240160ff604084205416612bb5565b80825260186020526040822060ff19815416905560136020527fd925f48a4bdadc5aa560d87d26859723a16dae3571e73b39eef796fadff2118960a06040842054604051908152846020820152846040820152846060820152846080820152a280f35b503461099a578060031936011261099a5761247d612cf8565b60ff19600754166007557fc00eb52d383b32d956eb0bff90d7b8bd8c19a7f9d71ca10bcf5c0c3e144be7fc8180a180f35b503461099a57602036600319011261099a5760406020916004358152601c83522054604051908152f35b503461099a57606036600319011261099a576124f2612afa565b6124fa612b15565b6001600160a01b03821680845260016020908152604080862033875290915284205460443593916000198210612537575b50506116779350612d24565b8482106125a057801561258757331561256e578486926040926116779852600160205282842033855260205203912055388061252b565b604051634a1406b160e11b815260048101879052602490fd5b60405163e602df0560e01b815260048101879052602490fd5b604051637dc7a0d960e11b81523360048201526024810183905260448101869052606490fd5b503461099a57602036600319011261099a576125e0612afa565b6125e8612cf8565b6001600160a01b0390811690811561263757600a54826001600160601b0360a01b821617600a55167f0db17895a9d092fb3ca24d626f2150dd80c185b0706b36f1040ee239f56cb8718380a380f35b60405162461bcd60e51b815260206004820152602160248201527f4465762077616c6c657420616464726573732063616e6e6f74206265207a65726044820152606f60f81b6064820152608490fd5b503461099a578060031936011261099a5761269f612cf8565b4780156126f65760018060a01b038280808085856005541682f1156107555760407f28edec7a6a65e8fa9c6513c03b816f03352dd0557fde05b2a52aba6e627ec9b39160055416928151908152426020820152a280f35b60405162461bcd60e51b815260206004820152601a60248201527f4e6f2045544820746f20627579204f706570656e20666c6f6f720000000000006044820152606490fd5b503461099a578060031936011261099a576020600254604051908152f35b503461099a57602036600319011261099a57612773612afa565b61277b612cf8565b6001600160a01b031680156127c857808252601d60205260408220805460ff191660011790557feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef8280a280f35b60405162461bcd60e51b815260206004820152601d60248201527f43616c6c657220616464726573732063616e6e6f74206265207a65726f0000006044820152606490fd5b503461099a57602036600319011261099a57602090600435815260158252604060018060a01b0391205416604051908152f35b503461099a57602036600319011261099a5761285a612afa565b612862612cf8565b6001600160a01b03168015612887576001600160601b0360a01b600d541617600d5580f35b60405162461bcd60e51b815260206004820152602260248201527f4261636b656e642041504920616464726573732063616e6e6f74206265207a65604482015261726f60f01b6064820152608490fd5b503461099a578060031936011261099a576005546001600160a01b031660009081526020818152604090912054610a2f565b503461099a57604036600319011261099a57612923612afa565b6024359033156129a3576001600160a01b031691821561298b5760408291338152600160205281812085825260205220556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b60249060405190634a1406b160e11b82526004820152fd5b60405163e602df0560e01b815260048101849052602490fd5b503461099a578060031936011261099a5760405190806003549160018360011c9260018516948515612a76575b6020958686108114611ad157858852879493929187908215611aaf575050600114612a1c575050611a4192500383612b93565b90859250600382527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b858310612a5e575050611a4193508201013880611a33565b80548389018501528794508693909201918101612a46565b93607f16936129e9565b503461099a578060031936011261099a576020601054604051908152f35b9050346107495781600319360112610749576020906008548152f35b919082519283825260005b848110612ae6575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201612ac5565b600435906001600160a01b0382168203612b1057565b600080fd5b602435906001600160a01b0382168203612b1057565b34612b10576000366003190112612b1057602060405160018152f35b67ffffffffffffffff81116107b457604052565b60c0810190811067ffffffffffffffff8211176107b457604052565b6040810190811067ffffffffffffffff8211176107b457604052565b90601f8019910116810190811067ffffffffffffffff8211176107b457604052565b15612bbc57565b60405162461bcd60e51b815260206004820152601060248201526f151bdad95b881b9bdd081b1a5cdd195960821b6044820152606490fd5b15612bfb57565b606460405162461bcd60e51b815260206004820152602060248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f6044820152fd5b91908203918211612c4c57565b634e487b7160e01b600052601160045260246000fd5b8051906006821015612cae5760a091835281602082015191600180831b038093166020860152604081015160408601526060810151606086015260808101516080860152015116910152565b634e487b7160e01b600052602160045260246000fd5b6040513481524260208201527f7dd768b8b37911c0bb413d9cf56fcb57b286f5def4c57d475c8abdd6737b7e1e60403392a2565b6005546001600160a01b03163303612d0c57565b60405163118cdaa760e01b8152336004820152602490fd5b91906001600160a01b0380841615612d6157811615612d4857612d4692613008565b565b60405163ec442f0560e01b815260006004820152602490fd5b604051634b637e8f60e11b815260006004820152602490fd5b805115612d875760200190565b634e487b7160e01b600052603260045260246000fd5b908115612faf574791604080516020600160f81b8183015260019060018352612dc583612b77565b60018060a01b0380600f5416928551917f00000000000000000000000000000000000000000000000000000000000000008484015260018784015260609288606082015260009586608083015260a082015260a08152612e2481612b5b565b875193612e3085612b77565b6001855285875b818110612fa057505050612e4a84612d7a565b52612e5483612d7a565b507f00000000000000000000000000000000000000000000000000000000000000001692833b15612f9c5791612ea895928594928851978895630d64d59360e21b8752606060048801526064870190612aba565b916003198684030160248701528351908184528084019381808460051b83010196019489915b848310612f6457505050505050508383809242604483015203925af1908115612f5957507f474900d9b2b46fdc0d712d9b2c22e60183540cd4a034932052f34b6f7b76c9a99495612f4592612f2992612f4a575b5047612c3f565b9151928352602083019190915242604083015281906060820190565b0390a1565b612f5390612b47565b38612f22565b8351903d90823e3d90fd5b9285989a5080969950612f8781929598601f979497198682030187528b51612aba565b990193019301899896938b9896939592612ece565b8480fd5b82828289010152018690612e37565b9050565b600260065414612fc4576002600655565b604051633ee5aeb560e01b8152600490fd5b60405190612fe382612b5b565b8160a06000918281528260208201528260408201528260608201528260808201520152565b90916001600160a01b03808316928315929190838015613330575b6133215760ff60075460081c1693841580613313575b6132ba5760129660ff8854161595866132b2575b86613284575b86613275575b80613267575b80613257575b1561324657600a8502851594868204600a14861715612c4c578660031b878104600814871715612c4c5760649004958780046001141715612c4c576130c16130da936130ba896064809b049a8b960490612c3f565b908761333a565b6130d08682600954168761333a565b600a54168461333a565b156131c457509060025491818301809311612c4c577fa54e6c2fc0861aa9c991b26891d71059d517983b9e84b91020f42609c452eb9d926002555b61dead60009581875286602052604087208481540190557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020604051868152a36040805191825260208201839052810191909152606090a1613177575b5050565b604090308152806020522054601054811015806131b8575b15613173576131ac60ff19916001838554161784556120fa612fb3565b60016006558154169055565b5060ff8254161561318f565b600090858252816020526040822054908482106132145750906040847fa54e6c2fc0861aa9c991b26891d71059d517983b9e84b91020f42609c452eb9d9594938884528360205203912055613115565b60405163391434e360e21b81526001600160a01b03919091166004820152602481019190915260448101849052606490fd5b94505091935050612d46935061333a565b5083600554168482161415613065565b50836005541687141561305f565b60055485168814159650613059565b8185167f00000000000000000000000000000000000000000000000000000000000000008616149650613053565b95508561304d565b60405162461bcd60e51b815260206004820152602b60248201527f546f6b656e7320617265206c6f636b656420616e642063616e6e6f742062652060448201526a1d1c985b9cd9995c9c995960aa1b6064820152608490fd5b508260055416861415613039565b91935050612d4693915061333a565b5081861615613023565b6001600160a01b03808216929091836133b757509060025490848201809211612c4c577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef926020926002555b16938461339f5780600254036002555b604051908152a3565b84600052600082526040600020818154019055613396565b6000908482528160205260408220549086821061340857509181604087602095887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef98965283875203912055613386565b60405163391434e360e21b81526001600160a01b03919091166004820152602481019190915260448101869052606490fdfea264697066735822122007c50d24cbae664989979c670e4c9e4422492567341efa5b3fbef2be0866ee7364736f6c63430008180033000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000033b2e3c9fd0803ce80000000000000000000000000000006adddad1975cc69fb16fd3fe24d47f7d6e22eac700000000000000000000000086b811635f07e210b7bf873736c5d95d4fb1bfb80000000000000000000000000000000000000068f116a894984e2db1123eb395000000000000000000000000bd8451d2d5fb88469a764b05c1e0b623c510614500000000000000000000000086b811635f07e210b7bf873736c5d95d4fb1bfb80000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa0340800000000000000000000000000000000000000000000003635c9adc5dea000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001850657270657475616c204f706570656e204d616368696e65000000000000000000000000000000000000000000000000000000000000000000000000000000072450455053545200000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080806040526004361015610028575b5036156100205761001e612cc4565b005b61001e612cc4565b600090813560e01c9081620e7fa814612a9e575080630445b66714612a8057806306fdde03146129bc578063095ea7b3146129095780630a120868146128d75780630ec63db81461284057806312923b651461280d57806313a155ea1461275957806318160ddd1461273b5780631a00bdc1146126865780631f53ac02146125c657806323b872dd146124d857806328e85856146124ae578063290fd84314612464578063305a67a8146123cc578063313ce567146123b057806335a9e4df1461236b57806336296d81146123425780633af6a4f2146123195780633e0dc34e146122de578063425f375e14612208578063475e28b5146121de5780634e0aac871461218c57806351bc3c85146120ab578063536fff6c1461206c57806359d14b41146120135780635e6a645e14610a075780635fbbc0d214611fc657806360d938dc14611fa357806361d027b314611f7a5780636992dac714611f4f5780636e94729814611f3357806370a0823114611ef9578063715018a614611e9c57806377c12b1714611e105780637b97008d14611c3c5780637c4c069c14611c1e5780637d2ab1de14611bad5780638380edb714611b875780638547655914611b5e5780638da5cb5b14611b355780638ea5220f14611b0c57806393d5407914611aef57806395d89b41146119e05780639804767f146119b65780639d0014b1146118f9578063a18e5e781461173d578063a2b8a94714611682578063a9059cbb14611650578063a90d6de314611626578063a9f776841461160a578063ab48b09e146114c6578063abc6184c14611497578063b7aa023114611431578063b9314135146113c7578063b99be74014611380578063ba0a3533146112c5578063bb81d1cb1461129b578063bf6c1c5814611275578063c643929e1461124c578063d3f4e8d714611222578063d7517caa146111ea578063dc4c90d3146111a5578063dd62ed3e1461115a578063e0d30d9b1461113c578063e0fdc2f71461106f578063e111703a14611053578063e4463f4814610fb8578063e5da20de14610f8e578063e632c2f314610f70578063eb033c7514610ec9578063ed3f60aa14610e94578063f0f4426014610e08578063f19f7a7414610b69578063f2fde38b14610ade578063f4bf28a014610a86578063f968f49314610a37578063fa4ea78f14610a0c578063fad5c5b314610a07578063fb346eab146109e9578063fccc2813146109cc578063fcce48831461099d5763fdb3d7c50361000f573461099a5760a036600319011261099a576103da612cf8565b6004358152601760205260ff60408220541615610955576004358152601360205260408120541561091c576004358152601860205260ff6040822054166108e0576024351561088b57604435606435111561083c5742604435106107f85760405161044481612b77565b60018152815b602081106107e15750600c54604051906001600160a01b031661046c82612b5b565b600282526020820152600435604082015260016060820152600160808201528260a082015261049a82612d7a565b526104a481612d7a565b506040516104b181612b77565b60018152825b602081106107ca57506040516104cc81612b5b565b838152836020820152836040820152602435606082015260243560808201523060a08201526104fa82612d7a565b5261050481612d7a565b50604051918261016081011067ffffffffffffffff610160850111176107b45761016083016040523083528360208401526040830152606082015281608082015260443560a082015260643560c08201528160e082015260843561010082015281610120820152600161014082015260018060a01b03600b541660405191635bbabad760e11b83526020600484015261018483019060018060a01b03815116602485015260018060a01b0360208201511660448501526040810151916101606064860152825180915260206101a48601930190865b8181106107945750505060608101519160231985820301608486015260208084519283815201930190865b81811061077457505050608081015160048110156107605784809361014060209694839460a485015260a081015160c485015260c081015160e485015260e0810151610104850152610100810151610124850152610120810151610144850152015161016483015203915afa90811561075557829161071e575b506040602092600435815260188452818120600160ff198254161790556019845260243582822055601a84528282822055601b845260443582822055601c84526064358282205560138452205460405190815260243583820152604435604082015260643560608201528160808201527fd925f48a4bdadc5aa560d87d26859723a16dae3571e73b39eef796fadff2118960a060043592a2604051908152f35b90506020813d60201161074d575b8161073960209383612b93565b810103126107495751604061067e565b5080fd5b3d915061072c565b6040513d84823e3d90fd5b634e487b7160e01b86526021600452602486fd5b909193602060c0826107896001948951612c62565b019501929101610604565b909193602060c0826107a96001948951612c62565b0195019291016105d9565b634e487b7160e01b600052604160045260246000fd5b6020906107d5612fd6565b828285010152016104b7565b6020906107ec612fd6565b8282850101520161044a565b606460405162461bcd60e51b815260206004820152602060248201527f53746172742074696d65206d75737420626520696e20746865206675747572656044820152fd5b60405162461bcd60e51b815260206004820152602160248201527f456e642074696d65206d7573742062652061667465722073746172742074696d6044820152606560f81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602760248201527f4c697374696e67207072696365206d7573742062652067726561746572207468604482015266616e207a65726f60c81b6064820152608490fd5b60405162461bcd60e51b8152602060048201526014602482015273151bdad95b88185b1c9958591e481b1a5cdd195960621b6044820152606490fd5b60405162461bcd60e51b8152602060048201526011602482015270109d5e481c1c9a58d9481b9bdd081cd95d607a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152601b60248201527f546f6b656e206e6f74206f776e656420627920636f6e747261637400000000006044820152606490fd5b80fd5b503461099a57602036600319011261099a5760ff60406020926004358152601884522054166040519015158152f35b503461099a578060031936011261099a57602060405161dead8152f35b503461099a578060031936011261099a576020601f54604051908152f35b612b2b565b503461099a578060031936011261099a5730600090815260208181526040909120545b604051908152f35b503461099a578060031936011261099a57610a50612cf8565b61010061ff001960075416176007557f27591baca3ab78e62a0cbf3b92bae5a04d5a1768b720a980d1f4671374c93c4c8180a180f35b503461099a57602036600319011261099a576060906004358152601560205260018060a01b0360408220541690601460205260ff60408083205492601760205220541690604051928352602083015215156040820152f35b503461099a57602036600319011261099a57610af8612afa565b610b00612cf8565b6001600160a01b03908116908115610b5057600554826001600160601b0360a01b821617600555167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b50604036600319011261099a57600435610b81612b15565b903383526020601d815260ff6040852054168015610df4575b15610dbf57610ba7612fb3565b81845260188152610bbe60ff604086205416612bb5565b818452601b815260408420544210610d8557818452601c815260408420544211610d4f578184526019815260408420543410610d1457600c546001600160a01b03908116938591853b15610d1057606483926040519485938492632142170760e11b845230600485015216988960248401528860448401525af18015610d0557610cf2575b50818452601781526040842060ff199081815416905560188252604085209081541690556019815260408420549084610c7c8334612c3f565b8581158015610cc2575b505050507fc9c6b35011605bab9e8a5d7dce8f56664644b07b52c30022666c415dd4c93fc29160409182519182524290820152a3600160065580f35b8392839283928390610ce9575bf115610cde5784388581610c86565b6040513d86823e3d90fd5b506108fc610ccf565b610cfe90949194612b47565b9238610c43565b6040513d87823e3d90fd5b8280fd5b6064906040519062461bcd60e51b825260048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152fd5b6064906040519062461bcd60e51b82526004820152600f60248201526e131a5cdd1a5b99c8195e1c1a5c9959608a1b6044820152fd5b6064906040519062461bcd60e51b825260048201526013602482015272131a5cdd1a5b99c81b9bdd081cdd185c9d1959606a1b6044820152fd5b6064906040519062461bcd60e51b82526004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152fd5b506005546001600160a01b03163314610b9a565b503461099a57602036600319011261099a57610e22612afa565b610e2a612cf8565b6001600160a01b03168015610e4f576001600160601b0360a01b600954161760095580f35b60405162461bcd60e51b815260206004820152601f60248201527f547265617375727920616464726573732063616e6e6f74206265207a65726f006044820152606490fd5b503461099a578060031936011261099a57601e54601f54602080546040805194855291840192909252820152606090f35b0390f35b503461099a57602036600319011261099a57600435610ee6612cf8565b8015610f2b576020817f365bbb1b82a908cf64c94e1303370522345bd773d3f215e83443d836019bd7e492600855600160ff196007541617600755604051908152a180f35b60405162461bcd60e51b815260206004820152601f60248201527f5072696365206d7573742062652067726561746572207468616e207a65726f006044820152606490fd5b503461099a578060031936011261099a576020601e54604051908152f35b503461099a57602036600319011261099a5760406020916004358152601983522054604051908152f35b503461099a57602036600319011261099a57610fd2612afa565b610fda612cf8565b6001600160a01b03168015610fff576001600160601b0360a01b600c541617600c5580f35b60405162461bcd60e51b815260206004820152602660248201527f4f706570656e20636f6e747261637420616464726573732063616e6e6f74206260448201526565207a65726f60d01b6064820152608490fd5b503461099a578060031936011261099a57602060405160088152f35b503461099a57602036600319011261099a57611089612afa565b611091612cf8565b6001600160a01b031680156110eb57806001600160601b0360a01b600f541617600f557f6ac7f1172beb46365765e274b4a159dea9d9a7f85a64571d179671087a948073604060105460115482519182526020820152a280f35b60405162461bcd60e51b815260206004820152602360248201527f46656520726563656976657220616464726573732063616e6e6f74206265207a60448201526265726f60e81b6064820152608490fd5b503461099a578060031936011261099a576020601154604051908152f35b503461099a57604036600319011261099a576040602091611179612afa565b611181612b15565b6001600160a01b039182168352600185528383209116825283522054604051908152f35b503461099a578060031936011261099a576040517f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa034086001600160a01b03168152602090f35b503461099a578060031936011261099a57606060075460085460ff604051928181161515845260081c16151560208301526040820152f35b503461099a57602036600319011261099a5760406020916004358152601b83522054604051908152f35b503461099a578060031936011261099a57600f546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57602060ff600d5460a01c166040519015158152f35b503461099a57602036600319011261099a5760406020916004358152601483522054604051908152f35b503461099a578060031936011261099a5760e060018060a01b0380600f54166010546011549060ff601254169260405194807f0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad1686527f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa034081660208601527fe6fd991f064c6c63782b5cd724b068c37b078df1d02a9389201783079b88cd3860408601526060850152608084015260a0830152151560c0820152f35b503461099a57602036600319011261099a57600435801515809103610749576113a7612cf8565b600d805460ff60a01b191660a09290921b60ff60a01b1691909117905580f35b503461099a57602080600319360112610749579060a09160043582526018815260ff60408320541691601982526040812054601b8352604082205490601c845260408084205493601a86522054936040519515158652850152604084015260608301526080820152f35b503461099a57602036600319011261099a5761144b612afa565b611453612cf8565b6001600160a01b0316808252601d60205260408220805460ff191690557fc3803387881faad271c47728894e3e36fac830ffc8602ca6fc07733cbda775808280a280f35b503461099a57602036600319011261099a5760ff60406020926004358152601784522054166040519015158152f35b503461099a57602080600319360112610749576004356001600160a01b038181169291839003611606576114f8612cf8565b60405160a0810181811067ffffffffffffffff8211176115f25783929160c4916040523081528683858301978289528160408501610bb8815260608601603c815262ffffff6080880192878452846040519e8f9c8d9b63313b65df60e11b8d52511660048c0152511660248a0152511660448801525160020b60648701525116608485015260a48401527f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408165af180156115e7576115b4578280f35b81813d83116115e0575b6115c88183612b93565b8101031261074957518060020b0361099a5738808280f35b503d6115be565b6040513d85823e3d90fd5b634e487b7160e01b86526041600452602486fd5b8380fd5b503461099a578060031936011261099a576020604051600a8152f35b503461099a57602036600319011261099a5760406020916004358152601383522054604051908152f35b503461099a57604036600319011261099a5761167761166d612afa565b6024359033612d24565b602060405160018152f35b503461099a57602036600319011261099a5760043561169f612cf8565b606481116116ec57806011557f6ac7f1172beb46365765e274b4a159dea9d9a7f85a64571d179671087a948073604060018060a01b03600f5416926010549082519182526020820152a280f35b60405162461bcd60e51b815260206004820152602360248201527f53656c6c206665652070657263656e742063616e6e6f7420657863656564203160448201526230302560e81b6064820152608490fd5b503461099a57604036600319011261099a57600c546040516331a9108f60e11b8152600480359082018190529160209160248035926001600160a01b03918591849190829085165afa9182156118ee5786926118b2575b503091160361186d57801561181c578284526017825260408420600160ff19825416179055601382526040842055601481524260408420556015815260408320336001600160601b0360a01b825416179055604051906001825242908201527f0c8a6212f55b43783fb313e7036ac0f37beb5217118d4f3970e7d2105740f75360403392a380f35b60405162461bcd60e51b815260048101839052602360248201527f427579207072696365206d7573742062652067726561746572207468616e207a60448201526265726f60e81b6064820152608490fd5b60405162461bcd60e51b815260048101839052601a60248201527f436f6e747261637420646f65736e2774206f776e20746f6b656e0000000000006044820152606490fd5b9091508381813d83116118e7575b6118ca8183612b93565b810103126118e3575181811681036118e3579038611794565b8580fd5b503d6118c0565b6040513d88823e3d90fd5b503461099a57602036600319011261099a57600435611916612cf8565b801561196057806010557f6ac7f1172beb46365765e274b4a159dea9d9a7f85a64571d179671087a948073604060018060a01b03600f54169260115482519182526020820152a280f35b60405162461bcd60e51b815260206004820152602860248201527f53776170207468726573686f6c64206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608490fd5b503461099a57602036600319011261099a5760406020916004358152601683522054604051908152f35b503461099a578060031936011261099a5760405190806004549160018360011c9260018516948515611ae5575b6020958686108114611ad157858852879493929187908215611aaf575050600114611a55575b5050611a4192500383612b93565b610ec5604051928284938452830190612aba565b90859250600482527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b858310611a97575050611a4193508201013880611a33565b80548389018501528794508693909201918101611a7f565b9250935050611a4194915060ff191682840152151560051b8201013880611a33565b634e487b7160e01b83526022600452602483fd5b93607f1693611a0d565b503461099a578060031936011261099a5760208054604051908152f35b503461099a578060031936011261099a57600a546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a576005546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57600b546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57602060ff60075460081c166040519015158152f35b503461099a57602036600319011261099a57600435611bca612cf8565b6127108111611bd957600e5580f35b60405162461bcd60e51b815260206004820152601b60248201527f536c6970706167652063616e6e6f7420657863656564203130302500000000006044820152606490fd5b503461099a578060031936011261099a576020600e54604051908152f35b50602036600319011261099a5760043560ff6007541615611dd357611c5f612fb3565b8015611c6b8115612bf4565b6008549081830291838304141715611dbf57670de0b6b3a76400009004803410611d82576005546001600160a01b03166000818152602081905260409020548311611d2e5782611cbc913390612d24565b803411611cfd575b60405191825260208201527f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f3360403392a2600160065580f35b82808080611d0b8534612c3f565b818115611d25575b3390f1611cc4576040513d84823e3d90fd5b506108fc611d13565b60405162461bcd60e51b815260206004820152602660248201527f496e73756666696369656e7420746f6b656e7320617661696c61626c6520666f604482015265722073616c6560d01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526015602482015274125b9cdd59999a58da595b9d08115512081cd95b9d605a1b6044820152606490fd5b634e487b7160e01b83526011600452602483fd5b60405162461bcd60e51b815260206004820152601560248201527450726573616c65206973206e6f742061637469766560581b6044820152606490fd5b503461099a57602036600319011261099a57611e2a612afa565b611e32612cf8565b6001600160a01b03168015611e57576001600160601b0360a01b600b541617600b5580f35b60405162461bcd60e51b815260206004820152601e60248201527f536561706f727420616464726573732063616e6e6f74206265207a65726f00006044820152606490fd5b503461099a578060031936011261099a57611eb5612cf8565b600580546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461099a57602036600319011261099a576020610a2f611f18612afa565b6001600160a01b031660009081526020819052604090205490565b503461099a578060031936011261099a57602047604051908152f35b503461099a578060031936011261099a57604060209130815280835220546010541115604051908152f35b503461099a578060031936011261099a576009546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57602060ff600754166040519015158152f35b503461099a578060031936011261099a5760c060018060a01b03806009541690600a541660405191600883526001602084015260016040840152600a6060840152608083015260a0820152f35b503461099a57602036600319011261099a576020906001600160a01b039060ff60408361203e612afa565b1692838152601d865220541691821561205e575b50506040519015158152f35b600554161490503880612052565b503461099a57602036600319011261099a5760209060ff906040906001600160a01b03612097612afa565b168152601d84522054166040519015158152f35b503461099a578060031936011261099a576120c4612cf8565b3081528060205260408120548015612153576012549060ff821661210e5760ff199182166001176012556120ff906120fa612fb3565b612d9d565b60016006556012541660125580f35b60405162461bcd60e51b815260206004820152601860248201527f5377617020616c726561647920696e2070726f677265737300000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601160248201527004e6f20746f6b656e7320746f207377617607c1b6044820152606490fd5b503461099a578060031936011261099a5760a0600d54600180831b039081600b54169180600c541691600e54926040519460ff83881c1615158652602086015260408501521660608301526080820152f35b503461099a57602036600319011261099a5760406020916004358152601a83522054604051908152f35b503461099a57602036600319011261099a57600435612225612cf8565b80156122318115612bf4565b81471061229957828080808560018060a01b03958660055416908390612290575bf1156107555760407f28edec7a6a65e8fa9c6513c03b816f03352dd0557fde05b2a52aba6e627ec9b39160055416928151908152426020820152a280f35b506108fc612252565b60405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e74204554482062616c616e636500000000000000006044820152606490fd5b503461099a578060031936011261099a5760206040517fe6fd991f064c6c63782b5cd724b068c37b078df1d02a9389201783079b88cd388152f35b503461099a578060031936011261099a57600d546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a57600c546040516001600160a01b039091168152602090f35b503461099a578060031936011261099a576040517f0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad6001600160a01b03168152602090f35b503461099a578060031936011261099a57602060405160128152f35b503461099a57602036600319011261099a576004356123e9612cf8565b808252601860205261240160ff604084205416612bb5565b80825260186020526040822060ff19815416905560136020527fd925f48a4bdadc5aa560d87d26859723a16dae3571e73b39eef796fadff2118960a06040842054604051908152846020820152846040820152846060820152846080820152a280f35b503461099a578060031936011261099a5761247d612cf8565b60ff19600754166007557fc00eb52d383b32d956eb0bff90d7b8bd8c19a7f9d71ca10bcf5c0c3e144be7fc8180a180f35b503461099a57602036600319011261099a5760406020916004358152601c83522054604051908152f35b503461099a57606036600319011261099a576124f2612afa565b6124fa612b15565b6001600160a01b03821680845260016020908152604080862033875290915284205460443593916000198210612537575b50506116779350612d24565b8482106125a057801561258757331561256e578486926040926116779852600160205282842033855260205203912055388061252b565b604051634a1406b160e11b815260048101879052602490fd5b60405163e602df0560e01b815260048101879052602490fd5b604051637dc7a0d960e11b81523360048201526024810183905260448101869052606490fd5b503461099a57602036600319011261099a576125e0612afa565b6125e8612cf8565b6001600160a01b0390811690811561263757600a54826001600160601b0360a01b821617600a55167f0db17895a9d092fb3ca24d626f2150dd80c185b0706b36f1040ee239f56cb8718380a380f35b60405162461bcd60e51b815260206004820152602160248201527f4465762077616c6c657420616464726573732063616e6e6f74206265207a65726044820152606f60f81b6064820152608490fd5b503461099a578060031936011261099a5761269f612cf8565b4780156126f65760018060a01b038280808085856005541682f1156107555760407f28edec7a6a65e8fa9c6513c03b816f03352dd0557fde05b2a52aba6e627ec9b39160055416928151908152426020820152a280f35b60405162461bcd60e51b815260206004820152601a60248201527f4e6f2045544820746f20627579204f706570656e20666c6f6f720000000000006044820152606490fd5b503461099a578060031936011261099a576020600254604051908152f35b503461099a57602036600319011261099a57612773612afa565b61277b612cf8565b6001600160a01b031680156127c857808252601d60205260408220805460ff191660011790557feb1b9b92e50b7f88f9ff25d56765095ac6e91540eee214906f4036a908ffbdef8280a280f35b60405162461bcd60e51b815260206004820152601d60248201527f43616c6c657220616464726573732063616e6e6f74206265207a65726f0000006044820152606490fd5b503461099a57602036600319011261099a57602090600435815260158252604060018060a01b0391205416604051908152f35b503461099a57602036600319011261099a5761285a612afa565b612862612cf8565b6001600160a01b03168015612887576001600160601b0360a01b600d541617600d5580f35b60405162461bcd60e51b815260206004820152602260248201527f4261636b656e642041504920616464726573732063616e6e6f74206265207a65604482015261726f60f01b6064820152608490fd5b503461099a578060031936011261099a576005546001600160a01b031660009081526020818152604090912054610a2f565b503461099a57604036600319011261099a57612923612afa565b6024359033156129a3576001600160a01b031691821561298b5760408291338152600160205281812085825260205220556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b60249060405190634a1406b160e11b82526004820152fd5b60405163e602df0560e01b815260048101849052602490fd5b503461099a578060031936011261099a5760405190806003549160018360011c9260018516948515612a76575b6020958686108114611ad157858852879493929187908215611aaf575050600114612a1c575050611a4192500383612b93565b90859250600382527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b858310612a5e575050611a4193508201013880611a33565b80548389018501528794508693909201918101612a46565b93607f16936129e9565b503461099a578060031936011261099a576020601054604051908152f35b9050346107495781600319360112610749576020906008548152f35b919082519283825260005b848110612ae6575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201612ac5565b600435906001600160a01b0382168203612b1057565b600080fd5b602435906001600160a01b0382168203612b1057565b34612b10576000366003190112612b1057602060405160018152f35b67ffffffffffffffff81116107b457604052565b60c0810190811067ffffffffffffffff8211176107b457604052565b6040810190811067ffffffffffffffff8211176107b457604052565b90601f8019910116810190811067ffffffffffffffff8211176107b457604052565b15612bbc57565b60405162461bcd60e51b815260206004820152601060248201526f151bdad95b881b9bdd081b1a5cdd195960821b6044820152606490fd5b15612bfb57565b606460405162461bcd60e51b815260206004820152602060248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f6044820152fd5b91908203918211612c4c57565b634e487b7160e01b600052601160045260246000fd5b8051906006821015612cae5760a091835281602082015191600180831b038093166020860152604081015160408601526060810151606086015260808101516080860152015116910152565b634e487b7160e01b600052602160045260246000fd5b6040513481524260208201527f7dd768b8b37911c0bb413d9cf56fcb57b286f5def4c57d475c8abdd6737b7e1e60403392a2565b6005546001600160a01b03163303612d0c57565b60405163118cdaa760e01b8152336004820152602490fd5b91906001600160a01b0380841615612d6157811615612d4857612d4692613008565b565b60405163ec442f0560e01b815260006004820152602490fd5b604051634b637e8f60e11b815260006004820152602490fd5b805115612d875760200190565b634e487b7160e01b600052603260045260246000fd5b908115612faf574791604080516020600160f81b8183015260019060018352612dc583612b77565b60018060a01b0380600f5416928551917fe6fd991f064c6c63782b5cd724b068c37b078df1d02a9389201783079b88cd388484015260018784015260609288606082015260009586608083015260a082015260a08152612e2481612b5b565b875193612e3085612b77565b6001855285875b818110612fa057505050612e4a84612d7a565b52612e5483612d7a565b507f0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad1692833b15612f9c5791612ea895928594928851978895630d64d59360e21b8752606060048801526064870190612aba565b916003198684030160248701528351908184528084019381808460051b83010196019489915b848310612f6457505050505050508383809242604483015203925af1908115612f5957507f474900d9b2b46fdc0d712d9b2c22e60183540cd4a034932052f34b6f7b76c9a99495612f4592612f2992612f4a575b5047612c3f565b9151928352602083019190915242604083015281906060820190565b0390a1565b612f5390612b47565b38612f22565b8351903d90823e3d90fd5b9285989a5080969950612f8781929598601f979497198682030187528b51612aba565b990193019301899896938b9896939592612ece565b8480fd5b82828289010152018690612e37565b9050565b600260065414612fc4576002600655565b604051633ee5aeb560e01b8152600490fd5b60405190612fe382612b5b565b8160a06000918281528260208201528260408201528260608201528260808201520152565b90916001600160a01b03808316928315929190838015613330575b6133215760ff60075460081c1693841580613313575b6132ba5760129660ff8854161595866132b2575b86613284575b86613275575b80613267575b80613257575b1561324657600a8502851594868204600a14861715612c4c578660031b878104600814871715612c4c5760649004958780046001141715612c4c576130c16130da936130ba896064809b049a8b960490612c3f565b908761333a565b6130d08682600954168761333a565b600a54168461333a565b156131c457509060025491818301809311612c4c577fa54e6c2fc0861aa9c991b26891d71059d517983b9e84b91020f42609c452eb9d926002555b61dead60009581875286602052604087208481540190557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020604051868152a36040805191825260208201839052810191909152606090a1613177575b5050565b604090308152806020522054601054811015806131b8575b15613173576131ac60ff19916001838554161784556120fa612fb3565b60016006558154169055565b5060ff8254161561318f565b600090858252816020526040822054908482106132145750906040847fa54e6c2fc0861aa9c991b26891d71059d517983b9e84b91020f42609c452eb9d9594938884528360205203912055613115565b60405163391434e360e21b81526001600160a01b03919091166004820152602481019190915260448101849052606490fd5b94505091935050612d46935061333a565b5083600554168482161415613065565b50836005541687141561305f565b60055485168814159650613059565b8185167f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa034088616149650613053565b95508561304d565b60405162461bcd60e51b815260206004820152602b60248201527f546f6b656e7320617265206c6f636b656420616e642063616e6e6f742062652060448201526a1d1c985b9cd9995c9c995960aa1b6064820152608490fd5b508260055416861415613039565b91935050612d4693915061333a565b5081861615613023565b6001600160a01b03808216929091836133b757509060025490848201809211612c4c577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef926020926002555b16938461339f5780600254036002555b604051908152a3565b84600052600082526040600020818154019055613396565b6000908482528160205260408220549086821061340857509181604087602095887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef98965283875203912055613386565b60405163391434e360e21b81526001600160a01b03919091166004820152602481019190915260448101869052606490fdfea264697066735822122007c50d24cbae664989979c670e4c9e4422492567341efa5b3fbef2be0866ee7364736f6c63430008180033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000033b2e3c9fd0803ce80000000000000000000000000000006adddad1975cc69fb16fd3fe24d47f7d6e22eac700000000000000000000000086b811635f07e210b7bf873736c5d95d4fb1bfb80000000000000000000000000000000000000068f116a894984e2db1123eb395000000000000000000000000bd8451d2d5fb88469a764b05c1e0b623c510614500000000000000000000000086b811635f07e210b7bf873736c5d95d4fb1bfb80000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa0340800000000000000000000000000000000000000000000003635c9adc5dea000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001850657270657475616c204f706570656e204d616368696e65000000000000000000000000000000000000000000000000000000000000000000000000000000072450455053545200000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name (string): Perpetual Opepen Machine
Arg [1] : symbol (string): $PEPSTR
Arg [2] : initialSupply (uint256): 1000000000000000000000000000
Arg [3] : _treasury (address): 0x6addDaD1975cC69fB16fD3FE24D47F7d6e22eac7
Arg [4] : _devWallet (address): 0x86B811635f07E210B7BF873736C5d95d4fB1bfb8
Arg [5] : _openseaSeaport (address): 0x0000000000000068F116a894984e2DB1123eB395
Arg [6] : _opepenContract (address): 0xbD8451d2D5Fb88469A764B05C1e0b623C5106145
Arg [7] : _backendAPI (address): 0x86B811635f07E210B7BF873736C5d95d4fB1bfb8
Arg [8] : _universalRouter (address): 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD
Arg [9] : _poolManager (address): 0x05E73354cFDd6745C338b50BcFDfA3Aa6fA03408
Arg [10] : _swapThreshold (uint256): 1000000000000000000000
Arg [11] : _sellFeePercent (uint256): 0

-----Encoded View---------------
16 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [2] : 0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000
Arg [3] : 0000000000000000000000006adddad1975cc69fb16fd3fe24d47f7d6e22eac7
Arg [4] : 00000000000000000000000086b811635f07e210b7bf873736c5d95d4fb1bfb8
Arg [5] : 0000000000000000000000000000000000000068f116a894984e2db1123eb395
Arg [6] : 000000000000000000000000bd8451d2d5fb88469a764b05c1e0b623c5106145
Arg [7] : 00000000000000000000000086b811635f07e210b7bf873736c5d95d4fb1bfb8
Arg [8] : 0000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad
Arg [9] : 00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408
Arg [10] : 00000000000000000000000000000000000000000000003635c9adc5dea00000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000018
Arg [13] : 50657270657475616c204f706570656e204d616368696e650000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [15] : 2450455053545200000000000000000000000000000000000000000000000000


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.