Base Sepolia Testnet

Contract

0xCa62c35642722665D83e6481Ab30b19F11591440

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Buy236083752025-03-26 10:30:3827 days ago1742985038IN
0xCa62c356...F11591440
0.0001 ETH0.000000020.00010032
Initialize Pool236083282025-03-26 10:29:0427 days ago1742984944IN
0xCa62c356...F11591440
0 ETH0.000000110.00100032

Latest 2 internal transactions

Parent Transaction Hash Block From To
236083752025-03-26 10:30:3827 days ago1742985038
0xCa62c356...F11591440
0.00005 ETH
236083282025-03-26 10:29:0427 days ago1742984944  Contract Creation0 ETH

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AutoGrowingLPTokenV4

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
No with 200 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 29 : token.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

// Uniswap V4 imports
import {IPoolManager} from "v4-core/src/interfaces/IPoolManager.sol";
import {IHooks} from "v4-core/src/interfaces/IHooks.sol";
import {Hooks} from "v4-core/src/libraries/Hooks.sol";
import {PoolKey} from "v4-core/src/types/PoolKey.sol";
import {BalanceDelta} from "v4-core/src/types/BalanceDelta.sol";
import {Currency} from "v4-core/src/types/Currency.sol";
import {BeforeSwapDelta} from "v4-core/src/types/BeforeSwapDelta.sol";
import {SafeCast} from "v4-core/src/libraries/SafeCast.sol";
import {LPFeeLibrary} from "v4-core/src/libraries/LPFeeLibrary.sol";
import {IUnlockCallback} from "v4-core/src/interfaces/callback/IUnlockCallback.sol";

// Import base hook implementation from official Uniswap repositories
import {BaseHook} from "v4-periphery/src/utils/BaseHook.sol";
import {CurrencySettler} from "v4-core/test/utils/CurrencySettler.sol";

/**
 * @title AutoGrowingLPTokenV4
 * @dev A token that automatically grows in price based on purchase volume
 * Each 1 ETH volume increases price by 0.1%, so 10 ETH increases by 1%
 * Users can buy directly from the contract at the current price
 * 50% of ETH is added to LP in full range and the NFT position is kept
 * The hook claims fees over time, buys tokens, and burns them
 * @notice Version 1.1 - Updated for proper currency sorting and explicit owner
 */
contract AutoGrowingLPTokenV4 is ERC20, Ownable, BaseHook, IUnlockCallback {
    // Contract version
    string public constant VERSION = "1.1.0";
    
    using SafeCast for uint256;
    using CurrencySettler for Currency;
    using LPFeeLibrary for uint24;

    // Token price state variables
    uint256 public contractPrice; // Current contract-defined price in ETH (18 decimals)
    uint256 public buyCount; // Counter for buys to track statistics
    uint256 public constant GROWTH_RATE_DENOMINATOR = 1000000;
    uint256 public constant ETH_PRICE_IMPACT_RATE = 1001000; // 0.1% per 1 ETH (1001000/1000000)
    uint256 public constant PRICE_DECIMALS = 18; // Decimals for price calculations
    
    // Initial price of 0.00000000000001 ETH (with 18 decimals)
    uint256 public constant INITIAL_PRICE = 10000; // 0.00000000000001 * 10^18

    // Distribution parameters
    address public devWallet; // Developer wallet for fee distribution
    
    // Distribution ratios (out of 1000 for precision)
    uint256 public devShareRatio = 500; // 50%
    uint256 public lpShareRatio = 500; // 50%
    
    // Uniswap V4 parameters
    PoolKey public poolKey;
    Currency public tokenCurrency;
    Currency public wethCurrency;
    uint24 public constant FEE_RATE = 3000; // 0.3% fee tier
    int24 public constant MIN_TICK = -887272; // Full range lower tick
    int24 public constant MAX_TICK = 887272; // Full range upper tick
    
    // Fee collection parameters
    uint256 public lastFeeCollectionTimestamp;
    uint256 public feeCollectionInterval = 1 days; // Collect fees once per day
    uint256 public tokensBurned; // Track total tokens burned from fees
    
    // Events for transparency and monitoring
    event ContractPriceUpdated(uint256 oldPrice, uint256 newPrice, uint256 buyCount, uint256 ethAmount);
    event WalletUpdated(string walletType, address oldWallet, address newWallet);
    event DistributionRatiosUpdated(uint256 devShareRatio, uint256 lpShareRatio);
    event TokensPurchased(address buyer, uint256 ethAmount, uint256 tokenAmount);
    event LiquidityAdded(uint256 tokenAmount, uint256 ethAmount);
    event FeesCollected(uint256 amount0, uint256 amount1);
    event TokensBurned(uint256 amount);
    event PoolInitialized(address poolAddress, Currency token, Currency weth);

    /**
     * @dev Constructor sets up the token with initial parameters
     * @param _name Token name
     * @param _symbol Token symbol
     * @param _devWallet Address of the developer wallet
     * @param _poolManager Address of the Uniswap V4 PoolManager
     * @param _owner Address that will be set as the owner of the contract
     */
    constructor(
        string memory _name,
        string memory _symbol,
        address _devWallet,
        IPoolManager _poolManager,
        address _owner
    ) ERC20(_name, _symbol) Ownable(_owner) BaseHook(_poolManager) {
        require(_devWallet != address(0), "Dev wallet cannot be zero address");
        require(_owner != address(0), "Owner cannot be zero address");
        
        devWallet = _devWallet;
        
        // Set initial price to 0.00000000000001 ETH (converted to wei with 18 decimals)
        contractPrice = INITIAL_PRICE;
        buyCount = 0;
        
        // Set up currencies for Uniswap V4
        tokenCurrency = Currency.wrap(address(this));
        wethCurrency = Currency.wrap(address(0)); // Native ETH is represented by the zero address in Uniswap V4
        
        // Initialize timestamp for fee collection
        lastFeeCollectionTimestamp = block.timestamp;
    }

    /**
     * @dev Initialize the Uniswap V4 pool (must be called after deployment)
     * @param sqrtPriceX96 Initial sqrt price
     */
    function initializePool(uint160 sqrtPriceX96) external onlyOwner {
        // Create pool key with this contract as the hook
        // Sort currencies in ascending order
        Currency currency0;
        Currency currency1;
        
        // Get the address values from the Currency type
        address tokenAddress = Currency.unwrap(tokenCurrency);
        address wethAddress = Currency.unwrap(wethCurrency);
        
        // Compare addresses to determine the correct order
        if (tokenAddress < wethAddress) {
            currency0 = tokenCurrency;
            currency1 = wethCurrency;
        } else {
            currency0 = wethCurrency;
            currency1 = tokenCurrency;
        }
        
        poolKey = PoolKey({
            currency0: currency0,
            currency1: currency1,
            fee: FEE_RATE,
            tickSpacing: 60,
            hooks: IHooks(address(this))
        });
        
        // Initialize the pool
        poolManager.initialize(poolKey, sqrtPriceX96);
        
        emit PoolInitialized(address(poolManager), tokenCurrency, wethCurrency);
    }

    /**
     * @dev Updates the contract price based on the ETH volume of the purchase
     * Each 1 ETH increases price by 0.1%
     * @param ethAmount Amount of ETH used in the purchase (in wei)
     * @return newPrice The updated contract price
     */
    function updateContractPrice(uint256 ethAmount) internal returns (uint256 newPrice) {
        uint256 oldPrice = contractPrice;
        
        // Calculate price increase factor based on ETH amount
        // Convert to whole ETH units (divide by 1e18) and scale to our base (multiply by 1M)
        uint256 ethInWholeUnits = (ethAmount * 1000000) / 1 ether;
        
        // Calculate growth factor: 1.0 + (0.001 * ethAmount)
        // For 1 ETH: 1.0 + 0.001 = 1.001 (0.1% increase)
        // For 10 ETH: 1.0 + 0.01 = 1.01 (1% increase)
        uint256 growthFactor = 1000000 + ((ETH_PRICE_IMPACT_RATE - 1000000) * ethInWholeUnits) / 1000000;
        
        // Apply the growth factor to the current price
        contractPrice = (contractPrice * growthFactor) / GROWTH_RATE_DENOMINATOR;
        
        // Emit event with ETH amount included
        emit ContractPriceUpdated(oldPrice, contractPrice, buyCount, ethAmount);
        
        return contractPrice;
    }
    
    /**
     * @dev Update the dev wallet address (only owner)
     * @param _newDevWallet New dev wallet address
     */
    function setDevWallet(address _newDevWallet) external onlyOwner {
        require(_newDevWallet != address(0), "Dev wallet cannot be zero address");
        
        address oldWallet = devWallet;
        devWallet = _newDevWallet;
        
        emit WalletUpdated("DevWallet", oldWallet, _newDevWallet);
    }

    /**
     * @dev Update distribution ratios (only owner)
     * @param _devShareRatio New dev share ratio (out of 1000)
     * @param _lpShareRatio New LP share ratio (out of 1000)
     */
    function setDistributionRatios(uint256 _devShareRatio, uint256 _lpShareRatio) external onlyOwner {
        require(_devShareRatio + _lpShareRatio == 1000, "Ratios must sum to 1000");
        
        devShareRatio = _devShareRatio;
        lpShareRatio = _lpShareRatio;
        
        emit DistributionRatiosUpdated(_devShareRatio, _lpShareRatio);
    }
    
    /**
     * @dev Update fee collection interval (only owner)
     * @param _interval New interval in seconds
     */
    function setFeeCollectionInterval(uint256 _interval) external onlyOwner {
        require(_interval > 0, "Interval must be greater than 0");
        feeCollectionInterval = _interval;
    }
    
    /**
     * @dev Get the current token price from the contract
     * @return Current contract price with 18 decimals precision
     */
    function getCurrentPrice() public view returns (uint256) {
        return contractPrice;
    }
    
    /**
     * @dev Buy tokens with ETH
     * This function allows users to buy tokens directly from the contract
     * Price increases based on purchase volume - each 1 ETH increases price by 0.1%
     */
    function buy() external payable {
        require(msg.value > 0, "Must send ETH to buy tokens");
        
        // Calculate token amount based on current price
        uint256 tokenAmount = (msg.value * 10**decimals()) / contractPrice;
        
        // Mint tokens to buyer
        _mint(msg.sender, tokenAmount);
        
        // Calculate shares
        uint256 devShare = (msg.value * devShareRatio) / 1000;
        uint256 lpShare = (msg.value * lpShareRatio) / 1000;
        
        // Transfer dev share
        (bool devSuccess, ) = devWallet.call{value: devShare}("");
        require(devSuccess, "Dev fee transfer failed");
        
        // Use LP share to add liquidity
        if (lpShare > 0) {
            addLiquidityV4(lpShare);
        }
        
        // Increment buy counter
        buyCount++;
        
        // Update price after purchase with the ETH amount
        updateContractPrice(msg.value);
        
        emit TokensPurchased(msg.sender, msg.value, tokenAmount);
    }
    
    /**
     * @dev Adds liquidity to Uniswap V4 in full range
     * @param ethAmount Amount of ETH to add to liquidity
     */
    function addLiquidityV4(uint256 ethAmount) internal {
        // Calculate token amount to match ETH for liquidity
        uint256 tokenAmount = (ethAmount * 10**decimals()) / contractPrice;
        
        // Mint tokens to this contract for liquidity
        _mint(address(this), tokenAmount);
        
        // Approve tokens for the pool manager
        _approve(address(this), address(poolManager), tokenAmount);
        
        // Construct unlock data to add liquidity - only encode the necessary data
        bytes memory unlockData = abi.encode(
            ethAmount,
            tokenAmount
        );
        
        // Unlock the pool manager to add liquidity
        try poolManager.unlock(unlockData) {
            emit LiquidityAdded(tokenAmount, ethAmount);
        } catch Error(string memory reason) {
            revert(string(abi.encodePacked("Liquidity addition failed: ", reason)));
        } catch (bytes memory) {
            // Instead of reverting immediately, try to provide more context
            emit LiquidityAdded(0, 0); // Emit event with zero values to indicate attempt
            revert("Liquidity addition failed with unknown error");
        }
    }
    
    /**
     * @dev Implementation of IUnlockCallback for pool manager to call back
     * This handles the liquidity provision when the pool is unlocked
     */
    function unlockCallback(bytes calldata data) external returns (bytes memory) {
        require(msg.sender == address(poolManager), "Not pool manager");
        
        // Decode the unlock data - simplified to match what we're sending
        (uint256 ethAmount, uint256 tokenAmount) = abi.decode(
            data, 
            (uint256, uint256)
        );
        
        // Add liquidity to the pool in full range
        IPoolManager.ModifyLiquidityParams memory params = IPoolManager.ModifyLiquidityParams({
            tickLower: MIN_TICK,
            tickUpper: MAX_TICK,
            liquidityDelta: SafeCast.toInt128(int256(tokenAmount)), // Convert to int128 using SafeCast
            salt: bytes32(0) // Default salt value
        });
        
        // Call modifyLiquidity to add the liquidity with proper error handling
        try poolManager.modifyLiquidity(poolKey, params, "") returns (BalanceDelta delta, BalanceDelta feesAccrued) {
            // Settle the tokens and ETH based on the delta
            _settleDeltas(address(this), poolKey, delta, ethAmount);
        } catch Error(string memory reason) {
            revert(string(abi.encodePacked("Liquidity modification failed: ", reason)));
        } catch (bytes memory) {
            revert("Liquidity modification failed with unknown error");
        }
        
        return "";
    }
    
    /**
     * @dev Internal function to settle token and ETH deltas after liquidity operations
     */
    function _settleDeltas(address sender, PoolKey memory key, BalanceDelta delta, uint256 ethAmount) internal {
        // Determine which currency is which based on the pool configuration
        if (key.currency0 == tokenCurrency) {
            // If our token is currency0, we need to settle it
            int128 amount0 = delta.amount0();
            int128 amount1 = delta.amount1();
            
            // Handle token settlement (currency0)
            if (amount0 < 0) {
                // We need to pay tokens
                uint256 tokensToSend = uint256(uint128(-amount0));
                IERC20(address(this)).transfer(address(poolManager), tokensToSend);
            }
            
            // Handle ETH settlement (currency1)
            if (amount1 < 0) {
                // We need to pay ETH
                uint256 ethToSend = uint256(uint128(-amount1));
                try poolManager.settle{value: ethToSend}() {
                    // Settlement successful
                } catch Error(string memory reason) {
                    revert(string(abi.encodePacked("ETH settlement failed: ", reason)));
                } catch (bytes memory) {
                    revert("ETH settlement failed with unknown error");
                }
            }
        } else {
            // If our token is currency1, we handle it differently
            int128 amount0 = delta.amount0();
            int128 amount1 = delta.amount1();
            
            // Handle ETH settlement (currency0)
            if (amount0 < 0) {
                // We need to pay ETH
                uint256 ethToSend = uint256(uint128(-amount0));
                try poolManager.settle{value: ethToSend}() {
                    // Settlement successful
                } catch Error(string memory reason) {
                    revert(string(abi.encodePacked("ETH settlement failed: ", reason)));
                } catch (bytes memory) {
                    revert("ETH settlement failed with unknown error");
                }
            }
            
            // Handle token settlement (currency1)
            if (amount1 < 0) {
                // We need to pay tokens
                uint256 tokensToSend = uint256(uint128(-amount1));
                IERC20(address(this)).transfer(address(poolManager), tokensToSend);
            }
        }
        
        // Take any token balance owed to us from the delta
        if (delta.amount0() > 0) {
            key.currency0.take(poolManager, address(this), uint256(uint128(delta.amount0())), key.currency0 == wethCurrency);
        }
        if (delta.amount1() > 0) {
            key.currency1.take(poolManager, address(this), uint256(uint128(delta.amount1())), key.currency1 == wethCurrency);
        }
    }
    
    /**
     * @dev Collect fees from the pool and use them to buy and burn tokens
     * Can be called by anyone after the collection interval has passed
     */
    function collectFeesAndBurn() external {
        require(block.timestamp >= lastFeeCollectionTimestamp + feeCollectionInterval, "Collection interval not passed");
        
        // Update last collection timestamp
        lastFeeCollectionTimestamp = block.timestamp;
        
        // Collect fees from the pool by calling modifyLiquidity with zero liquidityDelta
        IPoolManager.ModifyLiquidityParams memory params = IPoolManager.ModifyLiquidityParams({
            tickLower: MIN_TICK,
            tickUpper: MAX_TICK,
            liquidityDelta: 0, // Zero to collect fees without modifying liquidity
            salt: bytes32(0)
        });
        
        // The first BalanceDelta is for the caller (total of principal and fees)
        // The second BalanceDelta is the fee delta generated in the liquidity range
        (BalanceDelta delta, BalanceDelta feesAccrued) = poolManager.modifyLiquidity(poolKey, params, "");
        
        // Extract amounts from the balance delta
        int128 amount0Delta = delta.amount0();
        int128 amount1Delta = delta.amount1();
        
        // Convert to uint256 if positive (we received tokens)
        uint256 amount0 = amount0Delta > 0 ? uint256(uint128(amount0Delta)) : 0;
        uint256 amount1 = amount1Delta > 0 ? uint256(uint128(amount1Delta)) : 0;
        
        emit FeesCollected(amount0, amount1);
        
        // Take any token balances owed to us
        if (amount0 > 0) {
            poolKey.currency0.take(poolManager, address(this), amount0, false);
        }
        
        // Take any ETH owed to us
        if (amount1 > 0) {
            poolKey.currency1.take(poolManager, address(this), amount1, true);
        }
        
        // Determine which amounts are tokens and which are ETH
        uint256 tokenAmount = 0;
        uint256 ethAmount = 0;
        
        if (poolKey.currency0 == tokenCurrency) {
            tokenAmount = amount0;
            ethAmount = amount1;
        } else {
            tokenAmount = amount1;
            ethAmount = amount0;
        }
        
        // Use collected ETH to buy and burn tokens if we have any ETH
        if (ethAmount > 0) {
            // Calculate tokens to burn based on current price
            uint256 tokensToBurn = (ethAmount * 10**decimals()) / contractPrice;
            
            // Mint additional tokens to burn (representing the "buy")
            _mint(address(this), tokensToBurn);
            
            // Burn both collected tokens and newly minted tokens
            _burn(address(this), tokenAmount + tokensToBurn);
            tokensBurned += tokenAmount + tokensToBurn;
            
            emit TokensBurned(tokenAmount + tokensToBurn);
        } else if (tokenAmount > 0) {
            // If we only collected tokens, just burn those
            _burn(address(this), tokenAmount);
            tokensBurned += tokenAmount;
            
            emit TokensBurned(tokenAmount);
        }
    }
    
    /**
     * @dev Fallback to receive ETH
     */
    receive() external payable {}

    /**
     * @dev Calculate how many tokens user will receive for a given ETH amount
     * @param ethAmount Amount of ETH in wei
     * @return Amount of tokens user will receive
     */
    function getTokensForETH(uint256 ethAmount) public view returns (uint256) {
        return (ethAmount * 10**decimals()) / contractPrice;
    }
    
    /**
     * @dev Calculate how much ETH is needed for a given token amount
     * @param tokenAmount Amount of tokens
     * @return Amount of ETH needed in wei
     */
    function getETHForTokens(uint256 tokenAmount) public view returns (uint256) {
        return (tokenAmount * contractPrice) / 10**decimals();
    }
    
    /**
     * @dev Get information about tokens burned from fees
     * @return Amount of tokens burned from collected fees
     */
    function getTotalBurnedTokens() public view returns (uint256) {
        return tokensBurned;
    }
    
    /**
     * @dev Get comprehensive price growth statistics
     * @return initialPrice The starting price of the token
     * @return currentPrice The current price of the token
     * @return growthPercentage How much the price has grown in basis points (100 = 1%)
     * @return totalBuys Total number of purchases
     */
    function getPriceGrowthStats() public view returns (
        uint256 initialPrice,
        uint256 currentPrice,
        uint256 growthPercentage,
        uint256 totalBuys
    ) {
        initialPrice = INITIAL_PRICE;
        currentPrice = contractPrice;
        // Calculate growth in basis points (100 = 1%)
        growthPercentage = currentPrice > initialPrice ? 
            ((currentPrice * 10000) / INITIAL_PRICE) - 10000 : 0;
        totalBuys = buyCount;
    }
    
    /**
     * @dev Get all current distribution parameters in a single call
     * @return _devWallet Current developer wallet address
     * @return _devShareRatio Percentage of ETH going to dev (out of 1000)
     * @return _lpShareRatio Percentage of ETH going to liquidity (out of 1000)
     */
    function getDistributionParams() public view returns (
        address _devWallet,
        uint256 _devShareRatio,
        uint256 _lpShareRatio
    ) {
        return (devWallet, devShareRatio, lpShareRatio);
    }
    
    /**
     * @dev Implementation of the getHookPermissions function from BaseHook
     * Defines which hook functions are implemented
     */
    function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
        return Hooks.Permissions({
            beforeInitialize: false,
            afterInitialize: true,
            beforeAddLiquidity: false,
            afterAddLiquidity: true,
            beforeRemoveLiquidity: false,
            afterRemoveLiquidity: false,
            beforeSwap: false,
            afterSwap: true,
            beforeDonate: false,
            afterDonate: false,
            beforeSwapReturnDelta: false,
            afterSwapReturnDelta: false,
            afterAddLiquidityReturnDelta: false,
            afterRemoveLiquidityReturnDelta: false
        });
    }
    
    /**
     * @dev Hook called after pool initialization
     */
    function _afterInitialize(address, PoolKey calldata key, uint160, int24) internal override returns (bytes4) {
        // Verify this is our pool
        if (!(key.currency0 == tokenCurrency || key.currency1 == tokenCurrency)) {
            return IHooks.afterInitialize.selector;
        }
        
        // Return the function selector to indicate success
        return IHooks.afterInitialize.selector;
    }
    
    /**
     * @dev Hook called after liquidity is added to the pool
     */
    function _afterAddLiquidity(
        address,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata,
        BalanceDelta,
        BalanceDelta,
        bytes calldata
    ) internal override returns (bytes4, BalanceDelta) {
        // Verify this is our pool
        if (!(key.currency0 == tokenCurrency || key.currency1 == tokenCurrency)) {
            return (IHooks.afterAddLiquidity.selector, BalanceDelta.wrap(0));
        }
        
        // Return the function selector to indicate success
        return (IHooks.afterAddLiquidity.selector, BalanceDelta.wrap(0));
    }
    
    /**
     * @dev Hook called after a swap occurs in the pool
     * We can use this to track volume and potentially trigger fee collection
     */
    function _afterSwap(
        address,
        PoolKey calldata key,
        IPoolManager.SwapParams calldata,
        BalanceDelta,
        bytes calldata
    ) internal override returns (bytes4, int128) {
        // Verify this is our pool
        if (!(key.currency0 == tokenCurrency || key.currency1 == tokenCurrency)) {
            return (IHooks.afterSwap.selector, 0);
        }
        
        // Check if it's time to collect fees
        if (block.timestamp >= lastFeeCollectionTimestamp + feeCollectionInterval) {
            // We can't call collectFeesAndBurn directly from here due to reentrancy protection
            // Instead, we'll update the timestamp so it can be called after this transaction
            lastFeeCollectionTimestamp = block.timestamp;
        }
        
        // Return the function selector to indicate success
        return (IHooks.afterSwap.selector, 0);
    }
}

File 2 of 29 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.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}.
     *
     * All two of these 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;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    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;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    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);
            }
        }
    }
}

File 3 of 29 : Ownable.sol
// 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);
    }
}

File 4 of 29 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @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);
}

File 5 of 29 : IPoolManager.sol
// 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;
}

File 6 of 29 : IHooks.sol
// 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);
}

File 7 of 29 : Hooks.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {PoolKey} from "../types/PoolKey.sol";
import {IHooks} from "../interfaces/IHooks.sol";
import {SafeCast} from "./SafeCast.sol";
import {LPFeeLibrary} from "./LPFeeLibrary.sol";
import {BalanceDelta, toBalanceDelta, BalanceDeltaLibrary} from "../types/BalanceDelta.sol";
import {BeforeSwapDelta, BeforeSwapDeltaLibrary} from "../types/BeforeSwapDelta.sol";
import {IPoolManager} from "../interfaces/IPoolManager.sol";
import {ParseBytes} from "./ParseBytes.sol";
import {CustomRevert} from "./CustomRevert.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.
library Hooks {
    using LPFeeLibrary for uint24;
    using Hooks for IHooks;
    using SafeCast for int256;
    using BeforeSwapDeltaLibrary for BeforeSwapDelta;
    using ParseBytes for bytes;
    using CustomRevert for bytes4;

    uint160 internal constant ALL_HOOK_MASK = uint160((1 << 14) - 1);

    uint160 internal constant BEFORE_INITIALIZE_FLAG = 1 << 13;
    uint160 internal constant AFTER_INITIALIZE_FLAG = 1 << 12;

    uint160 internal constant BEFORE_ADD_LIQUIDITY_FLAG = 1 << 11;
    uint160 internal constant AFTER_ADD_LIQUIDITY_FLAG = 1 << 10;

    uint160 internal constant BEFORE_REMOVE_LIQUIDITY_FLAG = 1 << 9;
    uint160 internal constant AFTER_REMOVE_LIQUIDITY_FLAG = 1 << 8;

    uint160 internal constant BEFORE_SWAP_FLAG = 1 << 7;
    uint160 internal constant AFTER_SWAP_FLAG = 1 << 6;

    uint160 internal constant BEFORE_DONATE_FLAG = 1 << 5;
    uint160 internal constant AFTER_DONATE_FLAG = 1 << 4;

    uint160 internal constant BEFORE_SWAP_RETURNS_DELTA_FLAG = 1 << 3;
    uint160 internal constant AFTER_SWAP_RETURNS_DELTA_FLAG = 1 << 2;
    uint160 internal constant AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG = 1 << 1;
    uint160 internal constant AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG = 1 << 0;

    struct Permissions {
        bool beforeInitialize;
        bool afterInitialize;
        bool beforeAddLiquidity;
        bool afterAddLiquidity;
        bool beforeRemoveLiquidity;
        bool afterRemoveLiquidity;
        bool beforeSwap;
        bool afterSwap;
        bool beforeDonate;
        bool afterDonate;
        bool beforeSwapReturnDelta;
        bool afterSwapReturnDelta;
        bool afterAddLiquidityReturnDelta;
        bool afterRemoveLiquidityReturnDelta;
    }

    /// @notice Thrown if the address will not lead to the specified hook calls being called
    /// @param hooks The address of the hooks contract
    error HookAddressNotValid(address hooks);

    /// @notice Hook did not return its selector
    error InvalidHookResponse();

    /// @notice Additional context for ERC-7751 wrapped error when a hook call fails
    error HookCallFailed();

    /// @notice The hook's delta changed the swap from exactIn to exactOut or vice versa
    error HookDeltaExceedsSwapAmount();

    /// @notice Utility function intended to be used in hook constructors to ensure
    /// the deployed hooks address causes the intended hooks to be called
    /// @param permissions The hooks that are intended to be called
    /// @dev permissions param is memory as the function will be called from constructors
    function validateHookPermissions(IHooks self, Permissions memory permissions) internal pure {
        if (
            permissions.beforeInitialize != self.hasPermission(BEFORE_INITIALIZE_FLAG)
                || permissions.afterInitialize != self.hasPermission(AFTER_INITIALIZE_FLAG)
                || permissions.beforeAddLiquidity != self.hasPermission(BEFORE_ADD_LIQUIDITY_FLAG)
                || permissions.afterAddLiquidity != self.hasPermission(AFTER_ADD_LIQUIDITY_FLAG)
                || permissions.beforeRemoveLiquidity != self.hasPermission(BEFORE_REMOVE_LIQUIDITY_FLAG)
                || permissions.afterRemoveLiquidity != self.hasPermission(AFTER_REMOVE_LIQUIDITY_FLAG)
                || permissions.beforeSwap != self.hasPermission(BEFORE_SWAP_FLAG)
                || permissions.afterSwap != self.hasPermission(AFTER_SWAP_FLAG)
                || permissions.beforeDonate != self.hasPermission(BEFORE_DONATE_FLAG)
                || permissions.afterDonate != self.hasPermission(AFTER_DONATE_FLAG)
                || permissions.beforeSwapReturnDelta != self.hasPermission(BEFORE_SWAP_RETURNS_DELTA_FLAG)
                || permissions.afterSwapReturnDelta != self.hasPermission(AFTER_SWAP_RETURNS_DELTA_FLAG)
                || permissions.afterAddLiquidityReturnDelta != self.hasPermission(AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG)
                || permissions.afterRemoveLiquidityReturnDelta
                    != self.hasPermission(AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)
        ) {
            HookAddressNotValid.selector.revertWith(address(self));
        }
    }

    /// @notice Ensures that the hook address includes at least one hook flag or dynamic fees, or is the 0 address
    /// @param self The hook to verify
    /// @param fee The fee of the pool the hook is used with
    /// @return bool True if the hook address is valid
    function isValidHookAddress(IHooks self, uint24 fee) internal pure returns (bool) {
        // The hook can only have a flag to return a hook delta on an action if it also has the corresponding action flag
        if (!self.hasPermission(BEFORE_SWAP_FLAG) && self.hasPermission(BEFORE_SWAP_RETURNS_DELTA_FLAG)) return false;
        if (!self.hasPermission(AFTER_SWAP_FLAG) && self.hasPermission(AFTER_SWAP_RETURNS_DELTA_FLAG)) return false;
        if (!self.hasPermission(AFTER_ADD_LIQUIDITY_FLAG) && self.hasPermission(AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG))
        {
            return false;
        }
        if (
            !self.hasPermission(AFTER_REMOVE_LIQUIDITY_FLAG)
                && self.hasPermission(AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)
        ) return false;

        // If there is no hook contract set, then fee cannot be dynamic
        // If a hook contract is set, it must have at least 1 flag set, or have a dynamic fee
        return address(self) == address(0)
            ? !fee.isDynamicFee()
            : (uint160(address(self)) & ALL_HOOK_MASK > 0 || fee.isDynamicFee());
    }

    /// @notice performs a hook call using the given calldata on the given hook that doesn't return a delta
    /// @return result The complete data returned by the hook
    function callHook(IHooks self, bytes memory data) internal returns (bytes memory result) {
        bool success;
        assembly ("memory-safe") {
            success := call(gas(), self, 0, add(data, 0x20), mload(data), 0, 0)
        }
        // Revert with FailedHookCall, containing any error message to bubble up
        if (!success) CustomRevert.bubbleUpAndRevertWith(address(self), bytes4(data), HookCallFailed.selector);

        // The call was successful, fetch the returned data
        assembly ("memory-safe") {
            // allocate result byte array from the free memory pointer
            result := mload(0x40)
            // store new free memory pointer at the end of the array padded to 32 bytes
            mstore(0x40, add(result, and(add(returndatasize(), 0x3f), not(0x1f))))
            // store length in memory
            mstore(result, returndatasize())
            // copy return data to result
            returndatacopy(add(result, 0x20), 0, returndatasize())
        }

        // Length must be at least 32 to contain the selector. Check expected selector and returned selector match.
        if (result.length < 32 || result.parseSelector() != data.parseSelector()) {
            InvalidHookResponse.selector.revertWith();
        }
    }

    /// @notice performs a hook call using the given calldata on the given hook
    /// @return int256 The delta returned by the hook
    function callHookWithReturnDelta(IHooks self, bytes memory data, bool parseReturn) internal returns (int256) {
        bytes memory result = callHook(self, data);

        // If this hook wasn't meant to return something, default to 0 delta
        if (!parseReturn) return 0;

        // A length of 64 bytes is required to return a bytes4, and a 32 byte delta
        if (result.length != 64) InvalidHookResponse.selector.revertWith();
        return result.parseReturnDelta();
    }

    /// @notice modifier to prevent calling a hook if they initiated the action
    modifier noSelfCall(IHooks self) {
        if (msg.sender != address(self)) {
            _;
        }
    }

    /// @notice calls beforeInitialize hook if permissioned and validates return value
    function beforeInitialize(IHooks self, PoolKey memory key, uint160 sqrtPriceX96) internal noSelfCall(self) {
        if (self.hasPermission(BEFORE_INITIALIZE_FLAG)) {
            self.callHook(abi.encodeCall(IHooks.beforeInitialize, (msg.sender, key, sqrtPriceX96)));
        }
    }

    /// @notice calls afterInitialize hook if permissioned and validates return value
    function afterInitialize(IHooks self, PoolKey memory key, uint160 sqrtPriceX96, int24 tick)
        internal
        noSelfCall(self)
    {
        if (self.hasPermission(AFTER_INITIALIZE_FLAG)) {
            self.callHook(abi.encodeCall(IHooks.afterInitialize, (msg.sender, key, sqrtPriceX96, tick)));
        }
    }

    /// @notice calls beforeModifyLiquidity hook if permissioned and validates return value
    function beforeModifyLiquidity(
        IHooks self,
        PoolKey memory key,
        IPoolManager.ModifyLiquidityParams memory params,
        bytes calldata hookData
    ) internal noSelfCall(self) {
        if (params.liquidityDelta > 0 && self.hasPermission(BEFORE_ADD_LIQUIDITY_FLAG)) {
            self.callHook(abi.encodeCall(IHooks.beforeAddLiquidity, (msg.sender, key, params, hookData)));
        } else if (params.liquidityDelta <= 0 && self.hasPermission(BEFORE_REMOVE_LIQUIDITY_FLAG)) {
            self.callHook(abi.encodeCall(IHooks.beforeRemoveLiquidity, (msg.sender, key, params, hookData)));
        }
    }

    /// @notice calls afterModifyLiquidity hook if permissioned and validates return value
    function afterModifyLiquidity(
        IHooks self,
        PoolKey memory key,
        IPoolManager.ModifyLiquidityParams memory params,
        BalanceDelta delta,
        BalanceDelta feesAccrued,
        bytes calldata hookData
    ) internal returns (BalanceDelta callerDelta, BalanceDelta hookDelta) {
        if (msg.sender == address(self)) return (delta, BalanceDeltaLibrary.ZERO_DELTA);

        callerDelta = delta;
        if (params.liquidityDelta > 0) {
            if (self.hasPermission(AFTER_ADD_LIQUIDITY_FLAG)) {
                hookDelta = BalanceDelta.wrap(
                    self.callHookWithReturnDelta(
                        abi.encodeCall(
                            IHooks.afterAddLiquidity, (msg.sender, key, params, delta, feesAccrued, hookData)
                        ),
                        self.hasPermission(AFTER_ADD_LIQUIDITY_RETURNS_DELTA_FLAG)
                    )
                );
                callerDelta = callerDelta - hookDelta;
            }
        } else {
            if (self.hasPermission(AFTER_REMOVE_LIQUIDITY_FLAG)) {
                hookDelta = BalanceDelta.wrap(
                    self.callHookWithReturnDelta(
                        abi.encodeCall(
                            IHooks.afterRemoveLiquidity, (msg.sender, key, params, delta, feesAccrued, hookData)
                        ),
                        self.hasPermission(AFTER_REMOVE_LIQUIDITY_RETURNS_DELTA_FLAG)
                    )
                );
                callerDelta = callerDelta - hookDelta;
            }
        }
    }

    /// @notice calls beforeSwap hook if permissioned and validates return value
    function beforeSwap(IHooks self, PoolKey memory key, IPoolManager.SwapParams memory params, bytes calldata hookData)
        internal
        returns (int256 amountToSwap, BeforeSwapDelta hookReturn, uint24 lpFeeOverride)
    {
        amountToSwap = params.amountSpecified;
        if (msg.sender == address(self)) return (amountToSwap, BeforeSwapDeltaLibrary.ZERO_DELTA, lpFeeOverride);

        if (self.hasPermission(BEFORE_SWAP_FLAG)) {
            bytes memory result = callHook(self, abi.encodeCall(IHooks.beforeSwap, (msg.sender, key, params, hookData)));

            // A length of 96 bytes is required to return a bytes4, a 32 byte delta, and an LP fee
            if (result.length != 96) InvalidHookResponse.selector.revertWith();

            // dynamic fee pools that want to override the cache fee, return a valid fee with the override flag. If override flag
            // is set but an invalid fee is returned, the transaction will revert. Otherwise the current LP fee will be used
            if (key.fee.isDynamicFee()) lpFeeOverride = result.parseFee();

            // skip this logic for the case where the hook return is 0
            if (self.hasPermission(BEFORE_SWAP_RETURNS_DELTA_FLAG)) {
                hookReturn = BeforeSwapDelta.wrap(result.parseReturnDelta());

                // any return in unspecified is passed to the afterSwap hook for handling
                int128 hookDeltaSpecified = hookReturn.getSpecifiedDelta();

                // Update the swap amount according to the hook's return, and check that the swap type doesn't change (exact input/output)
                if (hookDeltaSpecified != 0) {
                    bool exactInput = amountToSwap < 0;
                    amountToSwap += hookDeltaSpecified;
                    if (exactInput ? amountToSwap > 0 : amountToSwap < 0) {
                        HookDeltaExceedsSwapAmount.selector.revertWith();
                    }
                }
            }
        }
    }

    /// @notice calls afterSwap hook if permissioned and validates return value
    function afterSwap(
        IHooks self,
        PoolKey memory key,
        IPoolManager.SwapParams memory params,
        BalanceDelta swapDelta,
        bytes calldata hookData,
        BeforeSwapDelta beforeSwapHookReturn
    ) internal returns (BalanceDelta, BalanceDelta) {
        if (msg.sender == address(self)) return (swapDelta, BalanceDeltaLibrary.ZERO_DELTA);

        int128 hookDeltaSpecified = beforeSwapHookReturn.getSpecifiedDelta();
        int128 hookDeltaUnspecified = beforeSwapHookReturn.getUnspecifiedDelta();

        if (self.hasPermission(AFTER_SWAP_FLAG)) {
            hookDeltaUnspecified += self.callHookWithReturnDelta(
                abi.encodeCall(IHooks.afterSwap, (msg.sender, key, params, swapDelta, hookData)),
                self.hasPermission(AFTER_SWAP_RETURNS_DELTA_FLAG)
            ).toInt128();
        }

        BalanceDelta hookDelta;
        if (hookDeltaUnspecified != 0 || hookDeltaSpecified != 0) {
            hookDelta = (params.amountSpecified < 0 == params.zeroForOne)
                ? toBalanceDelta(hookDeltaSpecified, hookDeltaUnspecified)
                : toBalanceDelta(hookDeltaUnspecified, hookDeltaSpecified);

            // the caller has to pay for (or receive) the hook's delta
            swapDelta = swapDelta - hookDelta;
        }
        return (swapDelta, hookDelta);
    }

    /// @notice calls beforeDonate hook if permissioned and validates return value
    function beforeDonate(IHooks self, PoolKey memory key, uint256 amount0, uint256 amount1, bytes calldata hookData)
        internal
        noSelfCall(self)
    {
        if (self.hasPermission(BEFORE_DONATE_FLAG)) {
            self.callHook(abi.encodeCall(IHooks.beforeDonate, (msg.sender, key, amount0, amount1, hookData)));
        }
    }

    /// @notice calls afterDonate hook if permissioned and validates return value
    function afterDonate(IHooks self, PoolKey memory key, uint256 amount0, uint256 amount1, bytes calldata hookData)
        internal
        noSelfCall(self)
    {
        if (self.hasPermission(AFTER_DONATE_FLAG)) {
            self.callHook(abi.encodeCall(IHooks.afterDonate, (msg.sender, key, amount0, amount1, hookData)));
        }
    }

    function hasPermission(IHooks self, uint160 flag) internal pure returns (bool) {
        return uint160(address(self)) & flag != 0;
    }
}

File 8 of 29 : 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;
}

File 9 of 29 : BalanceDelta.sol
// 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)
        }
    }
}

File 10 of 29 : Currency.sol
// 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)));
    }
}

File 11 of 29 : BeforeSwapDelta.sol
// 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)
        }
    }
}

File 12 of 29 : SafeCast.sol
// 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));
    }
}

File 13 of 29 : LPFeeLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

/// @notice Library of helper functions for a pools LP fee
library LPFeeLibrary {
    using LPFeeLibrary for uint24;
    using CustomRevert for bytes4;

    /// @notice Thrown when the static or dynamic fee on a pool exceeds 100%.
    error LPFeeTooLarge(uint24 fee);

    /// @notice An lp fee of exactly 0b1000000... signals a dynamic fee pool. This isn't a valid static fee as it is > MAX_LP_FEE
    uint24 public constant DYNAMIC_FEE_FLAG = 0x800000;

    /// @notice the second bit of the fee returned by beforeSwap is used to signal if the stored LP fee should be overridden in this swap
    // only dynamic-fee pools can return a fee via the beforeSwap hook
    uint24 public constant OVERRIDE_FEE_FLAG = 0x400000;

    /// @notice mask to remove the override fee flag from a fee returned by the beforeSwaphook
    uint24 public constant REMOVE_OVERRIDE_MASK = 0xBFFFFF;

    /// @notice the lp fee is represented in hundredths of a bip, so the max is 100%
    uint24 public constant MAX_LP_FEE = 1000000;

    /// @notice returns true if a pool's LP fee signals that the pool has a dynamic fee
    /// @param self The fee to check
    /// @return bool True of the fee is dynamic
    function isDynamicFee(uint24 self) internal pure returns (bool) {
        return self == DYNAMIC_FEE_FLAG;
    }

    /// @notice returns true if an LP fee is valid, aka not above the maximum permitted fee
    /// @param self The fee to check
    /// @return bool True of the fee is valid
    function isValid(uint24 self) internal pure returns (bool) {
        return self <= MAX_LP_FEE;
    }

    /// @notice validates whether an LP fee is larger than the maximum, and reverts if invalid
    /// @param self The fee to validate
    function validate(uint24 self) internal pure {
        if (!self.isValid()) LPFeeTooLarge.selector.revertWith(self);
    }

    /// @notice gets and validates the initial LP fee for a pool. Dynamic fee pools have an initial fee of 0.
    /// @dev if a dynamic fee pool wants a non-0 initial fee, it should call `updateDynamicLPFee` in the afterInitialize hook
    /// @param self The fee to get the initial LP from
    /// @return initialFee 0 if the fee is dynamic, otherwise the fee (if valid)
    function getInitialLPFee(uint24 self) internal pure returns (uint24) {
        // the initial fee for a dynamic fee pool is 0
        if (self.isDynamicFee()) return 0;
        self.validate();
        return self;
    }

    /// @notice returns true if the fee has the override flag set (2nd highest bit of the uint24)
    /// @param self The fee to check
    /// @return bool True of the fee has the override flag set
    function isOverride(uint24 self) internal pure returns (bool) {
        return self & OVERRIDE_FEE_FLAG != 0;
    }

    /// @notice returns a fee with the override flag removed
    /// @param self The fee to remove the override flag from
    /// @return fee The fee without the override flag set
    function removeOverrideFlag(uint24 self) internal pure returns (uint24) {
        return self & REMOVE_OVERRIDE_MASK;
    }

    /// @notice Removes the override flag and validates the fee (reverts if the fee is too large)
    /// @param self The fee to remove the override flag from, and then validate
    /// @return fee The fee without the override flag set (if valid)
    function removeOverrideFlagAndValidate(uint24 self) internal pure returns (uint24 fee) {
        fee = self.removeOverrideFlag();
        fee.validate();
    }
}

File 14 of 29 : IUnlockCallback.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @notice Interface for the callback executed when an address unlocks the pool manager
interface IUnlockCallback {
    /// @notice Called by the pool manager on `msg.sender` when the manager is unlocked
    /// @param data The data that was passed to the call to unlock
    /// @return Any data that you want to be returned from the unlock call
    function unlockCallback(bytes calldata data) external returns (bytes memory);
}

File 15 of 29 : BaseHook.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Hooks} from "@uniswap/v4-core/src/libraries/Hooks.sol";
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
import {IHooks} from "@uniswap/v4-core/src/interfaces/IHooks.sol";
import {BalanceDelta} from "@uniswap/v4-core/src/types/BalanceDelta.sol";
import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";
import {BeforeSwapDelta} from "@uniswap/v4-core/src/types/BeforeSwapDelta.sol";
import {ImmutableState} from "../base/ImmutableState.sol";

/// @title Base Hook
/// @notice abstract contract for hook implementations
abstract contract BaseHook is IHooks, ImmutableState {
    error HookNotImplemented();

    constructor(IPoolManager _manager) ImmutableState(_manager) {
        validateHookAddress(this);
    }

    /// @notice Returns a struct of permissions to signal which hook functions are to be implemented
    /// @dev Used at deployment to validate the address correctly represents the expected permissions
    function getHookPermissions() public pure virtual returns (Hooks.Permissions memory);

    /// @notice Validates the deployed hook address agrees with the expected permissions of the hook
    /// @dev this function is virtual so that we can override it during testing,
    /// which allows us to deploy an implementation to any address
    /// and then etch the bytecode into the correct address
    function validateHookAddress(BaseHook _this) internal pure virtual {
        Hooks.validateHookPermissions(_this, getHookPermissions());
    }

    /// @inheritdoc IHooks
    function beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96)
        external
        onlyPoolManager
        returns (bytes4)
    {
        return _beforeInitialize(sender, key, sqrtPriceX96);
    }

    function _beforeInitialize(address, PoolKey calldata, uint160) internal virtual returns (bytes4) {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function afterInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96, int24 tick)
        external
        onlyPoolManager
        returns (bytes4)
    {
        return _afterInitialize(sender, key, sqrtPriceX96, tick);
    }

    function _afterInitialize(address, PoolKey calldata, uint160, int24) internal virtual returns (bytes4) {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function beforeAddLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4) {
        return _beforeAddLiquidity(sender, key, params, hookData);
    }

    function _beforeAddLiquidity(address, PoolKey calldata, IPoolManager.ModifyLiquidityParams calldata, bytes calldata)
        internal
        virtual
        returns (bytes4)
    {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function beforeRemoveLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4) {
        return _beforeRemoveLiquidity(sender, key, params, hookData);
    }

    function _beforeRemoveLiquidity(
        address,
        PoolKey calldata,
        IPoolManager.ModifyLiquidityParams calldata,
        bytes calldata
    ) internal virtual returns (bytes4) {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function afterAddLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        BalanceDelta delta,
        BalanceDelta feesAccrued,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4, BalanceDelta) {
        return _afterAddLiquidity(sender, key, params, delta, feesAccrued, hookData);
    }

    function _afterAddLiquidity(
        address,
        PoolKey calldata,
        IPoolManager.ModifyLiquidityParams calldata,
        BalanceDelta,
        BalanceDelta,
        bytes calldata
    ) internal virtual returns (bytes4, BalanceDelta) {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function afterRemoveLiquidity(
        address sender,
        PoolKey calldata key,
        IPoolManager.ModifyLiquidityParams calldata params,
        BalanceDelta delta,
        BalanceDelta feesAccrued,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4, BalanceDelta) {
        return _afterRemoveLiquidity(sender, key, params, delta, feesAccrued, hookData);
    }

    function _afterRemoveLiquidity(
        address,
        PoolKey calldata,
        IPoolManager.ModifyLiquidityParams calldata,
        BalanceDelta,
        BalanceDelta,
        bytes calldata
    ) internal virtual returns (bytes4, BalanceDelta) {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function beforeSwap(
        address sender,
        PoolKey calldata key,
        IPoolManager.SwapParams calldata params,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) {
        return _beforeSwap(sender, key, params, hookData);
    }

    function _beforeSwap(address, PoolKey calldata, IPoolManager.SwapParams calldata, bytes calldata)
        internal
        virtual
        returns (bytes4, BeforeSwapDelta, uint24)
    {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function afterSwap(
        address sender,
        PoolKey calldata key,
        IPoolManager.SwapParams calldata params,
        BalanceDelta delta,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4, int128) {
        return _afterSwap(sender, key, params, delta, hookData);
    }

    function _afterSwap(address, PoolKey calldata, IPoolManager.SwapParams calldata, BalanceDelta, bytes calldata)
        internal
        virtual
        returns (bytes4, int128)
    {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function beforeDonate(
        address sender,
        PoolKey calldata key,
        uint256 amount0,
        uint256 amount1,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4) {
        return _beforeDonate(sender, key, amount0, amount1, hookData);
    }

    function _beforeDonate(address, PoolKey calldata, uint256, uint256, bytes calldata)
        internal
        virtual
        returns (bytes4)
    {
        revert HookNotImplemented();
    }

    /// @inheritdoc IHooks
    function afterDonate(
        address sender,
        PoolKey calldata key,
        uint256 amount0,
        uint256 amount1,
        bytes calldata hookData
    ) external onlyPoolManager returns (bytes4) {
        return _afterDonate(sender, key, amount0, amount1, hookData);
    }

    function _afterDonate(address, PoolKey calldata, uint256, uint256, bytes calldata)
        internal
        virtual
        returns (bytes4)
    {
        revert HookNotImplemented();
    }
}

File 16 of 29 : CurrencySettler.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Currency} from "../../src/types/Currency.sol";
import {IERC20Minimal} from "../../src/interfaces/external/IERC20Minimal.sol";
import {IPoolManager} from "../../src/interfaces/IPoolManager.sol";

/// @notice Library used to interact with PoolManager.sol to settle any open deltas.
/// To settle a positive delta (a credit to the user), a user may take or mint.
/// To settle a negative delta (a debt on the user), a user make transfer or burn to pay off a debt.
/// @dev Note that sync() is called before any erc-20 transfer in `settle`.
library CurrencySettler {
    /// @notice Settle (pay) a currency to the PoolManager
    /// @param currency Currency to settle
    /// @param manager IPoolManager to settle to
    /// @param payer Address of the payer, the token sender
    /// @param amount Amount to send
    /// @param burn If true, burn the ERC-6909 token, otherwise ERC20-transfer to the PoolManager
    function settle(Currency currency, IPoolManager manager, address payer, uint256 amount, bool burn) internal {
        // for native currencies or burns, calling sync is not required
        // short circuit for ERC-6909 burns to support ERC-6909-wrapped native tokens
        if (burn) {
            manager.burn(payer, currency.toId(), amount);
        } else if (currency.isAddressZero()) {
            manager.settle{value: amount}();
        } else {
            manager.sync(currency);
            if (payer != address(this)) {
                IERC20Minimal(Currency.unwrap(currency)).transferFrom(payer, address(manager), amount);
            } else {
                IERC20Minimal(Currency.unwrap(currency)).transfer(address(manager), amount);
            }
            manager.settle();
        }
    }

    /// @notice Take (receive) a currency from the PoolManager
    /// @param currency Currency to take
    /// @param manager IPoolManager to take from
    /// @param recipient Address of the recipient, the token receiver
    /// @param amount Amount to receive
    /// @param claims If true, mint the ERC-6909 token, otherwise ERC20-transfer from the PoolManager to recipient
    function take(Currency currency, IPoolManager manager, address recipient, uint256 amount, bool claims) internal {
        claims ? manager.mint(recipient, currency.toId(), amount) : manager.take(currency, recipient, amount);
    }
}

File 17 of 29 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

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);
}

File 18 of 29 : Context.sol
// 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;
    }
}

File 19 of 29 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @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);
}

File 20 of 29 : IERC6909Claims.sol
// 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);
}

File 21 of 29 : IProtocolFees.sol
// 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);
}

File 22 of 29 : PoolId.sol
// 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 29 : IExtsload.sol
// 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);
}

File 24 of 29 : IExttload.sol
// 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);
}

File 25 of 29 : ParseBytes.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/// @notice Parses bytes returned from hooks and the byte selector used to check return selectors from hooks.
/// @dev parseSelector also is used to parse the expected selector
/// For parsing hook returns, note that all hooks return either bytes4 or (bytes4, 32-byte-delta) or (bytes4, 32-byte-delta, uint24).
library ParseBytes {
    function parseSelector(bytes memory result) internal pure returns (bytes4 selector) {
        // equivalent: (selector,) = abi.decode(result, (bytes4, int256));
        assembly ("memory-safe") {
            selector := mload(add(result, 0x20))
        }
    }

    function parseFee(bytes memory result) internal pure returns (uint24 lpFee) {
        // equivalent: (,, lpFee) = abi.decode(result, (bytes4, int256, uint24));
        assembly ("memory-safe") {
            lpFee := mload(add(result, 0x60))
        }
    }

    function parseReturnDelta(bytes memory result) internal pure returns (int256 hookReturn) {
        // equivalent: (, hookReturnDelta) = abi.decode(result, (bytes4, int256));
        assembly ("memory-safe") {
            hookReturn := mload(add(result, 0x40))
        }
    }
}

File 26 of 29 : CustomRevert.sol
// 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))
        }
    }
}

File 27 of 29 : IERC20Minimal.sol
// 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);
}

File 28 of 29 : ImmutableState.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
import {IImmutableState} from "../interfaces/IImmutableState.sol";

/// @title Immutable State
/// @notice A collection of immutable state variables, commonly used across multiple contracts
contract ImmutableState is IImmutableState {
    /// @inheritdoc IImmutableState
    IPoolManager public immutable poolManager;

    /// @notice Thrown when the caller is not PoolManager
    error NotPoolManager();

    /// @notice Only allow calls from the PoolManager contract
    modifier onlyPoolManager() {
        if (msg.sender != address(poolManager)) revert NotPoolManager();
        _;
    }

    constructor(IPoolManager _poolManager) {
        poolManager = _poolManager;
    }
}

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

import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";

/// @title IImmutableState
/// @notice Interface for the ImmutableState contract
interface IImmutableState {
    /// @notice The Uniswap v4 PoolManager contract
    function poolManager() external view returns (IPoolManager);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "forge-std/=lib/forge-std/src/",
    "v4-core/=lib/v4-core/",
    "v4-periphery/=lib/v4-periphery/",
    "@uniswap/v4-core/=lib/v4-core/",
    "solmate/=lib/v4-core/lib/solmate/",
    "permit2/=lib/v4-periphery/lib/permit2/",
    "uniswap-hooks/=lib/uniswap-hooks/src/",
    "@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
    "ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "hardhat/=lib/v4-core/node_modules/hardhat/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": true,
  "libraries": {}
}

Contract ABI

API
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_devWallet","type":"address"},{"internalType":"contract IPoolManager","name":"_poolManager","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"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":[],"name":"HookNotImplemented","type":"error"},{"inputs":[],"name":"NotPoolManager","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","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":false,"internalType":"uint256","name":"oldPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"buyCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"ContractPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"devShareRatio","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpShareRatio","type":"uint256"}],"name":"DistributionRatiosUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"FeesCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"LiquidityAdded","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":"address","name":"poolAddress","type":"address"},{"indexed":false,"internalType":"Currency","name":"token","type":"address"},{"indexed":false,"internalType":"Currency","name":"weth","type":"address"}],"name":"PoolInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"ethAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"TokensPurchased","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":false,"internalType":"string","name":"walletType","type":"string"},{"indexed":false,"internalType":"address","name":"oldWallet","type":"address"},{"indexed":false,"internalType":"address","name":"newWallet","type":"address"}],"name":"WalletUpdated","type":"event"},{"inputs":[],"name":"ETH_PRICE_IMPACT_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_RATE","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GROWTH_RATE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INITIAL_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TICK","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_TICK","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"components":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"int256","name":"liquidityDelta","type":"int256"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"internalType":"struct IPoolManager.ModifyLiquidityParams","name":"params","type":"tuple"},{"internalType":"BalanceDelta","name":"delta","type":"int256"},{"internalType":"BalanceDelta","name":"feesAccrued","type":"int256"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"afterAddLiquidity","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"},{"internalType":"BalanceDelta","name":"","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"afterDonate","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"}],"name":"afterInitialize","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"components":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"int256","name":"liquidityDelta","type":"int256"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"internalType":"struct IPoolManager.ModifyLiquidityParams","name":"params","type":"tuple"},{"internalType":"BalanceDelta","name":"delta","type":"int256"},{"internalType":"BalanceDelta","name":"feesAccrued","type":"int256"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"afterRemoveLiquidity","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"},{"internalType":"BalanceDelta","name":"","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"components":[{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"int256","name":"amountSpecified","type":"int256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IPoolManager.SwapParams","name":"params","type":"tuple"},{"internalType":"BalanceDelta","name":"delta","type":"int256"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"afterSwap","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"},{"internalType":"int128","name":"","type":"int128"}],"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":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"components":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"int256","name":"liquidityDelta","type":"int256"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"internalType":"struct IPoolManager.ModifyLiquidityParams","name":"params","type":"tuple"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"beforeAddLiquidity","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"beforeDonate","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"beforeInitialize","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"components":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"int256","name":"liquidityDelta","type":"int256"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"internalType":"struct IPoolManager.ModifyLiquidityParams","name":"params","type":"tuple"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"beforeRemoveLiquidity","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"key","type":"tuple"},{"components":[{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"int256","name":"amountSpecified","type":"int256"},{"internalType":"uint160","name":"sqrtPriceLimitX96","type":"uint160"}],"internalType":"struct IPoolManager.SwapParams","name":"params","type":"tuple"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"beforeSwap","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"},{"internalType":"BeforeSwapDelta","name":"","type":"int256"},{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"buyCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectFeesAndBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devShareRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCollectionInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDistributionParams","outputs":[{"internalType":"address","name":"_devWallet","type":"address"},{"internalType":"uint256","name":"_devShareRatio","type":"uint256"},{"internalType":"uint256","name":"_lpShareRatio","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"getETHForTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getHookPermissions","outputs":[{"components":[{"internalType":"bool","name":"beforeInitialize","type":"bool"},{"internalType":"bool","name":"afterInitialize","type":"bool"},{"internalType":"bool","name":"beforeAddLiquidity","type":"bool"},{"internalType":"bool","name":"afterAddLiquidity","type":"bool"},{"internalType":"bool","name":"beforeRemoveLiquidity","type":"bool"},{"internalType":"bool","name":"afterRemoveLiquidity","type":"bool"},{"internalType":"bool","name":"beforeSwap","type":"bool"},{"internalType":"bool","name":"afterSwap","type":"bool"},{"internalType":"bool","name":"beforeDonate","type":"bool"},{"internalType":"bool","name":"afterDonate","type":"bool"},{"internalType":"bool","name":"beforeSwapReturnDelta","type":"bool"},{"internalType":"bool","name":"afterSwapReturnDelta","type":"bool"},{"internalType":"bool","name":"afterAddLiquidityReturnDelta","type":"bool"},{"internalType":"bool","name":"afterRemoveLiquidityReturnDelta","type":"bool"}],"internalType":"struct Hooks.Permissions","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getPriceGrowthStats","outputs":[{"internalType":"uint256","name":"initialPrice","type":"uint256"},{"internalType":"uint256","name":"currentPrice","type":"uint256"},{"internalType":"uint256","name":"growthPercentage","type":"uint256"},{"internalType":"uint256","name":"totalBuys","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ethAmount","type":"uint256"}],"name":"getTokensForETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalBurnedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"initializePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastFeeCollectionTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpShareRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolKey","outputs":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolManager","outputs":[{"internalType":"contract IPoolManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newDevWallet","type":"address"}],"name":"setDevWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_devShareRatio","type":"uint256"},{"internalType":"uint256","name":"_lpShareRatio","type":"uint256"}],"name":"setDistributionRatios","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_interval","type":"uint256"}],"name":"setFeeCollectionInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenCurrency","outputs":[{"internalType":"Currency","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensBurned","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":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"unlockCallback","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wethCurrency","outputs":[{"internalType":"Currency","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052346100eb5761001d6100146102d4565b9392909261061f565b6100256100f0565b615d4561133b8239608051818181611a19015281816124430152818161274a0152818161279201528181612a7901528181612b2201528181612bf001528181612cba01528181612d46015281816132e80152818161339a0152818161354001528181613c6501528181613ccf01528181613db601528181613e990152818161431f015281816143d301528181614d6701528181614de401528181614e7201528181614ffc01528181615119015281816151c90152818161559601526155f60152615d4590f35b6100f6565b60405190565b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b90610122906100fa565b810190811060018060401b0382111761013a57604052565b610104565b9061015261014b6100f0565b9283610118565b565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b60018060401b0381116101805761017c6020916100fa565b0190565b610104565b90825f9392825e0152565b909291926101a56101a082610164565b61013f565b938185526020850190828401116101c1576101bf92610185565b565b610160565b9080601f830112156101e4578160206101e193519101610190565b90565b61015c565b60018060a01b031690565b6101fd906101e9565b90565b610209816101f4565b0361021057565b5f80fd5b9050519061022182610200565b565b61022c906101f4565b90565b61023881610223565b0361023f57565b5f80fd5b905051906102508261022f565b565b919060a0838203126102cf575f83015160018060401b0381116102ca578161027b9185016101c6565b92602081015160018060401b0381116102c5578261029a9183016101c6565b926102c26102ab8460408501610214565b936102b98160608601610243565b93608001610214565b90565b610158565b610158565b610154565b6102f2617080803803806102e78161013f565b928339810190610252565b9091929394565b5f1b90565b9061030a5f19916102f9565b9181191691161790565b90565b90565b90565b61033161032c61033692610314565b61031a565b610317565b90565b90565b9061035161034c6103589261031d565b610339565b82546102fe565b9055565b90565b61037361036e6103789261035c565b61031a565b610317565b90565b9061039061038b6103979261035f565b610339565b82546102fe565b9055565b90565b6103b26103ad6103b79261039b565b61031a565b6101e9565b90565b6103c39061039e565b90565b60209181520190565b60207f7300000000000000000000000000000000000000000000000000000000000000917f4465762077616c6c65742063616e6e6f74206265207a65726f206164647265735f8201520152565b61042960216040926103c6565b610432816103cf565b0190565b61044b9060208101905f81830391015261041c565b90565b1561045557565b61045d6100f0565b62461bcd60e51b81528061047360048201610436565b0390fd5b5f7f4f776e65722063616e6e6f74206265207a65726f206164647265737300000000910152565b6104ab601c6020926103c6565b6104b481610477565b0190565b6104cd9060208101905f81830391015261049e565b90565b156104d757565b6104df6100f0565b62461bcd60e51b8152806104f5600482016104b8565b0390fd5b9061050a60018060a01b03916102f9565b9181191691161790565b61052861052361052d926101e9565b61031a565b6101e9565b90565b61053990610514565b90565b61054590610530565b90565b90565b9061056061055b6105679261053c565b610548565b82546104f9565b9055565b90565b61058261057d6105879261056b565b61031a565b610317565b90565b61059561271061056e565b90565b6105ac6105a76105b192610317565b61031a565b610317565b90565b906105c96105c46105d092610598565b610339565b82546102fe565b9055565b6105e86105e36105ed9261039b565b61031a565b610317565b90565b6105f990610530565b90565b90565b9061061461060f61061b9261053c565b6105fc565b82546104f9565b9055565b610637906106ac95926106a594959184909192610714565b6106446101f4600961033c565b6106516101f4600a61033c565b61065f62015180601161037b565b6106848361067d6106776106725f6103ba565b6101f4565b916101f4565b141561044e565b61069e6106986106935f6103ba565b6101f4565b916101f4565b14156104d0565b600861054b565b6106be6106b761058a565b60066105b4565b6106d16106ca5f6105d4565b60076105b4565b6106ec6106e56106e0306105f0565b61053c565b600e6105ff565b6107076107006106fb5f6103ba565b61053c565b600f6105ff565b6107124260106105b4565b565b90610720939291610722565b565b9061072e939291610739565b61073730610a44565b565b9290916107459261074a565b608052565b906107559291610757565b565b906107629291610786565b565b61076d906101f4565b9052565b9190610784905f60208501940190610764565b565b9161079091610a14565b806107ab6107a56107a05f6103ba565b6101f4565b916101f4565b146107bb576107b990610a96565b565b6107de6107c75f6103ba565b5f918291631e4fbdf760e01b835260048301610771565b0390fd5b5190565b634e487b7160e01b5f52602260045260245ffd5b906001600283049216801561081a575b602083101461081557565b6107e6565b91607f169161080a565b5f5260205f2090565b601f602091010490565b1b90565b919060086108569102916108505f1984610837565b92610837565b9181191691161790565b919061087661087161087e93610598565b610339565b90835461083b565b9055565b5f90565b61089891610892610882565b91610860565b565b5b8181106108a6575050565b806108b35f600193610886565b0161089b565b9190601f81116108c9575b505050565b6108d56108fa93610824565b9060206108e18461082d565b83019310610902575b6108f39061082d565b019061089a565b5f80806108c4565b91506108f3819290506108ea565b1c90565b90610924905f1990600802610910565b191690565b8161093391610914565b906002021790565b90610945816107e2565b9060018060401b038211610a03576109678261096185546107fa565b856108b9565b602090601f831160011461099b5791809161098a935f9261098f575b5050610929565b90555b565b90915001515f80610983565b601f198316916109aa85610824565b925f5b8181106109eb575091600293918560019694106109d1575b5050500201905561098d565b6109e1910151601f841690610914565b90555f80806109c5565b919360206001819287870151815501950192016109ad565b610104565b90610a129161093b565b565b90610a23610a2a926003610a08565b6004610a08565b565b610a3590610514565b90565b610a4190610a2c565b90565b610a5e90610a59610a53610bec565b91610a38565b610f68565b565b5f1c90565b60018060a01b031690565b610a7c610a8191610a60565b610a65565b90565b610a8e9054610a70565b90565b5f0190565b610aa06005610a84565b610aab82600561054b565b90610adf610ad97f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361053c565b9161053c565b91610ae86100f0565b80610af281610a91565b0390a3565b610b026101c061013f565b90565b5f90565b60209081808080808080808080808080610b21610af7565b9e8f610b2b610b05565b815201610b36610b05565b815201610b41610b05565b815201610b4c610b05565b815201610b57610b05565b815201610b62610b05565b815201610b6d610b05565b815201610b78610b05565b815201610b83610b05565b815201610b8e610b05565b815201610b99610b05565b815201610ba4610b05565b815201610baf610b05565b815201610bba610b05565b81525050565b610bc8610b09565b90565b610bd66101c061013f565b90565b151590565b90610be890610bd9565b9052565b610bf4610bc0565b505f60015f60015f805f60015f915f935f955f975f995f9b610c14610bcb565b809e5f820190610c2391610bde565b60200190610c3091610bde565b60408d0190610c3e91610bde565b60608c0190610c4c91610bde565b60808b0190610c5a91610bde565b60a08a0190610c6891610bde565b60c0890190610c7691610bde565b60e0880190610c8491610bde565b610100870190610c9391610bde565b610120860190610ca291610bde565b610140850190610cb191610bde565b610160840190610cc091610bde565b610180830190610ccf91610bde565b6101a0820190610cde91610bde565b90565b610ceb9051610bd9565b90565b90565b610d05610d00610d0a92610cee565b61031a565b6101e9565b90565b610d18612000610cf1565b90565b90565b610d32610d2d610d3792610d1b565b61031a565b6101e9565b90565b610d45611000610d1e565b90565b90565b610d5f610d5a610d6492610d48565b61031a565b6101e9565b90565b610d72610800610d4b565b90565b90565b610d8c610d87610d9192610d75565b61031a565b6101e9565b90565b610d9f610400610d78565b90565b90565b610db9610db4610dbe92610da2565b61031a565b6101e9565b90565b610dcc610200610da5565b90565b90565b610de6610de1610deb92610dcf565b61031a565b6101e9565b90565b610df9610100610dd2565b90565b90565b610e13610e0e610e1892610dfc565b61031a565b6101e9565b90565b610e256080610dff565b90565b90565b610e3f610e3a610e4492610e28565b61031a565b6101e9565b90565b610e516040610e2b565b90565b90565b610e6b610e66610e7092610e54565b61031a565b6101e9565b90565b610e7d6020610e57565b90565b90565b610e97610e92610e9c92610e80565b61031a565b6101e9565b90565b610ea96010610e83565b90565b90565b610ec3610ebe610ec892610eac565b61031a565b6101e9565b90565b610ed56008610eaf565b90565b90565b610eef610eea610ef492610ed8565b61031a565b6101e9565b90565b610f016004610edb565b90565b90565b610f1b610f16610f2092610f04565b61031a565b6101e9565b90565b610f2d6002610f07565b90565b90565b610f47610f42610f4c92610f30565b61031a565b6101e9565b90565b610f596001610f33565b90565b610f6590610530565b90565b90610f745f8201610ce1565b610f97610f91610f8c85610f86610d0d565b906112f6565b610bd9565b91610bd9565b141580156112af575b8015611278575b8015611241575b801561120a575b80156111d3575b801561119c575b8015611165575b801561112d575b80156110f5575b80156110bd575b8015611085575b801561104d575b908115611014575b50610ffd5750565b61100e630732d7b560e51b91610f5c565b90611328565b61102291506101a001610ce1565b61104561103f61103a84611034610f4f565b906112f6565b610bd9565b91610bd9565b14155f610ff5565b5061105b6101808201610ce1565b61107e6110786110738561106d610f23565b906112f6565b610bd9565b91610bd9565b1415610fed565b506110936101608201610ce1565b6110b66110b06110ab856110a5610ef7565b906112f6565b610bd9565b91610bd9565b1415610fe6565b506110cb6101408201610ce1565b6110ee6110e86110e3856110dd610ecb565b906112f6565b610bd9565b91610bd9565b1415610fdf565b506111036101208201610ce1565b61112661112061111b85611115610e9f565b906112f6565b610bd9565b91610bd9565b1415610fd8565b5061113b6101008201610ce1565b61115e6111586111538561114d610e73565b906112f6565b610bd9565b91610bd9565b1415610fd1565b5061117260e08201610ce1565b61119561118f61118a85611184610e47565b906112f6565b610bd9565b91610bd9565b1415610fca565b506111a960c08201610ce1565b6111cc6111c66111c1856111bb610e1b565b906112f6565b610bd9565b91610bd9565b1415610fc3565b506111e060a08201610ce1565b6112036111fd6111f8856111f2610dee565b906112f6565b610bd9565b91610bd9565b1415610fbc565b5061121760808201610ce1565b61123a61123461122f85611229610dc1565b906112f6565b610bd9565b91610bd9565b1415610fb5565b5061124e60608201610ce1565b61127161126b61126685611260610d94565b906112f6565b610bd9565b91610bd9565b1415610fae565b5061128560408201610ce1565b6112a86112a261129d85611297610d67565b906112f6565b610bd9565b91610bd9565b1415610fa7565b506112bc60208201610ce1565b6112df6112d96112d4856112ce610d3a565b906112f6565b610bd9565b91610bd9565b1415610fa0565b5f90565b6112f390610514565b90565b61130b611310916113056112e6565b50610f5c565b6112ea565b1661132361131d5f61039e565b916101e9565b141590565b5f5260018060a01b031660045260245ffdfe60806040526004361015610015575b36611db157005b61001f5f3561039e565b806306fdde0314610399578063095ea7b31461039457806316acbfcb1461038f57806318160ddd1461038a578063182148ef1461038557806318c824cf146103805780631f53ac021461037b57806321d0ee701461037657806323b872dd14610371578063259982e51461036c5780632af0e251146103675780632d11c58a14610362578063313ce5671461035d578063344ebf041461035857806352c8c3c014610353578063559f4e321461034e578063575e24b41461034957806361e2c8551461034457806366cb3a421461033f5780636882a8881461033a5780636c2bbe7e146103355780636fe7e6eb146103305780637048594b1461032b57806370a0823114610326578063715018a6146103215780637c5e27951461031c5780638da5cb5b146103175780638ea5220f14610312578063911157821461030d57806391dd73461461030857806391e97e591461030357806395d89b41146102fe57806397e9a0bf146102f95780639f063efc146102f4578063a1634b14146102ef578063a6f2ae3a146102ea578063a9059cbb146102e5578063ab48b09e146102e0578063b47b2fb1146102db578063b5e19d23146102d6578063b6a8b0fa146102d1578063b92ab477146102cc578063be48af99146102c7578063c4e833ce146102c2578063ca703075146102bd578063d2e1f2b1146102b8578063d5969ce0146102b3578063dc4c90d3146102ae578063dc98354e146102a9578063dd62ed3e146102a4578063e1b4af691461029f578063e7873b581461029a578063eb91d37e14610295578063f1a640f814610290578063f2fde38b1461028b5763ffa1ad740361000e57611d7c565b611c5c565b611c27565b611bbb565b611b86565b611b56565b611b20565b611ad8565b611a69565b6119e4565b6119af565b61196b565b611927565b6117c5565b61175f565b611711565b61166a565b61162d565b611551565b6114fd565b6114d4565b61149f565b611428565b6113f3565b6113af565b61137a565b611335565b611270565b6111fd565b611188565b611131565b6110c6565b611091565b61105c565b611014565b610f66565b610e5e565b610ddb565b610d88565b610d5b565b610c92565b610c24565b610bb7565b610b34565b610ad7565b610a55565b610a37565b610a01565b6109a9565b610871565b61081e565b6107ac565b6105a9565b610554565b610519565b61042c565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f9103126103bc57565b6103ae565b5190565b60209181520190565b90825f9392825e0152565b601f801991011690565b61040261040b602093610410936103f9816103c1565b938480936103c5565b958691016103ce565b6103d9565b0190565b6104299160208201915f8184039101526103e3565b90565b3461045c5761043c3660046103b2565b610458610447611ed1565b61044f6103a4565b91829182610414565b0390f35b6103aa565b5f80fd5b60018060a01b031690565b61047990610465565b90565b61048581610470565b0361048c57565b5f80fd5b9050359061049d8261047c565b565b90565b6104ab8161049f565b036104b257565b5f80fd5b905035906104c3826104a2565b565b91906040838203126104ed57806104e16104ea925f8601610490565b936020016104b6565b90565b6103ae565b151590565b610500906104f2565b9052565b9190610517905f602085019401906104f7565b565b3461054a5761054661053561052f3660046104c5565b90611eeb565b61053d6103a4565b91829182610504565b0390f35b6103aa565b5f0190565b34610582576105643660046103b2565b61056c61239d565b6105746103a4565b8061057e8161054f565b0390f35b6103aa565b6105909061049f565b9052565b91906105a7905f60208501940190610587565b565b346105d9576105b93660046103b2565b6105d56105c461281c565b6105cc6103a4565b91829182610594565b0390f35b6103aa565b5f1c90565b60018060a01b031690565b6105fa6105ff916105de565b6105e3565b90565b61060c90546105ee565b90565b60a01c90565b62ffffff1690565b61062961062e9161060f565b610615565b90565b61063b905461061d565b90565b60b81c90565b60020b90565b61065661065b9161063e565b610644565b90565b610668905461064a565b90565b60018060a01b031690565b610682610687916105de565b61066b565b90565b6106949054610676565b90565b600b6106a45f8201610602565b916106b160018301610602565b916106be60018201610631565b916106d760026106d06001850161065e565b930161068a565b90565b90565b6106f16106ec6106f692610465565b6106da565b610465565b90565b610702906106dd565b90565b61070e906106f9565b90565b61071a90610705565b9052565b62ffffff1690565b61072f9061071e565b9052565b60020b90565b61074290610733565b9052565b61074f906106f9565b90565b61075b90610746565b9052565b909594926107aa946107996107a39261078f60809661078560a088019c5f890190610711565b6020870190610711565b6040850190610726565b6060830190610739565b0190610752565b565b346107e0576107bc3660046103b2565b6107dc6107c7610697565b916107d39593956103a4565b9586958661075f565b0390f35b6103aa565b90565b6107fc6107f7610801926107e5565b6106da565b61049f565b90565b610810620f42406107e8565b90565b61081b610804565b90565b3461084e5761082e3660046103b2565b61084a610839610813565b6108416103a4565b91829182610594565b0390f35b6103aa565b9060208282031261086c57610869915f01610490565b90565b6103ae565b3461089f57610889610884366004610853565b612a5e565b6108916103a4565b8061089b8161054f565b0390f35b6103aa565b5f80fd5b908160a09103126108b65790565b6108a4565b908160809103126108c95790565b6108a4565b5f80fd5b5f80fd5b5f80fd5b909182601f830112156109145781359167ffffffffffffffff831161090f57602001926001830284011161090a57565b6108d6565b6108d2565b6108ce565b906101608282031261097657610931815f8401610490565b9261093f82602085016108a8565b9261094d8360c083016108bb565b9261014082013567ffffffffffffffff81116109715761096d92016108da565b9091565b610461565b6103ae565b63ffffffff60e01b1690565b6109909061097b565b9052565b91906109a7905f60208501940190610987565b565b346109c2576109b9366004610919565b93929092612ada565b6103aa565b90916060828403126109fc576109f96109e2845f8501610490565b936109f08160208601610490565b936040016104b6565b90565b6103ae565b34610a3257610a2e610a1d610a173660046109c7565b91612ae7565b610a256103a4565b91829182610504565b0390f35b6103aa565b34610a5057610a47366004610919565b93929092612b83565b6103aa565b34610a8557610a653660046103b2565b610a81610a70612b90565b610a786103a4565b91829182610594565b0390f35b6103aa565b90565b610aa1610a9c610aa692610a8a565b6106da565b61071e565b90565b610ab4610bb8610a8d565b90565b610abf610aa9565b90565b9190610ad5905f60208501940190610726565b565b34610b0757610ae73660046103b2565b610b03610af2610ab7565b610afa6103a4565b91829182610ac2565b0390f35b6103aa565b60ff1690565b610b1b90610b0c565b9052565b9190610b32905f60208501940190610b12565b565b34610b6457610b443660046103b2565b610b60610b4f612bc6565b610b576103a4565b91829182610b1f565b0390f35b6103aa565b1c90565b610b7d906008610b829302610b69565b6105e3565b90565b90610b909154610b6d565b90565b610b9f600f5f90610b85565b90565b9190610bb5905f60208501940190610711565b565b34610be757610bc73660046103b2565b610be3610bd2610b93565b610bda6103a4565b91829182610ba2565b0390f35b6103aa565b90565b610bff906008610c049302610b69565b610bec565b90565b90610c129154610bef565b90565b610c2160105f90610c07565b90565b34610c5457610c343660046103b2565b610c50610c3f610c15565b610c476103a4565b91829182610594565b0390f35b6103aa565b90565b610c70610c6b610c7592610c59565b6106da565b61049f565b90565b610c84620f4628610c5c565b90565b610c8f610c78565b90565b34610cc257610ca23660046103b2565b610cbe610cad610c87565b610cb56103a4565b91829182610594565b0390f35b6103aa565b90816060910312610cd55790565b6108a4565b9061014082820312610d3757610cf2815f8401610490565b92610d0082602085016108a8565b92610d0e8360c08301610cc7565b9261012082013567ffffffffffffffff8111610d3257610d2e92016108da565b9091565b610461565b6103ae565b90565b610d53610d4e610d5892610d3c565b6106da565b610d3c565b90565b34610d7457610d6b366004610cda565b93929092612c53565b6103aa565b610d8560115f90610c07565b90565b34610db857610d983660046103b2565b610db4610da3610d79565b610dab6103a4565b91829182610594565b0390f35b6103aa565b90602082820312610dd657610dd3915f016104b6565b90565b6103ae565b34610e0b57610e07610df6610df1366004610dbd565b612c71565b610dfe6103a4565b91829182610594565b0390f35b6103aa565b90565b610e27610e22610e2c92610e10565b6106da565b610733565b90565b610e3b620d89e8610e13565b90565b610e46610e2f565b90565b9190610e5c905f60208501940190610739565b565b34610e8e57610e6e3660046103b2565b610e8a610e79610e3e565b610e816103a4565b91829182610e49565b0390f35b6103aa565b610e9c81610d3c565b03610ea357565b5f80fd5b90503590610eb482610e93565b565b916101a083830312610f3157610ece825f8501610490565b92610edc83602083016108a8565b92610eea8160c084016108bb565b92610ef9826101408501610ea7565b92610f08836101608301610ea7565b9261018082013567ffffffffffffffff8111610f2c57610f2892016108da565b9091565b610461565b6103ae565b610f3f90610d3f565b9052565b916020610f64929493610f5d60408201965f830190610987565b0190610f36565b565b34610f8257610f76366004610eb6565b95949094939193612d20565b6103aa565b610f9081610465565b03610f9757565b5f80fd5b90503590610fa882610f87565b565b610fb381610733565b03610fba57565b5f80fd5b90503590610fcb82610faa565b565b6101008183031261100f57610fe4825f8301610490565b9261100c610ff584602085016108a8565b936110038160c08601610f9b565b9360e001610fbe565b90565b6103ae565b346110485761104461103361102a366004610fcd565b92919091612db7565b61103b6103a4565b91829182610994565b0390f35b6103aa565b611059600e5f90610b85565b90565b3461108c5761106c3660046103b2565b61108861107761104d565b61107f6103a4565b91829182610ba2565b0390f35b6103aa565b346110c1576110bd6110ac6110a7366004610853565b612de4565b6110b46103a4565b91829182610594565b0390f35b6103aa565b346110f4576110d63660046103b2565b6110de612e27565b6110e66103a4565b806110f08161054f565b0390f35b6103aa565b90565b61111061110b611115926110f9565b6106da565b61049f565b90565b6111236127106110fc565b90565b61112e611118565b90565b34611161576111413660046103b2565b61115d61114c611126565b6111546103a4565b91829182610594565b0390f35b6103aa565b61116f90610470565b9052565b9190611186905f60208501940190611166565b565b346111b8576111983660046103b2565b6111b46111a3612e35565b6111ab6103a4565b91829182611173565b0390f35b6103aa565b60018060a01b031690565b6111d89060086111dd9302610b69565b6111bd565b90565b906111eb91546111c8565b90565b6111fa60085f906111e0565b90565b3461122d5761120d3660046103b2565b6112296112186111ee565b6112206103a4565b91829182611173565b0390f35b6103aa565b61126761126e9461125d606094989795611253608086019a5f870190610587565b6020850190610587565b6040830190610587565b0190610587565b565b346112a4576112803660046103b2565b6112a061128b612e70565b906112979492946103a4565b94859485611232565b0390f35b6103aa565b906020828203126112da575f82013567ffffffffffffffff81116112d5576112d192016108da565b9091565b610461565b6103ae565b5190565b60209181520190565b61130b61131460209361131993611302816112df565b938480936112e3565b958691016103ce565b6103d9565b0190565b6113329160208201915f8184039101526112ec565b90565b346113665761136261135161134b3660046112a9565b906132cb565b6113596103a4565b9182918261131d565b0390f35b6103aa565b61137760095f90610c07565b90565b346113aa5761138a3660046103b2565b6113a661139561136b565b61139d6103a4565b91829182610594565b0390f35b6103aa565b346113df576113bf3660046103b2565b6113db6113ca613516565b6113d26103a4565b91829182610414565b0390f35b6103aa565b6113f060065f90610c07565b90565b34611423576114033660046103b2565b61141f61140e6113e4565b6114166103a4565b91829182610594565b0390f35b6103aa565b346114605761144761143b366004610eb6565b959490949391936135be565b9061145c6114536103a4565b92839283610f43565b0390f35b6103aa565b90565b61147c61147761148192611465565b6106da565b610733565b90565b611491620d89e719611468565b90565b61149c611484565b90565b346114cf576114af3660046103b2565b6114cb6114ba611494565b6114c26103a4565b91829182610e49565b0390f35b6103aa565b6114df3660046103b2565b6114e7613741565b6114ef6103a4565b806114f98161054f565b0390f35b3461152e5761152a6115196115133660046104c5565b906138aa565b6115216103a4565b91829182610504565b0390f35b6103aa565b9060208282031261154c57611549915f01610f9b565b90565b6103ae565b3461157f57611569611564366004611533565b613d94565b6115716103a4565b8061157b8161054f565b0390f35b6103aa565b919091610160818403126115f25761159e835f8301610490565b926115ac81602084016108a8565b926115ba8260c08501610cc7565b926115c9836101208301610ea7565b9261014082013567ffffffffffffffff81116115ed576115e992016108da565b9091565b610461565b6103ae565b600f0b90565b611606906115f7565b9052565b91602061162b92949361162460408201965f830190610987565b01906115fd565b565b346116655761164c611640366004611584565b94939093929192613e31565b906116616116586103a4565b9283928361160a565b0390f35b6103aa565b3461169a57611696611685611680366004610dbd565b613e54565b61168d6103a4565b91829182610594565b0390f35b6103aa565b9190916101208184031261170c576116b9835f8301610490565b926116c781602084016108a8565b926116d58260c085016104b6565b926116e38360e083016104b6565b9261010082013567ffffffffffffffff81116117075761170392016108da565b9091565b610461565b6103ae565b3461172d5761172136600461169f565b94939093929192613efc565b6103aa565b919060408382031261175a578061174e611757925f86016104b6565b936020016104b6565b90565b6103ae565b3461178e57611778611772366004611732565b90614019565b6117806103a4565b8061178a8161054f565b0390f35b6103aa565b6040906117bc6117c394969593966117b260608401985f850190611166565b6020830190610587565b0190610587565b565b346117f8576117d53660046103b2565b6117f46117e0614025565b6117eb9391936103a4565b93849384611793565b0390f35b6103aa565b611806906104f2565b9052565b906101a08061190f936118235f8201515f8601906117fd565b611835602082015160208601906117fd565b611847604082015160408601906117fd565b611859606082015160608601906117fd565b61186b608082015160808601906117fd565b61187d60a082015160a08601906117fd565b61188f60c082015160c08601906117fd565b6118a160e082015160e08601906117fd565b6118b56101008201516101008601906117fd565b6118c96101208201516101208601906117fd565b6118dd6101408201516101408601906117fd565b6118f16101608201516101608601906117fd565b6119056101808201516101808601906117fd565b01519101906117fd565b565b9190611925905f6101c0850194019061180a565b565b34611957576119373660046103b2565b611953611942614155565b61194a6103a4565b91829182611911565b0390f35b6103aa565b61196860075f90610c07565b90565b3461199b5761197b3660046103b2565b61199761198661195c565b61198e6103a4565b91829182610594565b0390f35b6103aa565b6119ac600a5f90610c07565b90565b346119df576119bf3660046103b2565b6119db6119ca6119a0565b6119d26103a4565b91829182610594565b0390f35b6103aa565b34611a12576119fc6119f7366004610dbd565b614308565b611a046103a4565b80611a0e8161054f565b0390f35b6103aa565b7f000000000000000000000000000000000000000000000000000000000000000090565b611a44906106f9565b90565b611a5090611a3b565b9052565b9190611a67905f60208501940190611a47565b565b34611a9957611a793660046103b2565b611a95611a84611a17565b611a8c6103a4565b91829182611a54565b0390f35b6103aa565b909160e082840312611ad357611ad0611ab9845f8501610490565b93611ac781602086016108a8565b9360c001610f9b565b90565b6103ae565b34611aee57611ae8366004611a9e565b9161437c565b6103aa565b9190604083820312611b1b5780611b0f611b18925f8601610490565b93602001610490565b90565b6103ae565b34611b5157611b4d611b3c611b36366004611af3565b9061439f565b611b446103a4565b91829182610594565b0390f35b6103aa565b34611b7257611b6636600461169f565b94939093929192614436565b6103aa565b611b8360125f90610c07565b90565b34611bb657611b963660046103b2565b611bb2611ba1611b77565b611ba96103a4565b91829182610594565b0390f35b6103aa565b34611beb57611bcb3660046103b2565b611be7611bd6614443565b611bde6103a4565b91829182610594565b0390f35b6103aa565b90565b611c07611c02611c0c92611bf0565b6106da565b61049f565b90565b611c196012611bf3565b90565b611c24611c0f565b90565b34611c5757611c373660046103b2565b611c53611c42611c1c565b611c4a6103a4565b91829182610594565b0390f35b6103aa565b34611c8a57611c74611c6f366004610853565b6144be565b611c7c6103a4565b80611c868161054f565b0390f35b6103aa565b634e487b7160e01b5f52604160045260245ffd5b90611cad906103d9565b810190811067ffffffffffffffff821117611cc757604052565b611c8f565b90611cdf611cd86103a4565b9283611ca3565b565b67ffffffffffffffff8111611cff57611cfb6020916103d9565b0190565b611c8f565b90611d16611d1183611ce1565b611ccc565b918252565b5f7f312e312e30000000000000000000000000000000000000000000000000000000910152565b611d4c6005611d04565b90611d5960208301611d1b565b565b611d63611d42565b90565b611d6e611d5b565b90565b611d79611d66565b90565b34611dac57611d8c3660046103b2565b611da8611d97611d71565b611d9f6103a4565b91829182610414565b0390f35b6103aa565b5f80fd5b606090565b634e487b7160e01b5f52602260045260245ffd5b9060016002830492168015611dee575b6020831014611de957565b611dba565b91607f1691611dde565b60209181520190565b5f5260205f2090565b905f9291805490611e24611e1d83611dce565b8094611df8565b916001811690815f14611e7b5750600114611e3f575b505050565b611e4c9192939450611e01565b915f925b818410611e6357505001905f8080611e3a565b60018160209295939554848601520191019290611e50565b92949550505060ff19168252151560200201905f8080611e3a565b90611ea091611e0a565b90565b90611ec3611ebc92611eb36103a4565b93848092611e96565b0383611ca3565b565b611ece90611ea3565b90565b611ed9611db5565b50611ee46003611ec5565b90565b5f90565b611f0891611ef7611ee7565b50611f006144c9565b9190916144d6565b600190565b611f19611f1e916105de565b610bec565b90565b611f2b9054611f0d565b90565b634e487b7160e01b5f52601160045260245ffd5b611f51611f579193929361049f565b9261049f565b8201809211611f6257565b611f2e565b5f7f436f6c6c656374696f6e20696e74657276616c206e6f74207061737365640000910152565b611f9b601e6020926103c5565b611fa481611f67565b0190565b611fbd9060208101905f818303910152611f8e565b90565b15611fc757565b611fcf6103a4565b62461bcd60e51b815280611fe560048201611fa8565b0390fd5b5f1b90565b90611ffa5f1991611fe9565b9181191691161790565b61201861201361201d9261049f565b6106da565b61049f565b90565b90565b9061203861203361203f92612004565b612020565b8254611fee565b9055565b90565b90565b61205d61205861206292612043565b611fe9565b612046565b90565b61206f6080611ccc565b90565b9061207c90610733565b9052565b61209461208f61209992612043565b6106da565b610d3c565b90565b906120a690610d3c565b9052565b906120b490612046565b9052565b5f80fd5b60e01b90565b905051906120cf82610e93565b565b91906040838203126120f957806120ed6120f6925f86016120c2565b936020016120c2565b90565b6103ae565b61210790610705565b9052565b6121149061071e565b9052565b61212190610733565b9052565b61212e90610746565b9052565b9060806121a360026121ab9461215661214d5f8301546105ee565b5f8701906120fe565b61219c612192600183015461217761216d826105ee565b60208a01906120fe565b61218d6121838261061d565b60408a019061210b565b61064a565b6060870190612118565b0154610676565b910190612125565b565b6121b690610d3c565b9052565b6121c390612046565b9052565b9060608061220d936121df5f8201515f860190612118565b6121f160208201516020860190612118565b612203604082015160408601906121ad565b01519101906121ba565b565b61221a5f80926112e3565b0190565b61224161224f936122376101408401945f850190612132565b60a08301906121c7565b61012081830391015261220f565b90565b61225a6103a4565b3d5f823e3d90fd5b61227661227161227b92612043565b6106da565b6115f7565b90565b61229261228d61229792612043565b6106da565b61049f565b90565b6fffffffffffffffffffffffffffffffff1690565b6122c36122be6122c8926115f7565b6106da565b61229a565b90565b6122df6122da6122e49261229a565b6106da565b61049f565b90565b91602061230892949361230160408201965f830190610587565b0190610587565b565b612313906106f9565b90565b61231f90610b0c565b604d811161232d57600a0a90565b611f2e565b6123416123479193929361049f565b9261049f565b9161235383820261049f565b92818404149015171561236257565b611f2e565b634e487b7160e01b5f52601260045260245ffd5b61238761238d9161049f565b9161049f565b908115612398570490565b612367565b6123d6426123cf6123c96123c46123b46010611f21565b6123be6011611f21565b90611f42565b61049f565b9161049f565b1015611fc0565b6123e1426010612023565b6123e9611484565b61243c6123f4610e2f565b61243361242a5f6124256124075f612049565b9461241c612413612065565b985f8a01612072565b60208801612072565b612080565b6040850161209c565b606083016120aa565b60406124677f0000000000000000000000000000000000000000000000000000000000000000611a3b565b91635a6bcfda9261248d5f600b93956124986124816103a4565b978896879586946120bc565b84526004840161221e565b03925af1908115612813575f916127e6575b506124bd6124b7826144e6565b916144f5565b90806124d16124cb5f612262565b916115f7565b135f146127d7576124e46124e9916122af565b6122cb565b5b90806124fe6124f85f612262565b916115f7565b135f146127c857612511612516916122af565b6122cb565b5b9080827f49d512bf9cb224241c05691e73eb9fab078cf350c7dbcbcf66788f1fc0cc8b0b916125506125476103a4565b928392836122e7565b0390a1806125666125605f61227e565b9161049f565b11612781575b8161257f6125795f61227e565b9161049f565b11612738575b61258e5f61227e565b506125985f61227e565b506125b86125a85f600b01610602565b6125b2600e610602565b90614671565b5f1461273357905b806125d36125cd5f61227e565b9161049f565b115f146126a4579061260b6125fb612668936125f56125f0612bc6565b612316565b90612332565b6126056006611f21565b9061237b565b9061261f6126183061230a565b8390614700565b61263c61262b3061230a565b612636838590611f42565b906146a1565b61266361265c61264d838590611f42565b6126576012611f21565b611f42565b6012612023565b611f42565b61269e7f6ef4855b666dcc7884561072e4358b28dfe01feb1b7f4dcebc00e62d50394ac7916126956103a4565b91829182610594565b0390a15b565b50806126b86126b25f61227e565b9161049f565b116126c4575b506126a2565b6126d76126d03061230a565b82906146a1565b6126f46126ed826126e86012611f21565b611f42565b6012612023565b61272a7f6ef4855b666dcc7884561072e4358b28dfe01feb1b7f4dcebc00e62d50394ac7916127216103a4565b91829182610594565b0390a15f6126be565b6125c0565b61277c6127486001600b01610602565b7f00000000000000000000000000000000000000000000000000000000000000006127723061230a565b8591600193614545565b612585565b6127c36127905f600b01610602565b7f00000000000000000000000000000000000000000000000000000000000000006127ba3061230a565b84915f93614545565b61256c565b506127d25f61227e565b612517565b506127e15f61227e565b6124ea565b612807915060403d811161280c575b6127ff8183611ca3565b8101906120d1565b6124aa565b503d6127f5565b612252565b5f90565b612824612818565b5061282f6002611f21565b90565b6128439061283e61475e565b6129e8565b565b61285961285461285e92612043565b6106da565b610465565b90565b61286a90612845565b90565b60207f7300000000000000000000000000000000000000000000000000000000000000917f4465762077616c6c65742063616e6e6f74206265207a65726f206164647265735f8201520152565b6128c760216040926103c5565b6128d08161286d565b0190565b6128e99060208101905f8183039101526128ba565b90565b156128f357565b6128fb6103a4565b62461bcd60e51b815280612911600482016128d4565b0390fd5b612921612926916105de565b6111bd565b90565b6129339054612915565b90565b9061294760018060a01b0391611fe9565b9181191691161790565b90565b9061296961296461297092610705565b612951565b8254612936565b9055565b5f7f44657657616c6c65740000000000000000000000000000000000000000000000910152565b6129a860096020926103c5565b6129b181612974565b0190565b9160406129e69294936129df6129d4606083018381035f85015261299b565b966020830190611166565b0190611166565b565b612a0d81612a06612a006129fb5f612861565b610470565b91610470565b14156128ec565b612a176008612929565b612a22826008612954565b907fd8e98bff5ae8522235ef48daecff7488b367200bea03a4e8cb4bc98108c6a49291612a59612a506103a4565b928392836129b5565b0390a1565b612a6790612832565b565b5f90565b33612aa8612aa2612a9d7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b0315612aca575f63570c108560e11b815280612ac66004820161054f565b0390fd5b94939291945093909192936147ac565b612ae2612a69565b612a6d565b91612b1192612af4611ee7565b50612b09612b006144c9565b829084916147df565b91909161486b565b600190565b33612b51612b4b612b467f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b0315612b73575f63570c108560e11b815280612b6f6004820161054f565b0390fd5b9493929194509390919293614908565b612b8b612a69565b612b16565b612b98612818565b50612ba36012611f21565b90565b5f90565b612bbe612bb9612bc392611bf0565b6106da565b610b0c565b90565b612bce612ba6565b50612bd96012612baa565b90565b5f90565b5f90565b33612c1f612c19612c147f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b0315612c41575f63570c108560e11b815280612c3d6004820161054f565b0390fd5b9695949396505050939091929361492d565b612c5b612a69565b612c63612bdc565b612c6b612be0565b91612be4565b612c91612ca791612c80612818565b50612c8b6006611f21565b90612332565b612ca1612c9c612bc6565b612316565b9061237b565b90565b5f90565b33612ce9612ce3612cde7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b0315612d0b575f63570c108560e11b815280612d076004820161054f565b0390fd5b97969594939297505095909192939495614964565b612d28612a69565b612d30612caa565b90612cae565b9392919033612d75612d6f612d6a7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b03612d8657612d8394612da2565b90565b5f63570c108560e11b815280612d9e6004820161054f565b0390fd5b90612db49492939150929091926149b3565b90565b90612dcb939291612dc6612a69565b612d36565b90565b90612dd890610705565b5f5260205260405f2090565b612dfa612dff91612df3612818565b505f612dce565b611f21565b90565b612e0a61475e565b612e12612e14565b565b612e25612e205f612861565b614a32565b565b612e2f612e02565b565b5f90565b612e3d612e31565b50612e486005612929565b90565b612e5a612e609193929361049f565b9261049f565b8203918211612e6b57565b611f2e565b612e78612818565b50612e81612818565b50612e8a612818565b50612e93612818565b50612e9c611118565b90612ea76006611f21565b9081612ebb612eb58561049f565b9161049f565b115f14612f0b57612efc612eeb612edd84612ed76127106110fc565b90612332565b612ee5611118565b9061237b565b612ef66127106110fc565b90612e4b565b5b90612f086007611f21565b90565b612f145f61227e565b612efd565b606090565b5f7f4e6f7420706f6f6c206d616e6167657200000000000000000000000000000000910152565b612f5260106020926103c5565b612f5b81612f1e565b0190565b612f749060208101905f818303910152612f45565b90565b15612f7e57565b612f866103a4565b62461bcd60e51b815280612f9c60048201612f5f565b0390fd5b612fb4612faf612fb99261049f565b6106da565b610d3c565b90565b612fd0612fcb612fd5926115f7565b6106da565b610d3c565b90565b90612fe290610470565b9052565b90612ff09061071e565b9052565b612ffd90610470565b90565b9061300a90612ff4565b9052565b61301860a0611ccc565b90565b9061309a613091600261302c61300e565b9461304361303b5f8301610602565b5f8801612fd8565b61305b61305260018301610602565b60208801612fd8565b61307361306a60018301610631565b60408801612fe6565b61308b6130826001830161065e565b60608801612072565b0161068a565b60808401613000565b565b6130a59061301b565b90565b5f9060033d116130b5575b565b905060045f803e6130c65f5161039e565b906130b3565b5f9060443d10613149576130de6103a4565b60043d036004823e8051903d602483011167ffffffffffffffff8311176131455781810191825167ffffffffffffffff811161313f5780602085010160043d0384011061313957613136939495506020010190611ca3565b90565b50505050565b50505050565b5050565b565b905090565b5f7f4c6971756964697479206d6f64696669636174696f6e206661696c65643a2000910152565b613183601f809261314b565b61318c81613150565b0190565b6131b56131ac926020926131a3816103c1565b9485809361314b565b938491016103ce565b0190565b906131c66131cc92613177565b90613190565b90565b90565b67ffffffffffffffff81116131f0576131ec6020916103d9565b0190565b611c8f565b90613207613202836131d2565b611ccc565b918252565b3d5f146132275761321c3d6131f5565b903d5f602084013e5b565b61322f612f19565b90613225565b60207f746820756e6b6e6f776e206572726f7200000000000000000000000000000000917f4c6971756964697479206d6f64696669636174696f6e206661696c65642077695f8201520152565b61328f60306040926103c5565b61329881613235565b0190565b6132b19060208101905f818303910152613282565b90565b6132bd5f611d04565b90565b6132c86132b4565b90565b90613326916132d8612f19565b5061331d3361331761331161330c7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b14612f77565b90810190611732565b613392613331611484565b9161338961338061335161334c613346610e2f565b94612fa0565b614aaf565b61337b61335d5f612049565b94613372613369612065565b985f8a01612072565b60208801612072565b612fbc565b6040850161209c565b606083016120aa565b9060406133be7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b92635a6bcfda936133e45f600b93966133ef6133d86103a4565b988996879586946120bc565b84526004840161221e565b03925af180925f936134e5575b50155f146134bf57505060016134106130a8565b6308c379a014613456575b61342b575b6134286132c0565b90565b61343361320c565b5061343c6103a4565b62461bcd60e51b8152806134526004820161329c565b0390fd5b61345e6130cc565b80613469575061341b565b61349e61348a6134996134bb9361347e6103a4565b928391602083016131b9565b60208201810382520382611ca3565b6131cf565b6134a66103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b6134e091906134cd3061230a565b6134da600b93929361309c565b90614c9f565b613420565b61350791935060403d811161350f575b6134ff8183611ca3565b8101906120d1565b9290926133fc565b503d6134f5565b61351e611db5565b506135296004611ec5565b90565b97969594939291903361356f6135696135647f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b036135815761357d9861359d565b9091565b5f63570c108560e11b8152806135996004820161054f565b0390fd5b906135b898969492919795939750509590919293949561530f565b91909190565b906135de9695949392916135d0612a69565b6135d8612caa565b9061352c565b9091565b5f7f4d7573742073656e642045544820746f2062757920746f6b656e730000000000910152565b613616601b6020926103c5565b61361f816135e2565b0190565b6136389060208101905f818303910152613609565b90565b1561364257565b61364a6103a4565b62461bcd60e51b81528061366060048201613623565b0390fd5b90565b61367b61367661368092613664565b6106da565b61049f565b90565b905090565b6136935f8092613683565b0190565b6136a090613688565b90565b5f7f44657620666565207472616e73666572206661696c6564000000000000000000910152565b6136d760176020926103c5565b6136e0816136a3565b0190565b6136f99060208101905f8183039101526136ca565b90565b1561370357565b61370b6103a4565b62461bcd60e51b815280613721600482016136e4565b0390fd5b61372e9061049f565b5f19811461373c5760010190565b611f2e565b61375d346137576137515f61227e565b9161049f565b1161363b565b61378a61377a3461377461376f612bc6565b612316565b90612332565b6137846006611f21565b9061237b565b613795338290614700565b6137bd6137ac346137a66009611f21565b90612332565b6137b76103e8613667565b9061237b565b61381b5f806137ea6137d9346137d3600a611f21565b90612332565b6137e46103e8613667565b9061237b565b936137f56008612929565b906137fe6103a4565b908161380981613697565b03925af161381561320c565b506136fc565b8061382e6138285f61227e565b9161049f565b1161389b575b5061385161384a6138456007611f21565b613725565b6007612023565b61385a346157c0565b5033903490916138967f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f339361388d6103a4565b93849384611793565b0390a1565b6138a490615545565b5f613834565b6138c7916138b6611ee7565b506138bf6144c9565b91909161486b565b600190565b6138dd906138d861475e565b613b86565b565b5f90565b6138ec906106dd565b90565b6138f8906138e3565b90565b61390560a0611ccc565b90565b90565b61391f61391a61392492613908565b6106da565b610733565b90565b6139319051610470565b90565b90565b9061394c61394761395392610705565b613934565b8254612936565b9055565b613961905161071e565b90565b60a01b90565b9061397b62ffffff60a01b91613964565b9181191691161790565b61399961399461399e9261071e565b6106da565b61071e565b90565b90565b906139b96139b46139c092613985565b6139a1565b825461396a565b9055565b6139ce9051610733565b90565b60b81b90565b906139e862ffffff60b81b916139d1565b9181191691161790565b613a06613a01613a0b92610733565b6106da565b610733565b90565b90565b90613a26613a21613a2d926139f2565b613a0e565b82546139d7565b9055565b613a3b9051612ff4565b90565b613a47906138e3565b90565b90565b90613a62613a5d613a6992613a3e565b613a4a565b8254612936565b9055565b90613ae360806002613ae994613a905f8201613a8a5f8801613927565b90613937565b613aa960018201613aa360208801613927565b90613937565b613ac260018201613abc60408801613957565b906139a4565b613adb60018201613ad5606088016139c4565b90613a11565b019201613a31565b90613a4d565b565b90613af591613a6d565b565b90505190613b0482610faa565b565b90602082820312613b1f57613b1c915f01613af7565b90565b6103ae565b613b2d90610465565b9052565b9160a0613b52929493613b4b60c08201965f830190612132565b0190613b24565b565b604090613b7d613b849496959396613b7360608401985f850190611166565b6020830190610711565b0190610711565b565b613b8e6138df565b50613b976138df565b50613baa613ba5600e610602565b610705565b613bcd613bc7613bc2613bbd600f610602565b610705565b610470565b91610470565b105f14613d7457613c5e613be1600e610602565b613c57613bee600f610602565b915b91613c4e613c45613bff610aa9565b613c40603c91613c37613c19613c143061230a565b6138ef565b96613c2e613c256138fb565b9a5f8c01612fd8565b60208a01612fd8565b60408801612fe6565b61390b565b60608501612072565b60808301613000565b600b613aeb565b6020613c897f0000000000000000000000000000000000000000000000000000000000000000611a3b565b91636276cbbe92613caf5f600b9395613cba613ca36103a4565b978896879586946120bc565b845260048401613b31565b03925af18015613d6f57613d43575b50613cf37f0000000000000000000000000000000000000000000000000000000000000000611a3b565b613cfd600e610602565b613d07600f610602565b91613d3e7fb2684e1b8e116bbb42a14d7a6bc6afa19d85ff0a8666a6b424b79a738c661d8193613d356103a4565b93849384613b54565b0390a1565b613d639060203d8111613d68575b613d5b8183611ca3565b810190613b06565b613cc9565b503d613d51565b612252565b613c5e613d81600f610602565b613c57613d8e600e610602565b91613bf0565b613d9d906138cc565b565b5f90565b9695949392919033613de5613ddf613dda7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b03613df757613df397613e13565b9091565b5f63570c108560e11b815280613e0f6004820161054f565b0390fd5b90613e2b9795939694929150509490919293946158dc565b91909190565b90613e509594939291613e42612a69565b613e4a613d9f565b90613da3565b9091565b613e7a613e8a91613e63612818565b50613e74613e6f612bc6565b612316565b90612332565b613e846006611f21565b9061237b565b90565b33613ec8613ec2613ebd7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b0315613eea575f63570c108560e11b815280613ee66004820161054f565b0390fd5b959493929195509490919293946159c0565b613f04612a69565b613e8d565b90613f1b91613f1661475e565b613f9f565b565b5f7f526174696f73206d7573742073756d20746f2031303030000000000000000000910152565b613f5160176020926103c5565b613f5a81613f1d565b0190565b613f739060208101905f818303910152613f44565b90565b15613f7d57565b613f856103a4565b62461bcd60e51b815280613f9b60048201613f5e565b0390fd5b613fc7613fad828490611f42565b613fc1613fbb6103e8613667565b9161049f565b14613f76565b613fd2816009612023565b613fdd82600a612023565b907fb42de28a546baa00aa8f10cdade93e8b7095b4324f2e48786f17825cc839ae9b9161401461400b6103a4565b928392836122e7565b0390a1565b9061402391613f09565b565b61402d612e31565b50614036612818565b5061403f612818565b5061404a6008612929565b6140546009611f21565b9161405f600a611f21565b91929190565b6140706101c0611ccc565b90565b5f90565b6020908180808080808080808080808061408f614065565b9e8f614099614073565b8152016140a4614073565b8152016140af614073565b8152016140ba614073565b8152016140c5614073565b8152016140d0614073565b8152016140db614073565b8152016140e6614073565b8152016140f1614073565b8152016140fc614073565b815201614107614073565b815201614112614073565b81520161411d614073565b815201614128614073565b81525050565b614136614077565b90565b6141446101c0611ccc565b90565b90614151906104f2565b9052565b61415d61412e565b505f60015f60015f805f60015f915f935f955f975f995f9b61417d614139565b809e5f82019061418c91614147565b6020019061419991614147565b60408d01906141a791614147565b60608c01906141b591614147565b60808b01906141c391614147565b60a08a01906141d191614147565b60c08901906141df91614147565b60e08801906141ed91614147565b6101008701906141fc91614147565b61012086019061420b91614147565b61014085019061421a91614147565b61016084019061422991614147565b61018083019061423891614147565b6101a082019061424791614147565b90565b61425b9061425661475e565b6142df565b565b5f7f496e74657276616c206d7573742062652067726561746572207468616e203000910152565b614291601f6020926103c5565b61429a8161425d565b0190565b6142b39060208101905f818303910152614284565b90565b156142bd57565b6142c56103a4565b62461bcd60e51b8152806142db6004820161429e565b0390fd5b614306906142ff816142f96142f35f61227e565b9161049f565b116142b6565b6011612023565b565b6143119061424a565b565b3361434e6143486143437f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b0315614370575f63570c108560e11b81528061436c6004820161054f565b0390fd5b929192509190916159e5565b614384612a69565b614313565b9061439390610705565b5f5260205260405f2090565b6143c4916143ba6143bf926143b2612818565b506001614389565b612dce565b611f21565b90565b336144026143fc6143f77f0000000000000000000000000000000000000000000000000000000000000000611a3b565b610470565b91610470565b0315614424575f63570c108560e11b8152806144206004820161054f565b0390fd5b95949392919550949091929394615a0a565b61443e612a69565b6143c7565b61444b612818565b506144566006611f21565b90565b61446a9061446561475e565b61446c565b565b8061448761448161447c5f612861565b610470565b91610470565b146144975761449590614a32565b565b6144ba6144a35f612861565b5f918291631e4fbdf760e01b835260048301611173565b0390fd5b6144c790614459565b565b6144d1612e31565b503390565b916144e49291600192615a2f565b565b6144ee613d9f565b5060801d90565b6144fd613d9f565b50600f0b90565b5f91031261450e57565b6103ae565b60409061453c614543949695939661453260608401985f850190610711565b6020830190611166565b0190610587565b565b9192935f146145e15761455790611a3b565b61456663156e29f69392615b66565b9392813b156145dc575f61458d9161459882966145816103a4565b988997889687956120bc565b855260048501611793565b03925af180156145d7576145ab575b505b565b6145ca905f3d81116145d0575b6145c28183611ca3565b810190614504565b5f6145a7565b503d6145b8565b612252565b6120b8565b6145ed90929192611a3b565b630b0d9c0992919392813b1561466c575f61461b91614626829661460f6103a4565b988997889687956120bc565b855260048501614513565b03925af180156146675761463b575b506145a9565b61465a905f3d8111614660575b6146528183611ca3565b810190614504565b5f614635565b503d614648565b612252565b6120b8565b61469761469261468c61469d93614686611ee7565b50610705565b93610705565b610470565b91610470565b1490565b90816146bd6146b76146b25f612861565b610470565b91610470565b146146d9576146d791906146d05f612861565b9091615b99565b565b6146fc6146e55f612861565b5f918291634b637e8f60e11b835260048301611173565b0390fd5b8061471b6147156147105f612861565b610470565b91610470565b14614737576147359161472d5f612861565b919091615b99565b565b61475a6147435f612861565b5f91829163ec442f0560e01b835260048301611173565b0390fd5b614766612e35565b61477f6147796147746144c9565b610470565b91610470565b0361478657565b6147a86147916144c9565b5f91829163118cdaa760e01b835260048301611173565b0390fd5b6147b4612a69565b505f630a85dc2960e01b8152806147cd6004820161054f565b0390fd5b906147dc910361049f565b90565b9291926147ed81839061439f565b90816148026147fc5f1961049f565b9161049f565b1061480f575b5050509050565b8161482261481c8761049f565b9161049f565b106148485761483f93946148379193926147d1565b905f92615a2f565b805f8080614808565b50614867849291925f938493637dc7a0d960e11b855260048501611793565b0390fd5b918261488761488161487c5f612861565b610470565b91610470565b146148e157816148a76148a161489c5f612861565b610470565b91610470565b146148ba576148b892919091615b99565b565b6148dd6148c65f612861565b5f91829163ec442f0560e01b835260048301611173565b0390fd5b6149046148ed5f612861565b5f918291634b637e8f60e11b835260048301611173565b0390fd5b614910612a69565b505f630a85dc2960e01b8152806149296004820161054f565b0390fd5b614935612a69565b5061493e612bdc565b50614947612be0565b505f630a85dc2960e01b8152806149606004820161054f565b0390fd5b61496c612a69565b50614975612caa565b505f630a85dc2960e01b81528061498e6004820161054f565b0390fd5b61499b81610470565b036149a257565b5f80fd5b356149b081614992565b90565b5090506149f191506149c3612a69565b506149e26149d25f83016149a6565b6149dc600e610602565b90614671565b908115614a0b575b50156104f2565b614a0057636fe7e6eb60e01b90565b636fe7e6eb60e01b90565b614a2c91506020614a1c91016149a6565b614a26600e610602565b90614671565b5f6149ea565b614a3c6005612929565b614a47826005612954565b90614a7b614a757f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610705565b91610705565b91614a846103a4565b80614a8e8161054f565b0390a3565b614aa7614aa2614aac92610d3c565b6106da565b6115f7565b90565b90614ab8613d9f565b50614ac282614a93565b91614ad6614ad08492610d3c565b91612fbc565b03614add57565b6393dafdf160e01b615d08565b614af3906115f7565b6f7fffffffffffffffffffffffffffffff198114614b10575f0390565b611f2e565b90505190614b22826104a2565b565b90602082820312614b3d57614b3a915f01614b15565b90565b6103ae565b5f7f45544820736574746c656d656e74206661696c65643a20000000000000000000910152565b614b756017809261314b565b614b7e81614b42565b0190565b90614b8f614b9592614b69565b90613190565b90565b60207f776e206572726f72000000000000000000000000000000000000000000000000917f45544820736574746c656d656e74206661696c6564207769746820756e6b6e6f5f8201520152565b614bf260286040926103c5565b614bfb81614b98565b0190565b614c149060208101905f818303910152614be5565b90565b614c20906106dd565b90565b614c2c90614c17565b90565b614c38906106f9565b90565b614c44816104f2565b03614c4b57565b5f80fd5b90505190614c5c82614c3b565b565b90602082820312614c7757614c74915f01614c4f565b90565b6103ae565b916020614c9d929493614c9660408201965f830190611166565b0190610587565b565b509150614cc0614cb05f8401613927565b614cba600e610602565b90614671565b5f1461508957614ccf816144e6565b614cd8826144f5565b9080614cec614ce65f612262565b916115f7565b12614fb8575b5080614d06614d005f612262565b916115f7565b12614e4f575b505b614d17816144e6565b614d29614d235f612262565b916115f7565b13614dd4575b614d38816144f5565b614d4a614d445f612262565b916115f7565b13614d54575b5050565b81614d646020614dcd9401613927565b917f0000000000000000000000000000000000000000000000000000000000000000614dc7614db76020614db0614dab614da6614da03061230a565b976144f5565b6122af565b6122cb565b9501613927565b614dc1600f610602565b90614671565b93614545565b5f80614d50565b614e4a614de25f8401613927565b7f0000000000000000000000000000000000000000000000000000000000000000614e0c3061230a565b614e25614e20614e1b876144e6565b6122af565b6122cb565b91614e44614e345f8901613927565b614e3e600f610602565b90614671565b93614545565b614d2f565b614e63614e5e614e6892614aea565b6122af565b6122cb565b6020614eb1614e967f0000000000000000000000000000000000000000000000000000000000000000611a3b565b926311da60b4909390614ea76103a4565b94859384926120bc565b825281614ec06004820161054f565b03925af19081614f8c575b50155f14614f87576001614edd6130a8565b6308c379a014614f1e575b614ef3575b5f614d0c565b614efb61320c565b50614f046103a4565b62461bcd60e51b815280614f1a60048201614bff565b0390fd5b614f266130cc565b80614f315750614ee8565b614f66614f52614f61614f8393614f466103a4565b92839160208301614b82565b60208201810382520382611ca3565b6131cf565b614f6e6103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b614eed565b614fac9060203d8111614fb1575b614fa48183611ca3565b810190614b24565b614ecb565b503d614f9a565b614fcc614fc7614fd192614aea565b6122af565b6122cb565b6020614fec614fe7614fe23061230a565b614c23565b614c2f565b9163a9059cbb926150395f6150207f0000000000000000000000000000000000000000000000000000000000000000611a3b565b939561504461502d6103a4565b978896879586946120bc565b845260048401614c7c565b03925af1801561508457615058575b614cf2565b6150789060203d811161507d575b6150708183611ca3565b810190614c5e565b615053565b503d615066565b612252565b615092816144e6565b61509b826144f5565b90806150af6150a95f612262565b916115f7565b126151a6575b50806150c96150c35f612262565b916115f7565b126150d5575b50614d0e565b6150e96150e46150ee92614aea565b6122af565b6122cb565b60206151096151046150ff3061230a565b614c23565b614c2f565b9163a9059cbb926151565f61513d7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b939561516161514a6103a4565b978896879586946120bc565b845260048401614c7c565b03925af180156151a157615175575b6150cf565b6151959060203d811161519a575b61518d8183611ca3565b810190614c5e565b615170565b503d615183565b612252565b6151ba6151b56151bf92614aea565b6122af565b6122cb565b60206152086151ed7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b926311da60b49093906151fe6103a4565b94859384926120bc565b8252816152176004820161054f565b03925af190816152e3575b50155f146152de5760016152346130a8565b6308c379a014615275575b61524a575b5f6150b5565b61525261320c565b5061525b6103a4565b62461bcd60e51b81528061527160048201614bff565b0390fd5b61527d6130cc565b80615288575061523f565b6152bd6152a96152b86152da9361529d6103a4565b92839160208301614b82565b60208201810382520382611ca3565b6131cf565b6152c56103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b615244565b6153039060203d8111615308575b6152fb8183611ca3565b810190614b24565b615222565b503d6152f1565b5093505050506153599150615322612a69565b5061532b612caa565b5061534a61533a5f83016149a6565b615344600e610602565b90614671565b908115615387575b50156104f2565b615372576327c18fbf60e21b9061536f5f612080565b90565b6327c18fbf60e21b906153845f612080565b90565b6153a89150602061539891016149a6565b6153a2600e610602565b90614671565b5f615352565b5f80fd5b909291926153c76153c2826131d2565b611ccc565b938185526020850190828401116153e3576153e1926103ce565b565b6153ae565b9080601f8301121561540657816020615403935191016153b2565b90565b6108ce565b9060208282031261543b575f82015167ffffffffffffffff81116154365761543392016153e8565b90565b610461565b6103ae565b5f7f4c6971756964697479206164646974696f6e206661696c65643a200000000000910152565b615473601b809261314b565b61547c81615440565b0190565b9061548d61549392615467565b90613190565b90565b61549f9061227e565b9052565b9160206154c49294936154bd60408201965f830190615496565b0190615496565b565b60207f6e6b6e6f776e206572726f720000000000000000000000000000000000000000917f4c6971756964697479206164646974696f6e206661696c6564207769746820755f8201520152565b615520602c6040926103c5565b615529816154c6565b0190565b6155429060208101905f818303910152615513565b90565b6155726155628261555c615557612bc6565b612316565b90612332565b61556c6006611f21565b9061237b565b61558561557e3061230a565b8290614700565b6155c16155913061230a565b6155ba7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b83916144d6565b6156425f836155f184916155e26155d66103a4565b938492602084016122e7565b60208201810382520382611ca3565b61561a7f0000000000000000000000000000000000000000000000000000000000000000611a3b565b615637836348c8949161562b6103a4565b968795869485936120bc565b83526004830161131d565b03925af19081615781575b50155f1461574257505060016156616130a8565b6308c379a0146156d9575b615673575b565b61567b61320c565b505f807f38f8a0c92f4c5b0b6877f878cb4c0c8d348a47b76d716c8e78f425043df9515b916156b46156ab6103a4565b928392836154a3565b0390a16156bf6103a4565b62461bcd60e51b8152806156d56004820161552d565b0390fd5b6156e16130cc565b806156ec575061566c565b61572161570d61571c61573e936157016103a4565b92839160208301615480565b60208201810382520382611ca3565b6131cf565b6157296103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b907f38f8a0c92f4c5b0b6877f878cb4c0c8d348a47b76d716c8e78f425043df9515b916157796157706103a4565b928392836122e7565b0390a1615671565b61579c903d805f833e6157948183611ca3565b81019061540b565b61564d565b90565b6157b86157b36157bd926157a1565b6106da565b61049f565b90565b6157c8612818565b506157d36006611f21565b61588061587961586b61585c61580f6157f8876157f2620f42406107e8565b90612332565b615809670de0b6b3a76400006157a4565b9061237b565b61585761585161583f620f42409361583a615828610c78565b615834620f42406107e8565b90612e4b565b612332565b61584b620f42406107e8565b9061237b565b916107e8565b611f42565b6158666006611f21565b612332565b615873610804565b9061237b565b6006612023565b61588a6006611f21565b906158cc6158986007611f21565b937f915fb3a5adc404a6cf1ee942b80e2ba141b434e19a25cbd1a3fc9ec0b9a5f20d946158c36103a4565b94859485611232565b0390a16158d96006611f21565b90565b509250505061592591506158ee612a69565b506158f7613d9f565b506159166159065f83016149a6565b615910600e610602565b90614671565b908115615999575b50156104f2565b615984574261595861595261594d61593d6010611f21565b6159476011611f21565b90611f42565b61049f565b9161049f565b1015615974575b63b47b2fb160e01b906159715f612262565b90565b61597f426010612023565b61595f565b63b47b2fb160e01b906159965f612262565b90565b6159ba915060206159aa91016149a6565b6159b4600e610602565b90614671565b5f61591e565b6159c8612a69565b505f630a85dc2960e01b8152806159e16004820161054f565b0390fd5b6159ed612a69565b505f630a85dc2960e01b815280615a066004820161054f565b0390fd5b615a12612a69565b505f630a85dc2960e01b815280615a2b6004820161054f565b0390fd5b909281615a4c615a46615a415f612861565b610470565b91610470565b14615b175783615a6c615a66615a615f612861565b610470565b91610470565b14615af057615a9083615a8b615a8460018690614389565b8790612dce565b612023565b615a9a575b505050565b919091615ae5615ad3615acd7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92593610705565b93610705565b93615adc6103a4565b91829182610594565b0390a35f8080615a95565b615b13615afc5f612861565b5f918291634a1406b160e11b835260048301611173565b0390fd5b615b3a615b235f612861565b5f91829163e602df0560e01b835260048301611173565b0390fd5b615b47906106dd565b90565b615b5e615b59615b6392610465565b6106da565b61049f565b90565b615b83615b7e615b8892615b78612818565b50610705565b615b3e565b615b4a565b90565b90615b96910161049f565b90565b91909180615bb7615bb1615bac5f612861565b610470565b91610470565b145f14615c9857615bdb615bd483615bcf6002611f21565b611f42565b6002612023565b5b82615bf7615bf1615bec5f612861565b610470565b91610470565b145f14615c6c57615c1b615c1483615c0f6002611f21565b6147d1565b6002612023565b5b919091615c67615c55615c4f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef93610705565b93610705565b93615c5e6103a4565b91829182610594565b0390a3565b615c9382615c8d615c7e5f8790612dce565b91615c8883611f21565b615b8b565b90612023565b615c1c565b615cab615ca65f8390612dce565b611f21565b80615cbe615cb88561049f565b9161049f565b10615ce657615cd1615ce19184906147d1565b615cdc5f8490612dce565b612023565b615bdc565b90615d049091925f93849363391434e360e21b855260048501611793565b0390fd5b5f5260045ffdfea2646970667358221220e85651dbc4f445be4e1e0b5889f630764e0420b8521ac5cb0959b8df7ea6b24064736f6c634300081a003300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000be2680dc1752109b4344dbeb1072fd8cd880e54b00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408000000000000000000000000be2680dc1752109b4344dbeb1072fd8cd880e54b00000000000000000000000000000000000000000000000000000000000000124175746f47726f77696e674c50546f6b656e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000441474c5000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x60806040526004361015610015575b36611db157005b61001f5f3561039e565b806306fdde0314610399578063095ea7b31461039457806316acbfcb1461038f57806318160ddd1461038a578063182148ef1461038557806318c824cf146103805780631f53ac021461037b57806321d0ee701461037657806323b872dd14610371578063259982e51461036c5780632af0e251146103675780632d11c58a14610362578063313ce5671461035d578063344ebf041461035857806352c8c3c014610353578063559f4e321461034e578063575e24b41461034957806361e2c8551461034457806366cb3a421461033f5780636882a8881461033a5780636c2bbe7e146103355780636fe7e6eb146103305780637048594b1461032b57806370a0823114610326578063715018a6146103215780637c5e27951461031c5780638da5cb5b146103175780638ea5220f14610312578063911157821461030d57806391dd73461461030857806391e97e591461030357806395d89b41146102fe57806397e9a0bf146102f95780639f063efc146102f4578063a1634b14146102ef578063a6f2ae3a146102ea578063a9059cbb146102e5578063ab48b09e146102e0578063b47b2fb1146102db578063b5e19d23146102d6578063b6a8b0fa146102d1578063b92ab477146102cc578063be48af99146102c7578063c4e833ce146102c2578063ca703075146102bd578063d2e1f2b1146102b8578063d5969ce0146102b3578063dc4c90d3146102ae578063dc98354e146102a9578063dd62ed3e146102a4578063e1b4af691461029f578063e7873b581461029a578063eb91d37e14610295578063f1a640f814610290578063f2fde38b1461028b5763ffa1ad740361000e57611d7c565b611c5c565b611c27565b611bbb565b611b86565b611b56565b611b20565b611ad8565b611a69565b6119e4565b6119af565b61196b565b611927565b6117c5565b61175f565b611711565b61166a565b61162d565b611551565b6114fd565b6114d4565b61149f565b611428565b6113f3565b6113af565b61137a565b611335565b611270565b6111fd565b611188565b611131565b6110c6565b611091565b61105c565b611014565b610f66565b610e5e565b610ddb565b610d88565b610d5b565b610c92565b610c24565b610bb7565b610b34565b610ad7565b610a55565b610a37565b610a01565b6109a9565b610871565b61081e565b6107ac565b6105a9565b610554565b610519565b61042c565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f9103126103bc57565b6103ae565b5190565b60209181520190565b90825f9392825e0152565b601f801991011690565b61040261040b602093610410936103f9816103c1565b938480936103c5565b958691016103ce565b6103d9565b0190565b6104299160208201915f8184039101526103e3565b90565b3461045c5761043c3660046103b2565b610458610447611ed1565b61044f6103a4565b91829182610414565b0390f35b6103aa565b5f80fd5b60018060a01b031690565b61047990610465565b90565b61048581610470565b0361048c57565b5f80fd5b9050359061049d8261047c565b565b90565b6104ab8161049f565b036104b257565b5f80fd5b905035906104c3826104a2565b565b91906040838203126104ed57806104e16104ea925f8601610490565b936020016104b6565b90565b6103ae565b151590565b610500906104f2565b9052565b9190610517905f602085019401906104f7565b565b3461054a5761054661053561052f3660046104c5565b90611eeb565b61053d6103a4565b91829182610504565b0390f35b6103aa565b5f0190565b34610582576105643660046103b2565b61056c61239d565b6105746103a4565b8061057e8161054f565b0390f35b6103aa565b6105909061049f565b9052565b91906105a7905f60208501940190610587565b565b346105d9576105b93660046103b2565b6105d56105c461281c565b6105cc6103a4565b91829182610594565b0390f35b6103aa565b5f1c90565b60018060a01b031690565b6105fa6105ff916105de565b6105e3565b90565b61060c90546105ee565b90565b60a01c90565b62ffffff1690565b61062961062e9161060f565b610615565b90565b61063b905461061d565b90565b60b81c90565b60020b90565b61065661065b9161063e565b610644565b90565b610668905461064a565b90565b60018060a01b031690565b610682610687916105de565b61066b565b90565b6106949054610676565b90565b600b6106a45f8201610602565b916106b160018301610602565b916106be60018201610631565b916106d760026106d06001850161065e565b930161068a565b90565b90565b6106f16106ec6106f692610465565b6106da565b610465565b90565b610702906106dd565b90565b61070e906106f9565b90565b61071a90610705565b9052565b62ffffff1690565b61072f9061071e565b9052565b60020b90565b61074290610733565b9052565b61074f906106f9565b90565b61075b90610746565b9052565b909594926107aa946107996107a39261078f60809661078560a088019c5f890190610711565b6020870190610711565b6040850190610726565b6060830190610739565b0190610752565b565b346107e0576107bc3660046103b2565b6107dc6107c7610697565b916107d39593956103a4565b9586958661075f565b0390f35b6103aa565b90565b6107fc6107f7610801926107e5565b6106da565b61049f565b90565b610810620f42406107e8565b90565b61081b610804565b90565b3461084e5761082e3660046103b2565b61084a610839610813565b6108416103a4565b91829182610594565b0390f35b6103aa565b9060208282031261086c57610869915f01610490565b90565b6103ae565b3461089f57610889610884366004610853565b612a5e565b6108916103a4565b8061089b8161054f565b0390f35b6103aa565b5f80fd5b908160a09103126108b65790565b6108a4565b908160809103126108c95790565b6108a4565b5f80fd5b5f80fd5b5f80fd5b909182601f830112156109145781359167ffffffffffffffff831161090f57602001926001830284011161090a57565b6108d6565b6108d2565b6108ce565b906101608282031261097657610931815f8401610490565b9261093f82602085016108a8565b9261094d8360c083016108bb565b9261014082013567ffffffffffffffff81116109715761096d92016108da565b9091565b610461565b6103ae565b63ffffffff60e01b1690565b6109909061097b565b9052565b91906109a7905f60208501940190610987565b565b346109c2576109b9366004610919565b93929092612ada565b6103aa565b90916060828403126109fc576109f96109e2845f8501610490565b936109f08160208601610490565b936040016104b6565b90565b6103ae565b34610a3257610a2e610a1d610a173660046109c7565b91612ae7565b610a256103a4565b91829182610504565b0390f35b6103aa565b34610a5057610a47366004610919565b93929092612b83565b6103aa565b34610a8557610a653660046103b2565b610a81610a70612b90565b610a786103a4565b91829182610594565b0390f35b6103aa565b90565b610aa1610a9c610aa692610a8a565b6106da565b61071e565b90565b610ab4610bb8610a8d565b90565b610abf610aa9565b90565b9190610ad5905f60208501940190610726565b565b34610b0757610ae73660046103b2565b610b03610af2610ab7565b610afa6103a4565b91829182610ac2565b0390f35b6103aa565b60ff1690565b610b1b90610b0c565b9052565b9190610b32905f60208501940190610b12565b565b34610b6457610b443660046103b2565b610b60610b4f612bc6565b610b576103a4565b91829182610b1f565b0390f35b6103aa565b1c90565b610b7d906008610b829302610b69565b6105e3565b90565b90610b909154610b6d565b90565b610b9f600f5f90610b85565b90565b9190610bb5905f60208501940190610711565b565b34610be757610bc73660046103b2565b610be3610bd2610b93565b610bda6103a4565b91829182610ba2565b0390f35b6103aa565b90565b610bff906008610c049302610b69565b610bec565b90565b90610c129154610bef565b90565b610c2160105f90610c07565b90565b34610c5457610c343660046103b2565b610c50610c3f610c15565b610c476103a4565b91829182610594565b0390f35b6103aa565b90565b610c70610c6b610c7592610c59565b6106da565b61049f565b90565b610c84620f4628610c5c565b90565b610c8f610c78565b90565b34610cc257610ca23660046103b2565b610cbe610cad610c87565b610cb56103a4565b91829182610594565b0390f35b6103aa565b90816060910312610cd55790565b6108a4565b9061014082820312610d3757610cf2815f8401610490565b92610d0082602085016108a8565b92610d0e8360c08301610cc7565b9261012082013567ffffffffffffffff8111610d3257610d2e92016108da565b9091565b610461565b6103ae565b90565b610d53610d4e610d5892610d3c565b6106da565b610d3c565b90565b34610d7457610d6b366004610cda565b93929092612c53565b6103aa565b610d8560115f90610c07565b90565b34610db857610d983660046103b2565b610db4610da3610d79565b610dab6103a4565b91829182610594565b0390f35b6103aa565b90602082820312610dd657610dd3915f016104b6565b90565b6103ae565b34610e0b57610e07610df6610df1366004610dbd565b612c71565b610dfe6103a4565b91829182610594565b0390f35b6103aa565b90565b610e27610e22610e2c92610e10565b6106da565b610733565b90565b610e3b620d89e8610e13565b90565b610e46610e2f565b90565b9190610e5c905f60208501940190610739565b565b34610e8e57610e6e3660046103b2565b610e8a610e79610e3e565b610e816103a4565b91829182610e49565b0390f35b6103aa565b610e9c81610d3c565b03610ea357565b5f80fd5b90503590610eb482610e93565b565b916101a083830312610f3157610ece825f8501610490565b92610edc83602083016108a8565b92610eea8160c084016108bb565b92610ef9826101408501610ea7565b92610f08836101608301610ea7565b9261018082013567ffffffffffffffff8111610f2c57610f2892016108da565b9091565b610461565b6103ae565b610f3f90610d3f565b9052565b916020610f64929493610f5d60408201965f830190610987565b0190610f36565b565b34610f8257610f76366004610eb6565b95949094939193612d20565b6103aa565b610f9081610465565b03610f9757565b5f80fd5b90503590610fa882610f87565b565b610fb381610733565b03610fba57565b5f80fd5b90503590610fcb82610faa565b565b6101008183031261100f57610fe4825f8301610490565b9261100c610ff584602085016108a8565b936110038160c08601610f9b565b9360e001610fbe565b90565b6103ae565b346110485761104461103361102a366004610fcd565b92919091612db7565b61103b6103a4565b91829182610994565b0390f35b6103aa565b611059600e5f90610b85565b90565b3461108c5761106c3660046103b2565b61108861107761104d565b61107f6103a4565b91829182610ba2565b0390f35b6103aa565b346110c1576110bd6110ac6110a7366004610853565b612de4565b6110b46103a4565b91829182610594565b0390f35b6103aa565b346110f4576110d63660046103b2565b6110de612e27565b6110e66103a4565b806110f08161054f565b0390f35b6103aa565b90565b61111061110b611115926110f9565b6106da565b61049f565b90565b6111236127106110fc565b90565b61112e611118565b90565b34611161576111413660046103b2565b61115d61114c611126565b6111546103a4565b91829182610594565b0390f35b6103aa565b61116f90610470565b9052565b9190611186905f60208501940190611166565b565b346111b8576111983660046103b2565b6111b46111a3612e35565b6111ab6103a4565b91829182611173565b0390f35b6103aa565b60018060a01b031690565b6111d89060086111dd9302610b69565b6111bd565b90565b906111eb91546111c8565b90565b6111fa60085f906111e0565b90565b3461122d5761120d3660046103b2565b6112296112186111ee565b6112206103a4565b91829182611173565b0390f35b6103aa565b61126761126e9461125d606094989795611253608086019a5f870190610587565b6020850190610587565b6040830190610587565b0190610587565b565b346112a4576112803660046103b2565b6112a061128b612e70565b906112979492946103a4565b94859485611232565b0390f35b6103aa565b906020828203126112da575f82013567ffffffffffffffff81116112d5576112d192016108da565b9091565b610461565b6103ae565b5190565b60209181520190565b61130b61131460209361131993611302816112df565b938480936112e3565b958691016103ce565b6103d9565b0190565b6113329160208201915f8184039101526112ec565b90565b346113665761136261135161134b3660046112a9565b906132cb565b6113596103a4565b9182918261131d565b0390f35b6103aa565b61137760095f90610c07565b90565b346113aa5761138a3660046103b2565b6113a661139561136b565b61139d6103a4565b91829182610594565b0390f35b6103aa565b346113df576113bf3660046103b2565b6113db6113ca613516565b6113d26103a4565b91829182610414565b0390f35b6103aa565b6113f060065f90610c07565b90565b34611423576114033660046103b2565b61141f61140e6113e4565b6114166103a4565b91829182610594565b0390f35b6103aa565b346114605761144761143b366004610eb6565b959490949391936135be565b9061145c6114536103a4565b92839283610f43565b0390f35b6103aa565b90565b61147c61147761148192611465565b6106da565b610733565b90565b611491620d89e719611468565b90565b61149c611484565b90565b346114cf576114af3660046103b2565b6114cb6114ba611494565b6114c26103a4565b91829182610e49565b0390f35b6103aa565b6114df3660046103b2565b6114e7613741565b6114ef6103a4565b806114f98161054f565b0390f35b3461152e5761152a6115196115133660046104c5565b906138aa565b6115216103a4565b91829182610504565b0390f35b6103aa565b9060208282031261154c57611549915f01610f9b565b90565b6103ae565b3461157f57611569611564366004611533565b613d94565b6115716103a4565b8061157b8161054f565b0390f35b6103aa565b919091610160818403126115f25761159e835f8301610490565b926115ac81602084016108a8565b926115ba8260c08501610cc7565b926115c9836101208301610ea7565b9261014082013567ffffffffffffffff81116115ed576115e992016108da565b9091565b610461565b6103ae565b600f0b90565b611606906115f7565b9052565b91602061162b92949361162460408201965f830190610987565b01906115fd565b565b346116655761164c611640366004611584565b94939093929192613e31565b906116616116586103a4565b9283928361160a565b0390f35b6103aa565b3461169a57611696611685611680366004610dbd565b613e54565b61168d6103a4565b91829182610594565b0390f35b6103aa565b9190916101208184031261170c576116b9835f8301610490565b926116c781602084016108a8565b926116d58260c085016104b6565b926116e38360e083016104b6565b9261010082013567ffffffffffffffff81116117075761170392016108da565b9091565b610461565b6103ae565b3461172d5761172136600461169f565b94939093929192613efc565b6103aa565b919060408382031261175a578061174e611757925f86016104b6565b936020016104b6565b90565b6103ae565b3461178e57611778611772366004611732565b90614019565b6117806103a4565b8061178a8161054f565b0390f35b6103aa565b6040906117bc6117c394969593966117b260608401985f850190611166565b6020830190610587565b0190610587565b565b346117f8576117d53660046103b2565b6117f46117e0614025565b6117eb9391936103a4565b93849384611793565b0390f35b6103aa565b611806906104f2565b9052565b906101a08061190f936118235f8201515f8601906117fd565b611835602082015160208601906117fd565b611847604082015160408601906117fd565b611859606082015160608601906117fd565b61186b608082015160808601906117fd565b61187d60a082015160a08601906117fd565b61188f60c082015160c08601906117fd565b6118a160e082015160e08601906117fd565b6118b56101008201516101008601906117fd565b6118c96101208201516101208601906117fd565b6118dd6101408201516101408601906117fd565b6118f16101608201516101608601906117fd565b6119056101808201516101808601906117fd565b01519101906117fd565b565b9190611925905f6101c0850194019061180a565b565b34611957576119373660046103b2565b611953611942614155565b61194a6103a4565b91829182611911565b0390f35b6103aa565b61196860075f90610c07565b90565b3461199b5761197b3660046103b2565b61199761198661195c565b61198e6103a4565b91829182610594565b0390f35b6103aa565b6119ac600a5f90610c07565b90565b346119df576119bf3660046103b2565b6119db6119ca6119a0565b6119d26103a4565b91829182610594565b0390f35b6103aa565b34611a12576119fc6119f7366004610dbd565b614308565b611a046103a4565b80611a0e8161054f565b0390f35b6103aa565b7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa0340890565b611a44906106f9565b90565b611a5090611a3b565b9052565b9190611a67905f60208501940190611a47565b565b34611a9957611a793660046103b2565b611a95611a84611a17565b611a8c6103a4565b91829182611a54565b0390f35b6103aa565b909160e082840312611ad357611ad0611ab9845f8501610490565b93611ac781602086016108a8565b9360c001610f9b565b90565b6103ae565b34611aee57611ae8366004611a9e565b9161437c565b6103aa565b9190604083820312611b1b5780611b0f611b18925f8601610490565b93602001610490565b90565b6103ae565b34611b5157611b4d611b3c611b36366004611af3565b9061439f565b611b446103a4565b91829182610594565b0390f35b6103aa565b34611b7257611b6636600461169f565b94939093929192614436565b6103aa565b611b8360125f90610c07565b90565b34611bb657611b963660046103b2565b611bb2611ba1611b77565b611ba96103a4565b91829182610594565b0390f35b6103aa565b34611beb57611bcb3660046103b2565b611be7611bd6614443565b611bde6103a4565b91829182610594565b0390f35b6103aa565b90565b611c07611c02611c0c92611bf0565b6106da565b61049f565b90565b611c196012611bf3565b90565b611c24611c0f565b90565b34611c5757611c373660046103b2565b611c53611c42611c1c565b611c4a6103a4565b91829182610594565b0390f35b6103aa565b34611c8a57611c74611c6f366004610853565b6144be565b611c7c6103a4565b80611c868161054f565b0390f35b6103aa565b634e487b7160e01b5f52604160045260245ffd5b90611cad906103d9565b810190811067ffffffffffffffff821117611cc757604052565b611c8f565b90611cdf611cd86103a4565b9283611ca3565b565b67ffffffffffffffff8111611cff57611cfb6020916103d9565b0190565b611c8f565b90611d16611d1183611ce1565b611ccc565b918252565b5f7f312e312e30000000000000000000000000000000000000000000000000000000910152565b611d4c6005611d04565b90611d5960208301611d1b565b565b611d63611d42565b90565b611d6e611d5b565b90565b611d79611d66565b90565b34611dac57611d8c3660046103b2565b611da8611d97611d71565b611d9f6103a4565b91829182610414565b0390f35b6103aa565b5f80fd5b606090565b634e487b7160e01b5f52602260045260245ffd5b9060016002830492168015611dee575b6020831014611de957565b611dba565b91607f1691611dde565b60209181520190565b5f5260205f2090565b905f9291805490611e24611e1d83611dce565b8094611df8565b916001811690815f14611e7b5750600114611e3f575b505050565b611e4c9192939450611e01565b915f925b818410611e6357505001905f8080611e3a565b60018160209295939554848601520191019290611e50565b92949550505060ff19168252151560200201905f8080611e3a565b90611ea091611e0a565b90565b90611ec3611ebc92611eb36103a4565b93848092611e96565b0383611ca3565b565b611ece90611ea3565b90565b611ed9611db5565b50611ee46003611ec5565b90565b5f90565b611f0891611ef7611ee7565b50611f006144c9565b9190916144d6565b600190565b611f19611f1e916105de565b610bec565b90565b611f2b9054611f0d565b90565b634e487b7160e01b5f52601160045260245ffd5b611f51611f579193929361049f565b9261049f565b8201809211611f6257565b611f2e565b5f7f436f6c6c656374696f6e20696e74657276616c206e6f74207061737365640000910152565b611f9b601e6020926103c5565b611fa481611f67565b0190565b611fbd9060208101905f818303910152611f8e565b90565b15611fc757565b611fcf6103a4565b62461bcd60e51b815280611fe560048201611fa8565b0390fd5b5f1b90565b90611ffa5f1991611fe9565b9181191691161790565b61201861201361201d9261049f565b6106da565b61049f565b90565b90565b9061203861203361203f92612004565b612020565b8254611fee565b9055565b90565b90565b61205d61205861206292612043565b611fe9565b612046565b90565b61206f6080611ccc565b90565b9061207c90610733565b9052565b61209461208f61209992612043565b6106da565b610d3c565b90565b906120a690610d3c565b9052565b906120b490612046565b9052565b5f80fd5b60e01b90565b905051906120cf82610e93565b565b91906040838203126120f957806120ed6120f6925f86016120c2565b936020016120c2565b90565b6103ae565b61210790610705565b9052565b6121149061071e565b9052565b61212190610733565b9052565b61212e90610746565b9052565b9060806121a360026121ab9461215661214d5f8301546105ee565b5f8701906120fe565b61219c612192600183015461217761216d826105ee565b60208a01906120fe565b61218d6121838261061d565b60408a019061210b565b61064a565b6060870190612118565b0154610676565b910190612125565b565b6121b690610d3c565b9052565b6121c390612046565b9052565b9060608061220d936121df5f8201515f860190612118565b6121f160208201516020860190612118565b612203604082015160408601906121ad565b01519101906121ba565b565b61221a5f80926112e3565b0190565b61224161224f936122376101408401945f850190612132565b60a08301906121c7565b61012081830391015261220f565b90565b61225a6103a4565b3d5f823e3d90fd5b61227661227161227b92612043565b6106da565b6115f7565b90565b61229261228d61229792612043565b6106da565b61049f565b90565b6fffffffffffffffffffffffffffffffff1690565b6122c36122be6122c8926115f7565b6106da565b61229a565b90565b6122df6122da6122e49261229a565b6106da565b61049f565b90565b91602061230892949361230160408201965f830190610587565b0190610587565b565b612313906106f9565b90565b61231f90610b0c565b604d811161232d57600a0a90565b611f2e565b6123416123479193929361049f565b9261049f565b9161235383820261049f565b92818404149015171561236257565b611f2e565b634e487b7160e01b5f52601260045260245ffd5b61238761238d9161049f565b9161049f565b908115612398570490565b612367565b6123d6426123cf6123c96123c46123b46010611f21565b6123be6011611f21565b90611f42565b61049f565b9161049f565b1015611fc0565b6123e1426010612023565b6123e9611484565b61243c6123f4610e2f565b61243361242a5f6124256124075f612049565b9461241c612413612065565b985f8a01612072565b60208801612072565b612080565b6040850161209c565b606083016120aa565b60406124677f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b91635a6bcfda9261248d5f600b93956124986124816103a4565b978896879586946120bc565b84526004840161221e565b03925af1908115612813575f916127e6575b506124bd6124b7826144e6565b916144f5565b90806124d16124cb5f612262565b916115f7565b135f146127d7576124e46124e9916122af565b6122cb565b5b90806124fe6124f85f612262565b916115f7565b135f146127c857612511612516916122af565b6122cb565b5b9080827f49d512bf9cb224241c05691e73eb9fab078cf350c7dbcbcf66788f1fc0cc8b0b916125506125476103a4565b928392836122e7565b0390a1806125666125605f61227e565b9161049f565b11612781575b8161257f6125795f61227e565b9161049f565b11612738575b61258e5f61227e565b506125985f61227e565b506125b86125a85f600b01610602565b6125b2600e610602565b90614671565b5f1461273357905b806125d36125cd5f61227e565b9161049f565b115f146126a4579061260b6125fb612668936125f56125f0612bc6565b612316565b90612332565b6126056006611f21565b9061237b565b9061261f6126183061230a565b8390614700565b61263c61262b3061230a565b612636838590611f42565b906146a1565b61266361265c61264d838590611f42565b6126576012611f21565b611f42565b6012612023565b611f42565b61269e7f6ef4855b666dcc7884561072e4358b28dfe01feb1b7f4dcebc00e62d50394ac7916126956103a4565b91829182610594565b0390a15b565b50806126b86126b25f61227e565b9161049f565b116126c4575b506126a2565b6126d76126d03061230a565b82906146a1565b6126f46126ed826126e86012611f21565b611f42565b6012612023565b61272a7f6ef4855b666dcc7884561072e4358b28dfe01feb1b7f4dcebc00e62d50394ac7916127216103a4565b91829182610594565b0390a15f6126be565b6125c0565b61277c6127486001600b01610602565b7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa034086127723061230a565b8591600193614545565b612585565b6127c36127905f600b01610602565b7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa034086127ba3061230a565b84915f93614545565b61256c565b506127d25f61227e565b612517565b506127e15f61227e565b6124ea565b612807915060403d811161280c575b6127ff8183611ca3565b8101906120d1565b6124aa565b503d6127f5565b612252565b5f90565b612824612818565b5061282f6002611f21565b90565b6128439061283e61475e565b6129e8565b565b61285961285461285e92612043565b6106da565b610465565b90565b61286a90612845565b90565b60207f7300000000000000000000000000000000000000000000000000000000000000917f4465762077616c6c65742063616e6e6f74206265207a65726f206164647265735f8201520152565b6128c760216040926103c5565b6128d08161286d565b0190565b6128e99060208101905f8183039101526128ba565b90565b156128f357565b6128fb6103a4565b62461bcd60e51b815280612911600482016128d4565b0390fd5b612921612926916105de565b6111bd565b90565b6129339054612915565b90565b9061294760018060a01b0391611fe9565b9181191691161790565b90565b9061296961296461297092610705565b612951565b8254612936565b9055565b5f7f44657657616c6c65740000000000000000000000000000000000000000000000910152565b6129a860096020926103c5565b6129b181612974565b0190565b9160406129e69294936129df6129d4606083018381035f85015261299b565b966020830190611166565b0190611166565b565b612a0d81612a06612a006129fb5f612861565b610470565b91610470565b14156128ec565b612a176008612929565b612a22826008612954565b907fd8e98bff5ae8522235ef48daecff7488b367200bea03a4e8cb4bc98108c6a49291612a59612a506103a4565b928392836129b5565b0390a1565b612a6790612832565b565b5f90565b33612aa8612aa2612a9d7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b0315612aca575f63570c108560e11b815280612ac66004820161054f565b0390fd5b94939291945093909192936147ac565b612ae2612a69565b612a6d565b91612b1192612af4611ee7565b50612b09612b006144c9565b829084916147df565b91909161486b565b600190565b33612b51612b4b612b467f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b0315612b73575f63570c108560e11b815280612b6f6004820161054f565b0390fd5b9493929194509390919293614908565b612b8b612a69565b612b16565b612b98612818565b50612ba36012611f21565b90565b5f90565b612bbe612bb9612bc392611bf0565b6106da565b610b0c565b90565b612bce612ba6565b50612bd96012612baa565b90565b5f90565b5f90565b33612c1f612c19612c147f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b0315612c41575f63570c108560e11b815280612c3d6004820161054f565b0390fd5b9695949396505050939091929361492d565b612c5b612a69565b612c63612bdc565b612c6b612be0565b91612be4565b612c91612ca791612c80612818565b50612c8b6006611f21565b90612332565b612ca1612c9c612bc6565b612316565b9061237b565b90565b5f90565b33612ce9612ce3612cde7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b0315612d0b575f63570c108560e11b815280612d076004820161054f565b0390fd5b97969594939297505095909192939495614964565b612d28612a69565b612d30612caa565b90612cae565b9392919033612d75612d6f612d6a7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b03612d8657612d8394612da2565b90565b5f63570c108560e11b815280612d9e6004820161054f565b0390fd5b90612db49492939150929091926149b3565b90565b90612dcb939291612dc6612a69565b612d36565b90565b90612dd890610705565b5f5260205260405f2090565b612dfa612dff91612df3612818565b505f612dce565b611f21565b90565b612e0a61475e565b612e12612e14565b565b612e25612e205f612861565b614a32565b565b612e2f612e02565b565b5f90565b612e3d612e31565b50612e486005612929565b90565b612e5a612e609193929361049f565b9261049f565b8203918211612e6b57565b611f2e565b612e78612818565b50612e81612818565b50612e8a612818565b50612e93612818565b50612e9c611118565b90612ea76006611f21565b9081612ebb612eb58561049f565b9161049f565b115f14612f0b57612efc612eeb612edd84612ed76127106110fc565b90612332565b612ee5611118565b9061237b565b612ef66127106110fc565b90612e4b565b5b90612f086007611f21565b90565b612f145f61227e565b612efd565b606090565b5f7f4e6f7420706f6f6c206d616e6167657200000000000000000000000000000000910152565b612f5260106020926103c5565b612f5b81612f1e565b0190565b612f749060208101905f818303910152612f45565b90565b15612f7e57565b612f866103a4565b62461bcd60e51b815280612f9c60048201612f5f565b0390fd5b612fb4612faf612fb99261049f565b6106da565b610d3c565b90565b612fd0612fcb612fd5926115f7565b6106da565b610d3c565b90565b90612fe290610470565b9052565b90612ff09061071e565b9052565b612ffd90610470565b90565b9061300a90612ff4565b9052565b61301860a0611ccc565b90565b9061309a613091600261302c61300e565b9461304361303b5f8301610602565b5f8801612fd8565b61305b61305260018301610602565b60208801612fd8565b61307361306a60018301610631565b60408801612fe6565b61308b6130826001830161065e565b60608801612072565b0161068a565b60808401613000565b565b6130a59061301b565b90565b5f9060033d116130b5575b565b905060045f803e6130c65f5161039e565b906130b3565b5f9060443d10613149576130de6103a4565b60043d036004823e8051903d602483011167ffffffffffffffff8311176131455781810191825167ffffffffffffffff811161313f5780602085010160043d0384011061313957613136939495506020010190611ca3565b90565b50505050565b50505050565b5050565b565b905090565b5f7f4c6971756964697479206d6f64696669636174696f6e206661696c65643a2000910152565b613183601f809261314b565b61318c81613150565b0190565b6131b56131ac926020926131a3816103c1565b9485809361314b565b938491016103ce565b0190565b906131c66131cc92613177565b90613190565b90565b90565b67ffffffffffffffff81116131f0576131ec6020916103d9565b0190565b611c8f565b90613207613202836131d2565b611ccc565b918252565b3d5f146132275761321c3d6131f5565b903d5f602084013e5b565b61322f612f19565b90613225565b60207f746820756e6b6e6f776e206572726f7200000000000000000000000000000000917f4c6971756964697479206d6f64696669636174696f6e206661696c65642077695f8201520152565b61328f60306040926103c5565b61329881613235565b0190565b6132b19060208101905f818303910152613282565b90565b6132bd5f611d04565b90565b6132c86132b4565b90565b90613326916132d8612f19565b5061331d3361331761331161330c7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b14612f77565b90810190611732565b613392613331611484565b9161338961338061335161334c613346610e2f565b94612fa0565b614aaf565b61337b61335d5f612049565b94613372613369612065565b985f8a01612072565b60208801612072565b612fbc565b6040850161209c565b606083016120aa565b9060406133be7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b92635a6bcfda936133e45f600b93966133ef6133d86103a4565b988996879586946120bc565b84526004840161221e565b03925af180925f936134e5575b50155f146134bf57505060016134106130a8565b6308c379a014613456575b61342b575b6134286132c0565b90565b61343361320c565b5061343c6103a4565b62461bcd60e51b8152806134526004820161329c565b0390fd5b61345e6130cc565b80613469575061341b565b61349e61348a6134996134bb9361347e6103a4565b928391602083016131b9565b60208201810382520382611ca3565b6131cf565b6134a66103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b6134e091906134cd3061230a565b6134da600b93929361309c565b90614c9f565b613420565b61350791935060403d811161350f575b6134ff8183611ca3565b8101906120d1565b9290926133fc565b503d6134f5565b61351e611db5565b506135296004611ec5565b90565b97969594939291903361356f6135696135647f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b036135815761357d9861359d565b9091565b5f63570c108560e11b8152806135996004820161054f565b0390fd5b906135b898969492919795939750509590919293949561530f565b91909190565b906135de9695949392916135d0612a69565b6135d8612caa565b9061352c565b9091565b5f7f4d7573742073656e642045544820746f2062757920746f6b656e730000000000910152565b613616601b6020926103c5565b61361f816135e2565b0190565b6136389060208101905f818303910152613609565b90565b1561364257565b61364a6103a4565b62461bcd60e51b81528061366060048201613623565b0390fd5b90565b61367b61367661368092613664565b6106da565b61049f565b90565b905090565b6136935f8092613683565b0190565b6136a090613688565b90565b5f7f44657620666565207472616e73666572206661696c6564000000000000000000910152565b6136d760176020926103c5565b6136e0816136a3565b0190565b6136f99060208101905f8183039101526136ca565b90565b1561370357565b61370b6103a4565b62461bcd60e51b815280613721600482016136e4565b0390fd5b61372e9061049f565b5f19811461373c5760010190565b611f2e565b61375d346137576137515f61227e565b9161049f565b1161363b565b61378a61377a3461377461376f612bc6565b612316565b90612332565b6137846006611f21565b9061237b565b613795338290614700565b6137bd6137ac346137a66009611f21565b90612332565b6137b76103e8613667565b9061237b565b61381b5f806137ea6137d9346137d3600a611f21565b90612332565b6137e46103e8613667565b9061237b565b936137f56008612929565b906137fe6103a4565b908161380981613697565b03925af161381561320c565b506136fc565b8061382e6138285f61227e565b9161049f565b1161389b575b5061385161384a6138456007611f21565b613725565b6007612023565b61385a346157c0565b5033903490916138967f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f339361388d6103a4565b93849384611793565b0390a1565b6138a490615545565b5f613834565b6138c7916138b6611ee7565b506138bf6144c9565b91909161486b565b600190565b6138dd906138d861475e565b613b86565b565b5f90565b6138ec906106dd565b90565b6138f8906138e3565b90565b61390560a0611ccc565b90565b90565b61391f61391a61392492613908565b6106da565b610733565b90565b6139319051610470565b90565b90565b9061394c61394761395392610705565b613934565b8254612936565b9055565b613961905161071e565b90565b60a01b90565b9061397b62ffffff60a01b91613964565b9181191691161790565b61399961399461399e9261071e565b6106da565b61071e565b90565b90565b906139b96139b46139c092613985565b6139a1565b825461396a565b9055565b6139ce9051610733565b90565b60b81b90565b906139e862ffffff60b81b916139d1565b9181191691161790565b613a06613a01613a0b92610733565b6106da565b610733565b90565b90565b90613a26613a21613a2d926139f2565b613a0e565b82546139d7565b9055565b613a3b9051612ff4565b90565b613a47906138e3565b90565b90565b90613a62613a5d613a6992613a3e565b613a4a565b8254612936565b9055565b90613ae360806002613ae994613a905f8201613a8a5f8801613927565b90613937565b613aa960018201613aa360208801613927565b90613937565b613ac260018201613abc60408801613957565b906139a4565b613adb60018201613ad5606088016139c4565b90613a11565b019201613a31565b90613a4d565b565b90613af591613a6d565b565b90505190613b0482610faa565b565b90602082820312613b1f57613b1c915f01613af7565b90565b6103ae565b613b2d90610465565b9052565b9160a0613b52929493613b4b60c08201965f830190612132565b0190613b24565b565b604090613b7d613b849496959396613b7360608401985f850190611166565b6020830190610711565b0190610711565b565b613b8e6138df565b50613b976138df565b50613baa613ba5600e610602565b610705565b613bcd613bc7613bc2613bbd600f610602565b610705565b610470565b91610470565b105f14613d7457613c5e613be1600e610602565b613c57613bee600f610602565b915b91613c4e613c45613bff610aa9565b613c40603c91613c37613c19613c143061230a565b6138ef565b96613c2e613c256138fb565b9a5f8c01612fd8565b60208a01612fd8565b60408801612fe6565b61390b565b60608501612072565b60808301613000565b600b613aeb565b6020613c897f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b91636276cbbe92613caf5f600b9395613cba613ca36103a4565b978896879586946120bc565b845260048401613b31565b03925af18015613d6f57613d43575b50613cf37f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b613cfd600e610602565b613d07600f610602565b91613d3e7fb2684e1b8e116bbb42a14d7a6bc6afa19d85ff0a8666a6b424b79a738c661d8193613d356103a4565b93849384613b54565b0390a1565b613d639060203d8111613d68575b613d5b8183611ca3565b810190613b06565b613cc9565b503d613d51565b612252565b613c5e613d81600f610602565b613c57613d8e600e610602565b91613bf0565b613d9d906138cc565b565b5f90565b9695949392919033613de5613ddf613dda7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b03613df757613df397613e13565b9091565b5f63570c108560e11b815280613e0f6004820161054f565b0390fd5b90613e2b9795939694929150509490919293946158dc565b91909190565b90613e509594939291613e42612a69565b613e4a613d9f565b90613da3565b9091565b613e7a613e8a91613e63612818565b50613e74613e6f612bc6565b612316565b90612332565b613e846006611f21565b9061237b565b90565b33613ec8613ec2613ebd7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b0315613eea575f63570c108560e11b815280613ee66004820161054f565b0390fd5b959493929195509490919293946159c0565b613f04612a69565b613e8d565b90613f1b91613f1661475e565b613f9f565b565b5f7f526174696f73206d7573742073756d20746f2031303030000000000000000000910152565b613f5160176020926103c5565b613f5a81613f1d565b0190565b613f739060208101905f818303910152613f44565b90565b15613f7d57565b613f856103a4565b62461bcd60e51b815280613f9b60048201613f5e565b0390fd5b613fc7613fad828490611f42565b613fc1613fbb6103e8613667565b9161049f565b14613f76565b613fd2816009612023565b613fdd82600a612023565b907fb42de28a546baa00aa8f10cdade93e8b7095b4324f2e48786f17825cc839ae9b9161401461400b6103a4565b928392836122e7565b0390a1565b9061402391613f09565b565b61402d612e31565b50614036612818565b5061403f612818565b5061404a6008612929565b6140546009611f21565b9161405f600a611f21565b91929190565b6140706101c0611ccc565b90565b5f90565b6020908180808080808080808080808061408f614065565b9e8f614099614073565b8152016140a4614073565b8152016140af614073565b8152016140ba614073565b8152016140c5614073565b8152016140d0614073565b8152016140db614073565b8152016140e6614073565b8152016140f1614073565b8152016140fc614073565b815201614107614073565b815201614112614073565b81520161411d614073565b815201614128614073565b81525050565b614136614077565b90565b6141446101c0611ccc565b90565b90614151906104f2565b9052565b61415d61412e565b505f60015f60015f805f60015f915f935f955f975f995f9b61417d614139565b809e5f82019061418c91614147565b6020019061419991614147565b60408d01906141a791614147565b60608c01906141b591614147565b60808b01906141c391614147565b60a08a01906141d191614147565b60c08901906141df91614147565b60e08801906141ed91614147565b6101008701906141fc91614147565b61012086019061420b91614147565b61014085019061421a91614147565b61016084019061422991614147565b61018083019061423891614147565b6101a082019061424791614147565b90565b61425b9061425661475e565b6142df565b565b5f7f496e74657276616c206d7573742062652067726561746572207468616e203000910152565b614291601f6020926103c5565b61429a8161425d565b0190565b6142b39060208101905f818303910152614284565b90565b156142bd57565b6142c56103a4565b62461bcd60e51b8152806142db6004820161429e565b0390fd5b614306906142ff816142f96142f35f61227e565b9161049f565b116142b6565b6011612023565b565b6143119061424a565b565b3361434e6143486143437f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b0315614370575f63570c108560e11b81528061436c6004820161054f565b0390fd5b929192509190916159e5565b614384612a69565b614313565b9061439390610705565b5f5260205260405f2090565b6143c4916143ba6143bf926143b2612818565b506001614389565b612dce565b611f21565b90565b336144026143fc6143f77f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b610470565b91610470565b0315614424575f63570c108560e11b8152806144206004820161054f565b0390fd5b95949392919550949091929394615a0a565b61443e612a69565b6143c7565b61444b612818565b506144566006611f21565b90565b61446a9061446561475e565b61446c565b565b8061448761448161447c5f612861565b610470565b91610470565b146144975761449590614a32565b565b6144ba6144a35f612861565b5f918291631e4fbdf760e01b835260048301611173565b0390fd5b6144c790614459565b565b6144d1612e31565b503390565b916144e49291600192615a2f565b565b6144ee613d9f565b5060801d90565b6144fd613d9f565b50600f0b90565b5f91031261450e57565b6103ae565b60409061453c614543949695939661453260608401985f850190610711565b6020830190611166565b0190610587565b565b9192935f146145e15761455790611a3b565b61456663156e29f69392615b66565b9392813b156145dc575f61458d9161459882966145816103a4565b988997889687956120bc565b855260048501611793565b03925af180156145d7576145ab575b505b565b6145ca905f3d81116145d0575b6145c28183611ca3565b810190614504565b5f6145a7565b503d6145b8565b612252565b6120b8565b6145ed90929192611a3b565b630b0d9c0992919392813b1561466c575f61461b91614626829661460f6103a4565b988997889687956120bc565b855260048501614513565b03925af180156146675761463b575b506145a9565b61465a905f3d8111614660575b6146528183611ca3565b810190614504565b5f614635565b503d614648565b612252565b6120b8565b61469761469261468c61469d93614686611ee7565b50610705565b93610705565b610470565b91610470565b1490565b90816146bd6146b76146b25f612861565b610470565b91610470565b146146d9576146d791906146d05f612861565b9091615b99565b565b6146fc6146e55f612861565b5f918291634b637e8f60e11b835260048301611173565b0390fd5b8061471b6147156147105f612861565b610470565b91610470565b14614737576147359161472d5f612861565b919091615b99565b565b61475a6147435f612861565b5f91829163ec442f0560e01b835260048301611173565b0390fd5b614766612e35565b61477f6147796147746144c9565b610470565b91610470565b0361478657565b6147a86147916144c9565b5f91829163118cdaa760e01b835260048301611173565b0390fd5b6147b4612a69565b505f630a85dc2960e01b8152806147cd6004820161054f565b0390fd5b906147dc910361049f565b90565b9291926147ed81839061439f565b90816148026147fc5f1961049f565b9161049f565b1061480f575b5050509050565b8161482261481c8761049f565b9161049f565b106148485761483f93946148379193926147d1565b905f92615a2f565b805f8080614808565b50614867849291925f938493637dc7a0d960e11b855260048501611793565b0390fd5b918261488761488161487c5f612861565b610470565b91610470565b146148e157816148a76148a161489c5f612861565b610470565b91610470565b146148ba576148b892919091615b99565b565b6148dd6148c65f612861565b5f91829163ec442f0560e01b835260048301611173565b0390fd5b6149046148ed5f612861565b5f918291634b637e8f60e11b835260048301611173565b0390fd5b614910612a69565b505f630a85dc2960e01b8152806149296004820161054f565b0390fd5b614935612a69565b5061493e612bdc565b50614947612be0565b505f630a85dc2960e01b8152806149606004820161054f565b0390fd5b61496c612a69565b50614975612caa565b505f630a85dc2960e01b81528061498e6004820161054f565b0390fd5b61499b81610470565b036149a257565b5f80fd5b356149b081614992565b90565b5090506149f191506149c3612a69565b506149e26149d25f83016149a6565b6149dc600e610602565b90614671565b908115614a0b575b50156104f2565b614a0057636fe7e6eb60e01b90565b636fe7e6eb60e01b90565b614a2c91506020614a1c91016149a6565b614a26600e610602565b90614671565b5f6149ea565b614a3c6005612929565b614a47826005612954565b90614a7b614a757f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610705565b91610705565b91614a846103a4565b80614a8e8161054f565b0390a3565b614aa7614aa2614aac92610d3c565b6106da565b6115f7565b90565b90614ab8613d9f565b50614ac282614a93565b91614ad6614ad08492610d3c565b91612fbc565b03614add57565b6393dafdf160e01b615d08565b614af3906115f7565b6f7fffffffffffffffffffffffffffffff198114614b10575f0390565b611f2e565b90505190614b22826104a2565b565b90602082820312614b3d57614b3a915f01614b15565b90565b6103ae565b5f7f45544820736574746c656d656e74206661696c65643a20000000000000000000910152565b614b756017809261314b565b614b7e81614b42565b0190565b90614b8f614b9592614b69565b90613190565b90565b60207f776e206572726f72000000000000000000000000000000000000000000000000917f45544820736574746c656d656e74206661696c6564207769746820756e6b6e6f5f8201520152565b614bf260286040926103c5565b614bfb81614b98565b0190565b614c149060208101905f818303910152614be5565b90565b614c20906106dd565b90565b614c2c90614c17565b90565b614c38906106f9565b90565b614c44816104f2565b03614c4b57565b5f80fd5b90505190614c5c82614c3b565b565b90602082820312614c7757614c74915f01614c4f565b90565b6103ae565b916020614c9d929493614c9660408201965f830190611166565b0190610587565b565b509150614cc0614cb05f8401613927565b614cba600e610602565b90614671565b5f1461508957614ccf816144e6565b614cd8826144f5565b9080614cec614ce65f612262565b916115f7565b12614fb8575b5080614d06614d005f612262565b916115f7565b12614e4f575b505b614d17816144e6565b614d29614d235f612262565b916115f7565b13614dd4575b614d38816144f5565b614d4a614d445f612262565b916115f7565b13614d54575b5050565b81614d646020614dcd9401613927565b917f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408614dc7614db76020614db0614dab614da6614da03061230a565b976144f5565b6122af565b6122cb565b9501613927565b614dc1600f610602565b90614671565b93614545565b5f80614d50565b614e4a614de25f8401613927565b7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408614e0c3061230a565b614e25614e20614e1b876144e6565b6122af565b6122cb565b91614e44614e345f8901613927565b614e3e600f610602565b90614671565b93614545565b614d2f565b614e63614e5e614e6892614aea565b6122af565b6122cb565b6020614eb1614e967f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b926311da60b4909390614ea76103a4565b94859384926120bc565b825281614ec06004820161054f565b03925af19081614f8c575b50155f14614f87576001614edd6130a8565b6308c379a014614f1e575b614ef3575b5f614d0c565b614efb61320c565b50614f046103a4565b62461bcd60e51b815280614f1a60048201614bff565b0390fd5b614f266130cc565b80614f315750614ee8565b614f66614f52614f61614f8393614f466103a4565b92839160208301614b82565b60208201810382520382611ca3565b6131cf565b614f6e6103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b614eed565b614fac9060203d8111614fb1575b614fa48183611ca3565b810190614b24565b614ecb565b503d614f9a565b614fcc614fc7614fd192614aea565b6122af565b6122cb565b6020614fec614fe7614fe23061230a565b614c23565b614c2f565b9163a9059cbb926150395f6150207f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b939561504461502d6103a4565b978896879586946120bc565b845260048401614c7c565b03925af1801561508457615058575b614cf2565b6150789060203d811161507d575b6150708183611ca3565b810190614c5e565b615053565b503d615066565b612252565b615092816144e6565b61509b826144f5565b90806150af6150a95f612262565b916115f7565b126151a6575b50806150c96150c35f612262565b916115f7565b126150d5575b50614d0e565b6150e96150e46150ee92614aea565b6122af565b6122cb565b60206151096151046150ff3061230a565b614c23565b614c2f565b9163a9059cbb926151565f61513d7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b939561516161514a6103a4565b978896879586946120bc565b845260048401614c7c565b03925af180156151a157615175575b6150cf565b6151959060203d811161519a575b61518d8183611ca3565b810190614c5e565b615170565b503d615183565b612252565b6151ba6151b56151bf92614aea565b6122af565b6122cb565b60206152086151ed7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b926311da60b49093906151fe6103a4565b94859384926120bc565b8252816152176004820161054f565b03925af190816152e3575b50155f146152de5760016152346130a8565b6308c379a014615275575b61524a575b5f6150b5565b61525261320c565b5061525b6103a4565b62461bcd60e51b81528061527160048201614bff565b0390fd5b61527d6130cc565b80615288575061523f565b6152bd6152a96152b86152da9361529d6103a4565b92839160208301614b82565b60208201810382520382611ca3565b6131cf565b6152c56103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b615244565b6153039060203d8111615308575b6152fb8183611ca3565b810190614b24565b615222565b503d6152f1565b5093505050506153599150615322612a69565b5061532b612caa565b5061534a61533a5f83016149a6565b615344600e610602565b90614671565b908115615387575b50156104f2565b615372576327c18fbf60e21b9061536f5f612080565b90565b6327c18fbf60e21b906153845f612080565b90565b6153a89150602061539891016149a6565b6153a2600e610602565b90614671565b5f615352565b5f80fd5b909291926153c76153c2826131d2565b611ccc565b938185526020850190828401116153e3576153e1926103ce565b565b6153ae565b9080601f8301121561540657816020615403935191016153b2565b90565b6108ce565b9060208282031261543b575f82015167ffffffffffffffff81116154365761543392016153e8565b90565b610461565b6103ae565b5f7f4c6971756964697479206164646974696f6e206661696c65643a200000000000910152565b615473601b809261314b565b61547c81615440565b0190565b9061548d61549392615467565b90613190565b90565b61549f9061227e565b9052565b9160206154c49294936154bd60408201965f830190615496565b0190615496565b565b60207f6e6b6e6f776e206572726f720000000000000000000000000000000000000000917f4c6971756964697479206164646974696f6e206661696c6564207769746820755f8201520152565b615520602c6040926103c5565b615529816154c6565b0190565b6155429060208101905f818303910152615513565b90565b6155726155628261555c615557612bc6565b612316565b90612332565b61556c6006611f21565b9061237b565b61558561557e3061230a565b8290614700565b6155c16155913061230a565b6155ba7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b83916144d6565b6156425f836155f184916155e26155d66103a4565b938492602084016122e7565b60208201810382520382611ca3565b61561a7f00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408611a3b565b615637836348c8949161562b6103a4565b968795869485936120bc565b83526004830161131d565b03925af19081615781575b50155f1461574257505060016156616130a8565b6308c379a0146156d9575b615673575b565b61567b61320c565b505f807f38f8a0c92f4c5b0b6877f878cb4c0c8d348a47b76d716c8e78f425043df9515b916156b46156ab6103a4565b928392836154a3565b0390a16156bf6103a4565b62461bcd60e51b8152806156d56004820161552d565b0390fd5b6156e16130cc565b806156ec575061566c565b61572161570d61571c61573e936157016103a4565b92839160208301615480565b60208201810382520382611ca3565b6131cf565b6157296103a4565b91829162461bcd60e51b835260048301610414565b0390fd5b907f38f8a0c92f4c5b0b6877f878cb4c0c8d348a47b76d716c8e78f425043df9515b916157796157706103a4565b928392836122e7565b0390a1615671565b61579c903d805f833e6157948183611ca3565b81019061540b565b61564d565b90565b6157b86157b36157bd926157a1565b6106da565b61049f565b90565b6157c8612818565b506157d36006611f21565b61588061587961586b61585c61580f6157f8876157f2620f42406107e8565b90612332565b615809670de0b6b3a76400006157a4565b9061237b565b61585761585161583f620f42409361583a615828610c78565b615834620f42406107e8565b90612e4b565b612332565b61584b620f42406107e8565b9061237b565b916107e8565b611f42565b6158666006611f21565b612332565b615873610804565b9061237b565b6006612023565b61588a6006611f21565b906158cc6158986007611f21565b937f915fb3a5adc404a6cf1ee942b80e2ba141b434e19a25cbd1a3fc9ec0b9a5f20d946158c36103a4565b94859485611232565b0390a16158d96006611f21565b90565b509250505061592591506158ee612a69565b506158f7613d9f565b506159166159065f83016149a6565b615910600e610602565b90614671565b908115615999575b50156104f2565b615984574261595861595261594d61593d6010611f21565b6159476011611f21565b90611f42565b61049f565b9161049f565b1015615974575b63b47b2fb160e01b906159715f612262565b90565b61597f426010612023565b61595f565b63b47b2fb160e01b906159965f612262565b90565b6159ba915060206159aa91016149a6565b6159b4600e610602565b90614671565b5f61591e565b6159c8612a69565b505f630a85dc2960e01b8152806159e16004820161054f565b0390fd5b6159ed612a69565b505f630a85dc2960e01b815280615a066004820161054f565b0390fd5b615a12612a69565b505f630a85dc2960e01b815280615a2b6004820161054f565b0390fd5b909281615a4c615a46615a415f612861565b610470565b91610470565b14615b175783615a6c615a66615a615f612861565b610470565b91610470565b14615af057615a9083615a8b615a8460018690614389565b8790612dce565b612023565b615a9a575b505050565b919091615ae5615ad3615acd7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92593610705565b93610705565b93615adc6103a4565b91829182610594565b0390a35f8080615a95565b615b13615afc5f612861565b5f918291634a1406b160e11b835260048301611173565b0390fd5b615b3a615b235f612861565b5f91829163e602df0560e01b835260048301611173565b0390fd5b615b47906106dd565b90565b615b5e615b59615b6392610465565b6106da565b61049f565b90565b615b83615b7e615b8892615b78612818565b50610705565b615b3e565b615b4a565b90565b90615b96910161049f565b90565b91909180615bb7615bb1615bac5f612861565b610470565b91610470565b145f14615c9857615bdb615bd483615bcf6002611f21565b611f42565b6002612023565b5b82615bf7615bf1615bec5f612861565b610470565b91610470565b145f14615c6c57615c1b615c1483615c0f6002611f21565b6147d1565b6002612023565b5b919091615c67615c55615c4f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef93610705565b93610705565b93615c5e6103a4565b91829182610594565b0390a3565b615c9382615c8d615c7e5f8790612dce565b91615c8883611f21565b615b8b565b90612023565b615c1c565b615cab615ca65f8390612dce565b611f21565b80615cbe615cb88561049f565b9161049f565b10615ce657615cd1615ce19184906147d1565b615cdc5f8490612dce565b612023565b615bdc565b90615d049091925f93849363391434e360e21b855260048501611793565b0390fd5b5f5260045ffdfea2646970667358221220e85651dbc4f445be4e1e0b5889f630764e0420b8521ac5cb0959b8df7ea6b24064736f6c634300081a0033

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

00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000be2680dc1752109b4344dbeb1072fd8cd880e54b00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408000000000000000000000000be2680dc1752109b4344dbeb1072fd8cd880e54b00000000000000000000000000000000000000000000000000000000000000124175746f47726f77696e674c50546f6b656e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000441474c5000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _name (string): AutoGrowingLPToken
Arg [1] : _symbol (string): AGLP
Arg [2] : _devWallet (address): 0xbe2680DC1752109b4344DbEB1072fd8Cd880e54b
Arg [3] : _poolManager (address): 0x05E73354cFDd6745C338b50BcFDfA3Aa6fA03408
Arg [4] : _owner (address): 0xbe2680DC1752109b4344DbEB1072fd8Cd880e54b

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 000000000000000000000000be2680dc1752109b4344dbeb1072fd8cd880e54b
Arg [3] : 00000000000000000000000005e73354cfdd6745c338b50bcfdfa3aa6fa03408
Arg [4] : 000000000000000000000000be2680dc1752109b4344dbeb1072fd8cd880e54b
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [6] : 4175746f47726f77696e674c50546f6b656e0000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [8] : 41474c5000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.