ETH Price: $3,261.98 (+4.13%)

Contract

0x4B16703f7B0de03D23FD54606ed5786a59E3f27e

Overview

ETH Balance

154.88 ETH

ETH Value

$505,215.34 (@ $3,261.98/ETH)

Token Holdings

Transaction Hash
Method
Block
From
To
Mint5276632025-01-30 22:58:171 min ago1738277897IN
0x4B16703f...a59E3f27e
0.275 ETH0.000008150.04525
Mint5271032025-01-30 22:48:5110 mins ago1738277331IN
0x4B16703f...a59E3f27e
0.055 ETH0.000006670.04525
Mint5263602025-01-30 22:36:1823 mins ago1738276578IN
0x4B16703f...a59E3f27e
0.055 ETH0.000006020.04525
Mint5247442025-01-30 22:09:0350 mins ago1738274943IN
0x4B16703f...a59E3f27e
0.055 ETH0.000006470.04525
Mint5242342025-01-30 22:00:291 hrs ago1738274429IN
0x4B16703f...a59E3f27e
0.055 ETH0.000009710.04525
Mint5232732025-01-30 21:44:091 hr ago1738273449IN
0x4B16703f...a59E3f27e
0.055 ETH0.000006440.04525
Mint5216652025-01-30 21:17:101 hr ago1738271830IN
0x4B16703f...a59E3f27e
0.11 ETH0.000006410.04525
Mint5181792025-01-30 20:18:362 hrs ago1738268316IN
0x4B16703f...a59E3f27e
0.055 ETH0.000006360.04525
Mint5180552025-01-30 20:16:312 hrs ago1738268191IN
0x4B16703f...a59E3f27e
0.11 ETH0.000008510.04525
Mint5171572025-01-30 20:01:282 hrs ago1738267288IN
0x4B16703f...a59E3f27e
0.055 ETH0.000007410.04525
Mint5152352025-01-30 19:29:183 hrs ago1738265358IN
0x4B16703f...a59E3f27e
0.055 ETH0.000008980.04525
Mint5145462025-01-30 19:17:433 hrs ago1738264663IN
0x4B16703f...a59E3f27e
0.165 ETH0.000009270.04525
Mint5143512025-01-30 19:14:253 hrs ago1738264465IN
0x4B16703f...a59E3f27e
0.055 ETH0.000008020.04525
Mint5136472025-01-30 19:02:393 hrs ago1738263759IN
0x4B16703f...a59E3f27e
0.055 ETH0.000008520.04525
Mint5133002025-01-30 18:56:494 hrs ago1738263409IN
0x4B16703f...a59E3f27e
0.055 ETH0.000006250.04525
Mint5132432025-01-30 18:55:524 hrs ago1738263352IN
0x4B16703f...a59E3f27e
0.055 ETH0.000007170.04525
Mint5126992025-01-30 18:46:474 hrs ago1738262807IN
0x4B16703f...a59E3f27e
0.11 ETH0.000007560.04525
Mint5115682025-01-30 18:27:534 hrs ago1738261673IN
0x4B16703f...a59E3f27e
0.055 ETH0.000009580.04525
Mint5105432025-01-30 18:10:424 hrs ago1738260642IN
0x4B16703f...a59E3f27e
0.055 ETH0.000006620.04525
Mint5103352025-01-30 18:07:144 hrs ago1738260434IN
0x4B16703f...a59E3f27e
0.055 ETH0.00000790.04525
Mint5082182025-01-30 17:31:485 hrs ago1738258308IN
0x4B16703f...a59E3f27e
0.055 ETH0.000007120.04525
Mint5081732025-01-30 17:31:035 hrs ago1738258263IN
0x4B16703f...a59E3f27e
0.22 ETH0.000004070.04525
Mint5081272025-01-30 17:30:175 hrs ago1738258217IN
0x4B16703f...a59E3f27e
0.055 ETH0.00000640.04525
Mint5079802025-01-30 17:27:505 hrs ago1738258070IN
0x4B16703f...a59E3f27e
0.11 ETH0.000007510.04525
Mint5071612025-01-30 17:14:095 hrs ago1738257249IN
0x4B16703f...a59E3f27e
0.055 ETH0.000004270.04525
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
5276632025-01-30 22:58:171 min ago1738277897
0x4B16703f...a59E3f27e
0.275 ETH
5271032025-01-30 22:48:5110 mins ago1738277331
0x4B16703f...a59E3f27e
0.055 ETH
5263602025-01-30 22:36:1823 mins ago1738276578
0x4B16703f...a59E3f27e
0.055 ETH
5257402025-01-30 22:25:5133 mins ago1738275951
0x4B16703f...a59E3f27e
0.055 ETH
5247442025-01-30 22:09:0350 mins ago1738274943
0x4B16703f...a59E3f27e
0.055 ETH
5242342025-01-30 22:00:291 hrs ago1738274429
0x4B16703f...a59E3f27e
0.055 ETH
5232732025-01-30 21:44:091 hr ago1738273449
0x4B16703f...a59E3f27e
0.055 ETH
5229982025-01-30 21:39:331 hr ago1738273173
0x4B16703f...a59E3f27e
0.055 ETH
5229652025-01-30 21:39:001 hr ago1738273140
0x4B16703f...a59E3f27e
0.055 ETH
5217502025-01-30 21:18:351 hr ago1738271915
0x4B16703f...a59E3f27e
0.055 ETH
5216652025-01-30 21:17:101 hr ago1738271830
0x4B16703f...a59E3f27e
0.11 ETH
5198772025-01-30 20:47:082 hrs ago1738270028
0x4B16703f...a59E3f27e
0.055 ETH
5181792025-01-30 20:18:362 hrs ago1738268316
0x4B16703f...a59E3f27e
0.055 ETH
5180552025-01-30 20:16:312 hrs ago1738268191
0x4B16703f...a59E3f27e
0.11 ETH
5171572025-01-30 20:01:282 hrs ago1738267288
0x4B16703f...a59E3f27e
0.055 ETH
5152352025-01-30 19:29:183 hrs ago1738265358
0x4B16703f...a59E3f27e
0.055 ETH
5145462025-01-30 19:17:433 hrs ago1738264663
0x4B16703f...a59E3f27e
0.165 ETH
5143512025-01-30 19:14:253 hrs ago1738264465
0x4B16703f...a59E3f27e
0.055 ETH
5136472025-01-30 19:02:393 hrs ago1738263759
0x4B16703f...a59E3f27e
0.055 ETH
5133002025-01-30 18:56:494 hrs ago1738263409
0x4B16703f...a59E3f27e
0.055 ETH
5132432025-01-30 18:55:524 hrs ago1738263352
0x4B16703f...a59E3f27e
0.055 ETH
5126992025-01-30 18:46:474 hrs ago1738262807
0x4B16703f...a59E3f27e
0.11 ETH
5115682025-01-30 18:27:534 hrs ago1738261673
0x4B16703f...a59E3f27e
0.055 ETH
5105432025-01-30 18:10:424 hrs ago1738260642
0x4B16703f...a59E3f27e
0.055 ETH
5103352025-01-30 18:07:144 hrs ago1738260434
0x4B16703f...a59E3f27e
0.055 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Bearish

Compiler Version
v0.8.28+commit.7893614a

ZkSolc Version
v1.5.10

Optimization Enabled:
Yes with Mode 3

Other Settings:
paris EvmVersion
File 1 of 11 : Bearish.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import "dn404/src/DN404.sol";
import "dn404/src/DN404Mirror.sol";
import {Ownable} from "solady/src/auth/Ownable.sol";
import {LibString} from "solady/src/utils/LibString.sol";
import {SafeTransferLib} from "solady/src/utils/SafeTransferLib.sol";
import {MerkleProofLib} from "solady/src/utils/MerkleProofLib.sol";
import {IExclusiveDelegateResolver} from "./interfaces/IExclusiveDelegateResolver.sol";
import {IBearishRenderer} from "./interfaces/IBearishRenderer.sol";

/**
 * @title BEARISH
 * @author @bearish_af
 */
contract Bearish is DN404, Ownable {
    bytes24 constant _AGW_LINK_RIGHTS = bytes24(keccak256("AGW_LINK"));

    uint256 internal constant LATEST_FRACTIONAL_ENABLE_TIME = 1769576400; // 01/28/2026 anyone can trigger fractional

    string private _name;
    string private _symbol;
    string private _baseURI;
    bytes32 private _allowlistRoot;
    bytes32 private _fcfsRoot;

    uint96 public publicPrice;
    uint96 public allowlistPrice;
    uint96 public delegateDiscountPrice;
    uint32 public totalMinted;

    bool public isLive;
    bool public isPublicLive;
    bool public baseURILocked;
    bool public nameAndSymbolLocked;
    bool public fractionalTransfersEnabled;
    bool public useRenderingEngine;

    uint32 public constant MAX_SUPPLY = 8888;
    uint32 public constant MAX_MINTABLE_SUPPLY = 5555;

    uint32 public maxPerWallet; // Max per wallet
    uint32 public maxFCFSlist; // GTD mints determined by merkle, remaining 1755 for fcfs & public mints
    uint32 public reservedSupply; // Holders reserve
    uint32 public fcfsMinted; // FCFS minted count

    uint256 public allowListEndsAt;

    mapping(address => bool) public mintedAllowlist; // Allowlist minted check
    mapping(uint256 => uint256) public seeds; // Seeds for each token

    address public renderer; // Rendering contract if enabled
    address public delegateResolver; // Delegate resolver for AGW

    error AlreadyMinted();
    error InvalidProof();
    error InvalidMint();
    error InvalidPrice();
    error TotalSupplyReached();
    error NotLive();
    error NotPublicLive();
    error MaxFCFSlistReached();
    error MaxSupplyReached();
    error MaxPerWalletReached();
    error Locked();
    error FractionalTransferNotAllowed();
    error TokenSeedDoesNotExist();
    error AllowlistEnded();
    error NotDelegated();
    error DelegateResolverNotSet();
    error NotOwner();

    constructor(bytes32 allowlistRoot_, bytes32 fcfsRoot_) {
        _initializeOwner(msg.sender);

        _name = "BEARISH";
        _symbol = "BURR";

        _allowlistRoot = allowlistRoot_;
        _fcfsRoot = fcfsRoot_;

        isLive = false;
        isPublicLive = false;
        baseURILocked = false;
        fractionalTransfersEnabled = false;

        maxPerWallet = 2;
        maxFCFSlist = 1755;
        reservedSupply = 3333;
        publicPrice = 0.055 ether;
        allowlistPrice = 0.055 ether;
        delegateDiscountPrice = 0.055 ether;
        allowListEndsAt = 1738087200; // Ends 01/28/2025 1PM EST

        address mirror = address(new DN404Mirror(msg.sender));
        _initializeDN404(0, msg.sender, mirror);
    }

    /**
     * @notice Checks if the contract is public live
     * @dev This function is used to check if the contract is public live
     */
    modifier onlyPublicLive() {
        if (!isPublicLive) {
            revert NotPublicLive();
        }
        _;
    }

    /**
     * @notice Checks if the contract is live
     * @dev This function is used to check if the contract is live
     */
    modifier onlyLive() {
        if (!isLive) {
            revert NotLive();
        }
        _;
    }

    modifier checkAllowlistEndsAt() {
        if (block.timestamp > allowListEndsAt) {
            revert AllowlistEnded();
        }
        _;
    }

    /**
     * @notice Checks the price
     * @dev This function is used to check the price
     * @param price The price
     * @param nftAmount The number of NFTs to mint
     */
    modifier checkPrice(uint256 price, uint256 nftAmount) {
        if (price * nftAmount != msg.value) {
            revert InvalidPrice();
        }
        _;
    }

    /**
     * @notice Checks if the buyer has already minted
     * @dev This function is used to check if the buyer has already minted
     */
    modifier checkMintedAllowlist(address user) {
        if (mintedAllowlist[user]) {
            revert AlreadyMinted();
        }
        _;
    }

    /**
     * @notice Checks and updates the total minted count
     * @dev This function is used to check and update the total minted count
     * @param nftAmount The number of NFTs to mint
     */
    modifier checkMintedTotal(uint256 nftAmount) {
        uint256 newTotalMinted = uint256(totalMinted) + nftAmount;
        if (newTotalMinted > MAX_MINTABLE_SUPPLY) {
            revert MaxSupplyReached();
        }
        totalMinted = uint32(newTotalMinted);
        _;
    }

    /**
     * @notice Checks and updates the FCFS mint count
     * @dev This function is used to check and update the FCFS mint count
     * @param nftAmount The number of NFTs to mint
     */
    modifier checkFCFSMintedTotal(uint256 nftAmount) {
        uint256 newMintCount = uint256(fcfsMinted) + nftAmount;
        if (newMintCount > maxFCFSlist) {
            revert MaxFCFSlistReached();
        }
        fcfsMinted = uint32(newMintCount);
        _;
    }

    /**
     * @notice Checks and updates the buyer mint count
     * @dev This function is used to check and update the buyer mint count
     * @param nftAmount The number of NFTs to mint
     * @param user The address of the user
     */
    modifier checkMaxPerWallet(uint256 nftAmount, address user) {
        uint256 newMintCount = uint256(_getAux(user)) + nftAmount;
        if (newMintCount > maxPerWallet) {
            revert MaxPerWalletReached();
        }
        _setAux(user, uint88(newMintCount));
        _;
    }

    /**
     * @notice Checks if the msg.sender has delegated the rights to the delegate
     * @param delegated The address of the delegated user
     */
    modifier checkDelegate(address delegated) {
        if (delegateResolver == address(0)) revert DelegateResolverNotSet();

        IExclusiveDelegateResolver instance = IExclusiveDelegateResolver(
            delegateResolver
        );

        if (
            msg.sender !=
            instance.exclusiveWalletByRights(delegated, _AGW_LINK_RIGHTS)
        ) {
            revert NotDelegated();
        }
        _;
    }

    /**
     * @notice Public mint
     * @dev Public mint is only available when isPublicLive is true
     * @param nftAmount The number of NFTs to mint
     */
    function mint(
        uint256 nftAmount
    )
        public
        payable
        onlyPublicLive
        checkPrice(publicPrice, nftAmount)
        checkMintedTotal(nftAmount)
    {
        _mint(msg.sender, nftAmount * _unit());
    }

    /**
     * @notice FCFS mint
     * @dev FCFS mint is only available when live is true
     * @param nftAmount The number of NFTs to mint
     * @param proof The Merkle proof for the FCFS list
     */
    function fcfsMint(
        uint256 nftAmount,
        bytes32[] calldata proof
    )
        public
        payable
        onlyLive
        checkPrice(publicPrice, nftAmount)
        checkMaxPerWallet(nftAmount, msg.sender)
        checkFCFSMintedTotal(nftAmount)
        checkMintedTotal(nftAmount)
    {
        _proofMint(nftAmount, proof, _fcfsRoot, msg.sender, msg.sender);
    }

    /**
     * @notice FCFS mint by delegate
     * @dev FCFS mint is only available when live is true, mints to the msg.sender wallet
     * @param nftAmount The number of NFTs to mint
     * @param proof The Merkle proof for the FCFS list
     * @param delegated The address of the delegated user
     * @param to The address to mint to
     */
    function fcfsMintByDelegate(
        uint256 nftAmount,
        bytes32[] calldata proof,
        address delegated,
        address to
    )
        public
        payable
        onlyLive
        checkDelegate(delegated)
        checkPrice(delegateDiscountPrice, nftAmount)
        checkMaxPerWallet(nftAmount, delegated)
        checkFCFSMintedTotal(nftAmount)
        checkMintedTotal(nftAmount)
    {
        _proofMint(nftAmount, proof, _fcfsRoot, delegated, to);
    }

    /**
     * @notice Allowlist mint
     * @dev Allowlist mint is only available when live is true
     * @param proof The Merkle proof for the allowlist
     */
    function allowlistMint(
        bytes32[] calldata proof
    )
        public
        payable
        onlyLive
        checkAllowlistEndsAt
        checkMintedAllowlist(msg.sender)
        checkPrice(allowlistPrice, 1)
        checkMintedTotal(1)
    {
        mintedAllowlist[msg.sender] = true;
        _proofMint(1, proof, _allowlistRoot, msg.sender, msg.sender);
    }

    /**
     * @notice Allowlist mint by delegate
     * @dev Allowlist mint is only available when live is true
     * @param proof The Merkle proof for the allowlist
     * @param delegated The address of the delegated user
     * @param to The address to mint to
     */
    function allowlistMintByDelegate(
        bytes32[] calldata proof,
        address delegated,
        address to
    )
        public
        payable
        onlyLive
        checkAllowlistEndsAt
        checkDelegate(delegated)
        checkMintedAllowlist(delegated)
        checkPrice(delegateDiscountPrice, 1)
        checkMintedTotal(1)
    {
        mintedAllowlist[delegated] = true;
        _proofMint(1, proof, _allowlistRoot, delegated, to);
    }

    /**
     * @notice Internal function to mint NFTs using a Merkle proof
     * @param nftAmount The number of NFTs to mint
     * @param proof The Merkle proof for the allowlist or FCFS list
     * @param root The root of the Merkle tree for the allowlist or FCFS list
     * @param user The address of the user
     */
    function _proofMint(
        uint256 nftAmount,
        bytes32[] calldata proof,
        bytes32 root,
        address user,
        address to
    ) internal {
        bytes32 leaf = keccak256(abi.encodePacked(user));
        if (!MerkleProofLib.verifyCalldata(proof, root, leaf))
            revert InvalidProof();
        _mint(to, nftAmount * _unit());
    }

    /**
     * @notice Airdrop parts of the reserve allocations
     * @param amount The number of NFTs to mint
     * @param to The address to mint to
     */
    function airdrop(uint256 amount, address to) public payable onlyOwner {
        if (amount > reservedSupply) revert InvalidMint();

        uint256 newTotalMinted = uint256(totalMinted) + amount;

        if (newTotalMinted > MAX_SUPPLY) {
            revert MaxSupplyReached();
        }

        totalMinted = uint32(newTotalMinted);
        uint256 newReservedSupply = uint256(reservedSupply) - amount;
        reservedSupply = uint32(newReservedSupply);
        _mint(to, amount * _unit());
    }

    /**
     * @notice Transfer override
     * @dev Enforces whole `_unit()` transfers if fractional transfers are disabled
     * @param from The address of the sender
     * @param to The address of the recipient
     * @param amount The amount to transfer
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual override {
        if (!fractionalTransfersEnabled) {
            if (amount % _unit() != 0) {
                revert FractionalTransferNotAllowed();
            }
        }
        super._transfer(from, to, amount);
    }

    /**
     * @notice Checks if the sender is the canonical Permit2 address on ZKsync
     * @param sender The address of the sender
     * @return Whether the sender is the canonical Permit2 address
     */
    function _isPermit2(address sender) internal view override returns (bool) {
        return sender == _ZKSYNC_PERMIT_2;
    }

    /**
     * @notice Withdraw ETH from the contract
     * @dev onlyOwner can withdraw ETH from the contract
     */
    function withdraw() public onlyOwner {
        SafeTransferLib.safeTransferAllETH(msg.sender);
    }

    /**
     * @notice Returns the name of the contract
     * @dev This function is used to return the name of the contract
     * @return The name of the contract
     */
    function name() public view override returns (string memory) {
        return _name;
    }

    /**
     * @notice Returns the symbol of the contract
     * @dev This function is used to return the symbol of the contract
     * @return The symbol of the contract
     */
    function symbol() public view override returns (string memory) {
        return _symbol;
    }

    /**
     * @notice The unit of BURR token that equals 1 BEARISH NFT
     * @dev 1 BEARISH = 10,001 BURR * 8888 = 88,888,888 BURR
     * @return The unit in wei
     */
    function _unit() internal pure override returns (uint256) {
        return 10 ** 18 * 10_001;
    }

    /**
     * @notice Locks the name and symbol
     * @dev This function is used to lock the name and symbol
     */
    function lockNameAndSymbol() public onlyOwner {
        nameAndSymbolLocked = true;
    }

    /**
     * @notice Sets the name and symbol of the contract
     * @dev This function is used to set the name and symbol of the contract
     * @param name_ The name of the contract
     * @param symbol_ The symbol of the contract
     */
    function setNameAndSymbol(
        string calldata name_,
        string calldata symbol_
    ) public onlyOwner {
        if (nameAndSymbolLocked) revert Locked();
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @notice Sets the delegate resolver for AGW
     * @dev This function is used to set the delegate resolver
     * @param delegateResolver_ The delegate resolver
     */
    function setDelegateResolver(address delegateResolver_) public onlyOwner {
        delegateResolver = delegateResolver_;
    }

    /**
     * @notice Sets the max per wallet
     * @dev This function is used to set the max per wallet
     * @param maxPerWallet_ The max per wallet
     */
    function setMaxPerWallet(uint32 maxPerWallet_) public onlyOwner {
        maxPerWallet = maxPerWallet_;
    }

    /**
     * @notice Sets the allowlist ends at
     * @dev This function is used to set the allowlist ends at
     * @param allowListEndsAt_ The allowlist ends at
     */
    function setAllowListEndsAt(uint256 allowListEndsAt_) public onlyOwner {
        allowListEndsAt = allowListEndsAt_;
    }

    /**
     * @notice Sets the reserved supply
     * @dev This function is used to set the reserved supply
     * @param reservedSupply_ The reserved supply
     */
    function setReservedSupply(uint32 reservedSupply_) public onlyOwner {
        reservedSupply = reservedSupply_;
    }

    /**
     * @notice Allows owner to turn on fractional transfers once or anyone can trigger fractional after LATEST_FRACTIONAL_ENABLE_TIME
     * @dev Once enabled, fractional transfers are allowed
     */
    function setFractionalTransfersEnabled() external {
        if (block.timestamp < LATEST_FRACTIONAL_ENABLE_TIME) {
            _checkOwner();
        }
        if (fractionalTransfersEnabled) revert Locked();
        fractionalTransfersEnabled = true;
    }

    /**
     * @notice Sets the renderer
     * @dev This function is used to set the renderer
     * @param renderer_ The renderer
     */
    function setRenderer(address renderer_) public onlyOwner {
        renderer = renderer_;
    }

    /**
     * @notice Sets the seeds for a batch of tokens
     * @dev This function is used to set the seeds for a batch of tokens
     * @param tokenIds The token IDs
     * @param seeds_ The seeds
     */
    function batchSetSeeds(
        uint256[] calldata tokenIds,
        uint256[] calldata seeds_
    ) public onlyOwner {
        for (uint256 i = 0; i < tokenIds.length; i++) {
            seeds[tokenIds[i]] = seeds_[i];
        }
    }

    /**
     * @notice Sets the use rendering engine
     * @dev This function is used to set the use rendering engine
     * @param useRenderingEngine_ The use rendering engine
     */
    function setUseRenderingEngine(bool useRenderingEngine_) public onlyOwner {
        useRenderingEngine = useRenderingEngine_;
    }

    /**
     * @notice Sets the base URI
     * @dev This function is used to set the base URI
     * @param baseURI_ The base URI
     */
    function setBaseURI(string calldata baseURI_) public onlyOwner {
        if (baseURILocked) revert Locked();
        _baseURI = baseURI_;
    }

    /**
     * @notice Locks the base URI
     * @dev This function is used to lock the base URI
     */
    function lockBaseURI() public onlyOwner {
        baseURILocked = true;
    }

    /**
     * @notice Sets the prices
     * @dev This function is used to set the prices
     * @param publicPrice_ The public price
     * @param allowlistPrice_ The allowlist price
     * @param delegateDiscountPrice_ The delegate discount price
     */
    function setPrices(
        uint96 publicPrice_,
        uint96 allowlistPrice_,
        uint96 delegateDiscountPrice_
    ) public onlyOwner {
        publicPrice = publicPrice_;
        allowlistPrice = allowlistPrice_;
        delegateDiscountPrice = delegateDiscountPrice_;
    }

    /**
     * @notice Sets the max FCFS list
     * @dev This function is used to set the max FCFS list
     * @param maxFCFSlist_ The max FCFS list
     */
    function setMaxFCFSlist(uint32 maxFCFSlist_) public onlyOwner {
        maxFCFSlist = maxFCFSlist_;
    }

    /**
     * @notice Sets the allowlist root
     * @dev This function is used to set the allowlist root
     * @param allowlistRoot_ The allowlist root
     */
    function setAllowlistRoot(bytes32 allowlistRoot_) public onlyOwner {
        _allowlistRoot = allowlistRoot_;
    }

    /**
     * @notice Sets the FCFS root
     * @dev This function is used to set the FCFS root
     * @param fcfsRoot_ The FCFS root
     */
    function setFCFSRoot(bytes32 fcfsRoot_) public onlyOwner {
        _fcfsRoot = fcfsRoot_;
    }

    /**
     * @notice Toggles the public live status
     * @dev This function is used to toggle the public live status
     */
    function togglePublicLive() public onlyOwner {
        isPublicLive = !isPublicLive;
    }

    /**
     * @notice Toggles the live status
     * @dev This function is used to toggle the live status
     */
    function toggleLive() public onlyOwner {
        isLive = !isLive;
    }

    /**
     * @notice Returns if burns should be added to the burn pool
     * @dev This returns true to reuse NFT IDs
     * @param totalNFTSupplyAfterBurn The total NFT supply after burn
     * @param totalSupplyAfterBurn The total supply after burn
     * @return Whether burns should be added to the burn pool to reuse NFT IDs instead of minting new ones
     */
    function _addToBurnedPool(
        uint256 totalNFTSupplyAfterBurn,
        uint256 totalSupplyAfterBurn
    ) internal view override returns (bool) {
        return true;
    }

    /**
     * @notice Returns the token URI
     * @dev This function is used to return the token URI, extensible to support a rendering engine for the future
     * @param tokenId The token ID
     */
    function _tokenURI(
        uint256 tokenId
    ) internal view override returns (string memory result) {
        if (!_exists(tokenId)) revert TokenDoesNotExist();

        if (useRenderingEngine) {
            if (seeds[tokenId] == 0) revert TokenSeedDoesNotExist();
            result = IBearishRenderer(renderer).tokenURI(
                tokenId,
                seeds[tokenId]
            );
        } else {
            if (bytes(_baseURI).length != 0) {
                result = string(
                    abi.encodePacked(_baseURI, LibString.toString(tokenId))
                );
            }
        }
    }

    /**
     * @notice Returns the tokens of an owner
     * @dev This function is used to return the tokens of an owner
     * @param owner The owner of the tokens
     */
    function tokensOf(
        address owner
    ) public view returns (uint256[] memory result) {
        DN404Storage storage $ = _getDN404Storage();
        uint256 n = $.addressData[owner].ownedLength;
        result = new uint256[](n);
        for (uint256 i; i < n; ++i) {
            uint256 id = _get($.owned[owner], i);
            result[i] = id;
        }
    }

    /**
     * @notice Returns the mint count of an owner
     * @dev This function is used to return the mint count of an owner
     * @param owner The owner of the mint count
     * @return The mint count of the owner
     */
    function mintCount(address owner) public view returns (uint256) {
        return uint256(_getAux(owner));
    }
}

File 2 of 11 : IBearishRenderer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

/**
 * @title IBearishRenderer
 * @notice Interface for a generic NFT metadata/trait renderer
 */
interface IBearishRenderer {
    /**
     * @notice Adjusts the default SVG width/height used for rendering.
     */
    function setDefaultDimensions(uint256 w, uint256 h) external;

    /**
     * @notice Sets an alias table for the A-J Walker alias method on a given trait group.
     */
    function setAliasTable(
        uint256 groupId,
        uint256[] calldata aliasProb,
        uint256[] calldata aliasIndices
    ) external;

    /**
     * @notice For a given 256-bit DNA seed, returns an array of traitIds
     *         by splitting that seed into 6 segments and performing alias picks.
     */
    function getTraitIdsFromDNA(
        uint256 dnaSeed
    ) external view returns (uint256[] memory traitIds);

    /**
     * @notice Picks a single trait from `groupId` using the 4-byte random `rand32`
     *         and the alias-based selection table.
     */
    function pickTrait(
        uint256 groupId,
        uint32 rand32
    ) external view returns (uint256);

    /**
     * @notice Composes a final SVG string by layering the PNG data corresponding to `traitIds`.
     */
    function renderAsSvg(
        uint256[] memory traitIds
    ) external view returns (string memory);

    /**
     * @notice Produces a token URI (as base64-encoded JSON) for the given `tokenId` and `dnaSeed`.
     */
    function tokenURI(
        uint256 tokenId,
        uint256 dnaSeed
    ) external view returns (string memory);
}

File 3 of 11 : IExclusiveDelegateResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

interface IExclusiveDelegateResolver {
    function DELEGATE_REGISTRY() external view returns (address);

    function GLOBAL_DELEGATION() external view returns (bytes24);

    function exclusiveWalletByRights(
        address vault,
        bytes24 rights
    ) external view returns (address wallet);

    function delegatedWalletsByRights(
        address wallet,
        bytes24 rights
    ) external view returns (address[] memory wallets);

    function exclusiveOwnerByRights(
        address contractAddress,
        uint256 tokenId,
        bytes24 rights
    ) external view returns (address owner);

    function decodeRightsExpiration(
        bytes32 rights
    ) external pure returns (bytes24 rightsIdentifier, uint40 expiration);

    function generateRightsWithExpiration(
        bytes24 rightsIdentifier,
        uint40 expiration
    ) external pure returns (bytes32);
}

File 4 of 11 : DN404.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @title DN404
/// @notice DN404 is a hybrid ERC20 and ERC721 implementation that mints
/// and burns NFTs based on an account's ERC20 token balance.
///
/// @author vectorized.eth (@optimizoor)
/// @author Quit (@0xQuit)
/// @author Michael Amadi (@AmadiMichaels)
/// @author cygaar (@0xCygaar)
/// @author Thomas (@0xjustadev)
/// @author Harrison (@PopPunkOnChain)
///
/// @dev Note:
/// - The ERC721 data is stored in this base DN404 contract, however a
///   DN404Mirror contract ***MUST*** be deployed and linked during
///   initialization.
/// - For ERC20 transfers, the most recently acquired NFT will be burned / transferred out first.
/// - A unit worth of ERC20 tokens equates to a deed to one NFT token.
///   The skip NFT status determines if this deed is automatically exercised.
///   An account can configure their skip NFT status.
///     * If `getSkipNFT(owner) == true`, ERC20 mints / transfers to `owner`
///       will NOT trigger NFT mints / transfers to `owner` (i.e. deeds are left unexercised).
///     * If `getSkipNFT(owner) == false`, ERC20 mints / transfers to `owner`
///       will trigger NFT mints / transfers to `owner`, until the NFT balance of `owner`
///       is equal to its ERC20 balance divided by the unit (rounded down).
/// - Invariant: `mirror.balanceOf(owner) <= base.balanceOf(owner) / _unit()`.
/// - The gas costs for automatic minting / transferring / burning of NFTs is O(n).
///   This can exceed the block gas limit.
///   Applications and users may need to break up large transfers into a few transactions.
/// - This implementation does not support "safe" transfers for automatic NFT transfers.
/// - The ERC20 token allowances and ERC721 token / operator approvals are separate.
/// - For MEV safety, users should NOT have concurrently open orders for the ERC20 and ERC721.
abstract contract DN404 {
    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                           ENUMS                            */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Denotes the default skip NFT status.
    /// Override `_skipNFTDefault` to return a preferred value (defaults to `HasCode`).
    enum SkipNFTDefault {
        // `On` if the ERC20 owner has code, else `Off`.
        HasCode,
        // Skip NFT (ERC20 transfers will NOT trigger NFT minting / burning / transferring).
        On,
        // NOT skip NFT (ERC20 transfers will trigger NFT minting / burning / transferring).
        Off
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                           EVENTS                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Emitted when `amount` tokens is transferred from `from` to `to`.
    event Transfer(address indexed from, address indexed to, uint256 amount);

    /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`.
    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /// @dev Emitted when `owner` sets their skipNFT flag to `status`.
    event SkipNFTSet(address indexed owner, bool status);

    /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`.
    uint256 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`.
    uint256 private constant _APPROVAL_EVENT_SIGNATURE =
        0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925;

    /// @dev `keccak256(bytes("SkipNFTSet(address,bool)"))`.
    uint256 private constant _SKIP_NFT_SET_EVENT_SIGNATURE =
        0xb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d6420393;

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CUSTOM ERRORS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Thrown when attempting to double-initialize the contract.
    error DNAlreadyInitialized();

    /// @dev The function can only be called after the contract has been initialized.
    error DNNotInitialized();

    /// @dev Thrown when attempting to transfer or burn more tokens than sender's balance.
    error InsufficientBalance();

    /// @dev Thrown when a spender attempts to transfer tokens with an insufficient allowance.
    error InsufficientAllowance();

    /// @dev Thrown when minting an amount of tokens that would overflow the max tokens.
    error TotalSupplyOverflow();

    /// @dev The unit must be greater than zero and less than `2**96`.
    error InvalidUnit();

    /// @dev Thrown when the caller for a fallback NFT function is not the mirror contract.
    error SenderNotMirror();

    /// @dev Thrown when attempting to transfer tokens to the zero address.
    error TransferToZeroAddress();

    /// @dev Thrown when the mirror address provided for initialization is the zero address.
    error MirrorAddressIsZero();

    /// @dev Thrown when the link call to the mirror contract reverts.
    error LinkMirrorContractFailed();

    /// @dev Thrown when setting an NFT token approval
    /// and the caller is not the owner or an approved operator.
    error ApprovalCallerNotOwnerNorApproved();

    /// @dev Thrown when transferring an NFT
    /// and the caller is not the owner or an approved operator.
    error TransferCallerNotOwnerNorApproved();

    /// @dev Thrown when transferring an NFT and the from address is not the current owner.
    error TransferFromIncorrectOwner();

    /// @dev Thrown when checking the owner or approved address for a non-existent NFT.
    error TokenDoesNotExist();

    /// @dev The function selector is not recognized.
    error FnSelectorNotRecognized();

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                         CONSTANTS                          */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev The flag to denote that the skip NFT flag is initialized.
    uint8 internal constant _ADDRESS_DATA_SKIP_NFT_INITIALIZED_FLAG = 1 << 0;

    /// @dev The flag to denote that the address should skip NFTs.
    uint8 internal constant _ADDRESS_DATA_SKIP_NFT_FLAG = 1 << 1;

    /// @dev The flag to denote that the address has overridden the default Permit2 allowance.
    uint8 internal constant _ADDRESS_DATA_OVERRIDE_PERMIT2_FLAG = 1 << 2;

    /// @dev The canonical Permit2 address.
    /// For signature-based allowance granting for single transaction ERC20 `transferFrom`.
    /// Enabled by default. In Permit2 we trust.
    /// To disable, override `_givePermit2DefaultInfiniteAllowance()`.
    /// [Github](https://github.com/Uniswap/permit2)
    /// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)
    address internal constant _PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;

    /// @dev The ZKsync Permit2 deployment.
    /// If deploying on ZKsync or Abstract, override `_isPermit2(address)` to check against this too.
    /// [Etherscan](https://era.zksync.network/address/0x0000000000225e31D15943971F47aD3022F714Fa)
    address internal constant _ZKSYNC_PERMIT_2 = 0x0000000000225e31D15943971F47aD3022F714Fa;

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                          STORAGE                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Struct containing an address's token data and settings.
    struct AddressData {
        // Auxiliary data.
        uint88 aux;
        // Flags for `initialized` and `skipNFT`.
        uint8 flags;
        // The alias for the address. Zero means absence of an alias.
        uint32 addressAlias;
        // The number of NFT tokens.
        uint32 ownedLength;
        // The token balance in wei.
        uint96 balance;
    }

    /// @dev A uint32 map in storage.
    struct Uint32Map {
        uint256 spacer;
    }

    /// @dev A bitmap in storage.
    struct Bitmap {
        uint256 spacer;
    }

    /// @dev A struct to wrap a uint256 in storage.
    struct Uint256Ref {
        uint256 value;
    }

    /// @dev A mapping of an address pair to a Uint256Ref.
    struct AddressPairToUint256RefMap {
        uint256 spacer;
    }

    /// @dev Struct containing the base token contract storage.
    struct DN404Storage {
        // Current number of address aliases assigned.
        uint32 numAliases;
        // Next NFT ID to assign for a mint.
        uint32 nextTokenId;
        // The head of the burned pool.
        uint32 burnedPoolHead;
        // The tail of the burned pool.
        uint32 burnedPoolTail;
        // Total number of NFTs in existence.
        uint32 totalNFTSupply;
        // Total supply of tokens.
        uint96 totalSupply;
        // Address of the NFT mirror contract.
        address mirrorERC721;
        // Mapping of a user alias number to their address.
        mapping(uint32 => address) aliasToAddress;
        // Mapping of user operator approvals for NFTs.
        AddressPairToUint256RefMap operatorApprovals;
        // Mapping of NFT approvals to approved operators.
        mapping(uint256 => address) nftApprovals;
        // Bitmap of whether an non-zero NFT approval may exist.
        Bitmap mayHaveNFTApproval;
        // Bitmap of whether a NFT ID exists. Ignored if `_useExistsLookup()` returns false.
        Bitmap exists;
        // Mapping of user allowances for ERC20 spenders.
        AddressPairToUint256RefMap allowance;
        // Mapping of NFT IDs owned by an address.
        mapping(address => Uint32Map) owned;
        // The pool of burned NFT IDs.
        Uint32Map burnedPool;
        // Even indices: owner aliases. Odd indices: owned indices.
        Uint32Map oo;
        // Mapping of user account AddressData.
        mapping(address => AddressData) addressData;
    }

    /// @dev Returns a storage pointer for DN404Storage.
    function _getDN404Storage() internal pure virtual returns (DN404Storage storage $) {
        /// @solidity memory-safe-assembly
        assembly {
            // `uint72(bytes9(keccak256("DN404_STORAGE")))`.
            $.slot := 0xa20d6e21d0e5255308 // Truncate to 9 bytes to reduce bytecode size.
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                         INITIALIZER                        */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Initializes the DN404 contract with an
    /// `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address.
    ///
    /// Note: The `initialSupplyOwner` will have their skip NFT status set to true.
    function _initializeDN404(
        uint256 initialTokenSupply,
        address initialSupplyOwner,
        address mirror
    ) internal virtual {
        DN404Storage storage $ = _getDN404Storage();

        unchecked {
            if (_unit() - 1 >= 2 ** 96 - 1) _rv(uint32(InvalidUnit.selector));
        }
        if ($.mirrorERC721 != address(0)) _rv(uint32(DNAlreadyInitialized.selector));
        if (mirror == address(0)) _rv(uint32(MirrorAddressIsZero.selector));

        /// @solidity memory-safe-assembly
        assembly {
            // Make the call to link the mirror contract.
            mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`.
            mstore(0x20, caller())
            if iszero(and(eq(mload(0x00), 1), call(gas(), mirror, 0, 0x1c, 0x24, 0x00, 0x20))) {
                mstore(0x00, 0xd125259c) // `LinkMirrorContractFailed()`.
                revert(0x1c, 0x04)
            }
            // Query `owner()` on this contract, and if it is non-zero, call `pullOwner()` on the mirror.
            // This allows for any Ownable (e.g. OpenZeppelin, Solady).
            mstore(0x00, 0x8da5cb5b6cef16e6) // `owner()` and `pullOwner()`.
            if and(
                lt(iszero(shl(96, mload(0x20))), gt(returndatasize(), 0x1f)),
                staticcall(gas(), address(), 0x18, 0x04, 0x20, 0x20)
            ) { if iszero(call(gas(), mirror, 0, 0x1c, 0x04, 0x00, 0x00)) { revert(0x00, 0x00) } }
        }

        $.nextTokenId = uint32(_toUint(_useOneIndexed()));
        $.mirrorERC721 = mirror;

        if (initialTokenSupply != 0) {
            if (initialSupplyOwner == address(0)) _rv(uint32(TransferToZeroAddress.selector));
            if (_totalSupplyOverflows(initialTokenSupply)) {
                _rv(uint32(TotalSupplyOverflow.selector));
            }

            $.totalSupply = uint96(initialTokenSupply);
            AddressData storage initialOwnerAddressData = $.addressData[initialSupplyOwner];
            initialOwnerAddressData.balance = uint96(initialTokenSupply);

            /// @solidity memory-safe-assembly
            assembly {
                // Emit the {Transfer} event.
                mstore(0x00, initialTokenSupply)
                log3(0x00, 0x20, _TRANSFER_EVENT_SIGNATURE, 0, shr(96, shl(96, initialSupplyOwner)))
            }

            _setSkipNFT(initialSupplyOwner, true);
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*               BASE UNIT FUNCTION TO OVERRIDE               */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Amount of token balance that is equal to one NFT.
    ///
    /// Note: The return value MUST be kept constant after `_initializeDN404` is called.
    function _unit() internal view virtual returns (uint256) {
        return 10 ** 18;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*               METADATA FUNCTIONS TO OVERRIDE               */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the name of the token.
    function name() public view virtual returns (string memory);

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

    /// @dev Returns the Uniform Resource Identifier (URI) for token `id`.
    function _tokenURI(uint256 id) internal view virtual returns (string memory);

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                       CONFIGURABLES                        */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the default mode for the skip NFT status.
    function _skipNFTDefault() internal view virtual returns (SkipNFTDefault) {
        return SkipNFTDefault.HasCode;
    }

    /// @dev Returns whether the tokens IDs are from `[1..n]` instead of `[0..n-1]`.
    function _useOneIndexed() internal pure virtual returns (bool) {
        return true;
    }

    /// @dev Returns if direct NFT transfers should be used during ERC20 transfers
    /// whenever possible, instead of burning and re-minting.
    function _useDirectTransfersIfPossible() internal view virtual returns (bool) {
        return true;
    }

    /// @dev Returns if burns should be added to the burn pool.
    /// This returns false by default, which means the NFT IDs are re-minted in a cycle.
    function _addToBurnedPool(uint256 totalNFTSupplyAfterBurn, uint256 totalSupplyAfterBurn)
        internal
        view
        virtual
        returns (bool)
    {
        // Silence unused variable compiler warning.
        totalSupplyAfterBurn = totalNFTSupplyAfterBurn;
        return false;
    }

    /// @dev Returns whether to use the exists bitmap for more efficient
    /// scanning of an empty token ID slot.
    /// Recommended for collections that do not use the burn pool,
    /// and are expected to have nearly all possible NFTs materialized.
    ///
    /// Note: The returned value must be constant after initialization.
    function _useExistsLookup() internal view virtual returns (bool) {
        return true;
    }

    /// @dev Hook that is called after a batch of NFT transfers.
    /// The lengths of `from`, `to`, and `ids` are guaranteed to be the same.
    function _afterNFTTransfers(address[] memory from, address[] memory to, uint256[] memory ids)
        internal
        virtual
    {}

    /// @dev Override this function to return true if `_afterNFTTransfers` is used.
    /// This is to help the compiler avoid producing dead bytecode.
    function _useAfterNFTTransfers() internal virtual returns (bool) {}

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                      ERC20 OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the decimals places of the token. Defaults to 18.
    /// Does not affect DN404's internal calculations.
    /// Will only affect the frontend UI on most protocols.
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /// @dev Returns the amount of tokens in existence.
    function totalSupply() public view virtual returns (uint256) {
        return uint256(_getDN404Storage().totalSupply);
    }

    /// @dev Returns the amount of tokens owned by `owner`.
    function balanceOf(address owner) public view virtual returns (uint256) {
        return _getDN404Storage().addressData[owner].balance;
    }

    /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`.
    function allowance(address owner, address spender) public view returns (uint256) {
        if (_givePermit2DefaultInfiniteAllowance() && _isPermit2(spender)) {
            uint8 flags = _getDN404Storage().addressData[owner].flags;
            if ((flags & _ADDRESS_DATA_OVERRIDE_PERMIT2_FLAG) == uint256(0)) {
                return type(uint256).max;
            }
        }
        return _ref(_getDN404Storage().allowance, owner, spender).value;
    }

    /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
    ///
    /// Emits a {Approval} event.
    function approve(address spender, uint256 amount) public virtual returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    /// @dev Transfer `amount` tokens from the caller to `to`.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is
    /// set to false.
    ///
    /// Requirements:
    /// - `from` must at least have `amount`.
    ///
    /// Emits a {Transfer} event.
    function transfer(address to, uint256 amount) public virtual returns (bool) {
        _transfer(msg.sender, to, amount);
        return true;
    }

    /// @dev Transfers `amount` tokens from `from` to `to`.
    ///
    /// Note: Does not update the allowance if it is the maximum uint256 value.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is
    /// set to false.
    ///
    /// Requirements:
    /// - `from` must at least have `amount`.
    /// - The caller must have at least `amount` of allowance to transfer the tokens of `from`.
    ///
    /// Emits a {Transfer} event.
    function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {
        Uint256Ref storage a = _ref(_getDN404Storage().allowance, from, msg.sender);

        uint256 allowed = _givePermit2DefaultInfiniteAllowance() && _isPermit2(msg.sender)
            && (_getDN404Storage().addressData[from].flags & _ADDRESS_DATA_OVERRIDE_PERMIT2_FLAG)
                == uint256(0) ? type(uint256).max : a.value;

        if (allowed != type(uint256).max) {
            if (amount > allowed) _rv(uint32(InsufficientAllowance.selector));
            unchecked {
                a.value = allowed - amount;
            }
        }
        _transfer(from, to, amount);
        return true;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                          PERMIT2                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Whether Permit2 has infinite allowances by default for all owners.
    /// For signature-based allowance granting for single transaction ERC20 `transferFrom`.
    /// To disable, override this function to return false.
    ///
    /// Note: The returned value SHOULD be kept constant after tokens have been minted.
    /// If the returned value changes from false to true and vice-versa,
    /// it can override the user customized allowances for Permit2 to infinity.
    function _givePermit2DefaultInfiniteAllowance() internal view virtual returns (bool) {
        return true;
    }

    /// @dev Returns checks if `sender` is the canonical Permit2 address.
    /// If on ZKsync, override this function to check against `_ZKSYNC_PERMIT_2` as well.
    function _isPermit2(address sender) internal view virtual returns (bool) {
        return sender == _PERMIT2;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                  INTERNAL MINT FUNCTIONS                   */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Mints `amount` tokens to `to`, increasing the total supply.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is set to false.
    ///
    /// Note:
    /// - May mint more NFTs than `amount / _unit()`.
    ///   The number of NFTs minted is what is needed to make `to`'s NFT balance whole.
    /// - Token IDs wraps back to `_toUint(_useOneIndexed())` upon exceeding the upper limit.
    ///
    /// Emits a {Transfer} event.
    function _mint(address to, uint256 amount) internal virtual {
        if (to == address(0)) _rv(uint32(TransferToZeroAddress.selector));

        DN404Storage storage $ = _getDN404Storage();
        if ($.mirrorERC721 == address(0)) _rv(uint32(DNNotInitialized.selector));
        AddressData storage toAddressData = $.addressData[to];

        _DNMintTemps memory t;
        unchecked {
            {
                uint256 toBalance = uint256(toAddressData.balance) + amount;
                toAddressData.balance = uint96(toBalance);
                t.toEnd = toBalance / _unit();
            }
            uint256 idLimit;
            {
                uint256 newTotalSupply = uint256($.totalSupply) + amount;
                $.totalSupply = uint96(newTotalSupply);
                uint256 overflows = _toUint(_totalSupplyOverflows(newTotalSupply));
                if (overflows | _toUint(newTotalSupply < amount) != 0) {
                    _rv(uint32(TotalSupplyOverflow.selector));
                }
                idLimit = newTotalSupply / _unit();
            }
            while (!getSkipNFT(to)) {
                Uint32Map storage toOwned = $.owned[to];
                Uint32Map storage oo = $.oo;
                uint256 toIndex = toAddressData.ownedLength;
                if ((t.numNFTMints = _zeroFloorSub(t.toEnd, toIndex)) == uint256(0)) break;

                t.packedLogs = _packedLogsMalloc(t.numNFTMints);
                _packedLogsSet(t.packedLogs, to, 0);
                $.totalNFTSupply += uint32(t.numNFTMints);
                toAddressData.ownedLength = uint32(t.toEnd);
                t.toAlias = _registerAndResolveAlias(toAddressData, to);
                uint32 burnedPoolHead = $.burnedPoolHead;
                t.burnedPoolTail = $.burnedPoolTail;
                t.nextTokenId = _wrapNFTId($.nextTokenId, idLimit);
                // Mint loop.
                do {
                    uint256 id;
                    if (burnedPoolHead != t.burnedPoolTail) {
                        id = _get($.burnedPool, burnedPoolHead++);
                    } else {
                        id = t.nextTokenId;
                        while (_get(oo, _ownershipIndex(id)) != 0) {
                            id = _useExistsLookup()
                                ? _wrapNFTId(_findFirstUnset($.exists, id + 1, idLimit), idLimit)
                                : _wrapNFTId(id + 1, idLimit);
                        }
                        t.nextTokenId = _wrapNFTId(id + 1, idLimit);
                    }
                    if (_useExistsLookup()) _set($.exists, id, true);
                    _set(toOwned, toIndex, uint32(id));
                    _setOwnerAliasAndOwnedIndex(oo, id, t.toAlias, uint32(toIndex++));
                    _packedLogsAppend(t.packedLogs, id);
                } while (toIndex != t.toEnd);

                $.nextTokenId = uint32(t.nextTokenId);
                $.burnedPoolHead = burnedPoolHead;
                _packedLogsSend(t.packedLogs, $);
                break;
            }
        }
        /// @solidity memory-safe-assembly
        assembly {
            // Emit the {Transfer} event.
            mstore(0x00, amount)
            log3(0x00, 0x20, _TRANSFER_EVENT_SIGNATURE, 0, shr(96, shl(96, to)))
        }
        if (_useAfterNFTTransfers()) {
            _afterNFTTransfers(
                _zeroAddresses(t.numNFTMints),
                _filled(t.numNFTMints, to),
                _packedLogsIds(t.packedLogs)
            );
        }
    }

    /// @dev Mints `amount` tokens to `to`, increasing the total supply.
    /// This variant mints NFT tokens starting from ID
    /// `preTotalSupply / _unit() + _toUint(_useOneIndexed())`.
    /// The `nextTokenId` will not be changed.
    /// If any NFTs are minted, the burned pool will be invalidated (emptied).
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is set to false.
    ///
    /// Note:
    /// - May mint more NFTs than `amount / _unit()`.
    ///   The number of NFTs minted is what is needed to make `to`'s NFT balance whole.
    /// - Token IDs wraps back to `_toUint(_useOneIndexed())` upon exceeding the upper limit.
    ///
    /// Emits a {Transfer} event.
    function _mintNext(address to, uint256 amount) internal virtual {
        if (to == address(0)) _rv(uint32(TransferToZeroAddress.selector));

        DN404Storage storage $ = _getDN404Storage();
        if ($.mirrorERC721 == address(0)) _rv(uint32(DNNotInitialized.selector));
        AddressData storage toAddressData = $.addressData[to];

        _DNMintTemps memory t;
        unchecked {
            {
                uint256 toBalance = uint256(toAddressData.balance) + amount;
                toAddressData.balance = uint96(toBalance);
                t.toEnd = toBalance / _unit();
            }
            uint256 id;
            uint256 idLimit;
            {
                uint256 preTotalSupply = uint256($.totalSupply);
                uint256 newTotalSupply = uint256(preTotalSupply) + amount;
                $.totalSupply = uint96(newTotalSupply);
                uint256 overflows = _toUint(_totalSupplyOverflows(newTotalSupply));
                if (overflows | _toUint(newTotalSupply < amount) != 0) {
                    _rv(uint32(TotalSupplyOverflow.selector));
                }
                idLimit = newTotalSupply / _unit();
                id = _wrapNFTId(preTotalSupply / _unit() + _toUint(_useOneIndexed()), idLimit);
            }
            while (!getSkipNFT(to)) {
                Uint32Map storage toOwned = $.owned[to];
                Uint32Map storage oo = $.oo;
                uint256 toIndex = toAddressData.ownedLength;
                if ((t.numNFTMints = _zeroFloorSub(t.toEnd, toIndex)) == uint256(0)) break;

                t.packedLogs = _packedLogsMalloc(t.numNFTMints);
                // Invalidate (empty) the burned pool.
                $.burnedPoolHead = 0;
                $.burnedPoolTail = 0;
                _packedLogsSet(t.packedLogs, to, 0);
                $.totalNFTSupply += uint32(t.numNFTMints);
                toAddressData.ownedLength = uint32(t.toEnd);
                t.toAlias = _registerAndResolveAlias(toAddressData, to);
                // Mint loop.
                do {
                    while (_get(oo, _ownershipIndex(id)) != 0) {
                        id = _useExistsLookup()
                            ? _wrapNFTId(_findFirstUnset($.exists, id + 1, idLimit), idLimit)
                            : _wrapNFTId(id + 1, idLimit);
                    }
                    if (_useExistsLookup()) _set($.exists, id, true);
                    _set(toOwned, toIndex, uint32(id));
                    _setOwnerAliasAndOwnedIndex(oo, id, t.toAlias, uint32(toIndex++));
                    _packedLogsAppend(t.packedLogs, id);
                    id = _wrapNFTId(id + 1, idLimit);
                } while (toIndex != t.toEnd);

                _packedLogsSend(t.packedLogs, $);
                break;
            }
        }
        /// @solidity memory-safe-assembly
        assembly {
            // Emit the {Transfer} event.
            mstore(0x00, amount)
            log3(0x00, 0x20, _TRANSFER_EVENT_SIGNATURE, 0, shr(96, shl(96, to)))
        }
        if (_useAfterNFTTransfers()) {
            _afterNFTTransfers(
                _zeroAddresses(t.numNFTMints),
                _filled(t.numNFTMints, to),
                _packedLogsIds(t.packedLogs)
            );
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                  INTERNAL BURN FUNCTIONS                   */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Burns `amount` tokens from `from`, reducing the total supply.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Emits a {Transfer} event.
    function _burn(address from, uint256 amount) internal virtual {
        DN404Storage storage $ = _getDN404Storage();
        if ($.mirrorERC721 == address(0)) _rv(uint32(DNNotInitialized.selector));

        AddressData storage fromAddressData = $.addressData[from];
        _DNBurnTemps memory t;

        unchecked {
            t.fromBalance = fromAddressData.balance;
            if (amount > t.fromBalance) _rv(uint32(InsufficientBalance.selector));

            fromAddressData.balance = uint96(t.fromBalance -= amount);
            t.totalSupply = uint256($.totalSupply) - amount;
            $.totalSupply = uint96(t.totalSupply);

            Uint32Map storage fromOwned = $.owned[from];
            uint256 fromIndex = fromAddressData.ownedLength;
            t.numNFTBurns = _zeroFloorSub(fromIndex, t.fromBalance / _unit());

            if (t.numNFTBurns != 0) {
                t.packedLogs = _packedLogsMalloc(t.numNFTBurns);
                _packedLogsSet(t.packedLogs, from, 1);
                bool addToBurnedPool;
                {
                    uint256 totalNFTSupply = uint256($.totalNFTSupply) - t.numNFTBurns;
                    $.totalNFTSupply = uint32(totalNFTSupply);
                    addToBurnedPool = _addToBurnedPool(totalNFTSupply, t.totalSupply);
                }

                Uint32Map storage oo = $.oo;
                uint256 fromEnd = fromIndex - t.numNFTBurns;
                fromAddressData.ownedLength = uint32(fromEnd);
                uint32 burnedPoolTail = $.burnedPoolTail;
                // Burn loop.
                do {
                    uint256 id = _get(fromOwned, --fromIndex);
                    _setOwnerAliasAndOwnedIndex(oo, id, 0, 0);
                    _packedLogsAppend(t.packedLogs, id);
                    if (_useExistsLookup()) _set($.exists, id, false);
                    if (addToBurnedPool) _set($.burnedPool, burnedPoolTail++, uint32(id));
                    if (_get($.mayHaveNFTApproval, id)) {
                        _set($.mayHaveNFTApproval, id, false);
                        delete $.nftApprovals[id];
                    }
                } while (fromIndex != fromEnd);

                if (addToBurnedPool) $.burnedPoolTail = burnedPoolTail;
                _packedLogsSend(t.packedLogs, $);
            }
        }
        /// @solidity memory-safe-assembly
        assembly {
            // Emit the {Transfer} event.
            mstore(0x00, amount)
            log3(0x00, 0x20, _TRANSFER_EVENT_SIGNATURE, shr(96, shl(96, from)), 0)
        }
        if (_useAfterNFTTransfers()) {
            _afterNFTTransfers(
                _filled(t.numNFTBurns, from),
                _zeroAddresses(t.numNFTBurns),
                _packedLogsIds(t.packedLogs)
            );
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                INTERNAL TRANSFER FUNCTIONS                 */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Moves `amount` of tokens from `from` to `to`.
    ///
    /// Will burn sender NFTs if balance after transfer is less than
    /// the amount required to support the current NFT balance.
    ///
    /// Will mint NFTs to `to` if the recipient's new balance supports
    /// additional NFTs ***AND*** the `to` address's skipNFT flag is
    /// set to false.
    ///
    /// Emits a {Transfer} event.
    function _transfer(address from, address to, uint256 amount) internal virtual {
        if (to == address(0)) _rv(uint32(TransferToZeroAddress.selector));

        DN404Storage storage $ = _getDN404Storage();
        AddressData storage fromAddressData = $.addressData[from];
        AddressData storage toAddressData = $.addressData[to];
        if ($.mirrorERC721 == address(0)) _rv(uint32(DNNotInitialized.selector));

        _DNTransferTemps memory t;
        t.fromOwnedLength = fromAddressData.ownedLength;
        t.toOwnedLength = toAddressData.ownedLength;

        unchecked {
            {
                uint256 fromBalance = fromAddressData.balance;
                if (amount > fromBalance) _rv(uint32(InsufficientBalance.selector));
                fromAddressData.balance = uint96(fromBalance -= amount);

                uint256 toBalance = uint256(toAddressData.balance) + amount;
                toAddressData.balance = uint96(toBalance);
                t.numNFTBurns = _zeroFloorSub(t.fromOwnedLength, fromBalance / _unit());

                if (!getSkipNFT(to)) {
                    if (from == to) t.toOwnedLength = t.fromOwnedLength - t.numNFTBurns;
                    t.numNFTMints = _zeroFloorSub(toBalance / _unit(), t.toOwnedLength);
                }
            }

            while (_useDirectTransfersIfPossible()) {
                uint256 n = _min(t.fromOwnedLength, _min(t.numNFTBurns, t.numNFTMints));
                if (n == uint256(0)) break;
                t.numNFTBurns -= n;
                t.numNFTMints -= n;
                if (from == to) {
                    t.toOwnedLength += n;
                    break;
                }
                t.directLogs = _directLogsMalloc(n, from, to);
                Uint32Map storage fromOwned = $.owned[from];
                Uint32Map storage toOwned = $.owned[to];
                t.toAlias = _registerAndResolveAlias(toAddressData, to);
                uint256 toIndex = t.toOwnedLength;
                n = toIndex + n;
                // Direct transfer loop.
                do {
                    uint256 id = _get(fromOwned, --t.fromOwnedLength);
                    _set(toOwned, toIndex, uint32(id));
                    _setOwnerAliasAndOwnedIndex($.oo, id, t.toAlias, uint32(toIndex));
                    _directLogsAppend(t.directLogs, id);
                    if (_get($.mayHaveNFTApproval, id)) {
                        _set($.mayHaveNFTApproval, id, false);
                        delete $.nftApprovals[id];
                    }
                } while (++toIndex != n);

                toAddressData.ownedLength = uint32(t.toOwnedLength = toIndex);
                fromAddressData.ownedLength = uint32(t.fromOwnedLength);
                break;
            }

            t.totalNFTSupply = uint256($.totalNFTSupply) + t.numNFTMints - t.numNFTBurns;
            $.totalNFTSupply = uint32(t.totalNFTSupply);

            Uint32Map storage oo = $.oo;
            t.packedLogs = _packedLogsMalloc(t.numNFTBurns + t.numNFTMints);

            t.burnedPoolTail = $.burnedPoolTail;
            if (t.numNFTBurns != 0) {
                _packedLogsSet(t.packedLogs, from, 1);
                bool addToBurnedPool = _addToBurnedPool(t.totalNFTSupply, $.totalSupply);
                Uint32Map storage fromOwned = $.owned[from];
                uint256 fromIndex = t.fromOwnedLength;
                fromAddressData.ownedLength = uint32(t.fromEnd = fromIndex - t.numNFTBurns);
                uint32 burnedPoolTail = t.burnedPoolTail;
                // Burn loop.
                do {
                    uint256 id = _get(fromOwned, --fromIndex);
                    _setOwnerAliasAndOwnedIndex(oo, id, 0, 0);
                    _packedLogsAppend(t.packedLogs, id);
                    if (_useExistsLookup()) _set($.exists, id, false);
                    if (addToBurnedPool) _set($.burnedPool, burnedPoolTail++, uint32(id));
                    if (_get($.mayHaveNFTApproval, id)) {
                        _set($.mayHaveNFTApproval, id, false);
                        delete $.nftApprovals[id];
                    }
                } while (fromIndex != t.fromEnd);

                if (addToBurnedPool) $.burnedPoolTail = (t.burnedPoolTail = burnedPoolTail);
            }

            if (t.numNFTMints != 0) {
                _packedLogsSet(t.packedLogs, to, 0);
                Uint32Map storage toOwned = $.owned[to];
                t.toAlias = _registerAndResolveAlias(toAddressData, to);
                uint256 idLimit = $.totalSupply / _unit();
                t.nextTokenId = _wrapNFTId($.nextTokenId, idLimit);
                uint256 toIndex = t.toOwnedLength;
                toAddressData.ownedLength = uint32(t.toEnd = toIndex + t.numNFTMints);
                uint32 burnedPoolHead = $.burnedPoolHead;
                // Mint loop.
                do {
                    uint256 id;
                    if (burnedPoolHead != t.burnedPoolTail) {
                        id = _get($.burnedPool, burnedPoolHead++);
                    } else {
                        id = t.nextTokenId;
                        while (_get(oo, _ownershipIndex(id)) != 0) {
                            id = _useExistsLookup()
                                ? _wrapNFTId(_findFirstUnset($.exists, id + 1, idLimit), idLimit)
                                : _wrapNFTId(id + 1, idLimit);
                        }
                        t.nextTokenId = _wrapNFTId(id + 1, idLimit);
                    }
                    if (_useExistsLookup()) _set($.exists, id, true);
                    _set(toOwned, toIndex, uint32(id));
                    _setOwnerAliasAndOwnedIndex(oo, id, t.toAlias, uint32(toIndex++));
                    _packedLogsAppend(t.packedLogs, id);
                } while (toIndex != t.toEnd);

                $.burnedPoolHead = burnedPoolHead;
                $.nextTokenId = uint32(t.nextTokenId);
            }

            if (t.directLogs != bytes32(0)) _directLogsSend(t.directLogs, $);
            if (t.packedLogs != bytes32(0)) _packedLogsSend(t.packedLogs, $);
        }
        /// @solidity memory-safe-assembly
        assembly {
            // Emit the {Transfer} event.
            mstore(0x00, amount)
            // forgefmt: disable-next-item
            log3(0x00, 0x20, _TRANSFER_EVENT_SIGNATURE, shr(96, shl(96, from)), shr(96, shl(96, to)))
        }
        if (_useAfterNFTTransfers()) {
            uint256[] memory ids = _directLogsIds(t.directLogs);
            unchecked {
                _afterNFTTransfers(
                    _concat(
                        _filled(ids.length + t.numNFTBurns, from), _zeroAddresses(t.numNFTMints)
                    ),
                    _concat(
                        _concat(_filled(ids.length, to), _zeroAddresses(t.numNFTBurns)),
                        _filled(t.numNFTMints, to)
                    ),
                    _concat(ids, _packedLogsIds(t.packedLogs))
                );
            }
        }
    }

    /// @dev Transfers token `id` from `from` to `to`.
    /// Also emits an ERC721 {Transfer} event on the `mirrorERC721`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - `msgSender` must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function _initiateTransferFromNFT(address from, address to, uint256 id, address msgSender)
        internal
        virtual
    {
        // Emit ERC721 {Transfer} event.
        // We do this before the `_transferFromNFT`, as `_transferFromNFT` may use
        // the `_afterNFTTransfers` hook, which may trigger more transfers.
        // This helps keeps the sequence of emitted events consistent.
        // Since `mirrorERC721` is a trusted contract, we can do this.
        bytes32 directLogs = _directLogsMalloc(1, from, to);
        _directLogsAppend(directLogs, id);
        _directLogsSend(directLogs, _getDN404Storage());

        _transferFromNFT(from, to, id, msgSender);
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// This function will be called when a ERC721 transfer is made on the mirror contract.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - `msgSender` must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function _transferFromNFT(address from, address to, uint256 id, address msgSender)
        internal
        virtual
    {
        if (to == address(0)) _rv(uint32(TransferToZeroAddress.selector));

        DN404Storage storage $ = _getDN404Storage();
        if ($.mirrorERC721 == address(0)) _rv(uint32(DNNotInitialized.selector));

        Uint32Map storage oo = $.oo;

        if (from != $.aliasToAddress[_get(oo, _ownershipIndex(_restrictNFTId(id)))]) {
            _rv(uint32(TransferFromIncorrectOwner.selector));
        }

        if (msgSender != from) {
            if (!_isApprovedForAll(from, msgSender)) {
                if (_getApproved(id) != msgSender) {
                    _rv(uint32(TransferCallerNotOwnerNorApproved.selector));
                }
            }
        }

        AddressData storage fromAddressData = $.addressData[from];
        AddressData storage toAddressData = $.addressData[to];

        uint256 unit = _unit();
        mapping(address => Uint32Map) storage owned = $.owned;

        unchecked {
            uint256 fromBalance = fromAddressData.balance;
            if (unit > fromBalance) _rv(uint32(InsufficientBalance.selector));
            fromAddressData.balance = uint96(fromBalance - unit);
            toAddressData.balance += uint96(unit);
        }
        if (_get($.mayHaveNFTApproval, id)) {
            _set($.mayHaveNFTApproval, id, false);
            delete $.nftApprovals[id];
        }
        unchecked {
            Uint32Map storage fromOwned = owned[from];
            uint32 updatedId = _get(fromOwned, --fromAddressData.ownedLength);
            uint32 i = _get(oo, _ownedIndex(id));
            _set(fromOwned, i, updatedId);
            _set(oo, _ownedIndex(updatedId), i);
        }
        unchecked {
            uint32 n = toAddressData.ownedLength++;
            _set(owned[to], n, uint32(id));
            _setOwnerAliasAndOwnedIndex(oo, id, _registerAndResolveAlias(toAddressData, to), n);
        }
        /// @solidity memory-safe-assembly
        assembly {
            // Emit the {Transfer} event.
            mstore(0x00, unit)
            // forgefmt: disable-next-item
            log3(0x00, 0x20, _TRANSFER_EVENT_SIGNATURE, shr(96, shl(96, from)), shr(96, shl(96, to)))
        }
        if (_useAfterNFTTransfers()) {
            _afterNFTTransfers(_filled(1, from), _filled(1, to), _filled(1, id));
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                 INTERNAL APPROVE FUNCTIONS                 */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Sets `amount` as the allowance of `spender` over the tokens of `owner`.
    ///
    /// Emits a {Approval} event.
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        if (_givePermit2DefaultInfiniteAllowance() && _isPermit2(spender)) {
            _getDN404Storage().addressData[owner].flags |= _ADDRESS_DATA_OVERRIDE_PERMIT2_FLAG;
        }
        _ref(_getDN404Storage().allowance, owner, spender).value = amount;
        /// @solidity memory-safe-assembly
        assembly {
            // Emit the {Approval} event.
            mstore(0x00, amount)
            // forgefmt: disable-next-item
            log3(0x00, 0x20, _APPROVAL_EVENT_SIGNATURE, shr(96, shl(96, owner)), shr(96, shl(96, spender)))
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                 DATA HITCHHIKING FUNCTIONS                 */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the auxiliary data for `owner`.
    /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.
    /// Auxiliary data can be set for any address, even if it does not have any tokens.
    function _getAux(address owner) internal view virtual returns (uint88) {
        return _getDN404Storage().addressData[owner].aux;
    }

    /// @dev Set the auxiliary data for `owner` to `value`.
    /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.
    /// Auxiliary data can be set for any address, even if it does not have any tokens.
    function _setAux(address owner, uint88 value) internal virtual {
        _getDN404Storage().addressData[owner].aux = value;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     SKIP NFT FUNCTIONS                     */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns true if minting and transferring ERC20s to `owner` will skip minting NFTs.
    /// Returns false otherwise.
    function getSkipNFT(address owner) public view virtual returns (bool result) {
        uint8 flags = _getDN404Storage().addressData[owner].flags;
        result = flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0;
        if (flags & _ADDRESS_DATA_SKIP_NFT_INITIALIZED_FLAG == uint256(0)) {
            if (_skipNFTDefault() == SkipNFTDefault.HasCode) {
                /// @solidity memory-safe-assembly
                assembly {
                    result := iszero(iszero(extcodesize(owner)))
                }
            }
            if (_skipNFTDefault() == SkipNFTDefault.On) result = true;
            if (_skipNFTDefault() == SkipNFTDefault.Off) result = false;
        }
    }

    /// @dev Sets the caller's skipNFT flag to `skipNFT`. Returns true.
    ///
    /// Emits a {SkipNFTSet} event.
    function setSkipNFT(bool skipNFT) public virtual returns (bool) {
        _setSkipNFT(msg.sender, skipNFT);
        return true;
    }

    /// @dev Internal function to set account `owner` skipNFT flag to `state`
    ///
    /// Initializes account `owner` AddressData if it is not currently initialized.
    ///
    /// Emits a {SkipNFTSet} event.
    function _setSkipNFT(address owner, bool state) internal virtual {
        AddressData storage d = _getDN404Storage().addressData[owner];
        uint8 flags = d.flags;
        /// @solidity memory-safe-assembly
        assembly {
            let s := xor(iszero(and(flags, _ADDRESS_DATA_SKIP_NFT_FLAG)), iszero(state))
            flags := xor(mul(_ADDRESS_DATA_SKIP_NFT_FLAG, s), flags)
            flags := or(_ADDRESS_DATA_SKIP_NFT_INITIALIZED_FLAG, flags)
            mstore(0x00, iszero(iszero(state)))
            log2(0x00, 0x20, _SKIP_NFT_SET_EVENT_SIGNATURE, shr(96, shl(96, owner)))
        }
        d.flags = flags;
    }

    /// @dev Returns the `addressAlias` of account `to`.
    ///
    /// Assigns and registers the next alias if `to` alias was not previously registered.
    function _registerAndResolveAlias(AddressData storage toAddressData, address to)
        internal
        virtual
        returns (uint32 addressAlias)
    {
        DN404Storage storage $ = _getDN404Storage();
        addressAlias = toAddressData.addressAlias;
        if (addressAlias == uint256(0)) {
            unchecked {
                addressAlias = ++$.numAliases;
            }
            toAddressData.addressAlias = addressAlias;
            $.aliasToAddress[addressAlias] = to;
            if (addressAlias == uint256(0)) revert(); // Overflow.
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     MIRROR OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the address of the mirror NFT contract.
    function mirrorERC721() public view virtual returns (address) {
        return _getDN404Storage().mirrorERC721;
    }

    /// @dev Returns the total NFT supply.
    function _totalNFTSupply() internal view virtual returns (uint256) {
        return _getDN404Storage().totalNFTSupply;
    }

    /// @dev Returns `owner` NFT balance.
    function _balanceOfNFT(address owner) internal view virtual returns (uint256) {
        return _getDN404Storage().addressData[owner].ownedLength;
    }

    /// @dev Returns the owner of token `id`.
    /// Returns the zero address instead of reverting if the token does not exist.
    function _ownerAt(uint256 id) internal view virtual returns (address) {
        DN404Storage storage $ = _getDN404Storage();
        return $.aliasToAddress[_get($.oo, _ownershipIndex(_restrictNFTId(id)))];
    }

    /// @dev Returns the owner of token `id`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function _ownerOf(uint256 id) internal view virtual returns (address) {
        if (!_exists(id)) _rv(uint32(TokenDoesNotExist.selector));
        return _ownerAt(id);
    }

    /// @dev Returns whether `operator` is approved to manage the NFT tokens of `owner`.
    function _isApprovedForAll(address owner, address operator)
        internal
        view
        virtual
        returns (bool)
    {
        return _ref(_getDN404Storage().operatorApprovals, owner, operator).value != 0;
    }

    /// @dev Returns if token `id` exists.
    function _exists(uint256 id) internal view virtual returns (bool) {
        return _ownerAt(id) != address(0);
    }

    /// @dev Returns the account approved to manage token `id`.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function _getApproved(uint256 id) internal view virtual returns (address) {
        if (!_exists(id)) _rv(uint32(TokenDoesNotExist.selector));
        return _getDN404Storage().nftApprovals[id];
    }

    /// @dev Sets `spender` as the approved account to manage token `id`, using `msgSender`.
    ///
    /// Requirements:
    /// - `msgSender` must be the owner or an approved operator for the token owner.
    function _approveNFT(address spender, uint256 id, address msgSender)
        internal
        virtual
        returns (address owner)
    {
        DN404Storage storage $ = _getDN404Storage();

        owner = $.aliasToAddress[_get($.oo, _ownershipIndex(_restrictNFTId(id)))];

        if (msgSender != owner) {
            if (!_isApprovedForAll(owner, msgSender)) {
                _rv(uint32(ApprovalCallerNotOwnerNorApproved.selector));
            }
        }

        $.nftApprovals[id] = spender;
        _set($.mayHaveNFTApproval, id, spender != address(0));
    }

    /// @dev Approve or remove the `operator` as an operator for `msgSender`,
    /// without authorization checks.
    function _setApprovalForAll(address operator, bool approved, address msgSender)
        internal
        virtual
    {
        // For efficiency, we won't check if `operator` isn't `address(0)` (practically a no-op).
        _ref(_getDN404Storage().operatorApprovals, msgSender, operator).value = _toUint(approved);
    }

    /// @dev Returns the NFT IDs of `owner` in the range `[begin..end)` (exclusive of `end`).
    /// `begin` and `end` are indices in the owner's token ID array, not the entire token range.
    /// Optimized for smaller bytecode size, as this function is intended for off-chain calling.
    function _ownedIds(address owner, uint256 begin, uint256 end)
        internal
        view
        virtual
        returns (uint256[] memory ids)
    {
        DN404Storage storage $ = _getDN404Storage();
        Uint32Map storage owned = $.owned[owner];
        end = _min($.addressData[owner].ownedLength, end);
        /// @solidity memory-safe-assembly
        assembly {
            ids := mload(0x40)
            let i := begin
            for {} lt(i, end) { i := add(i, 1) } {
                let s := add(shl(96, owned.slot), shr(3, i)) // Storage slot.
                let id := and(0xffffffff, shr(shl(5, and(i, 7)), sload(s)))
                mstore(add(add(ids, 0x20), shl(5, sub(i, begin))), id) // Append to.
            }
            mstore(ids, sub(i, begin)) // Store the length.
            mstore(0x40, add(add(ids, 0x20), shl(5, sub(i, begin)))) // Allocate memory.
        }
    }

    /// @dev Fallback modifier to dispatch calls from the mirror NFT contract
    /// to internal functions in this contract.
    modifier dn404Fallback() virtual {
        DN404Storage storage $ = _getDN404Storage();

        uint256 fnSelector = _calldataload(0x00) >> 224;

        // `transferFromNFT(address,address,uint256,address)`.
        if (fnSelector == 0xe5eb36c8) {
            if (msg.sender != $.mirrorERC721) _rv(uint32(SenderNotMirror.selector));
            _transferFromNFT(
                address(uint160(_calldataload(0x04))), // `from`.
                address(uint160(_calldataload(0x24))), // `to`.
                _calldataload(0x44), // `id`.
                address(uint160(_calldataload(0x64))) // `msgSender`.
            );
            _return(1);
        }
        // `setApprovalForAllNFT(address,bool,address)`.
        if (fnSelector == 0xf6916ddd) {
            if (msg.sender != $.mirrorERC721) _rv(uint32(SenderNotMirror.selector));
            _setApprovalForAll(
                address(uint160(_calldataload(0x04))), // `spender`.
                _calldataload(0x24) != 0, // `status`.
                address(uint160(_calldataload(0x44))) // `msgSender`.
            );
            _return(1);
        }
        // `isApprovedForAllNFT(address,address)`.
        if (fnSelector == 0x62fb246d) {
            bool result = _isApprovedForAll(
                address(uint160(_calldataload(0x04))), // `owner`.
                address(uint160(_calldataload(0x24))) // `operator`.
            );
            _return(_toUint(result));
        }
        // `ownerOfNFT(uint256)`.
        if (fnSelector == 0x2d8a746e) {
            _return(uint160(_ownerOf(_calldataload(0x04))));
        }
        // `ownerAtNFT(uint256)`.
        if (fnSelector == 0xc016aa52) {
            _return(uint160(_ownerAt(_calldataload(0x04))));
        }
        // `approveNFT(address,uint256,address)`.
        if (fnSelector == 0xd10b6e0c) {
            if (msg.sender != $.mirrorERC721) _rv(uint32(SenderNotMirror.selector));
            address owner = _approveNFT(
                address(uint160(_calldataload(0x04))), // `spender`.
                _calldataload(0x24), // `id`.
                address(uint160(_calldataload(0x44))) // `msgSender`.
            );
            _return(uint160(owner));
        }
        // `getApprovedNFT(uint256)`.
        if (fnSelector == 0x27ef5495) {
            _return(uint160(_getApproved(_calldataload(0x04))));
        }
        // `balanceOfNFT(address)`.
        if (fnSelector == 0xf5b100ea) {
            _return(_balanceOfNFT(address(uint160(_calldataload(0x04)))));
        }
        // `totalNFTSupply()`.
        if (fnSelector == 0xe2c79281) {
            _return(_totalNFTSupply());
        }
        // `tokenURINFT(uint256)`.
        if (fnSelector == 0xcb30b460) {
            /// @solidity memory-safe-assembly
            assembly {
                mstore(0x40, add(mload(0x40), 0x20))
            }
            string memory uri = _tokenURI(_calldataload(0x04));
            /// @solidity memory-safe-assembly
            assembly {
                // Memory safe, as we've advanced the free memory pointer by a word.
                let o := sub(uri, 0x20) // Start of the returndata.
                let z := add(mload(uri), 0x40) // Unpadded length of returndata.
                mstore(add(o, z), 0) // Zeroize the word after the end of the string.
                mstore(o, 0x20) // Store the offset of `uri`.
                return(o, and(not(0x1f), add(0x1f, z)))
            }
        }
        // `implementsDN404()`.
        if (fnSelector == 0xb7a94eb8) {
            _return(1);
        }
        _;
    }

    /// @dev Fallback function for calls from mirror NFT contract.
    /// Override this if you need to implement your custom
    /// fallback with utilities like Solady's `LibZip.cdFallback()`.
    /// And always remember to always wrap the fallback with `dn404Fallback`.
    fallback() external payable virtual dn404Fallback {
        _rv(uint32(FnSelectorNotRecognized.selector)); // Not mandatory. Just for quality of life.
    }

    /// @dev This is to silence the compiler warning.
    /// Override and remove the revert if you want your contract to receive ETH via receive.
    receive() external payable virtual {
        if (msg.value != 0) revert();
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                 INTERNAL / PRIVATE HELPERS                 */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns `(i - _toUint(_useOneIndexed())) << 1`.
    function _ownershipIndex(uint256 i) internal pure returns (uint256) {
        unchecked {
            return (i - _toUint(_useOneIndexed())) << 1;
        }
    }

    /// @dev Returns `((i - _toUint(_useOneIndexed())) << 1) + 1`.
    function _ownedIndex(uint256 i) internal pure returns (uint256) {
        unchecked {
            return ((i - _toUint(_useOneIndexed())) << 1) + 1;
        }
    }

    /// @dev Returns the uint32 value at `index` in `map`.
    function _get(Uint32Map storage map, uint256 index) internal view returns (uint32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := add(shl(96, map.slot), shr(3, index)) // Storage slot.
            result := and(0xffffffff, shr(shl(5, and(index, 7)), sload(s)))
        }
    }

    /// @dev Updates the uint32 value at `index` in `map`.
    function _set(Uint32Map storage map, uint256 index, uint32 value) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let s := add(shl(96, map.slot), shr(3, index)) // Storage slot.
            let o := shl(5, and(index, 7)) // Storage slot offset (bits).
            let v := sload(s) // Storage slot value.
            sstore(s, xor(v, shl(o, and(0xffffffff, xor(value, shr(o, v))))))
        }
    }

    /// @dev Sets the owner alias and the owned index together.
    function _setOwnerAliasAndOwnedIndex(
        Uint32Map storage map,
        uint256 id,
        uint32 ownership,
        uint32 ownedIndex
    ) internal {
        uint256 t = _toUint(_useOneIndexed());
        /// @solidity memory-safe-assembly
        assembly {
            let i := sub(id, t) // Index of the uint64 combined value.
            let s := add(shl(96, map.slot), shr(2, i)) // Storage slot.
            let v := sload(s) // Storage slot value.
            let o := shl(6, and(i, 3)) // Storage slot offset (bits).
            let combined := or(shl(32, ownedIndex), and(0xffffffff, ownership))
            sstore(s, xor(v, shl(o, and(0xffffffffffffffff, xor(shr(o, v), combined)))))
        }
    }

    /// @dev Returns the boolean value of the bit at `index` in `bitmap`.
    function _get(Bitmap storage bitmap, uint256 index) internal view returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := add(shl(96, bitmap.slot), shr(8, index)) // Storage slot.
            result := and(1, shr(and(0xff, index), sload(s)))
        }
    }

    /// @dev Updates the bit at `index` in `bitmap` to `value`.
    function _set(Bitmap storage bitmap, uint256 index, bool value) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let s := add(shl(96, bitmap.slot), shr(8, index)) // Storage slot.
            let o := and(0xff, index) // Storage slot offset (bits).
            sstore(s, or(and(sload(s), not(shl(o, 1))), shl(o, iszero(iszero(value)))))
        }
    }

    /// @dev Returns the index of the least significant unset bit in `[begin..upTo]`.
    /// If no unset bit is found, returns `type(uint256).max`.
    function _findFirstUnset(Bitmap storage bitmap, uint256 begin, uint256 upTo)
        internal
        view
        returns (uint256 unsetBitIndex)
    {
        /// @solidity memory-safe-assembly
        assembly {
            unsetBitIndex := not(0) // Initialize to `type(uint256).max`.
            let s := shl(96, bitmap.slot) // Storage offset of the bitmap.
            let bucket := add(s, shr(8, begin))
            let negBits := shl(and(0xff, begin), shr(and(0xff, begin), not(sload(bucket))))
            if iszero(negBits) {
                let lastBucket := add(s, shr(8, upTo))
                for {} 1 {} {
                    bucket := add(bucket, 1)
                    negBits := not(sload(bucket))
                    if or(negBits, gt(bucket, lastBucket)) { break }
                }
                if gt(bucket, lastBucket) {
                    negBits := shr(and(0xff, not(upTo)), shl(and(0xff, not(upTo)), negBits))
                }
            }
            if negBits {
                // Find-first-set routine.
                // From: https://github.com/vectorized/solady/blob/main/src/utils/LibBit.sol
                let b := and(negBits, add(not(negBits), 1)) // Isolate the least significant bit.
                // For the upper 3 bits of the result, use a De Bruijn-like lookup.
                // Credit to adhusson: https://blog.adhusson.com/cheap-find-first-set-evm/
                // forgefmt: disable-next-item
                let r := shl(5, shr(252, shl(shl(2, shr(250, mul(b,
                    0x2aaaaaaaba69a69a6db6db6db2cb2cb2ce739ce73def7bdeffffffff))),
                    0x1412563212c14164235266736f7425221143267a45243675267677)))
                // For the lower 5 bits of the result, use a De Bruijn lookup.
                // forgefmt: disable-next-item
                r := or(r, byte(and(div(0xd76453e0, shr(r, b)), 0x1f),
                    0x001f0d1e100c1d070f090b19131c1706010e11080a1a141802121b1503160405))
                r := or(shl(8, sub(bucket, s)), r)
                unsetBitIndex := or(r, sub(0, or(gt(r, upTo), lt(r, begin))))
            }
        }
    }

    /// @dev Returns a storage reference to the value at (`a0`, `a1`) in `map`.
    function _ref(AddressPairToUint256RefMap storage map, address a0, address a1)
        internal
        pure
        returns (Uint256Ref storage ref)
    {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x28, a1)
            mstore(0x14, a0)
            mstore(0x00, map.slot)
            ref.slot := keccak256(0x00, 0x48)
            // Clear the part of the free memory pointer that was overwritten.
            mstore(0x28, 0x00)
        }
    }

    /// @dev Wraps the NFT ID.
    function _wrapNFTId(uint256 id, uint256 idLimit) internal pure returns (uint256 result) {
        result = _toUint(_useOneIndexed());
        /// @solidity memory-safe-assembly
        assembly {
            result :=
                or(
                    mul(or(mul(iszero(gt(id, idLimit)), id), gt(id, idLimit)), result),
                    mul(mul(lt(id, idLimit), id), iszero(result))
                )
        }
    }

    /// @dev Returns `id > type(uint32).max ? 0 : id`.
    function _restrictNFTId(uint256 id) internal pure returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mul(id, lt(id, 0x100000000))
        }
    }

    /// @dev Returns whether `amount` is an invalid `totalSupply`.
    function _totalSupplyOverflows(uint256 amount) internal view returns (bool result) {
        uint256 unit = _unit();
        /// @solidity memory-safe-assembly
        assembly {
            result := iszero(iszero(or(shr(96, amount), lt(0xfffffffe, div(amount, unit)))))
        }
    }

    /// @dev Returns `max(0, x - y)`.
    function _zeroFloorSub(uint256 x, uint256 y) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := mul(gt(x, y), sub(x, y))
        }
    }

    /// @dev Returns `x < y ? x : y`.
    function _min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := xor(x, mul(xor(x, y), lt(y, x)))
        }
    }

    /// @dev Returns `b ? 1 : 0`.
    function _toUint(bool b) internal pure returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := iszero(iszero(b))
        }
    }

    /// @dev Initiates memory allocation for direct logs with `n` log items.
    function _directLogsMalloc(uint256 n, address from, address to)
        private
        pure
        returns (bytes32 p)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // `p`'s layout:
            //    uint256 offset;
            //    uint256[] logs;
            p := mload(0x40)
            let m := add(p, 0x40)
            mstore(m, 0x144027d3) // `logDirectTransfer(address,address,uint256[])`.
            mstore(add(m, 0x20), shr(96, shl(96, from)))
            mstore(add(m, 0x40), shr(96, shl(96, to)))
            mstore(add(m, 0x60), 0x60) // Offset of `logs` in the calldata to send.
            // Skip 4 words: `fnSelector`, `from`, `to`, `calldataLogsOffset`.
            let logs := add(0x80, m)
            mstore(logs, n) // Store the length.
            let offset := add(0x20, logs) // Skip the word for `p.logs.length`.
            mstore(0x40, add(offset, shl(5, n))) // Allocate memory.
            mstore(add(0x20, p), logs) // Set `p.logs`.
            mstore(p, offset) // Set `p.offset`.
        }
    }

    /// @dev Adds a direct log item to `p` with token `id`.
    function _directLogsAppend(bytes32 p, uint256 id) private pure {
        /// @solidity memory-safe-assembly
        assembly {
            let offset := mload(p)
            mstore(offset, id)
            mstore(p, add(offset, 0x20))
        }
    }

    /// @dev Calls the `mirror` NFT contract to emit {Transfer} events for packed logs `p`.
    function _directLogsSend(bytes32 p, DN404Storage storage $) private {
        address mirror = $.mirrorERC721;
        /// @solidity memory-safe-assembly
        assembly {
            let logs := mload(add(p, 0x20))
            let n := add(0x84, shl(5, mload(logs))) // Length of calldata to send.
            let o := sub(logs, 0x80) // Start of calldata to send.
            if iszero(and(eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20))) {
                revert(o, 0x00)
            }
        }
    }

    /// @dev Returns the token IDs of the direct logs.
    function _directLogsIds(bytes32 p) private pure returns (uint256[] memory ids) {
        /// @solidity memory-safe-assembly
        assembly {
            if p { ids := mload(add(p, 0x20)) }
        }
    }

    /// @dev Initiates memory allocation for packed logs with `n` log items.
    function _packedLogsMalloc(uint256 n) private pure returns (bytes32 p) {
        /// @solidity memory-safe-assembly
        assembly {
            // `p`'s layout:
            //     uint256 offset;
            //     uint256 addressAndBit;
            //     uint256[] logs;
            p := mload(0x40)
            let logs := add(p, 0xa0)
            mstore(logs, n) // Store the length.
            let offset := add(0x20, logs) // Skip the word for `p.logs.length`.
            mstore(0x40, add(offset, shl(5, n))) // Allocate memory.
            mstore(add(0x40, p), logs) // Set `p.logs`.
            mstore(p, offset) // Set `p.offset`.
        }
    }

    /// @dev Set the current address and the burn bit.
    function _packedLogsSet(bytes32 p, address a, uint256 burnBit) private pure {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(add(p, 0x20), or(shl(96, a), burnBit)) // Set `p.addressAndBit`.
        }
    }

    /// @dev Adds a packed log item to `p` with token `id`.
    function _packedLogsAppend(bytes32 p, uint256 id) private pure {
        /// @solidity memory-safe-assembly
        assembly {
            let offset := mload(p)
            mstore(offset, or(mload(add(p, 0x20)), shl(8, id))) // `p.addressAndBit | (id << 8)`.
            mstore(p, add(offset, 0x20))
        }
    }

    /// @dev Calls the `mirror` NFT contract to emit {Transfer} events for packed logs `p`.
    function _packedLogsSend(bytes32 p, DN404Storage storage $) private {
        address mirror = $.mirrorERC721;
        /// @solidity memory-safe-assembly
        assembly {
            let logs := mload(add(p, 0x40))
            let o := sub(logs, 0x40) // Start of calldata to send.
            mstore(o, 0x263c69d6) // `logTransfer(uint256[])`.
            mstore(add(o, 0x20), 0x20) // Offset of `logs` in the calldata to send.
            let n := add(0x44, shl(5, mload(logs))) // Length of calldata to send.
            if iszero(and(eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20))) {
                revert(o, 0x00)
            }
        }
    }

    /// @dev Returns the token IDs of the packed logs (destructively).
    function _packedLogsIds(bytes32 p) private pure returns (uint256[] memory ids) {
        /// @solidity memory-safe-assembly
        assembly {
            if p {
                ids := mload(add(p, 0x40))
                let o := add(ids, 0x20)
                let end := add(o, shl(5, mload(ids)))
                for {} iszero(eq(o, end)) { o := add(o, 0x20) } {
                    mstore(o, shr(168, shl(160, mload(o))))
                }
            }
        }
    }

    /// @dev Returns an array of zero addresses.
    function _zeroAddresses(uint256 n) private pure returns (address[] memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            mstore(0x40, add(add(result, 0x20), shl(5, n)))
            mstore(result, n)
            calldatacopy(add(result, 0x20), calldatasize(), shl(5, n))
        }
    }

    /// @dev Returns an array each set to `value`.
    function _filled(uint256 n, uint256 value) private pure returns (uint256[] memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let o := add(result, 0x20)
            let end := add(o, shl(5, n))
            mstore(0x40, end)
            mstore(result, n)
            for {} iszero(eq(o, end)) { o := add(o, 0x20) } { mstore(o, value) }
        }
    }

    /// @dev Returns an array each set to `value`.
    function _filled(uint256 n, address value) private pure returns (address[] memory result) {
        result = _toAddresses(_filled(n, uint160(value)));
    }

    /// @dev Concatenates the arrays.
    function _concat(uint256[] memory a, uint256[] memory b)
        private
        pure
        returns (uint256[] memory result)
    {
        uint256 aN = a.length;
        uint256 bN = b.length;
        if (aN == uint256(0)) return b;
        if (bN == uint256(0)) return a;
        /// @solidity memory-safe-assembly
        assembly {
            let n := add(aN, bN)
            if n {
                result := mload(0x40)
                mstore(result, n)
                function copy(dst_, src_, n_) -> _end {
                    _end := add(dst_, shl(5, n_))
                    if n_ {
                        for { let d_ := sub(src_, dst_) } 1 {} {
                            mstore(dst_, mload(add(dst_, d_)))
                            dst_ := add(dst_, 0x20)
                            if eq(dst_, _end) { break }
                        }
                    }
                }
                mstore(0x40, copy(copy(add(result, 0x20), add(a, 0x20), aN), add(b, 0x20), bN))
            }
        }
    }

    /// @dev Concatenates the arrays.
    function _concat(address[] memory a, address[] memory b)
        private
        pure
        returns (address[] memory result)
    {
        result = _toAddresses(_concat(_toUints(a), _toUints(b)));
    }

    /// @dev Reinterpret cast to an uint array.
    function _toUints(address[] memory a) private pure returns (uint256[] memory casted) {
        /// @solidity memory-safe-assembly
        assembly {
            casted := a
        }
    }

    /// @dev Reinterpret cast to an address array.
    function _toAddresses(uint256[] memory a) private pure returns (address[] memory casted) {
        /// @solidity memory-safe-assembly
        assembly {
            casted := a
        }
    }

    /// @dev Struct of temporary variables for transfers.
    struct _DNTransferTemps {
        uint256 numNFTBurns;
        uint256 numNFTMints;
        uint256 fromOwnedLength;
        uint256 toOwnedLength;
        uint256 totalNFTSupply;
        uint256 fromEnd;
        uint256 toEnd;
        uint32 toAlias;
        uint256 nextTokenId;
        uint32 burnedPoolTail;
        bytes32 directLogs;
        bytes32 packedLogs;
    }

    /// @dev Struct of temporary variables for mints.
    struct _DNMintTemps {
        uint256 nextTokenId;
        uint32 burnedPoolTail;
        uint256 toEnd;
        uint32 toAlias;
        uint256 numNFTMints;
        bytes32 packedLogs;
    }

    /// @dev Struct of temporary variables for burns.
    struct _DNBurnTemps {
        uint256 fromBalance;
        uint256 totalSupply;
        uint256 numNFTBurns;
        bytes32 packedLogs;
    }

    /// @dev Returns the calldata value at `offset`.
    function _calldataload(uint256 offset) private pure returns (uint256 value) {
        /// @solidity memory-safe-assembly
        assembly {
            value := calldataload(offset)
        }
    }

    /// @dev Executes a return opcode to return `x` and end the current call frame.
    function _return(uint256 x) private pure {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, x)
            return(0x00, 0x20)
        }
    }

    /// @dev More bytecode-efficient way to revert.
    function _rv(uint32 s) private pure {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, s)
            revert(0x1c, 0x04)
        }
    }
}

File 5 of 11 : DN404Mirror.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @title DN404Mirror
/// @notice DN404Mirror provides an interface for interacting with the
/// NFT tokens in a DN404 implementation.
///
/// @author vectorized.eth (@optimizoor)
/// @author Quit (@0xQuit)
/// @author Michael Amadi (@AmadiMichaels)
/// @author cygaar (@0xCygaar)
/// @author Thomas (@0xjustadev)
/// @author Harrison (@PopPunkOnChain)
///
/// @dev Note:
/// - The ERC721 data is stored in the base DN404 contract.
contract DN404Mirror {
    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                           EVENTS                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Emitted when token `id` is transferred from `from` to `to`.
    event Transfer(address indexed from, address indexed to, uint256 indexed id);

    /// @dev Emitted when `owner` enables `account` to manage the `id` token.
    event Approval(address indexed owner, address indexed account, uint256 indexed id);

    /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.
    event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved);

    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.
    /// This is for marketplace signaling purposes. This contract has a `pullOwner()`
    /// function that will sync the owner from the base contract.
    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

    /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`.
    uint256 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`.
    uint256 private constant _APPROVAL_EVENT_SIGNATURE =
        0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925;

    /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`.
    uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =
        0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CUSTOM ERRORS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Thrown when a call for an NFT function did not originate
    /// from the base DN404 contract.
    error SenderNotBase();

    /// @dev Thrown when a call for an NFT function did not originate from the deployer.
    error SenderNotDeployer();

    /// @dev Thrown when transferring an NFT to a contract address that
    /// does not implement ERC721Receiver.
    error TransferToNonERC721ReceiverImplementer();

    /// @dev Thrown when a linkMirrorContract call is received and the
    /// NFT mirror contract has already been linked to a DN404 base contract.
    error AlreadyLinked();

    /// @dev Thrown when retrieving the base DN404 address when a link has not
    /// been established.
    error NotLinked();

    /// @dev The function selector is not recognized.
    error FnSelectorNotRecognized();

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                          STORAGE                           */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Struct contain the NFT mirror contract storage.
    struct DN404NFTStorage {
        // Address of the ERC20 base contract.
        address baseERC20;
        // The deployer, if provided. If non-zero, the initialization of the
        // ERC20 <-> ERC721 link can only be done by the deployer via the ERC20 base contract.
        address deployer;
        // The owner of the ERC20 base contract. For marketplace signaling.
        address owner;
    }

    /// @dev Returns a storage pointer for DN404NFTStorage.
    function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) {
        /// @solidity memory-safe-assembly
        assembly {
            // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`.
            $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size.
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                        CONSTRUCTOR                         */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    constructor(address deployer) {
        // For non-proxies, we will store the deployer so that only the deployer can
        // link the base contract.
        _getDN404NFTStorage().deployer = deployer;
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     ERC721 OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the token collection name from the base DN404 contract.
    function name() public view virtual returns (string memory) {
        return _readString(0x06fdde03, 0); // `name()`.
    }

    /// @dev Returns the token collection symbol from the base DN404 contract.
    function symbol() public view virtual returns (string memory) {
        return _readString(0x95d89b41, 0); // `symbol()`.
    }

    /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from
    /// the base DN404 contract.
    function tokenURI(uint256 id) public view virtual returns (string memory) {
        ownerOf(id); // `ownerOf` reverts if the token does not exist.
        // We'll leave if optional for `_tokenURI` to revert for non-existent token
        // on the ERC20 side, since this is only recommended by the ERC721 standard.
        return _readString(0xcb30b460, id); // `tokenURINFT(uint256)`.
    }

    /// @dev Returns the total NFT supply from the base DN404 contract.
    function totalSupply() public view virtual returns (uint256) {
        return _readWord(0xe2c79281, 0, 0); // `totalNFTSupply()`.
    }

    /// @dev Returns the number of NFT tokens owned by `nftOwner` from the base DN404 contract.
    ///
    /// Requirements:
    /// - `nftOwner` must not be the zero address.
    function balanceOf(address nftOwner) public view virtual returns (uint256) {
        return _readWord(0xf5b100ea, uint160(nftOwner), 0); // `balanceOfNFT(address)`.
    }

    /// @dev Returns the owner of token `id` from the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function ownerOf(uint256 id) public view virtual returns (address) {
        return address(uint160(_readWord(0x2d8a746e, id, 0))); // `ownerOfNFT(uint256)`.
    }

    /// @dev Returns the owner of token `id` from the base DN404 contract.
    /// Returns `address(0)` instead of reverting if the token does not exist.
    function ownerAt(uint256 id) public view virtual returns (address) {
        return address(uint160(_readWord(0xc016aa52, id, 0))); // `ownerAtNFT(uint256)`.
    }

    /// @dev Sets `spender` as the approved account to manage token `id` in
    /// the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    /// - The caller must be the owner of the token,
    ///   or an approved operator for the token owner.
    ///
    /// Emits an {Approval} event.
    function approve(address spender, uint256 id) public payable virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            spender := shr(96, shl(96, spender))
            let m := mload(0x40)
            mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`.
            mstore(0x20, spender)
            mstore(0x40, id)
            mstore(0x60, caller())
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    gt(returndatasize(), 0x1f), // The call must return at least 32 bytes.
                    call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            mstore(0x40, m) // Restore the free memory pointer.
            mstore(0x60, 0) // Restore the zero pointer.
            // Emit the {Approval} event.
            log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id)
        }
    }

    /// @dev Returns the account approved to manage token `id` from
    /// the base DN404 contract.
    ///
    /// Requirements:
    /// - Token `id` must exist.
    function getApproved(uint256 id) public view virtual returns (address) {
        return address(uint160(_readWord(0x27ef5495, id, 0))); // `getApprovedNFT(uint256)`.
    }

    /// @dev Sets whether `operator` is approved to manage the tokens of the caller in
    /// the base DN404 contract.
    ///
    /// Emits an {ApprovalForAll} event.
    function setApprovalForAll(address operator, bool approved) public virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            operator := shr(96, shl(96, operator))
            let m := mload(0x40)
            mstore(0x00, 0xf6916ddd) // `setApprovalForAllNFT(address,bool,address)`.
            mstore(0x20, operator)
            mstore(0x40, iszero(iszero(approved)))
            mstore(0x60, caller())
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    eq(mload(0x00), 1), // The call must return 1.
                    call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            // Emit the {ApprovalForAll} event.
            // The `approved` value is already at 0x40.
            log3(0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator)
            mstore(0x40, m) // Restore the free memory pointer.
            mstore(0x60, 0) // Restore the zero pointer.
        }
    }

    /// @dev Returns whether `operator` is approved to manage the tokens of `nftOwner` from
    /// the base DN404 contract.
    function isApprovedForAll(address nftOwner, address operator)
        public
        view
        virtual
        returns (bool)
    {
        // `isApprovedForAllNFT(address,address)`.
        return _readWord(0x62fb246d, uint160(nftOwner), uint160(operator)) != 0;
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    ///
    /// Emits a {Transfer} event.
    function transferFrom(address from, address to, uint256 id) public payable virtual {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            from := shr(96, shl(96, from))
            to := shr(96, shl(96, to))
            let m := mload(0x40)
            mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`.
            mstore(add(m, 0x20), from)
            mstore(add(m, 0x40), to)
            mstore(add(m, 0x60), id)
            mstore(add(m, 0x80), caller())
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    eq(mload(m), 1), // The call must return 1.
                    call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            // Emit the {Transfer} event.
            log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id)
        }
    }

    /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`.
    function safeTransferFrom(address from, address to, uint256 id) public payable virtual {
        bytes calldata emptyData;
        /// @solidity memory-safe-assembly
        assembly {
            emptyData.length := 0
        }
        safeTransferFrom(from, to, id, emptyData);
    }

    /// @dev Transfers token `id` from `from` to `to`.
    ///
    /// Requirements:
    ///
    /// - Token `id` must exist.
    /// - `from` must be the owner of the token.
    /// - `to` cannot be the zero address.
    /// - The caller must be the owner of the token, or be approved to manage the token.
    /// - If `to` refers to a smart contract, it must implement
    ///   {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
    ///
    /// Emits a {Transfer} event.
    function safeTransferFrom(address from, address to, uint256 id, bytes calldata data)
        public
        payable
        virtual
    {
        transferFrom(from, to, id);
        /// @solidity memory-safe-assembly
        assembly {
            if extcodesize(to) {
                // Prepare the calldata.
                let m := mload(0x40)
                let onERC721ReceivedSelector := 0x150b7a02
                mstore(m, onERC721ReceivedSelector)
                mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`.
                mstore(add(m, 0x40), shr(96, shl(96, from)))
                mstore(add(m, 0x60), id)
                mstore(add(m, 0x80), 0x80)
                mstore(add(m, 0xa0), data.length)
                calldatacopy(add(m, 0xc0), data.offset, data.length)
                // Revert if the call reverts.
                if iszero(call(gas(), to, 0, add(m, 0x1c), add(data.length, 0xa4), m, 0x20)) {
                    if returndatasize() {
                        // Bubble up the revert if the call reverts.
                        returndatacopy(m, 0x00, returndatasize())
                        revert(m, returndatasize())
                    }
                }
                // Load the returndata and compare it.
                if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) {
                    mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`.
                    revert(0x1c, 0x04)
                }
            }
        }
    }

    /// @dev Returns true if this contract implements the interface defined by `interfaceId`.
    /// See: https://eips.ethereum.org/EIPS/eip-165
    /// This function call must use less than 30000 gas.
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            let s := shr(224, interfaceId)
            // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f.
            result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f))
        }
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                  OWNER SYNCING OPERATIONS                  */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the `owner` of the contract, for marketplace signaling purposes.
    function owner() public view virtual returns (address) {
        return _getDN404NFTStorage().owner;
    }

    /// @dev Permissionless function to pull the owner from the base DN404 contract
    /// if it implements ownable, for marketplace signaling purposes.
    function pullOwner() public virtual returns (bool) {
        address newOwner;
        address base = baseERC20();
        uint32 baseOwnerFunctionSelector = uint32(_baseOwnerFunctionSelector());
        DN404NFTStorage storage $ = _getDN404NFTStorage();
        address oldOwner = $.owner;
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, baseOwnerFunctionSelector)
            let success := staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20)
            newOwner := mul(shr(96, mload(0x0c)), and(gt(returndatasize(), 0x1f), success))
            if iszero(success) { if shl(96, oldOwner) { revert(0x00, 0x00) } }
        }
        if (oldOwner != newOwner) {
            $.owner = newOwner;
            emit OwnershipTransferred(oldOwner, newOwner);
        }
        return true;
    }

    /// @dev Override to allow for a different function selector on `baseERC20`.
    function _baseOwnerFunctionSelector() internal view virtual returns (bytes4) {
        return 0x8da5cb5b; // `owner()`.
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                     MIRROR OPERATIONS                      */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Returns the address of the base DN404 contract.
    function baseERC20() public view virtual returns (address base) {
        base = _getDN404NFTStorage().baseERC20;
        if (base == address(0)) _rv(uint32(NotLinked.selector));
    }

    /// @dev Fallback modifier to execute calls from the base DN404 contract.
    modifier dn404NFTFallback() virtual {
        DN404NFTStorage storage $ = _getDN404NFTStorage();

        uint256 fnSelector = _calldataload(0x00) >> 224;

        // `logTransfer(uint256[])`.
        if (fnSelector == 0x263c69d6) {
            if (msg.sender != $.baseERC20) _rv(uint32(SenderNotBase.selector));
            /// @solidity memory-safe-assembly
            assembly {
                let o := add(0x24, calldataload(0x04)) // Packed logs offset.
                let end := add(o, shl(5, calldataload(sub(o, 0x20))))
                for {} iszero(eq(o, end)) { o := add(0x20, o) } {
                    let d := calldataload(o) // Entry in the packed logs.
                    let a := shr(96, d) // The address.
                    let b := and(1, d) // Whether it is a burn.
                    log4(
                        codesize(),
                        0x00,
                        _TRANSFER_EVENT_SIGNATURE,
                        mul(a, b), // `from`.
                        mul(a, iszero(b)), // `to`.
                        shr(168, shl(160, d)) // `id`.
                    )
                }
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        // `logDirectTransfer(address,address,uint256[])`.
        if (fnSelector == 0x144027d3) {
            if (msg.sender != $.baseERC20) _rv(uint32(SenderNotBase.selector));
            /// @solidity memory-safe-assembly
            assembly {
                let from := calldataload(0x04)
                let to := calldataload(0x24)
                let o := add(0x24, calldataload(0x44)) // Direct logs offset.
                let end := add(o, shl(5, calldataload(sub(o, 0x20))))
                for {} iszero(eq(o, end)) { o := add(0x20, o) } {
                    log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, calldataload(o))
                }
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        // `linkMirrorContract(address)`.
        if (fnSelector == 0x0f4599e5) {
            if ($.deployer != address(0)) {
                if (address(uint160(_calldataload(0x04))) != $.deployer) {
                    _rv(uint32(SenderNotDeployer.selector));
                }
            }
            if ($.baseERC20 != address(0)) _rv(uint32(AlreadyLinked.selector));
            $.baseERC20 = msg.sender;
            /// @solidity memory-safe-assembly
            assembly {
                mstore(0x00, 0x01)
                return(0x00, 0x20)
            }
        }
        _;
    }

    /// @dev Fallback function for calls from base DN404 contract.
    /// Override this if you need to implement your custom
    /// fallback with utilities like Solady's `LibZip.cdFallback()`.
    /// And always remember to always wrap the fallback with `dn404NFTFallback`.
    fallback() external payable virtual dn404NFTFallback {
        _rv(uint32(FnSelectorNotRecognized.selector)); // Not mandatory. Just for quality of life.
    }

    /// @dev This is to silence the compiler warning.
    /// Override and remove the revert if you want your contract to receive ETH via receive.
    receive() external payable virtual {
        if (msg.value != 0) revert();
    }

    /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/
    /*                      PRIVATE HELPERS                       */
    /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/

    /// @dev Helper to read a string from the base DN404 contract.
    function _readString(uint256 fnSelector, uint256 arg0)
        private
        view
        returns (string memory result)
    {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            mstore(0x00, fnSelector)
            mstore(0x20, arg0)
            if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) {
                returndatacopy(result, 0x00, returndatasize())
                revert(result, returndatasize())
            }
            returndatacopy(0x00, 0x00, 0x20) // Copy the offset of the string in returndata.
            returndatacopy(result, mload(0x00), 0x20) // Copy the length of the string.
            returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) // Copy the string.
            let end := add(add(result, 0x20), mload(result))
            mstore(end, 0) // Zeroize the word after the string.
            mstore(0x40, add(end, 0x20)) // Allocate memory.
        }
    }

    /// @dev Helper to read a word from the base DN404 contract.
    function _readWord(uint256 fnSelector, uint256 arg0, uint256 arg1)
        private
        view
        returns (uint256 result)
    {
        address base = baseERC20();
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            mstore(0x00, fnSelector)
            mstore(0x20, arg0)
            mstore(0x40, arg1)
            if iszero(
                and( // Arguments of `and` are evaluated last to first.
                    gt(returndatasize(), 0x1f), // The call must return at least 32 bytes.
                    staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20)
                )
            ) {
                returndatacopy(m, 0x00, returndatasize())
                revert(m, returndatasize())
            }
            mstore(0x40, m) // Restore the free memory pointer.
            result := mload(0x00)
        }
    }

    /// @dev Returns the calldata value at `offset`.
    function _calldataload(uint256 offset) private pure returns (uint256 value) {
        /// @solidity memory-safe-assembly
        assembly {
            value := calldataload(offset)
        }
    }

    /// @dev More bytecode-efficient way to revert.
    function _rv(uint32 s) private pure {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, s)
            revert(0x1c, 0x04)
        }
    }
}

File 6 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Simple single owner authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract Ownable {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The caller is not authorized to call the function.
    error Unauthorized();

    /// @dev The `newOwner` cannot be the zero address.
    error NewOwnerIsZeroAddress();

    /// @dev The `pendingOwner` does not have a valid handover request.
    error NoHandoverRequest();

    /// @dev Cannot double-initialize.
    error AlreadyInitialized();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                           EVENTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.
    /// This event is intentionally kept the same as OpenZeppelin's Ownable to be
    /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
    /// despite it not being as lightweight as a single argument event.
    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

    /// @dev An ownership handover to `pendingOwner` has been requested.
    event OwnershipHandoverRequested(address indexed pendingOwner);

    /// @dev The ownership handover to `pendingOwner` has been canceled.
    event OwnershipHandoverCanceled(address indexed pendingOwner);

    /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
    uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
        0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;

    /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
        0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;

    /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
        0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STORAGE                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The owner slot is given by:
    /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`.
    /// It is intentionally chosen to be a high value
    /// to avoid collision with lower slots.
    /// The choice of manual storage layout is to enable compatibility
    /// with both regular and upgradeable contracts.
    bytes32 internal constant _OWNER_SLOT =
        0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;

    /// The ownership handover slot of `newOwner` is given by:
    /// ```
    ///     mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
    ///     let handoverSlot := keccak256(0x00, 0x20)
    /// ```
    /// It stores the expiry timestamp of the two-step ownership handover.
    uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     INTERNAL FUNCTIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Override to return true to make `_initializeOwner` prevent double-initialization.
    function _guardInitializeOwner() internal pure virtual returns (bool guard) {}

    /// @dev Initializes the owner directly without authorization guard.
    /// This function must be called upon initialization,
    /// regardless of whether the contract is upgradeable or not.
    /// This is to enable generalization to both regular and upgradeable contracts,
    /// and to save gas in case the initial owner is not the caller.
    /// For performance reasons, this function will not check if there
    /// is an existing owner.
    function _initializeOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                if sload(ownerSlot) {
                    mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.
                    revert(0x1c, 0x04)
                }
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(_OWNER_SLOT, newOwner)
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        }
    }

    /// @dev Sets the owner directly without authorization guard.
    function _setOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, newOwner)
            }
        }
    }

    /// @dev Throws if the sender is not the owner.
    function _checkOwner() internal view virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // If the caller is not the stored owner, revert.
            if iszero(eq(caller(), sload(_OWNER_SLOT))) {
                mstore(0x00, 0x82b42900) // `Unauthorized()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Returns how long a two-step ownership handover is valid for in seconds.
    /// Override to return a different value if needed.
    /// Made internal to conserve bytecode. Wrap it in a public function if needed.
    function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
        return 48 * 3600;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  PUBLIC UPDATE FUNCTIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Allows the owner to transfer the ownership to `newOwner`.
    function transferOwnership(address newOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(shl(96, newOwner)) {
                mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
                revert(0x1c, 0x04)
            }
        }
        _setOwner(newOwner);
    }

    /// @dev Allows the owner to renounce their ownership.
    function renounceOwnership() public payable virtual onlyOwner {
        _setOwner(address(0));
    }

    /// @dev Request a two-step ownership handover to the caller.
    /// The request will automatically expire in 48 hours (172800 seconds) by default.
    function requestOwnershipHandover() public payable virtual {
        unchecked {
            uint256 expires = block.timestamp + _ownershipHandoverValidFor();
            /// @solidity memory-safe-assembly
            assembly {
                // Compute and set the handover slot to `expires`.
                mstore(0x0c, _HANDOVER_SLOT_SEED)
                mstore(0x00, caller())
                sstore(keccak256(0x0c, 0x20), expires)
                // Emit the {OwnershipHandoverRequested} event.
                log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
            }
        }
    }

    /// @dev Cancels the two-step ownership handover to the caller, if any.
    function cancelOwnershipHandover() public payable virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, caller())
            sstore(keccak256(0x0c, 0x20), 0)
            // Emit the {OwnershipHandoverCanceled} event.
            log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
        }
    }

    /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
    /// Reverts if there is no existing ownership handover requested by `pendingOwner`.
    function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            let handoverSlot := keccak256(0x0c, 0x20)
            // If the handover does not exist, or has expired.
            if gt(timestamp(), sload(handoverSlot)) {
                mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.
                revert(0x1c, 0x04)
            }
            // Set the handover slot to 0.
            sstore(handoverSlot, 0)
        }
        _setOwner(pendingOwner);
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   PUBLIC READ FUNCTIONS                    */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the owner of the contract.
    function owner() public view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := sload(_OWNER_SLOT)
        }
    }

    /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
    function ownershipHandoverExpiresAt(address pendingOwner)
        public
        view
        virtual
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute the handover slot.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            // Load the handover slot.
            result := sload(keccak256(0x0c, 0x20))
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         MODIFIERS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Marks a function as only callable by the owner.
    modifier onlyOwner() virtual {
        _checkOwner();
        _;
    }
}

File 7 of 11 : LibString.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

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

/// @notice Library for converting numbers into strings and other string operations.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)
///
/// @dev Note:
/// For performance and bytecode compactness, most of the string operations are restricted to
/// byte strings (7-bit ASCII), except where otherwise specified.
/// Usage of byte string operations on charsets with runes spanning two or more bytes
/// can lead to undefined behavior.
library LibString {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STRUCTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Goated string storage struct that totally MOGs, no cap, fr.
    /// Uses less gas and bytecode than Solidity's native string storage. It's meta af.
    /// Packs length with the first 31 bytes if <255 bytes, so it’s mad tight.
    struct StringStorage {
        bytes32 _spacer;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                        CUSTOM ERRORS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The length of the output is too small to contain all the hex digits.
    error HexLengthInsufficient();

    /// @dev The length of the string is more than 32 bytes.
    error TooBigForSmallString();

    /// @dev The input string must be a 7-bit ASCII.
    error StringNot7BitASCII();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The constant returned when the `search` is not found in the string.
    uint256 internal constant NOT_FOUND = type(uint256).max;

    /// @dev Lookup for '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    uint128 internal constant ALPHANUMERIC_7_BIT_ASCII = 0x7fffffe07fffffe03ff000000000000;

    /// @dev Lookup for 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    uint128 internal constant LETTERS_7_BIT_ASCII = 0x7fffffe07fffffe0000000000000000;

    /// @dev Lookup for 'abcdefghijklmnopqrstuvwxyz'.
    uint128 internal constant LOWERCASE_7_BIT_ASCII = 0x7fffffe000000000000000000000000;

    /// @dev Lookup for 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
    uint128 internal constant UPPERCASE_7_BIT_ASCII = 0x7fffffe0000000000000000;

    /// @dev Lookup for '0123456789'.
    uint128 internal constant DIGITS_7_BIT_ASCII = 0x3ff000000000000;

    /// @dev Lookup for '0123456789abcdefABCDEF'.
    uint128 internal constant HEXDIGITS_7_BIT_ASCII = 0x7e0000007e03ff000000000000;

    /// @dev Lookup for '01234567'.
    uint128 internal constant OCTDIGITS_7_BIT_ASCII = 0xff000000000000;

    /// @dev Lookup for '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'.
    uint128 internal constant PRINTABLE_7_BIT_ASCII = 0x7fffffffffffffffffffffff00003e00;

    /// @dev Lookup for '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'.
    uint128 internal constant PUNCTUATION_7_BIT_ASCII = 0x78000001f8000001fc00fffe00000000;

    /// @dev Lookup for ' \t\n\r\x0b\x0c'.
    uint128 internal constant WHITESPACE_7_BIT_ASCII = 0x100003e00;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                 STRING STORAGE OPERATIONS                  */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Sets the value of the string storage `$` to `s`.
    function set(StringStorage storage $, string memory s) internal {
        LibBytes.set(bytesStorage($), bytes(s));
    }

    /// @dev Sets the value of the string storage `$` to `s`.
    function setCalldata(StringStorage storage $, string calldata s) internal {
        LibBytes.setCalldata(bytesStorage($), bytes(s));
    }

    /// @dev Sets the value of the string storage `$` to the empty string.
    function clear(StringStorage storage $) internal {
        delete $._spacer;
    }

    /// @dev Returns whether the value stored is `$` is the empty string "".
    function isEmpty(StringStorage storage $) internal view returns (bool) {
        return uint256($._spacer) & 0xff == uint256(0);
    }

    /// @dev Returns the length of the value stored in `$`.
    function length(StringStorage storage $) internal view returns (uint256) {
        return LibBytes.length(bytesStorage($));
    }

    /// @dev Returns the value stored in `$`.
    function get(StringStorage storage $) internal view returns (string memory) {
        return string(LibBytes.get(bytesStorage($)));
    }

    /// @dev Helper to cast `$` to a `BytesStorage`.
    function bytesStorage(StringStorage storage $)
        internal
        pure
        returns (LibBytes.BytesStorage storage casted)
    {
        /// @solidity memory-safe-assembly
        assembly {
            casted.slot := $.slot
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     DECIMAL OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(uint256 value) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits.
            result := add(mload(0x40), 0x80)
            mstore(0x40, add(result, 0x20)) // Allocate memory.
            mstore(result, 0) // Zeroize the slot after the string.

            let end := result // Cache the end of the memory to calculate the length later.
            let w := not(0) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                result := add(result, w) // `sub(result, 1)`.
                // Store the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(result, add(48, mod(temp, 10)))
                temp := div(temp, 10) // Keep dividing `temp` until zero.
                if iszero(temp) { break }
            }
            let n := sub(end, result)
            result := sub(result, 0x20) // Move the pointer 32 bytes back to make room for the length.
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the base 10 decimal representation of `value`.
    function toString(int256 value) internal pure returns (string memory result) {
        if (value >= 0) return toString(uint256(value));
        unchecked {
            result = toString(~uint256(value) + 1);
        }
        /// @solidity memory-safe-assembly
        assembly {
            // We still have some spare memory space on the left,
            // as we have allocated 3 words (96 bytes) for up to 78 digits.
            let n := mload(result) // Load the string length.
            mstore(result, 0x2d) // Store the '-' character.
            result := sub(result, 1) // Move back the string pointer by a byte.
            mstore(result, add(n, 1)) // Update the string length.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   HEXADECIMAL OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `byteCount` bytes.
    /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `byteCount * 2 + 2` bytes.
    /// Reverts if `byteCount` is too small for the output to contain all the digits.
    function toHexString(uint256 value, uint256 byteCount)
        internal
        pure
        returns (string memory result)
    {
        result = toHexStringNoPrefix(value, byteCount);
        /// @solidity memory-safe-assembly
        assembly {
            let n := add(mload(result), 2) // Compute the length.
            mstore(result, 0x3078) // Store the "0x" prefix.
            result := sub(result, 2) // Move the pointer.
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`,
    /// left-padded to an input length of `byteCount` bytes.
    /// The output is not prefixed with "0x" and is encoded using 2 hexadecimal digits per byte,
    /// giving a total length of `byteCount * 2` bytes.
    /// Reverts if `byteCount` is too small for the output to contain all the digits.
    function toHexStringNoPrefix(uint256 value, uint256 byteCount)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, `byteCount * 2` bytes
            // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length.
            // We add 0x20 to the total and round down to a multiple of 0x20.
            // (0x20 + 0x20 + 0x02 + 0x20) = 0x62.
            result := add(mload(0x40), and(add(shl(1, byteCount), 0x42), not(0x1f)))
            mstore(0x40, add(result, 0x20)) // Allocate memory.
            mstore(result, 0) // Zeroize the slot after the string.

            let end := result // Cache the end to calculate the length later.
            // Store "0123456789abcdef" in scratch space.
            mstore(0x0f, 0x30313233343536373839616263646566)

            let start := sub(result, add(byteCount, byteCount))
            let w := not(1) // Tsk.
            let temp := value
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for {} 1 {} {
                result := add(result, w) // `sub(result, 2)`.
                mstore8(add(result, 1), mload(and(temp, 15)))
                mstore8(result, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(xor(result, start)) { break }
            }
            if temp {
                mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`.
                revert(0x1c, 0x04)
            }
            let n := sub(end, result)
            result := sub(result, 0x20)
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2 + 2` bytes.
    function toHexString(uint256 value) internal pure returns (string memory result) {
        result = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let n := add(mload(result), 2) // Compute the length.
            mstore(result, 0x3078) // Store the "0x" prefix.
            result := sub(result, 2) // Move the pointer.
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x".
    /// The output excludes leading "0" from the `toHexString` output.
    /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`.
    function toMinimalHexString(uint256 value) internal pure returns (string memory result) {
        result = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(result, 0x20))), 0x30) // Whether leading zero is present.
            let n := add(mload(result), 2) // Compute the length.
            mstore(add(result, o), 0x3078) // Store the "0x" prefix, accounting for leading zero.
            result := sub(add(result, o), 2) // Move the pointer, accounting for leading zero.
            mstore(result, sub(n, o)) // Store the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output excludes leading "0" from the `toHexStringNoPrefix` output.
    /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`.
    function toMinimalHexStringNoPrefix(uint256 value)
        internal
        pure
        returns (string memory result)
    {
        result = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let o := eq(byte(0, mload(add(result, 0x20))), 0x30) // Whether leading zero is present.
            let n := mload(result) // Get the length.
            result := add(result, o) // Move the pointer, accounting for leading zero.
            mstore(result, sub(n, o)) // Store the length, accounting for leading zero.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    /// As address are 20 bytes long, the output will left-padded to have
    /// a length of `20 * 2` bytes.
    function toHexStringNoPrefix(uint256 value) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x40 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0.
            result := add(mload(0x40), 0x80)
            mstore(0x40, add(result, 0x20)) // Allocate memory.
            mstore(result, 0) // Zeroize the slot after the string.

            let end := result // Cache the end to calculate the length later.
            mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.

            let w := not(1) // Tsk.
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let temp := value } 1 {} {
                result := add(result, w) // `sub(result, 2)`.
                mstore8(add(result, 1), mload(and(temp, 15)))
                mstore8(result, mload(and(shr(4, temp), 15)))
                temp := shr(8, temp)
                if iszero(temp) { break }
            }
            let n := sub(end, result)
            result := sub(result, 0x20)
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte,
    /// and the alphabets are capitalized conditionally according to
    /// https://eips.ethereum.org/EIPS/eip-55
    function toHexStringChecksummed(address value) internal pure returns (string memory result) {
        result = toHexString(value);
        /// @solidity memory-safe-assembly
        assembly {
            let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...`
            let o := add(result, 0x22)
            let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... `
            let t := shl(240, 136) // `0b10001000 << 240`
            for { let i := 0 } 1 {} {
                mstore(add(i, i), mul(t, byte(i, hashed)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
            mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask)))))
            o := add(o, 0x20)
            mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask)))))
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.
    function toHexString(address value) internal pure returns (string memory result) {
        result = toHexStringNoPrefix(value);
        /// @solidity memory-safe-assembly
        assembly {
            let n := add(mload(result), 2) // Compute the length.
            mstore(result, 0x3078) // Store the "0x" prefix.
            result := sub(result, 2) // Move the pointer.
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the hexadecimal representation of `value`.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(address value) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            // Allocate memory.
            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,
            // 0x02 bytes for the prefix, and 0x28 bytes for the digits.
            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80.
            mstore(0x40, add(result, 0x80))
            mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.

            result := add(result, 2)
            mstore(result, 40) // Store the length.
            let o := add(result, 0x20)
            mstore(add(o, 40), 0) // Zeroize the slot after the string.
            value := shl(96, value)
            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            for { let i := 0 } 1 {} {
                let p := add(o, add(i, i))
                let temp := byte(i, value)
                mstore8(add(p, 1), mload(and(temp, 15)))
                mstore8(p, mload(shr(4, temp)))
                i := add(i, 1)
                if eq(i, 20) { break }
            }
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexString(bytes memory raw) internal pure returns (string memory result) {
        result = toHexStringNoPrefix(raw);
        /// @solidity memory-safe-assembly
        assembly {
            let n := add(mload(result), 2) // Compute the length.
            mstore(result, 0x3078) // Store the "0x" prefix.
            result := sub(result, 2) // Move the pointer.
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the hex encoded string from the raw bytes.
    /// The output is encoded using 2 hexadecimal digits per byte.
    function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            let n := mload(raw)
            result := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix.
            mstore(result, add(n, n)) // Store the length of the output.

            mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.
            let o := add(result, 0x20)
            let end := add(raw, n)
            for {} iszero(eq(raw, end)) {} {
                raw := add(raw, 1)
                mstore8(add(o, 1), mload(and(mload(raw), 15)))
                mstore8(o, mload(and(shr(4, mload(raw)), 15)))
                o := add(o, 2)
            }
            mstore(o, 0) // Zeroize the slot after the string.
            mstore(0x40, add(o, 0x20)) // Allocate memory.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   RUNE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the number of UTF characters in the string.
    function runeCount(string memory s) internal pure returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(s) {
                mstore(0x00, div(not(0), 255))
                mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506)
                let o := add(s, 0x20)
                let end := add(o, mload(s))
                for { result := 1 } 1 { result := add(result, 1) } {
                    o := add(o, byte(0, mload(shr(250, mload(o)))))
                    if iszero(lt(o, end)) { break }
                }
            }
        }
    }

    /// @dev Returns if this string is a 7-bit ASCII string.
    /// (i.e. all characters codes are in [0..127])
    function is7BitASCII(string memory s) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            let mask := shl(7, div(not(0), 255))
            let n := mload(s)
            if n {
                let o := add(s, 0x20)
                let end := add(o, n)
                let last := mload(end)
                mstore(end, 0)
                for {} 1 {} {
                    if and(mask, mload(o)) {
                        result := 0
                        break
                    }
                    o := add(o, 0x20)
                    if iszero(lt(o, end)) { break }
                }
                mstore(end, last)
            }
        }
    }

    /// @dev Returns if this string is a 7-bit ASCII string,
    /// AND all characters are in the `allowed` lookup.
    /// Note: If `s` is empty, returns true regardless of `allowed`.
    function is7BitASCII(string memory s, uint128 allowed) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := 1
            if mload(s) {
                let allowed_ := shr(128, shl(128, allowed))
                let o := add(s, 0x20)
                for { let end := add(o, mload(s)) } 1 {} {
                    result := and(result, shr(byte(0, mload(o)), allowed_))
                    o := add(o, 1)
                    if iszero(and(result, lt(o, end))) { break }
                }
            }
        }
    }

    /// @dev Converts the bytes in the 7-bit ASCII string `s` to
    /// an allowed lookup for use in `is7BitASCII(s, allowed)`.
    /// To save runtime gas, you can cache the result in an immutable variable.
    function to7BitASCIIAllowedLookup(string memory s) internal pure returns (uint128 result) {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(s) {
                let o := add(s, 0x20)
                for { let end := add(o, mload(s)) } 1 {} {
                    result := or(result, shl(byte(0, mload(o)), 1))
                    o := add(o, 1)
                    if iszero(lt(o, end)) { break }
                }
                if shr(128, result) {
                    mstore(0x00, 0xc9807e0d) // `StringNot7BitASCII()`.
                    revert(0x1c, 0x04)
                }
            }
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   BYTE STRING OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // For performance and bytecode compactness, byte string operations are restricted
    // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets.
    // Usage of byte string operations on charsets with runes spanning two or more bytes
    // can lead to undefined behavior.

    /// @dev Returns `subject` all occurrences of `needle` replaced with `replacement`.
    function replace(string memory subject, string memory needle, string memory replacement)
        internal
        pure
        returns (string memory)
    {
        return string(LibBytes.replace(bytes(subject), bytes(needle), bytes(replacement)));
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from left to right, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function indexOf(string memory subject, string memory needle, uint256 from)
        internal
        pure
        returns (uint256)
    {
        return LibBytes.indexOf(bytes(subject), bytes(needle), from);
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from left to right.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function indexOf(string memory subject, string memory needle) internal pure returns (uint256) {
        return LibBytes.indexOf(bytes(subject), bytes(needle), 0);
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from right to left, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function lastIndexOf(string memory subject, string memory needle, uint256 from)
        internal
        pure
        returns (uint256)
    {
        return LibBytes.lastIndexOf(bytes(subject), bytes(needle), from);
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from right to left.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function lastIndexOf(string memory subject, string memory needle)
        internal
        pure
        returns (uint256)
    {
        return LibBytes.lastIndexOf(bytes(subject), bytes(needle), type(uint256).max);
    }

    /// @dev Returns true if `needle` is found in `subject`, false otherwise.
    function contains(string memory subject, string memory needle) internal pure returns (bool) {
        return LibBytes.contains(bytes(subject), bytes(needle));
    }

    /// @dev Returns whether `subject` starts with `needle`.
    function startsWith(string memory subject, string memory needle) internal pure returns (bool) {
        return LibBytes.startsWith(bytes(subject), bytes(needle));
    }

    /// @dev Returns whether `subject` ends with `needle`.
    function endsWith(string memory subject, string memory needle) internal pure returns (bool) {
        return LibBytes.endsWith(bytes(subject), bytes(needle));
    }

    /// @dev Returns `subject` repeated `times`.
    function repeat(string memory subject, uint256 times) internal pure returns (string memory) {
        return string(LibBytes.repeat(bytes(subject), times));
    }

    /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).
    /// `start` and `end` are byte offsets.
    function slice(string memory subject, uint256 start, uint256 end)
        internal
        pure
        returns (string memory)
    {
        return string(LibBytes.slice(bytes(subject), start, end));
    }

    /// @dev Returns a copy of `subject` sliced from `start` to the end of the string.
    /// `start` is a byte offset.
    function slice(string memory subject, uint256 start) internal pure returns (string memory) {
        return string(LibBytes.slice(bytes(subject), start, type(uint256).max));
    }

    /// @dev Returns all the indices of `needle` in `subject`.
    /// The indices are byte offsets.
    function indicesOf(string memory subject, string memory needle)
        internal
        pure
        returns (uint256[] memory)
    {
        return LibBytes.indicesOf(bytes(subject), bytes(needle));
    }

    /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string.
    function split(string memory subject, string memory delimiter)
        internal
        pure
        returns (string[] memory result)
    {
        bytes[] memory a = LibBytes.split(bytes(subject), bytes(delimiter));
        /// @solidity memory-safe-assembly
        assembly {
            result := a
        }
    }

    /// @dev Returns a concatenated string of `a` and `b`.
    /// Cheaper than `string.concat()` and does not de-align the free memory pointer.
    function concat(string memory a, string memory b) internal pure returns (string memory) {
        return string(LibBytes.concat(bytes(a), bytes(b)));
    }

    /// @dev Returns a copy of the string in either lowercase or UPPERCASE.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function toCase(string memory subject, bool toUpper)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let n := mload(subject)
            if n {
                result := mload(0x40)
                let o := add(result, 0x20)
                let d := sub(subject, result)
                let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff)
                for { let end := add(o, n) } 1 {} {
                    let b := byte(0, mload(add(d, o)))
                    mstore8(o, xor(and(shr(b, flags), 0x20), b))
                    o := add(o, 1)
                    if eq(o, end) { break }
                }
                mstore(result, n) // Store the length.
                mstore(o, 0) // Zeroize the slot after the string.
                mstore(0x40, add(o, 0x20)) // Allocate memory.
            }
        }
    }

    /// @dev Returns a string from a small bytes32 string.
    /// `s` must be null-terminated, or behavior will be undefined.
    function fromSmallString(bytes32 s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let n := 0
            for {} byte(n, s) { n := add(n, 1) } {} // Scan for '\0'.
            mstore(result, n) // Store the length.
            let o := add(result, 0x20)
            mstore(o, s) // Store the bytes of the string.
            mstore(add(o, n), 0) // Zeroize the slot after the string.
            mstore(0x40, add(result, 0x40)) // Allocate memory.
        }
    }

    /// @dev Returns the small string, with all bytes after the first null byte zeroized.
    function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            for {} byte(result, s) { result := add(result, 1) } {} // Scan for '\0'.
            mstore(0x00, s)
            mstore(result, 0x00)
            result := mload(0x00)
        }
    }

    /// @dev Returns the string as a normalized null-terminated small string.
    function toSmallString(string memory s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(s)
            if iszero(lt(result, 33)) {
                mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`.
                revert(0x1c, 0x04)
            }
            result := shl(shl(3, sub(32, result)), mload(add(s, result)))
        }
    }

    /// @dev Returns a lowercased copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function lower(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, false);
    }

    /// @dev Returns an UPPERCASED copy of the string.
    /// WARNING! This function is only compatible with 7-bit ASCII strings.
    function upper(string memory subject) internal pure returns (string memory result) {
        result = toCase(subject, true);
    }

    /// @dev Escapes the string to be used within HTML tags.
    function escapeHTML(string memory s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let end := add(s, mload(s))
            let o := add(result, 0x20)
            // Store the bytes of the packed offsets and strides into the scratch space.
            // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6.
            mstore(0x1f, 0x900094)
            mstore(0x08, 0xc0000000a6ab)
            // Store "&quot;&amp;&#39;&lt;&gt;" into the scratch space.
            mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b))
            for {} iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                // Not in `["\"","'","&","<",">"]`.
                if iszero(and(shl(c, 1), 0x500000c400000000)) {
                    mstore8(o, c)
                    o := add(o, 1)
                    continue
                }
                let t := shr(248, mload(c))
                mstore(o, mload(and(t, 0x1f)))
                o := add(o, shr(5, t))
            }
            mstore(o, 0) // Zeroize the slot after the string.
            mstore(result, sub(o, add(result, 0x20))) // Store the length.
            mstore(0x40, add(o, 0x20)) // Allocate memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes.
    function escapeJSON(string memory s, bool addDoubleQuotes)
        internal
        pure
        returns (string memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let o := add(result, 0x20)
            if addDoubleQuotes {
                mstore8(o, 34)
                o := add(1, o)
            }
            // Store "\\u0000" in scratch space.
            // Store "0123456789abcdef" in scratch space.
            // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`.
            // into the scratch space.
            mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672)
            // Bitmask for detecting `["\"","\\"]`.
            let e := or(shl(0x22, 1), shl(0x5c, 1))
            for { let end := add(s, mload(s)) } iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                if iszero(lt(c, 0x20)) {
                    if iszero(and(shl(c, 1), e)) {
                        // Not in `["\"","\\"]`.
                        mstore8(o, c)
                        o := add(o, 1)
                        continue
                    }
                    mstore8(o, 0x5c) // "\\".
                    mstore8(add(o, 1), c)
                    o := add(o, 2)
                    continue
                }
                if iszero(and(shl(c, 1), 0x3700)) {
                    // Not in `["\b","\t","\n","\f","\d"]`.
                    mstore8(0x1d, mload(shr(4, c))) // Hex value.
                    mstore8(0x1e, mload(and(c, 15))) // Hex value.
                    mstore(o, mload(0x19)) // "\\u00XX".
                    o := add(o, 6)
                    continue
                }
                mstore8(o, 0x5c) // "\\".
                mstore8(add(o, 1), mload(add(c, 8)))
                o := add(o, 2)
            }
            if addDoubleQuotes {
                mstore8(o, 34)
                o := add(1, o)
            }
            mstore(o, 0) // Zeroize the slot after the string.
            mstore(result, sub(o, add(result, 0x20))) // Store the length.
            mstore(0x40, add(o, 0x20)) // Allocate memory.
        }
    }

    /// @dev Escapes the string to be used within double-quotes in a JSON.
    function escapeJSON(string memory s) internal pure returns (string memory result) {
        result = escapeJSON(s, false);
    }

    /// @dev Encodes `s` so that it can be safely used in a URI,
    /// just like `encodeURIComponent` in JavaScript.
    /// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
    /// See: https://datatracker.ietf.org/doc/html/rfc2396
    /// See: https://datatracker.ietf.org/doc/html/rfc3986
    function encodeURIComponent(string memory s) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            // Store "0123456789ABCDEF" in scratch space.
            // Uppercased to be consistent with JavaScript's implementation.
            mstore(0x0f, 0x30313233343536373839414243444546)
            let o := add(result, 0x20)
            for { let end := add(s, mload(s)) } iszero(eq(s, end)) {} {
                s := add(s, 1)
                let c := and(mload(s), 0xff)
                // If not in `[0-9A-Z-a-z-_.!~*'()]`.
                if iszero(and(1, shr(c, 0x47fffffe87fffffe03ff678200000000))) {
                    mstore8(o, 0x25) // '%'.
                    mstore8(add(o, 1), mload(and(shr(4, c), 15)))
                    mstore8(add(o, 2), mload(and(c, 15)))
                    o := add(o, 3)
                    continue
                }
                mstore8(o, c)
                o := add(o, 1)
            }
            mstore(result, sub(o, add(result, 0x20))) // Store the length.
            mstore(o, 0) // Zeroize the slot after the string.
            mstore(0x40, add(o, 0x20)) // Allocate memory.
        }
    }

    /// @dev Returns whether `a` equals `b`.
    function eq(string memory a, string memory b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))
        }
    }

    /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string.
    function eqs(string memory a, bytes32 b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            // These should be evaluated on compile time, as far as possible.
            let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.
            let x := not(or(m, or(b, add(m, and(b, m)))))
            let r := shl(7, iszero(iszero(shr(128, x))))
            r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),
                xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))
        }
    }

    /// @dev Returns 0 if `a == b`, -1 if `a < b`, +1 if `a > b`.
    /// If `a` == b[:a.length]`, and `a.length < b.length`, returns -1.
    function cmp(string memory a, string memory b) internal pure returns (int256) {
        return LibBytes.cmp(bytes(a), bytes(b));
    }

    /// @dev Packs a single string with its length into a single word.
    /// Returns `bytes32(0)` if the length is zero or greater than 31.
    function packOne(string memory a) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            // We don't need to zero right pad the string,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    // Load the length and the bytes.
                    mload(add(a, 0x1f)),
                    // `length != 0 && length < 32`. Abuses underflow.
                    // Assumes that the length is valid and within the block gas limit.
                    lt(sub(mload(a), 1), 0x1f)
                )
        }
    }

    /// @dev Unpacks a string packed using {packOne}.
    /// Returns the empty string if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packOne}, the output behavior is undefined.
    function unpackOne(bytes32 packed) internal pure returns (string memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40) // Grab the free memory pointer.
            mstore(0x40, add(result, 0x40)) // Allocate 2 words (1 for the length, 1 for the bytes).
            mstore(result, 0) // Zeroize the length slot.
            mstore(add(result, 0x1f), packed) // Store the length and bytes.
            mstore(add(add(result, 0x20), mload(result)), 0) // Right pad with zeroes.
        }
    }

    /// @dev Packs two strings with their lengths into a single word.
    /// Returns `bytes32(0)` if combined length is zero or greater than 30.
    function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let aLen := mload(a)
            // We don't need to zero right pad the strings,
            // since this is our own custom non-standard packing scheme.
            result :=
                mul(
                    or( // Load the length and the bytes of `a` and `b`.
                    shl(shl(3, sub(0x1f, aLen)), mload(add(a, aLen))), mload(sub(add(b, 0x1e), aLen))),
                    // `totalLen != 0 && totalLen < 31`. Abuses underflow.
                    // Assumes that the lengths are valid and within the block gas limit.
                    lt(sub(add(aLen, mload(b)), 1), 0x1e)
                )
        }
    }

    /// @dev Unpacks strings packed using {packTwo}.
    /// Returns the empty strings if `packed` is `bytes32(0)`.
    /// If `packed` is not an output of {packTwo}, the output behavior is undefined.
    function unpackTwo(bytes32 packed)
        internal
        pure
        returns (string memory resultA, string memory resultB)
    {
        /// @solidity memory-safe-assembly
        assembly {
            resultA := mload(0x40) // Grab the free memory pointer.
            resultB := add(resultA, 0x40)
            // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words.
            mstore(0x40, add(resultB, 0x40))
            // Zeroize the length slots.
            mstore(resultA, 0)
            mstore(resultB, 0)
            // Store the lengths and bytes.
            mstore(add(resultA, 0x1f), packed)
            mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA))))
            // Right pad with zeroes.
            mstore(add(add(resultA, 0x20), mload(resultA)), 0)
            mstore(add(add(resultB, 0x20), mload(resultB)), 0)
        }
    }

    /// @dev Directly returns `a` without copying.
    function directReturn(string memory a) internal pure {
        assembly {
            // Assumes that the string does not start from the scratch space.
            let retStart := sub(a, 0x20)
            let retUnpaddedSize := add(mload(a), 0x40)
            // Right pad with zeroes. Just in case the string is produced
            // by a method that doesn't zero right pad.
            mstore(add(retStart, retUnpaddedSize), 0)
            mstore(retStart, 0x20) // Store the return offset.
            // End the transaction, returning the string.
            return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))
        }
    }
}

File 8 of 11 : MerkleProofLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Gas optimized verification of proof of inclusion for a leaf in a Merkle tree.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/MerkleProofLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/MerkleProofLib.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol)
library MerkleProofLib {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*            MERKLE PROOF VERIFICATION OPERATIONS            */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`.
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf)
        internal
        pure
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            if mload(proof) {
                // Initialize `offset` to the offset of `proof` elements in memory.
                let offset := add(proof, 0x20)
                // Left shift by 5 is equivalent to multiplying by 0x20.
                let end := add(offset, shl(5, mload(proof)))
                // Iterate over proof elements to compute root hash.
                for {} 1 {} {
                    // Slot of `leaf` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(leaf, mload(offset)))
                    // Store elements to hash contiguously in scratch space.
                    // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes.
                    mstore(scratch, leaf)
                    mstore(xor(scratch, 0x20), mload(offset))
                    // Reuse `leaf` to store the hash to reduce stack operations.
                    leaf := keccak256(0x00, 0x40)
                    offset := add(offset, 0x20)
                    if iszero(lt(offset, end)) { break }
                }
            }
            isValid := eq(leaf, root)
        }
    }

    /// @dev Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`.
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf)
        internal
        pure
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            if proof.length {
                // Left shift by 5 is equivalent to multiplying by 0x20.
                let end := add(proof.offset, shl(5, proof.length))
                // Initialize `offset` to the offset of `proof` in the calldata.
                let offset := proof.offset
                // Iterate over proof elements to compute root hash.
                for {} 1 {} {
                    // Slot of `leaf` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(leaf, calldataload(offset)))
                    // Store elements to hash contiguously in scratch space.
                    // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes.
                    mstore(scratch, leaf)
                    mstore(xor(scratch, 0x20), calldataload(offset))
                    // Reuse `leaf` to store the hash to reduce stack operations.
                    leaf := keccak256(0x00, 0x40)
                    offset := add(offset, 0x20)
                    if iszero(lt(offset, end)) { break }
                }
            }
            isValid := eq(leaf, root)
        }
    }

    /// @dev Returns whether all `leaves` exist in the Merkle tree with `root`,
    /// given `proof` and `flags`.
    ///
    /// Note:
    /// - Breaking the invariant `flags.length == (leaves.length - 1) + proof.length`
    ///   will always return false.
    /// - The sum of the lengths of `proof` and `leaves` must never overflow.
    /// - Any non-zero word in the `flags` array is treated as true.
    /// - The memory offset of `proof` must be non-zero
    ///   (i.e. `proof` is not pointing to the scratch space).
    function verifyMultiProof(
        bytes32[] memory proof,
        bytes32 root,
        bytes32[] memory leaves,
        bool[] memory flags
    ) internal pure returns (bool isValid) {
        // Rebuilds the root by consuming and producing values on a queue.
        // The queue starts with the `leaves` array, and goes into a `hashes` array.
        // After the process, the last element on the queue is verified
        // to be equal to the `root`.
        //
        // The `flags` array denotes whether the sibling
        // should be popped from the queue (`flag == true`), or
        // should be popped from the `proof` (`flag == false`).
        /// @solidity memory-safe-assembly
        assembly {
            // Cache the lengths of the arrays.
            let leavesLength := mload(leaves)
            let proofLength := mload(proof)
            let flagsLength := mload(flags)

            // Advance the pointers of the arrays to point to the data.
            leaves := add(0x20, leaves)
            proof := add(0x20, proof)
            flags := add(0x20, flags)

            // If the number of flags is correct.
            for {} eq(add(leavesLength, proofLength), add(flagsLength, 1)) {} {
                // For the case where `proof.length + leaves.length == 1`.
                if iszero(flagsLength) {
                    // `isValid = (proof.length == 1 ? proof[0] : leaves[0]) == root`.
                    isValid := eq(mload(xor(leaves, mul(xor(proof, leaves), proofLength))), root)
                    break
                }

                // The required final proof offset if `flagsLength` is not zero, otherwise zero.
                let proofEnd := add(proof, shl(5, proofLength))
                // We can use the free memory space for the queue.
                // We don't need to allocate, since the queue is temporary.
                let hashesFront := mload(0x40)
                // Copy the leaves into the hashes.
                // Sometimes, a little memory expansion costs less than branching.
                // Should cost less, even with a high free memory offset of 0x7d00.
                leavesLength := shl(5, leavesLength)
                for { let i := 0 } iszero(eq(i, leavesLength)) { i := add(i, 0x20) } {
                    mstore(add(hashesFront, i), mload(add(leaves, i)))
                }
                // Compute the back of the hashes.
                let hashesBack := add(hashesFront, leavesLength)
                // This is the end of the memory for the queue.
                // We recycle `flagsLength` to save on stack variables (sometimes save gas).
                flagsLength := add(hashesBack, shl(5, flagsLength))

                for {} 1 {} {
                    // Pop from `hashes`.
                    let a := mload(hashesFront)
                    // Pop from `hashes`.
                    let b := mload(add(hashesFront, 0x20))
                    hashesFront := add(hashesFront, 0x40)

                    // If the flag is false, load the next proof,
                    // else, pops from the queue.
                    if iszero(mload(flags)) {
                        // Loads the next proof.
                        b := mload(proof)
                        proof := add(proof, 0x20)
                        // Unpop from `hashes`.
                        hashesFront := sub(hashesFront, 0x20)
                    }

                    // Advance to the next flag.
                    flags := add(flags, 0x20)

                    // Slot of `a` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(a, b))
                    // Hash the scratch space and push the result onto the queue.
                    mstore(scratch, a)
                    mstore(xor(scratch, 0x20), b)
                    mstore(hashesBack, keccak256(0x00, 0x40))
                    hashesBack := add(hashesBack, 0x20)
                    if iszero(lt(hashesBack, flagsLength)) { break }
                }
                isValid :=
                    and(
                        // Checks if the last value in the queue is same as the root.
                        eq(mload(sub(hashesBack, 0x20)), root),
                        // And whether all the proofs are used, if required.
                        eq(proofEnd, proof)
                    )
                break
            }
        }
    }

    /// @dev Returns whether all `leaves` exist in the Merkle tree with `root`,
    /// given `proof` and `flags`.
    ///
    /// Note:
    /// - Breaking the invariant `flags.length == (leaves.length - 1) + proof.length`
    ///   will always return false.
    /// - Any non-zero word in the `flags` array is treated as true.
    /// - The calldata offset of `proof` must be non-zero
    ///   (i.e. `proof` is from a regular Solidity function with a 4-byte selector).
    function verifyMultiProofCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32[] calldata leaves,
        bool[] calldata flags
    ) internal pure returns (bool isValid) {
        // Rebuilds the root by consuming and producing values on a queue.
        // The queue starts with the `leaves` array, and goes into a `hashes` array.
        // After the process, the last element on the queue is verified
        // to be equal to the `root`.
        //
        // The `flags` array denotes whether the sibling
        // should be popped from the queue (`flag == true`), or
        // should be popped from the `proof` (`flag == false`).
        /// @solidity memory-safe-assembly
        assembly {
            // If the number of flags is correct.
            for {} eq(add(leaves.length, proof.length), add(flags.length, 1)) {} {
                // For the case where `proof.length + leaves.length == 1`.
                if iszero(flags.length) {
                    // `isValid = (proof.length == 1 ? proof[0] : leaves[0]) == root`.
                    // forgefmt: disable-next-item
                    isValid := eq(
                        calldataload(
                            xor(leaves.offset, mul(xor(proof.offset, leaves.offset), proof.length))
                        ),
                        root
                    )
                    break
                }

                // The required final proof offset if `flagsLength` is not zero, otherwise zero.
                let proofEnd := add(proof.offset, shl(5, proof.length))
                // We can use the free memory space for the queue.
                // We don't need to allocate, since the queue is temporary.
                let hashesFront := mload(0x40)
                // Copy the leaves into the hashes.
                // Sometimes, a little memory expansion costs less than branching.
                // Should cost less, even with a high free memory offset of 0x7d00.
                calldatacopy(hashesFront, leaves.offset, shl(5, leaves.length))
                // Compute the back of the hashes.
                let hashesBack := add(hashesFront, shl(5, leaves.length))
                // This is the end of the memory for the queue.
                // We recycle `flagsLength` to save on stack variables (sometimes save gas).
                flags.length := add(hashesBack, shl(5, flags.length))

                // We don't need to make a copy of `proof.offset` or `flags.offset`,
                // as they are pass-by-value (this trick may not always save gas).

                for {} 1 {} {
                    // Pop from `hashes`.
                    let a := mload(hashesFront)
                    // Pop from `hashes`.
                    let b := mload(add(hashesFront, 0x20))
                    hashesFront := add(hashesFront, 0x40)

                    // If the flag is false, load the next proof,
                    // else, pops from the queue.
                    if iszero(calldataload(flags.offset)) {
                        // Loads the next proof.
                        b := calldataload(proof.offset)
                        proof.offset := add(proof.offset, 0x20)
                        // Unpop from `hashes`.
                        hashesFront := sub(hashesFront, 0x20)
                    }

                    // Advance to the next flag offset.
                    flags.offset := add(flags.offset, 0x20)

                    // Slot of `a` in scratch space.
                    // If the condition is true: 0x20, otherwise: 0x00.
                    let scratch := shl(5, gt(a, b))
                    // Hash the scratch space and push the result onto the queue.
                    mstore(scratch, a)
                    mstore(xor(scratch, 0x20), b)
                    mstore(hashesBack, keccak256(0x00, 0x40))
                    hashesBack := add(hashesBack, 0x20)
                    if iszero(lt(hashesBack, flags.length)) { break }
                }
                isValid :=
                    and(
                        // Checks if the last value in the queue is same as the root.
                        eq(mload(sub(hashesBack, 0x20)), root),
                        // And whether all the proofs are used, if required.
                        eq(proofEnd, proof.offset)
                    )
                break
            }
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                   EMPTY CALLDATA HELPERS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns an empty calldata bytes32 array.
    function emptyProof() internal pure returns (bytes32[] calldata proof) {
        /// @solidity memory-safe-assembly
        assembly {
            proof.length := 0
        }
    }

    /// @dev Returns an empty calldata bytes32 array.
    function emptyLeaves() internal pure returns (bytes32[] calldata leaves) {
        /// @solidity memory-safe-assembly
        assembly {
            leaves.length := 0
        }
    }

    /// @dev Returns an empty calldata bool array.
    function emptyFlags() internal pure returns (bool[] calldata flags) {
        /// @solidity memory-safe-assembly
        assembly {
            flags.length := 0
        }
    }
}

File 9 of 11 : SafeTransferLib.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @author Permit2 operations from (https://github.com/Uniswap/permit2/blob/main/src/libraries/Permit2Lib.sol)
///
/// @dev Note:
/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.
library SafeTransferLib {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The ETH transfer has failed.
    error ETHTransferFailed();

    /// @dev The ERC20 `transferFrom` has failed.
    error TransferFromFailed();

    /// @dev The ERC20 `transfer` has failed.
    error TransferFailed();

    /// @dev The ERC20 `approve` has failed.
    error ApproveFailed();

    /// @dev The ERC20 `totalSupply` query has failed.
    error TotalSupplyQueryFailed();

    /// @dev The Permit2 operation has failed.
    error Permit2Failed();

    /// @dev The Permit2 amount must be less than `2**160 - 1`.
    error Permit2AmountOverflow();

    /// @dev The Permit2 approve operation has failed.
    error Permit2ApproveFailed();

    /// @dev The Permit2 lockdown operation has failed.
    error Permit2LockdownFailed();

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes.
    uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300;

    /// @dev Suggested gas stipend for contract receiving ETH to perform a few
    /// storage reads and writes, but low enough to prevent griefing.
    uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;

    /// @dev The unique EIP-712 domain domain separator for the DAI token contract.
    bytes32 internal constant DAI_DOMAIN_SEPARATOR =
        0xdbb8cf42e1ecb028be3f3dbc922e1d878b963f411dc388ced501601c60f7c6f7;

    /// @dev The address for the WETH9 contract on Ethereum mainnet.
    address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

    /// @dev The canonical Permit2 address.
    /// [Github](https://github.com/Uniswap/permit2)
    /// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)
    address internal constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                       ETH OPERATIONS                       */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.
    //
    // The regular variants:
    // - Forwards all remaining gas to the target.
    // - Reverts if the target reverts.
    // - Reverts if the current contract has insufficient balance.
    //
    // The force variants:
    // - Forwards with an optional gas stipend
    //   (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).
    // - If the target reverts, or if the gas stipend is exhausted,
    //   creates a temporary contract to force send the ETH via `SELFDESTRUCT`.
    //   Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.
    // - Reverts if the current contract has insufficient balance.
    //
    // The try variants:
    // - Forwards with a mandatory gas stipend.
    // - Instead of reverting, returns whether the transfer succeeded.

    /// @dev Sends `amount` (in wei) ETH to `to`.
    function safeTransferETH(address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Sends all the ETH in the current contract to `to`.
    function safeTransferAllETH(address to) internal {
        /// @solidity memory-safe-assembly
        assembly {
            // Transfer all the ETH and check if it succeeded or not.
            if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
    function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if lt(selfbalance(), amount) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
            if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.
    function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.
    function forceSafeTransferETH(address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            if lt(selfbalance(), amount) {
                mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
                revert(0x1c, 0x04)
            }
            if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.
    function forceSafeTransferAllETH(address to) internal {
        /// @solidity memory-safe-assembly
        assembly {
            // forgefmt: disable-next-item
            if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
                mstore(0x00, to) // Store the address in scratch space.
                mstore8(0x0b, 0x73) // Opcode `PUSH20`.
                mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
                if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
            }
        }
    }

    /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
    function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)
        internal
        returns (bool success)
    {
        /// @solidity memory-safe-assembly
        assembly {
            success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)
        }
    }

    /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.
    function trySafeTransferAllETH(address to, uint256 gasStipend)
        internal
        returns (bool success)
    {
        /// @solidity memory-safe-assembly
        assembly {
            success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                      ERC20 OPERATIONS                      */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
    /// Reverts upon failure.
    ///
    /// The `from` account must have at least `amount` approved for
    /// the current contract to manage.
    function safeTransferFrom(address token, address from, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x60, amount) // Store the `amount` argument.
            mstore(0x40, to) // Store the `to` argument.
            mstore(0x2c, shl(96, from)) // Store the `from` argument.
            mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
            let success := call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
            if iszero(and(eq(mload(0x00), 1), success)) {
                if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
                    mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
                    revert(0x1c, 0x04)
                }
            }
            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
    ///
    /// The `from` account must have at least `amount` approved for the current contract to manage.
    function trySafeTransferFrom(address token, address from, address to, uint256 amount)
        internal
        returns (bool success)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x60, amount) // Store the `amount` argument.
            mstore(0x40, to) // Store the `to` argument.
            mstore(0x2c, shl(96, from)) // Store the `from` argument.
            mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
            success := call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
            if iszero(and(eq(mload(0x00), 1), success)) {
                success := lt(or(iszero(extcodesize(token)), returndatasize()), success)
            }
            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Sends all of ERC20 `token` from `from` to `to`.
    /// Reverts upon failure.
    ///
    /// The `from` account must have their entire balance approved for the current contract to manage.
    function safeTransferAllFrom(address token, address from, address to)
        internal
        returns (uint256 amount)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40) // Cache the free memory pointer.
            mstore(0x40, to) // Store the `to` argument.
            mstore(0x2c, shl(96, from)) // Store the `from` argument.
            mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
            // Read the balance, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                    staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)
                )
            ) {
                mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.
            amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.
            // Perform the transfer, reverting upon failure.
            let success := call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
            if iszero(and(eq(mload(0x00), 1), success)) {
                if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
                    mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
                    revert(0x1c, 0x04)
                }
            }
            mstore(0x60, 0) // Restore the zero slot to zero.
            mstore(0x40, m) // Restore the free memory pointer.
        }
    }

    /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
    /// Reverts upon failure.
    function safeTransfer(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
            // Perform the transfer, reverting upon failure.
            let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
            if iszero(and(eq(mload(0x00), 1), success)) {
                if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
                    mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
                    revert(0x1c, 0x04)
                }
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Sends all of ERC20 `token` from the current contract to `to`.
    /// Reverts upon failure.
    function safeTransferAll(address token, address to) internal returns (uint256 amount) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.
            mstore(0x20, address()) // Store the address of the current contract.
            // Read the balance, reverting upon failure.
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                    staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)
                )
            ) {
                mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
                revert(0x1c, 0x04)
            }
            mstore(0x14, to) // Store the `to` argument.
            amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.
            mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
            // Perform the transfer, reverting upon failure.
            let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
            if iszero(and(eq(mload(0x00), 1), success)) {
                if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
                    mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
                    revert(0x1c, 0x04)
                }
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
    /// Reverts upon failure.
    function safeApprove(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
            let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
            if iszero(and(eq(mload(0x00), 1), success)) {
                if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
                    mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
                    revert(0x1c, 0x04)
                }
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
    /// If the initial attempt to approve fails, attempts to reset the approved amount to zero,
    /// then retries the approval again (some tokens, e.g. USDT, requires this).
    /// Reverts upon failure.
    function safeApproveWithRetry(address token, address to, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, to) // Store the `to` argument.
            mstore(0x34, amount) // Store the `amount` argument.
            mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
            // Perform the approval, retrying upon failure.
            let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
            if iszero(and(eq(mload(0x00), 1), success)) {
                if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
                    mstore(0x34, 0) // Store 0 for the `amount`.
                    mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
                    pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval.
                    mstore(0x34, amount) // Store back the original `amount`.
                    // Retry the approval, reverting upon failure.
                    success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
                    if iszero(and(eq(mload(0x00), 1), success)) {
                        // Check the `extcodesize` again just in case the token selfdestructs lol.
                        if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
                            mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
                            revert(0x1c, 0x04)
                        }
                    }
                }
            }
            mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
        }
    }

    /// @dev Returns the amount of ERC20 `token` owned by `account`.
    /// Returns zero if the `token` does not exist.
    function balanceOf(address token, address account) internal view returns (uint256 amount) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x14, account) // Store the `account` argument.
            mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
            amount :=
                mul( // The arguments of `mul` are evaluated from right to left.
                    mload(0x20),
                    and( // The arguments of `and` are evaluated from right to left.
                        gt(returndatasize(), 0x1f), // At least 32 bytes returned.
                        staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
                    )
                )
        }
    }

    /// @dev Returns the total supply of the `token`.
    /// Reverts if the token does not exist or does not implement `totalSupply()`.
    function totalSupply(address token) internal view returns (uint256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, 0x18160ddd) // `totalSupply()`.
            if iszero(
                and(gt(returndatasize(), 0x1f), staticcall(gas(), token, 0x1c, 0x04, 0x00, 0x20))
            ) {
                mstore(0x00, 0x54cd9435) // `TotalSupplyQueryFailed()`.
                revert(0x1c, 0x04)
            }
            result := mload(0x00)
        }
    }

    /// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
    /// If the initial attempt fails, try to use Permit2 to transfer the token.
    /// Reverts upon failure.
    ///
    /// The `from` account must have at least `amount` approved for the current contract to manage.
    function safeTransferFrom2(address token, address from, address to, uint256 amount) internal {
        if (!trySafeTransferFrom(token, from, to, amount)) {
            permit2TransferFrom(token, from, to, amount);
        }
    }

    /// @dev Sends `amount` of ERC20 `token` from `from` to `to` via Permit2.
    /// Reverts upon failure.
    function permit2TransferFrom(address token, address from, address to, uint256 amount)
        internal
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            mstore(add(m, 0x74), shr(96, shl(96, token)))
            mstore(add(m, 0x54), amount)
            mstore(add(m, 0x34), to)
            mstore(add(m, 0x20), shl(96, from))
            // `transferFrom(address,address,uint160,address)`.
            mstore(m, 0x36c78516000000000000000000000000)
            let p := PERMIT2
            let exists := eq(chainid(), 1)
            if iszero(exists) { exists := iszero(iszero(extcodesize(p))) }
            if iszero(
                and(
                    call(gas(), p, 0, add(m, 0x10), 0x84, codesize(), 0x00),
                    lt(iszero(extcodesize(token)), exists) // Token has code and Permit2 exists.
                )
            ) {
                mstore(0x00, 0x7939f4248757f0fd) // `TransferFromFailed()` or `Permit2AmountOverflow()`.
                revert(add(0x18, shl(2, iszero(iszero(shr(160, amount))))), 0x04)
            }
        }
    }

    /// @dev Permit a user to spend a given amount of
    /// another user's tokens via native EIP-2612 permit if possible, falling
    /// back to Permit2 if native permit fails or is not implemented on the token.
    function permit2(
        address token,
        address owner,
        address spender,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        bool success;
        /// @solidity memory-safe-assembly
        assembly {
            for {} shl(96, xor(token, WETH9)) {} {
                mstore(0x00, 0x3644e515) // `DOMAIN_SEPARATOR()`.
                if iszero(
                    and( // The arguments of `and` are evaluated from right to left.
                        lt(iszero(mload(0x00)), eq(returndatasize(), 0x20)), // Returns 1 non-zero word.
                        // Gas stipend to limit gas burn for tokens that don't refund gas when
                        // an non-existing function is called. 5K should be enough for a SLOAD.
                        staticcall(5000, token, 0x1c, 0x04, 0x00, 0x20)
                    )
                ) { break }
                // After here, we can be sure that token is a contract.
                let m := mload(0x40)
                mstore(add(m, 0x34), spender)
                mstore(add(m, 0x20), shl(96, owner))
                mstore(add(m, 0x74), deadline)
                if eq(mload(0x00), DAI_DOMAIN_SEPARATOR) {
                    mstore(0x14, owner)
                    mstore(0x00, 0x7ecebe00000000000000000000000000) // `nonces(address)`.
                    mstore(
                        add(m, 0x94),
                        lt(iszero(amount), staticcall(gas(), token, 0x10, 0x24, add(m, 0x54), 0x20))
                    )
                    mstore(m, 0x8fcbaf0c000000000000000000000000) // `IDAIPermit.permit`.
                    // `nonces` is already at `add(m, 0x54)`.
                    // `amount != 0` is already stored at `add(m, 0x94)`.
                    mstore(add(m, 0xb4), and(0xff, v))
                    mstore(add(m, 0xd4), r)
                    mstore(add(m, 0xf4), s)
                    success := call(gas(), token, 0, add(m, 0x10), 0x104, codesize(), 0x00)
                    break
                }
                mstore(m, 0xd505accf000000000000000000000000) // `IERC20Permit.permit`.
                mstore(add(m, 0x54), amount)
                mstore(add(m, 0x94), and(0xff, v))
                mstore(add(m, 0xb4), r)
                mstore(add(m, 0xd4), s)
                success := call(gas(), token, 0, add(m, 0x10), 0xe4, codesize(), 0x00)
                break
            }
        }
        if (!success) simplePermit2(token, owner, spender, amount, deadline, v, r, s);
    }

    /// @dev Simple permit on the Permit2 contract.
    function simplePermit2(
        address token,
        address owner,
        address spender,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            mstore(m, 0x927da105) // `allowance(address,address,address)`.
            {
                let addressMask := shr(96, not(0))
                mstore(add(m, 0x20), and(addressMask, owner))
                mstore(add(m, 0x40), and(addressMask, token))
                mstore(add(m, 0x60), and(addressMask, spender))
                mstore(add(m, 0xc0), and(addressMask, spender))
            }
            let p := mul(PERMIT2, iszero(shr(160, amount)))
            if iszero(
                and( // The arguments of `and` are evaluated from right to left.
                    gt(returndatasize(), 0x5f), // Returns 3 words: `amount`, `expiration`, `nonce`.
                    staticcall(gas(), p, add(m, 0x1c), 0x64, add(m, 0x60), 0x60)
                )
            ) {
                mstore(0x00, 0x6b836e6b8757f0fd) // `Permit2Failed()` or `Permit2AmountOverflow()`.
                revert(add(0x18, shl(2, iszero(p))), 0x04)
            }
            mstore(m, 0x2b67b570) // `Permit2.permit` (PermitSingle variant).
            // `owner` is already `add(m, 0x20)`.
            // `token` is already at `add(m, 0x40)`.
            mstore(add(m, 0x60), amount)
            mstore(add(m, 0x80), 0xffffffffffff) // `expiration = type(uint48).max`.
            // `nonce` is already at `add(m, 0xa0)`.
            // `spender` is already at `add(m, 0xc0)`.
            mstore(add(m, 0xe0), deadline)
            mstore(add(m, 0x100), 0x100) // `signature` offset.
            mstore(add(m, 0x120), 0x41) // `signature` length.
            mstore(add(m, 0x140), r)
            mstore(add(m, 0x160), s)
            mstore(add(m, 0x180), shl(248, v))
            if iszero( // Revert if token does not have code, or if the call fails.
            mul(extcodesize(token), call(gas(), p, 0, add(m, 0x1c), 0x184, codesize(), 0x00))) {
                mstore(0x00, 0x6b836e6b) // `Permit2Failed()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Approves `spender` to spend `amount` of `token` for `address(this)`.
    function permit2Approve(address token, address spender, uint160 amount, uint48 expiration)
        internal
    {
        /// @solidity memory-safe-assembly
        assembly {
            let addressMask := shr(96, not(0))
            let m := mload(0x40)
            mstore(m, 0x87517c45) // `approve(address,address,uint160,uint48)`.
            mstore(add(m, 0x20), and(addressMask, token))
            mstore(add(m, 0x40), and(addressMask, spender))
            mstore(add(m, 0x60), and(addressMask, amount))
            mstore(add(m, 0x80), and(0xffffffffffff, expiration))
            if iszero(call(gas(), PERMIT2, 0, add(m, 0x1c), 0xa0, codesize(), 0x00)) {
                mstore(0x00, 0x324f14ae) // `Permit2ApproveFailed()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Revokes an approval for `token` and `spender` for `address(this)`.
    function permit2Lockdown(address token, address spender) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            mstore(m, 0xcc53287f) // `Permit2.lockdown`.
            mstore(add(m, 0x20), 0x20) // Offset of the `approvals`.
            mstore(add(m, 0x40), 1) // `approvals.length`.
            mstore(add(m, 0x60), shr(96, shl(96, token)))
            mstore(add(m, 0x80), shr(96, shl(96, spender)))
            if iszero(call(gas(), PERMIT2, 0, add(m, 0x1c), 0xa0, codesize(), 0x00)) {
                mstore(0x00, 0x96b3de23) // `Permit2LockdownFailed()`.
                revert(0x1c, 0x04)
            }
        }
    }
}

File 10 of 11 : IDelegateRegistry.sol
// SPDX-License-Identifier: CC0-1.0
pragma solidity >=0.8.13;

/**
 * @title IDelegateRegistry
 * @custom:version 2.0
 * @custom:author foobar (0xfoobar)
 * @notice A standalone immutable registry storing delegated permissions from one address to another
 */
interface IDelegateRegistry {
    /// @notice Delegation type, NONE is used when a delegation does not exist or is revoked
    enum DelegationType {
        NONE,
        ALL,
        CONTRACT,
        ERC721,
        ERC20,
        ERC1155
    }

    /// @notice Struct for returning delegations
    struct Delegation {
        DelegationType type_;
        address to;
        address from;
        bytes32 rights;
        address contract_;
        uint256 tokenId;
        uint256 amount;
    }

    /// @notice Emitted when an address delegates or revokes rights for their entire wallet
    event DelegateAll(
        address indexed from,
        address indexed to,
        bytes32 rights,
        bool enable
    );

    /// @notice Emitted when an address delegates or revokes rights for a contract address
    event DelegateContract(
        address indexed from,
        address indexed to,
        address indexed contract_,
        bytes32 rights,
        bool enable
    );

    /// @notice Emitted when an address delegates or revokes rights for an ERC721 tokenId
    event DelegateERC721(
        address indexed from,
        address indexed to,
        address indexed contract_,
        uint256 tokenId,
        bytes32 rights,
        bool enable
    );

    /// @notice Emitted when an address delegates or revokes rights for an amount of ERC20 tokens
    event DelegateERC20(
        address indexed from,
        address indexed to,
        address indexed contract_,
        bytes32 rights,
        uint256 amount
    );

    /// @notice Emitted when an address delegates or revokes rights for an amount of an ERC1155 tokenId
    event DelegateERC1155(
        address indexed from,
        address indexed to,
        address indexed contract_,
        uint256 tokenId,
        bytes32 rights,
        uint256 amount
    );

    /// @notice Thrown if multicall calldata is malformed
    error MulticallFailed();

    /**
     * -----------  WRITE -----------
     */

    /**
     * @notice Call multiple functions in the current contract and return the data from all of them if they all succeed
     * @param data The encoded function data for each of the calls to make to this contract
     * @return results The results from each of the calls passed in via data
     */
    function multicall(
        bytes[] calldata data
    ) external payable returns (bytes[] memory results);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for all contracts
     * @param to The address to act as delegate
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param enable Whether to enable or disable this delegation, true delegates and false revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateAll(
        address to,
        bytes32 rights,
        bool enable
    ) external payable returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific contract
     * @param to The address to act as delegate
     * @param contract_ The contract whose rights are being delegated
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param enable Whether to enable or disable this delegation, true delegates and false revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateContract(
        address to,
        address contract_,
        bytes32 rights,
        bool enable
    ) external payable returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific ERC721 token
     * @param to The address to act as delegate
     * @param contract_ The contract whose rights are being delegated
     * @param tokenId The token id to delegate
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param enable Whether to enable or disable this delegation, true delegates and false revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateERC721(
        address to,
        address contract_,
        uint256 tokenId,
        bytes32 rights,
        bool enable
    ) external payable returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC20 tokens
     * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound)
     * @param to The address to act as delegate
     * @param contract_ The address for the fungible token contract
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param amount The amount to delegate, > 0 delegates and 0 revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateERC20(
        address to,
        address contract_,
        bytes32 rights,
        uint256 amount
    ) external payable returns (bytes32 delegationHash);

    /**
     * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC1155 tokens
     * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound)
     * @param to The address to act as delegate
     * @param contract_ The address of the contract that holds the token
     * @param tokenId The token id to delegate
     * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights
     * @param amount The amount of that token id to delegate, > 0 delegates and 0 revokes
     * @return delegationHash The unique identifier of the delegation
     */
    function delegateERC1155(
        address to,
        address contract_,
        uint256 tokenId,
        bytes32 rights,
        uint256 amount
    ) external payable returns (bytes32 delegationHash);

    /**
     * ----------- CHECKS -----------
     */

    /**
     * @notice Check if `to` is a delegate of `from` for the entire wallet
     * @param to The potential delegate address
     * @param from The potential address who delegated rights
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return valid Whether delegate is granted to act on the from's behalf
     */
    function checkDelegateForAll(
        address to,
        address from,
        bytes32 rights
    ) external view returns (bool);

    /**
     * @notice Check if `to` is a delegate of `from` for the specified `contract_` or the entire wallet
     * @param to The delegated address to check
     * @param contract_ The specific contract address being checked
     * @param from The cold wallet who issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return valid Whether delegate is granted to act on from's behalf for entire wallet or that specific contract
     */
    function checkDelegateForContract(
        address to,
        address from,
        address contract_,
        bytes32 rights
    ) external view returns (bool);

    /**
     * @notice Check if `to` is a delegate of `from` for the specific `contract` and `tokenId`, the entire `contract_`, or the entire wallet
     * @param to The delegated address to check
     * @param contract_ The specific contract address being checked
     * @param tokenId The token id for the token to delegating
     * @param from The wallet that issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return valid Whether delegate is granted to act on from's behalf for entire wallet, that contract, or that specific tokenId
     */
    function checkDelegateForERC721(
        address to,
        address from,
        address contract_,
        uint256 tokenId,
        bytes32 rights
    ) external view returns (bool);

    /**
     * @notice Returns the amount of ERC20 tokens the delegate is granted rights to act on the behalf of
     * @param to The delegated address to check
     * @param contract_ The address of the token contract
     * @param from The cold wallet who issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return balance The delegated balance, which will be 0 if the delegation does not exist
     */
    function checkDelegateForERC20(
        address to,
        address from,
        address contract_,
        bytes32 rights
    ) external view returns (uint256);

    /**
     * @notice Returns the amount of a ERC1155 tokens the delegate is granted rights to act on the behalf of
     * @param to The delegated address to check
     * @param contract_ The address of the token contract
     * @param tokenId The token id to check the delegated amount of
     * @param from The cold wallet who issued the delegation
     * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only
     * @return balance The delegated balance, which will be 0 if the delegation does not exist
     */
    function checkDelegateForERC1155(
        address to,
        address from,
        address contract_,
        uint256 tokenId,
        bytes32 rights
    ) external view returns (uint256);

    /**
     * ----------- ENUMERATIONS -----------
     */

    /**
     * @notice Returns all enabled delegations a given delegate has received
     * @param to The address to retrieve delegations for
     * @return delegations Array of Delegation structs
     */
    function getIncomingDelegations(
        address to
    ) external view returns (Delegation[] memory delegations);

    /**
     * @notice Returns all enabled delegations an address has given out
     * @param from The address to retrieve delegations for
     * @return delegations Array of Delegation structs
     */
    function getOutgoingDelegations(
        address from
    ) external view returns (Delegation[] memory delegations);

    /**
     * @notice Returns all hashes associated with enabled delegations an address has received
     * @param to The address to retrieve incoming delegation hashes for
     * @return delegationHashes Array of delegation hashes
     */
    function getIncomingDelegationHashes(
        address to
    ) external view returns (bytes32[] memory delegationHashes);

    /**
     * @notice Returns all hashes associated with enabled delegations an address has given out
     * @param from The address to retrieve outgoing delegation hashes for
     * @return delegationHashes Array of delegation hashes
     */
    function getOutgoingDelegationHashes(
        address from
    ) external view returns (bytes32[] memory delegationHashes);

    /**
     * @notice Returns the delegations for a given array of delegation hashes
     * @param delegationHashes is an array of hashes that correspond to delegations
     * @return delegations Array of Delegation structs, return empty structs for nonexistent or revoked delegations
     */
    function getDelegationsFromHashes(
        bytes32[] calldata delegationHashes
    ) external view returns (Delegation[] memory delegations);

    /**
     * ----------- STORAGE ACCESS -----------
     */

    /**
     * @notice Allows external contracts to read arbitrary storage slots
     */
    function readSlot(bytes32 location) external view returns (bytes32);

    /**
     * @notice Allows external contracts to read an arbitrary array of storage slots
     */
    function readSlots(
        bytes32[] calldata locations
    ) external view returns (bytes32[] memory);
}

File 11 of 11 : LibBytes.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Library for byte related operations.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibBytes.sol)
library LibBytes {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STRUCTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Goated bytes storage struct that totally MOGs, no cap, fr.
    /// Uses less gas and bytecode than Solidity's native bytes storage. It's meta af.
    /// Packs length with the first 31 bytes if <255 bytes, so it’s mad tight.
    struct BytesStorage {
        bytes32 _spacer;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The constant returned when the `search` is not found in the bytes.
    uint256 internal constant NOT_FOUND = type(uint256).max;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  BYTE STORAGE OPERATIONS                   */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Sets the value of the bytes storage `$` to `s`.
    function set(BytesStorage storage $, bytes memory s) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let n := mload(s)
            let packed := or(0xff, shl(8, n))
            for { let i := 0 } 1 {} {
                if iszero(gt(n, 0xfe)) {
                    i := 0x1f
                    packed := or(n, shl(8, mload(add(s, i))))
                    if iszero(gt(n, i)) { break }
                }
                let o := add(s, 0x20)
                mstore(0x00, $.slot)
                for { let p := keccak256(0x00, 0x20) } 1 {} {
                    sstore(add(p, shr(5, i)), mload(add(o, i)))
                    i := add(i, 0x20)
                    if iszero(lt(i, n)) { break }
                }
                break
            }
            sstore($.slot, packed)
        }
    }

    /// @dev Sets the value of the bytes storage `$` to `s`.
    function setCalldata(BytesStorage storage $, bytes calldata s) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let packed := or(0xff, shl(8, s.length))
            for { let i := 0 } 1 {} {
                if iszero(gt(s.length, 0xfe)) {
                    i := 0x1f
                    packed := or(s.length, shl(8, shr(8, calldataload(s.offset))))
                    if iszero(gt(s.length, i)) { break }
                }
                mstore(0x00, $.slot)
                for { let p := keccak256(0x00, 0x20) } 1 {} {
                    sstore(add(p, shr(5, i)), calldataload(add(s.offset, i)))
                    i := add(i, 0x20)
                    if iszero(lt(i, s.length)) { break }
                }
                break
            }
            sstore($.slot, packed)
        }
    }

    /// @dev Sets the value of the bytes storage `$` to the empty bytes.
    function clear(BytesStorage storage $) internal {
        delete $._spacer;
    }

    /// @dev Returns whether the value stored is `$` is the empty bytes "".
    function isEmpty(BytesStorage storage $) internal view returns (bool) {
        return uint256($._spacer) & 0xff == uint256(0);
    }

    /// @dev Returns the length of the value stored in `$`.
    function length(BytesStorage storage $) internal view returns (uint256 result) {
        result = uint256($._spacer);
        /// @solidity memory-safe-assembly
        assembly {
            let n := and(0xff, result)
            result := or(mul(shr(8, result), eq(0xff, n)), mul(n, iszero(eq(0xff, n))))
        }
    }

    /// @dev Returns the value stored in `$`.
    function get(BytesStorage storage $) internal view returns (bytes memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let o := add(result, 0x20)
            let packed := sload($.slot)
            let n := shr(8, packed)
            for { let i := 0 } 1 {} {
                if iszero(eq(or(packed, 0xff), packed)) {
                    mstore(o, packed)
                    n := and(0xff, packed)
                    i := 0x1f
                    if iszero(gt(n, i)) { break }
                }
                mstore(0x00, $.slot)
                for { let p := keccak256(0x00, 0x20) } 1 {} {
                    mstore(add(o, i), sload(add(p, shr(5, i))))
                    i := add(i, 0x20)
                    if iszero(lt(i, n)) { break }
                }
                break
            }
            mstore(result, n) // Store the length of the memory.
            mstore(add(o, n), 0) // Zeroize the slot after the bytes.
            mstore(0x40, add(add(o, n), 0x20)) // Allocate memory.
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                      BYTES OPERATIONS                      */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns `subject` all occurrences of `needle` replaced with `replacement`.
    function replace(bytes memory subject, bytes memory needle, bytes memory replacement)
        internal
        pure
        returns (bytes memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let needleLen := mload(needle)
            let replacementLen := mload(replacement)
            let d := sub(result, subject) // Memory difference.
            let i := add(subject, 0x20) // Subject bytes pointer.
            mstore(0x00, add(i, mload(subject))) // End of subject.
            if iszero(gt(needleLen, mload(subject))) {
                let subjectSearchEnd := add(sub(mload(0x00), needleLen), 1)
                let h := 0 // The hash of `needle`.
                if iszero(lt(needleLen, 0x20)) { h := keccak256(add(needle, 0x20), needleLen) }
                let s := mload(add(needle, 0x20))
                for { let m := shl(3, sub(0x20, and(needleLen, 0x1f))) } 1 {} {
                    let t := mload(i)
                    // Whether the first `needleLen % 32` bytes of `subject` and `needle` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(i, needleLen), h)) {
                                mstore(add(i, d), t)
                                i := add(i, 1)
                                if iszero(lt(i, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        // Copy the `replacement` one word at a time.
                        for { let j := 0 } 1 {} {
                            mstore(add(add(i, d), j), mload(add(add(replacement, 0x20), j)))
                            j := add(j, 0x20)
                            if iszero(lt(j, replacementLen)) { break }
                        }
                        d := sub(add(d, replacementLen), needleLen)
                        if needleLen {
                            i := add(i, needleLen)
                            if iszero(lt(i, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    mstore(add(i, d), t)
                    i := add(i, 1)
                    if iszero(lt(i, subjectSearchEnd)) { break }
                }
            }
            let end := mload(0x00)
            let n := add(sub(d, add(result, 0x20)), end)
            // Copy the rest of the bytes one word at a time.
            for {} lt(i, end) { i := add(i, 0x20) } { mstore(add(i, d), mload(i)) }
            let o := add(i, d)
            mstore(o, 0) // Zeroize the slot after the bytes.
            mstore(0x40, add(o, 0x20)) // Allocate memory.
            mstore(result, n) // Store the length.
        }
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from left to right, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function indexOf(bytes memory subject, bytes memory needle, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := not(0) // Initialize to `NOT_FOUND`.
            for { let subjectLen := mload(subject) } 1 {} {
                if iszero(mload(needle)) {
                    result := from
                    if iszero(gt(from, subjectLen)) { break }
                    result := subjectLen
                    break
                }
                let needleLen := mload(needle)
                let subjectStart := add(subject, 0x20)

                subject := add(subjectStart, from)
                let end := add(sub(add(subjectStart, subjectLen), needleLen), 1)
                let m := shl(3, sub(0x20, and(needleLen, 0x1f)))
                let s := mload(add(needle, 0x20))

                if iszero(and(lt(subject, end), lt(from, subjectLen))) { break }

                if iszero(lt(needleLen, 0x20)) {
                    for { let h := keccak256(add(needle, 0x20), needleLen) } 1 {} {
                        if iszero(shr(m, xor(mload(subject), s))) {
                            if eq(keccak256(subject, needleLen), h) {
                                result := sub(subject, subjectStart)
                                break
                            }
                        }
                        subject := add(subject, 1)
                        if iszero(lt(subject, end)) { break }
                    }
                    break
                }
                for {} 1 {} {
                    if iszero(shr(m, xor(mload(subject), s))) {
                        result := sub(subject, subjectStart)
                        break
                    }
                    subject := add(subject, 1)
                    if iszero(lt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from left to right.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function indexOf(bytes memory subject, bytes memory needle) internal pure returns (uint256) {
        return indexOf(subject, needle, 0);
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from right to left, starting from `from`.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function lastIndexOf(bytes memory subject, bytes memory needle, uint256 from)
        internal
        pure
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            for {} 1 {} {
                result := not(0) // Initialize to `NOT_FOUND`.
                let needleLen := mload(needle)
                if gt(needleLen, mload(subject)) { break }
                let w := result

                let fromMax := sub(mload(subject), needleLen)
                if iszero(gt(fromMax, from)) { from := fromMax }

                let end := add(add(subject, 0x20), w)
                subject := add(add(subject, 0x20), from)
                if iszero(gt(subject, end)) { break }
                // As this function is not too often used,
                // we shall simply use keccak256 for smaller bytecode size.
                for { let h := keccak256(add(needle, 0x20), needleLen) } 1 {} {
                    if eq(keccak256(subject, needleLen), h) {
                        result := sub(subject, add(end, 1))
                        break
                    }
                    subject := add(subject, w) // `sub(subject, 1)`.
                    if iszero(gt(subject, end)) { break }
                }
                break
            }
        }
    }

    /// @dev Returns the byte index of the first location of `needle` in `subject`,
    /// needleing from right to left.
    /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.
    function lastIndexOf(bytes memory subject, bytes memory needle)
        internal
        pure
        returns (uint256)
    {
        return lastIndexOf(subject, needle, type(uint256).max);
    }

    /// @dev Returns true if `needle` is found in `subject`, false otherwise.
    function contains(bytes memory subject, bytes memory needle) internal pure returns (bool) {
        return indexOf(subject, needle) != NOT_FOUND;
    }

    /// @dev Returns whether `subject` starts with `needle`.
    function startsWith(bytes memory subject, bytes memory needle)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let n := mload(needle)
            // Just using keccak256 directly is actually cheaper.
            let t := eq(keccak256(add(subject, 0x20), n), keccak256(add(needle, 0x20), n))
            result := lt(gt(n, mload(subject)), t)
        }
    }

    /// @dev Returns whether `subject` ends with `needle`.
    function endsWith(bytes memory subject, bytes memory needle)
        internal
        pure
        returns (bool result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let n := mload(needle)
            let notInRange := gt(n, mload(subject))
            // `subject + 0x20 + max(subject.length - needle.length, 0)`.
            let t := add(add(subject, 0x20), mul(iszero(notInRange), sub(mload(subject), n)))
            // Just using keccak256 directly is actually cheaper.
            result := gt(eq(keccak256(t, n), keccak256(add(needle, 0x20), n)), notInRange)
        }
    }

    /// @dev Returns `subject` repeated `times`.
    function repeat(bytes memory subject, uint256 times)
        internal
        pure
        returns (bytes memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let l := mload(subject) // Subject length.
            if iszero(or(iszero(times), iszero(l))) {
                result := mload(0x40)
                subject := add(subject, 0x20)
                let o := add(result, 0x20)
                for {} 1 {} {
                    // Copy the `subject` one word at a time.
                    for { let j := 0 } 1 {} {
                        mstore(add(o, j), mload(add(subject, j)))
                        j := add(j, 0x20)
                        if iszero(lt(j, l)) { break }
                    }
                    o := add(o, l)
                    times := sub(times, 1)
                    if iszero(times) { break }
                }
                mstore(o, 0) // Zeroize the slot after the bytes.
                mstore(0x40, add(o, 0x20)) // Allocate memory.
                mstore(result, sub(o, add(result, 0x20))) // Store the length.
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).
    /// `start` and `end` are byte offsets.
    function slice(bytes memory subject, uint256 start, uint256 end)
        internal
        pure
        returns (bytes memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let l := mload(subject) // Subject length.
            if iszero(gt(l, end)) { end := l }
            if iszero(gt(l, start)) { start := l }
            if lt(start, end) {
                result := mload(0x40)
                let n := sub(end, start)
                let i := add(subject, start)
                let w := not(0x1f)
                // Copy the `subject` one word at a time, backwards.
                for { let j := and(add(n, 0x1f), w) } 1 {} {
                    mstore(add(result, j), mload(add(i, j)))
                    j := add(j, w) // `sub(j, 0x20)`.
                    if iszero(j) { break }
                }
                let o := add(add(result, 0x20), n)
                mstore(o, 0) // Zeroize the slot after the bytes.
                mstore(0x40, add(o, 0x20)) // Allocate memory.
                mstore(result, n) // Store the length.
            }
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to the end of the bytes.
    /// `start` is a byte offset.
    function slice(bytes memory subject, uint256 start)
        internal
        pure
        returns (bytes memory result)
    {
        result = slice(subject, start, type(uint256).max);
    }

    /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).
    /// `start` and `end` are byte offsets. Faster than Solidity's native slicing.
    function sliceCalldata(bytes calldata subject, uint256 start, uint256 end)
        internal
        pure
        returns (bytes calldata result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            end := xor(end, mul(xor(end, subject.length), lt(subject.length, end)))
            start := xor(start, mul(xor(start, subject.length), lt(subject.length, start)))
            result.offset := add(subject.offset, start)
            result.length := mul(lt(start, end), sub(end, start))
        }
    }

    /// @dev Returns a copy of `subject` sliced from `start` to the end of the bytes.
    /// `start` is a byte offset. Faster than Solidity's native slicing.
    function sliceCalldata(bytes calldata subject, uint256 start)
        internal
        pure
        returns (bytes calldata result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            start := xor(start, mul(xor(start, subject.length), lt(subject.length, start)))
            result.offset := add(subject.offset, start)
            result.length := mul(lt(start, subject.length), sub(subject.length, start))
        }
    }

    /// @dev Reduces the size of `subject` to `n`.
    /// If `n` is greater than the size of `subject`, this will be a no-op.
    function truncate(bytes memory subject, uint256 n)
        internal
        pure
        returns (bytes memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := subject
            mstore(mul(lt(n, mload(result)), result), n)
        }
    }

    /// @dev Returns a copy of `subject`, with the length reduced to `n`.
    /// If `n` is greater than the size of `subject`, this will be a no-op.
    function truncatedCalldata(bytes calldata subject, uint256 n)
        internal
        pure
        returns (bytes calldata result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result.offset := subject.offset
            result.length := xor(n, mul(xor(n, subject.length), lt(subject.length, n)))
        }
    }

    /// @dev Returns all the indices of `needle` in `subject`.
    /// The indices are byte offsets.
    function indicesOf(bytes memory subject, bytes memory needle)
        internal
        pure
        returns (uint256[] memory result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let searchLen := mload(needle)
            if iszero(gt(searchLen, mload(subject))) {
                result := mload(0x40)
                let i := add(subject, 0x20)
                let o := add(result, 0x20)
                let subjectSearchEnd := add(sub(add(i, mload(subject)), searchLen), 1)
                let h := 0 // The hash of `needle`.
                if iszero(lt(searchLen, 0x20)) { h := keccak256(add(needle, 0x20), searchLen) }
                let s := mload(add(needle, 0x20))
                for { let m := shl(3, sub(0x20, and(searchLen, 0x1f))) } 1 {} {
                    let t := mload(i)
                    // Whether the first `searchLen % 32` bytes of `subject` and `needle` matches.
                    if iszero(shr(m, xor(t, s))) {
                        if h {
                            if iszero(eq(keccak256(i, searchLen), h)) {
                                i := add(i, 1)
                                if iszero(lt(i, subjectSearchEnd)) { break }
                                continue
                            }
                        }
                        mstore(o, sub(i, add(subject, 0x20))) // Append to `result`.
                        o := add(o, 0x20)
                        i := add(i, searchLen) // Advance `i` by `searchLen`.
                        if searchLen {
                            if iszero(lt(i, subjectSearchEnd)) { break }
                            continue
                        }
                    }
                    i := add(i, 1)
                    if iszero(lt(i, subjectSearchEnd)) { break }
                }
                mstore(result, shr(5, sub(o, add(result, 0x20)))) // Store the length of `result`.
                // Allocate memory for result.
                // We allocate one more word, so this array can be recycled for {split}.
                mstore(0x40, add(o, 0x20))
            }
        }
    }

    /// @dev Returns a arrays of bytess based on the `delimiter` inside of the `subject` bytes.
    function split(bytes memory subject, bytes memory delimiter)
        internal
        pure
        returns (bytes[] memory result)
    {
        uint256[] memory indices = indicesOf(subject, delimiter);
        /// @solidity memory-safe-assembly
        assembly {
            let w := not(0x1f)
            let indexPtr := add(indices, 0x20)
            let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1)))
            mstore(add(indicesEnd, w), mload(subject))
            mstore(indices, add(mload(indices), 1))
            for { let prevIndex := 0 } 1 {} {
                let index := mload(indexPtr)
                mstore(indexPtr, 0x60)
                if iszero(eq(index, prevIndex)) {
                    let element := mload(0x40)
                    let l := sub(index, prevIndex)
                    mstore(element, l) // Store the length of the element.
                    // Copy the `subject` one word at a time, backwards.
                    for { let o := and(add(l, 0x1f), w) } 1 {} {
                        mstore(add(element, o), mload(add(add(subject, prevIndex), o)))
                        o := add(o, w) // `sub(o, 0x20)`.
                        if iszero(o) { break }
                    }
                    mstore(add(add(element, 0x20), l), 0) // Zeroize the slot after the bytes.
                    // Allocate memory for the length and the bytes, rounded up to a multiple of 32.
                    mstore(0x40, add(element, and(add(l, 0x3f), w)))
                    mstore(indexPtr, element) // Store the `element` into the array.
                }
                prevIndex := add(index, mload(delimiter))
                indexPtr := add(indexPtr, 0x20)
                if iszero(lt(indexPtr, indicesEnd)) { break }
            }
            result := indices
            if iszero(mload(delimiter)) {
                result := add(indices, 0x20)
                mstore(result, sub(mload(indices), 2))
            }
        }
    }

    /// @dev Returns a concatenated bytes of `a` and `b`.
    /// Cheaper than `bytes.concat()` and does not de-align the free memory pointer.
    function concat(bytes memory a, bytes memory b) internal pure returns (bytes memory result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(0x40)
            let w := not(0x1f)
            let aLen := mload(a)
            // Copy `a` one word at a time, backwards.
            for { let o := and(add(aLen, 0x20), w) } 1 {} {
                mstore(add(result, o), mload(add(a, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let bLen := mload(b)
            let output := add(result, aLen)
            // Copy `b` one word at a time, backwards.
            for { let o := and(add(bLen, 0x20), w) } 1 {} {
                mstore(add(output, o), mload(add(b, o)))
                o := add(o, w) // `sub(o, 0x20)`.
                if iszero(o) { break }
            }
            let totalLen := add(aLen, bLen)
            let last := add(add(result, 0x20), totalLen)
            mstore(last, 0) // Zeroize the slot after the bytes.
            mstore(result, totalLen) // Store the length.
            mstore(0x40, add(last, 0x20)) // Allocate memory.
        }
    }

    /// @dev Returns whether `a` equals `b`.
    function eq(bytes memory a, bytes memory b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))
        }
    }

    /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small bytes.
    function eqs(bytes memory a, bytes32 b) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            // These should be evaluated on compile time, as far as possible.
            let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.
            let x := not(or(m, or(b, add(m, and(b, m)))))
            let r := shl(7, iszero(iszero(shr(128, x))))
            r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),
                xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))
        }
    }

    /// @dev Returns 0 if `a == b`, -1 if `a < b`, +1 if `a > b`.
    /// If `a` == b[:a.length]`, and `a.length < b.length`, returns -1.
    function cmp(bytes memory a, bytes memory b) internal pure returns (int256 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let aLen := mload(a)
            let bLen := mload(b)
            let n := and(xor(aLen, mul(xor(aLen, bLen), lt(bLen, aLen))), not(0x1f))
            if n {
                for { let i := 0x20 } 1 {} {
                    let x := mload(add(a, i))
                    let y := mload(add(b, i))
                    if iszero(or(xor(x, y), eq(i, n))) {
                        i := add(i, 0x20)
                        continue
                    }
                    result := sub(gt(x, y), lt(x, y))
                    break
                }
            }
            // forgefmt: disable-next-item
            if iszero(result) {
                let l := 0x201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a090807060504030201
                let x := and(mload(add(add(a, 0x20), n)), shl(shl(3, byte(sub(aLen, n), l)), not(0)))
                let y := and(mload(add(add(b, 0x20), n)), shl(shl(3, byte(sub(bLen, n), l)), not(0)))
                result := sub(gt(x, y), lt(x, y))
                if iszero(result) { result := sub(gt(aLen, bLen), lt(aLen, bLen)) }
            }
        }
    }

    /// @dev Directly returns `a` without copying.
    function directReturn(bytes memory a) internal pure {
        assembly {
            // Assumes that the bytes does not start from the scratch space.
            let retStart := sub(a, 0x20)
            let retUnpaddedSize := add(mload(a), 0x40)
            // Right pad with zeroes. Just in case the bytes is produced
            // by a method that doesn't zero right pad.
            mstore(add(retStart, retUnpaddedSize), 0)
            mstore(retStart, 0x20) // Store the return offset.
            // End the transaction, returning the bytes.
            return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))
        }
    }

    /// @dev Directly returns `a` with minimal copying.
    function directReturn(bytes[] memory a) internal pure {
        assembly {
            let n := mload(a) // `a.length`.
            let o := add(a, 0x20) // Start of elements in `a`.
            let u := a // Highest memory slot.
            let w := not(0x1f)
            for { let i := 0 } iszero(eq(i, n)) { i := add(i, 1) } {
                let c := add(o, shl(5, i)) // Location of pointer to `a[i]`.
                let s := mload(c) // `a[i]`.
                let l := mload(s) // `a[i].length`.
                let r := and(l, 0x1f) // `a[i].length % 32`.
                let z := add(0x20, and(l, w)) // Offset of last word in `a[i]` from `s`.
                // If `s` comes before `o`, or `s` is not zero right padded.
                if iszero(lt(lt(s, o), or(iszero(r), iszero(shl(shl(3, r), mload(add(s, z))))))) {
                    let m := mload(0x40)
                    mstore(m, l) // Copy `a[i].length`.
                    for {} 1 {} {
                        mstore(add(m, z), mload(add(s, z))) // Copy `a[i]`, backwards.
                        z := add(z, w) // `sub(z, 0x20)`.
                        if iszero(z) { break }
                    }
                    let e := add(add(m, 0x20), l)
                    mstore(e, 0) // Zeroize the slot after the copied bytes.
                    mstore(0x40, add(e, 0x20)) // Allocate memory.
                    s := m
                }
                mstore(c, sub(s, o)) // Convert to calldata offset.
                let t := add(l, add(s, 0x20))
                if iszero(lt(t, u)) { u := t }
            }
            let retStart := add(a, w) // Assumes `a` doesn't start from scratch space.
            mstore(retStart, 0x20) // Store the return offset.
            return(retStart, add(0x40, sub(u, retStart))) // End the transaction.
        }
    }

    /// @dev Returns the word at `offset`, without any bounds checks.
    /// To load an address, you can use `address(bytes20(load(a, offset)))`.
    function load(bytes memory a, uint256 offset) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := mload(add(add(a, 0x20), offset))
        }
    }

    /// @dev Returns the word at `offset`, without any bounds checks.
    /// To load an address, you can use `address(bytes20(loadCalldata(a, offset)))`.
    function loadCalldata(bytes calldata a, uint256 offset)
        internal
        pure
        returns (bytes32 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            result := calldataload(add(a.offset, offset))
        }
    }

    /// @dev Returns empty calldata bytes. For silencing the compiler.
    function emptyCalldata() internal pure returns (bytes calldata result) {
        /// @solidity memory-safe-assembly
        assembly {
            result.length := 0
        }
    }
}

Settings
{
  "evmVersion": "paris",
  "optimizer": {
    "enabled": true,
    "mode": "3",
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "abi"
      ]
    }
  },
  "detectMissingLibraries": false,
  "forceEVMLA": false,
  "enableEraVMExtensions": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes32","name":"allowlistRoot_","type":"bytes32"},{"internalType":"bytes32","name":"fcfsRoot_","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AllowlistEnded","type":"error"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"AlreadyMinted","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"DNAlreadyInitialized","type":"error"},{"inputs":[],"name":"DNNotInitialized","type":"error"},{"inputs":[],"name":"DelegateResolverNotSet","type":"error"},{"inputs":[],"name":"FnSelectorNotRecognized","type":"error"},{"inputs":[],"name":"FractionalTransferNotAllowed","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidMint","type":"error"},{"inputs":[],"name":"InvalidPrice","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"InvalidUnit","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"Locked","type":"error"},{"inputs":[],"name":"MaxFCFSlistReached","type":"error"},{"inputs":[],"name":"MaxPerWalletReached","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"NotDelegated","type":"error"},{"inputs":[],"name":"NotLive","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NotPublicLive","type":"error"},{"inputs":[],"name":"SenderNotMirror","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TokenSeedDoesNotExist","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"TotalSupplyReached","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","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":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SkipNFTSet","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":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"airdrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"allowListEndsAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"allowlistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"address","name":"delegated","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"allowlistMintByDelegate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"allowlistPrice","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURILocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"seeds_","type":"uint256[]"}],"name":"batchSetSeeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegateDiscountPrice","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegateResolver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftAmount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"fcfsMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftAmount","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"address","name":"delegated","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"fcfsMintByDelegate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"fcfsMinted","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fractionalTransfersEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockNameAndSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxFCFSlist","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWallet","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"nftAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"mintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintedAllowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mirrorERC721","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nameAndSymbolLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicPrice","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renderer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"reservedSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"seeds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"allowListEndsAt_","type":"uint256"}],"name":"setAllowListEndsAt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"allowlistRoot_","type":"bytes32"}],"name":"setAllowlistRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegateResolver_","type":"address"}],"name":"setDelegateResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"fcfsRoot_","type":"bytes32"}],"name":"setFCFSRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setFractionalTransfersEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"maxFCFSlist_","type":"uint32"}],"name":"setMaxFCFSlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"maxPerWallet_","type":"uint32"}],"name":"setMaxPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"name":"setNameAndSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"publicPrice_","type":"uint96"},{"internalType":"uint96","name":"allowlistPrice_","type":"uint96"},{"internalType":"uint96","name":"delegateDiscountPrice_","type":"uint96"}],"name":"setPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"renderer_","type":"address"}],"name":"setRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"reservedSupply_","type":"uint32"}],"name":"setReservedSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"skipNFT","type":"bool"}],"name":"setSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"useRenderingEngine_","type":"bool"}],"name":"setUseRenderingEngine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleLive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"togglePublicLive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOf","outputs":[{"internalType":"uint256[]","name":"result","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"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":"amount","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":"amount","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":"payable","type":"function"},{"inputs":[],"name":"useRenderingEngine","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

9c4d535b0000000000000000000000000000000000000000000000000000000000000000010007c7bdab5adefacc637ecca4b517f7ef2a77dab08edf401e44f8e6059e6500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000040db091fdcc3d3a885ebbbc283175a787c6d1cb5327dbeb07821a26cc954eab30d3fd1bbf5b45987ed09c22d7aed1d392a698611cb336c22c7be1419557523b8a0

Deployed Bytecode

0x0002000000000002000800000000000200010000000103550000006003100270000006a20030019d000006a20330019700000001002001900000002d0000c13d0000008002000039000000400020043f000000040030008c000000870000413d000000000201043b000000e002200270000006c60020009c0000009c0000a13d000006c70020009c000000b50000213d000006e00020009c0000010e0000a13d000006e10020009c000001fe0000a13d000006e20020009c000004510000a13d000006e30020009c000006840000613d000006e40020009c0000068b0000613d000006e50020009c000000900000c13d000000440030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000202043b000006b70020009c00000e3c0000213d0000002401100370000000000301043b00000000010004111a800fa50000040f00000001010000390000079f0000013d0000000002000416000000000002004b00000e3c0000c13d0000001f02300039000006a3022001970000008002200039000000400020043f0000001f0430018f000006a40530019800000080025000390000003e0000613d0000008006000039000000000701034f000000007807043c0000000006860436000000000026004b0000003a0000c13d000000000004004b0000004b0000613d000000000151034f0000000304400210000000000502043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000120435000000400030008c00000e3c0000413d000000a00100043d000800000001001d000000800100043d000700000001001d0000000006000411000006a501000041000000000061041b0000000001000414000006a20010009c000006a201008041000000c001100210000006a6011001c70000800d020000390000000303000039000006a70400004100000000050000191a801a760000040f000000010020019000000e3c0000613d000000000100041a000000010310019000000001021002700000007f0220618f0000001f0020008c00000000010000390000000101002039000000000013004b000000810000c13d000000200020008c000000740000413d000006a8010000410000001f022000390000000502200270000006a90220009a000000000000043f000000000001041b0000000101100039000000000021004b000000700000413d000006aa01000041000000000010041b0000000101000039000000000301041a000000010030019000000001023002700000007f0220618f0000001f0020008c00000000040000390000000104002039000000000343013f0000000100300190000001d00000613d0000075301000041000000000010043f0000002201000039000000040010043f000007540100004100001a8200010430000000000003004b0000008e0000c13d0000000001000416000000000001004b00000e3c0000c13d000000000100001900001a810001042e000000000201043b000000e0022002700000077d0020009c000000e60000a13d0000077e0020009c000000f40000213d000007820020009c0000037c0000613d000007830020009c000003a10000613d000007840020009c000004200000c13d000006c001000041000004140000013d000006f80020009c000000d00000a13d000006f90020009c0000011d0000a13d000006fa0020009c000002090000a13d000006fb0020009c000004610000a13d000006fc0020009c000006aa0000613d000006fd0020009c000006b10000613d000006fe0020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d1a800f890000040f0000000601000039000000000201041a000007550220019700000756022001c7000000000021041b000000000100001900001a810001042e000006c80020009c000001500000a13d000006c90020009c0000024f0000a13d000006ca0020009c000004cb0000a13d000006cb0020009c000006b80000613d000006cc0020009c000006db0000613d000006cd0020009c000000900000c13d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000006b70010009c00000e3c0000213d00000728020000410000000c0020043f000000000010043f0000000c010000390000002002000039000005d00000013d000007110020009c0000015f0000213d0000071d0020009c000003160000213d000007230020009c000004d40000213d000007260020009c000008450000613d000007270020009c000000900000c13d000000240030008c00000e3c0000413d0000000001000416000000000001004b00000e3c0000c13d1a800f890000040f00000004010000390000000102100367000000000202043b000000000021041b000000000100001900001a810001042e000007850020009c000001a90000a13d000007860020009c000003e60000613d000007870020009c000004080000613d000007880020009c000004200000c13d0000000401100370000000000101043b1a801a0d0000040f000000000010043f0000073e0100004100001a810001042e0000077f0020009c000003f40000613d000007800020009c000004100000613d000007810020009c000004200000c13d000006b802000041000000000202041a000006b7032001970000000002000411000000000032004b0000040c0000c13d0000004403100370000000000403043b0000006403100370000000000503043b0000000403100370000000000303043b0000002401100370000000000101043b000006b701100198000009a00000c13d000007a801000041000000000010043f000006ba0100004100001a8200010430000006ed0020009c000003230000213d000006f30020009c000005230000213d000006f60020009c000006e20000613d000006f70020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a0000074a00100198000008670000013d000007060020009c0000032e0000213d0000070c0020009c0000053c0000213d0000070f0020009c000007290000613d000007100020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d000006a501000041000000000101041a0000000002000411000000000012004b0000094c0000c13d0000076a010000410000000000100443000000000100041200000004001004430000000001000414000006a20010009c000006a201008041000000c0011002100000076b011001c700008002020000391a801a7b0000040f000000010020019000000c570000613d0000076c010000410000000000100443000000000100041000000004001004430000000001000414000006a20010009c000006a201008041000000c0011002100000076b011001c70000800a020000391a801a7b0000040f000000010020019000000c570000613d000000000301043b0000000001000414000006a20010009c000006a201008041000000c001100210000000000003004b00000c370000c13d000000000200041100000c3b0000013d000006d50020009c000003390000213d000006db0020009c000005470000213d000006de0020009c000007380000613d000006df0020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a0000073300100198000008670000013d000007120020009c000003640000213d000007180020009c000005620000213d0000071b0020009c0000084f0000613d0000071c0020009c000000900000c13d000000640030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000202043b000800000002001d000006b70020009c00000e3c0000213d0000002402100370000000000202043b000700000002001d000006b70020009c00000e3c0000213d0000004401100370000000000101043b000600000001001d0000000001000411000000280010043f0000000801000029000000140010043f0000074301000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000744011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000301043b000000280000043f0000000001000411000007410010009c000001a00000c13d000500000003001d0000000801000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a0000074200100198000000050300002900000c930000613d000000000103041a000007aa0010009c00000c930000613d000000060110006c00000c920000813d0000077801000041000000000010043f000006ba0100004100001a8200010430000007890020009c0000041a0000613d0000078a0020009c000004200000c13d0000000401100370000000000301043b0000000101300210000000020110008a000000020200008a000800000003001d000006c20030009c00000000010280190000000502100210000000c00220018f00000003011002700000078b0110009a000000000101041a000000000121022f000006a201100197000000000010043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000006b700100198000009a60000c13d0000079a01000041000000000010043f000006ba0100004100001a82000104300000001f0020008c000001db0000a13d000000000010043f000006ab030000410000001f022000390000000502200270000006ac0220009a000000000003041b0000000103300039000000000023004b000001d70000413d000006ad02000041000000000021041b00000007010000290000000302000039000000000012041b00000004010000390000000802000029000000000021041b0000000701000039000000000201041a000006ae0220019700000d05022001bf0000000603000039000000000403041a000000000021041b0000000501000039000000000201041a000006af02200197000006b0022001c7000000000021041b000006b101400197000006b2011001c7000000000013041b000006b3010000410000000802000039000000000012041b000000400100043d000006b40010009c000004240000a13d0000075301000041000000000010043f0000004101000039000000040010043f000007540100004100001a8200010430000006e80020009c000005740000213d000006eb0020009c000007410000613d000006ec0020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d000006a501000041000007810000013d000007010020009c0000057f0000213d000007040020009c000007460000613d000007050020009c000000900000c13d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000402043b000007320040009c00000e3c0000213d0000002302400039000000000032004b00000e3c0000813d0000000405400039000000000251034f000000000202043b000007320020009c00000e3c0000213d00000024044000390000000006420019000000000036004b00000e3c0000213d000006a503000041000000000303041a0000000006000411000000000036004b0000094c0000c13d0000000603000039000000000303041a000007570030019800000ae60000c13d0000000203000039000000000703041a000000010070019000000001067002700000007f0660618f0000001f0060008c00000000080000390000000108002039000000000787013f0000000100700190000000810000c13d000000200060008c000002480000413d0000001f0720003900000005077002700000075f0770009a000000200020008c00000760070040410000001f0660003900000005066002700000075f0660009a000000000067004b000002480000813d000000000007041b0000000107700039000000000067004b000002440000413d0000001f0020008c00000da00000a13d000007ab0620019800000ddd0000c13d0000076005000041000000000700001900000de70000013d000006d00020009c000005c00000213d000006d30020009c0000075e0000613d000006d40020009c000000900000c13d000000840030008c00000e3c0000413d0000000402100370000000000202043b000800000002001d0000002402100370000000000202043b000007320020009c00000e3c0000213d0000002304200039000000000034004b00000e3c0000813d0000000404200039000000000441034f000000000404043b000700000004001d000007320040009c00000e3c0000213d000600240020003d000000070200002900000005022002100000000602200029000000000032004b00000e3c0000213d0000004402100370000000000202043b000500000002001d000006b70020009c00000e3c0000213d0000006401100370000000000101043b000400000001001d000006b70010009c00000e3c0000213d0000000601000039000000000101041a000300000001001d00000733001001980000083a0000613d0000000c01000039000000000101041a000006b702100198000005bc0000613d0000073401000041000000800010043f0000000501000029000000840010043f0000073501000041000000a40010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000736011001c71a801a7b0000040f0000006003100270000006a203300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000080057001bf0000029b0000613d0000008008000039000000000901034f000000009a09043c0000000008a80436000000000058004b000002970000c13d000000000006004b000002a80000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000dd10000613d0000001f01400039000000600110018f00000080011001bf000000400010043f000000200030008c00000e3c0000413d000000800100043d000006b70010009c00000e3c0000213d0000000002000411000000000012004b00000f110000c13d00000003010000290000072a0210019800000008012000b9000002bd0000613d00000000022100d9000000080020006c00000e5a0000c13d0000000002000416000000000021004b00000f090000c13d0000000501000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a0000073901100197000000080010002a00000e5a0000413d00000008021000290000000301000029000000b001100270000006a201100197000300000002001d000000000012004b000007250000213d0000000501000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d00000003020000290000073902200197000000000101043b000000000301041a0000073a03300197000000000223019f000000000021041b0000000702000039000000000302041a0000002001300270000006a201100197000000080010002a00000e5a0000413d00000008041000290000000601000039000000000101041a000000d005100270000006a205500197000000000054004b00000dcd0000213d000006c10330019700000020044002100000073b04400197000000000334019f000000000032041b0000006002100270000006a202200197000000080020002a00000e5a0000413d0000000802200029000015b30020008c00000bb40000213d0000073c0110019700000060022002100000073d02200197000000000112019f0000000602000039000000000012041b0000000401000039000000000401041a000000080100002900000006020000290000000703000029000000050500002900000004060000291a8015c70000040f000000000100001900001a810001042e0000071e0020009c000005d50000213d000007210020009c000008560000613d000007220020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a0000075800100198000008670000013d000006ee0020009c000005e40000213d000006f10020009c0000076b0000613d000006f20020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d0000000c01000039000007810000013d000007070020009c0000063a0000213d0000070a0020009c0000077d0000613d0000070b0020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d0000000801000039000005d10000013d000006d60020009c000006490000213d000006d90020009c000007860000613d000006da0020009c000000900000c13d000000440030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000202043b000800000002001d000006b70020009c00000e3c0000213d0000002401100370000000000101043b000700000001001d000006b70010009c00000e3c0000213d0000000701000029000007410010009c00000b940000c13d0000000801000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000007420010019800000b940000c13d000000010100008a0000079f0000013d000007130020009c000006580000213d000007160020009c0000086c0000613d000007170020009c000000900000c13d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000800000001001d000006a20010009c00000e3c0000213d1a800f890000040f0000000801000029000000b0011002100000076e011001970000000602000039000000000302041a0000076f03300197000007c00000013d000000a002000039000000400020043f0000000401100370000000000301043b0000000101300210000000020110008a000000020200008a000800000003001d000006c20030009c00000000010280190000000502100210000000c00220018f00000003011002700000078b0110009a000000000101041a000000000121022f000006a201100197000000000010043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000006b700100198000009a80000c13d0000079201000041000000000010043f000007460100004100001a8200010430000006b802000041000000000202041a000006b7022001970000000003000411000000000023004b0000040c0000c13d0000002402100370000000000302043b0000000102300210000000020220008a000000020400008a000800000003001d000006c20030009c00000000020480190000000503200210000000c00330018f00000003022002700000078b0220009a000000000202041a000000000232022f0000000403100370000000000303043b000600000003001d0000004401100370000000000101043b000700000001001d000006a201200197000000000010043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d0000000702000029000006b702200197000000000101043b000000000101041a000006b701100197000000000012004b000700000001001d000009bd0000613d000000280020043f000000140010043f0000079301000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000744011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000280000043f000000000101041a000000000001004b000009bd0000c13d0000079401000041000000000010043f000006ba0100004100001a82000104300000002402100370000000000202043b0000000401100370000000000101043b000006b701100197000006b7022001971a800f930000040f000000000101041a000000000001004b0000000001000039000000010100c039000000000010043f0000073e0100004100001a810001042e000006b802000041000000000202041a000006b7022001970000000003000411000000000023004b0000040c0000c13d0000002402100370000000000202043b000800000002001d0000000402100370000000000202043b0000004401100370000000000101043b000006b701100197000006b7022001971a800f930000040f000000080000006b0000000002000039000000010200c039000000000021041b0000000101000039000000000010043f0000073e0100004100001a810001042e0000079701000041000000000010043f000006ba0100004100001a82000104300000000401100370000000000101043b000006b7011001971a800f2a0000040f000000000101041a0000008001100270000006a201100197000000000010043f0000073e0100004100001a810001042e0000000401100370000000000101043b1a801a2b0000040f000000000010043f0000073e0100004100001a810001042e000007a901000041000000000010043f000006ba0100004100001a82000104300000008402100039000000000300041100000000003204350000002402100039000006a10300004100000000003204350000006402100039000000000300041400000020040000390000000000420435000000440210003900000060040000390000000000420435000006b502000041000000000021043500000004021000390000000000020435000006a20010009c000006a2010080410000004001100210000006a20030009c000006a203008041000000c002300210000000000121019f000006b6011001c700008006020000391a801a760000040f0000000100200190000006630000613d00000000020000310000000103200367000000000101043b000000000001004b0000000002000019000006660000613d000006b802000041000000000202041a000006b70020019800000a3b0000c13d000006b70210019800000a720000c13d000006c501000041000000000010043f000006ba0100004100001a8200010430000006e60020009c000008ad0000613d000006e70020009c000000900000c13d000000240030008c00000e3c0000413d0000000401100370000000000101043b0000000602000039000000000302041a0000074d0030019800000a3f0000c13d0000074e01000041000000000010043f000007460100004100001a8200010430000006ff0020009c000008cb0000613d000007000020009c000000900000c13d000000440030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000202043b000007320020009c00000e3c0000213d0000002304200039000000000034004b00000e3c0000813d0000000404200039000000000441034f000000000504043b000007320050009c00000e3c0000213d00000024062000390000000002650019000000000032004b00000e3c0000213d0000002402100370000000000402043b000007320040009c00000e3c0000213d0000002302400039000000000032004b00000e3c0000813d0000000402400039000000000221034f000000000202043b000007320020009c00000e3c0000213d00000024044000390000000007420019000000000037004b00000e3c0000213d000006a503000041000000000303041a0000000007000411000000000037004b0000094c0000c13d0000000603000039000000000303041a000007580030019800000ae60000c13d000000000700041a000000010070019000000001037002700000007f0330618f0000001f0030008c00000000080000390000000108002039000000000787013f0000000100700190000000810000c13d000000200030008c000004ae0000413d0000001f075000390000000507700270000006a90770009a000000200050008c000006a807004041000000000000043f0000001f033000390000000503300270000006a90330009a000000000037004b000004ae0000813d000000000007041b0000000107700039000000000037004b000004aa0000413d0000001f0050008c00000e790000a13d000007ab07500198000000000000043f000006a8030000410000000008000019000004bd0000613d0000000009680019000000000991034f000000000909043b000000000093041b00000001033000390000002008800039000000000078004b000004b50000413d000000000057004b000004c80000813d0000000307500210000000f80770018f000007aa0770027f000007aa077001670000000006680019000000000661034f000000000606043b000000000676016f000000000063041b000000010350021000000001033001bf00000e840000013d000006ce0020009c0000093b0000613d000006cf0020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d00000006010000390000073c0000013d000007240020009c000009500000613d000007250020009c000000900000c13d000000440030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000202043b000800000002001d000006b70020009c00000e3c0000213d00000000020004110000002401100370000000000101043b000700000001001d0000000801000029000007410010009c000004fc0000c13d000006b701200197000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000201041a00000742022001c7000000000021041b00000008010000290000000002000411000000280010043f000000140020043f0000074301000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000744011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000280000043f0000000702000029000000000021041b000000000020043f0000000001000414000006a20010009c000006a201008041000000c00110021000000770011001c70000800d0200003900000003030000390000077c04000041000000000500041100000008060000291a801a760000040f000000010020019000000e3c0000613d000000400100043d00000001020000390000000000210435000006a20010009c000006a20100804100000040011002100000073e011001c700001a810001042e000006f40020009c000007930000613d000006f50020009c000000900000c13d000006a501000041000000000101041a0000000005000411000000000015004b0000094c0000c13d0000000001000414000006a20010009c000006a201008041000000c001100210000006a6011001c70000800d020000390000000303000039000006a70400004100000000060000191a801a760000040f000000010020019000000e3c0000613d000006a501000041000000000001041b000000000100001900001a810001042e0000070d0020009c000007a60000613d0000070e0020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a000000b0011002700000084b0000013d000006dc0020009c000007ac0000613d000006dd0020009c000000900000c13d000000440030008c00000e3c0000413d0000000402100370000000000202043b0000002401100370000000000101043b000800000001001d000006b70010009c00000e3c0000213d000006a501000041000000000101041a0000000003000411000000000013004b0000094c0000c13d0000000701000039000000000301041a000006a204300197000000000042004b00000bab0000a13d0000074501000041000000000010043f000007460100004100001a8200010430000007190020009c000009650000613d0000071a0020009c000000900000c13d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000006b70010009c00000e3c0000213d1a800f4d0000040f000000000001004b0000000001000039000000010100c0390000079f0000013d000006e90020009c000007c40000613d000006ea0020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d0000000501000039000000000101041a00000060011002700000073d0000013d000007020020009c000007d10000613d000007030020009c000000900000c13d000000640030008c00000e3c0000413d0000000402100370000000000202043b000007320020009c00000e3c0000213d0000002304200039000000000034004b00000e3c0000813d0000000404200039000000000441034f000000000404043b000800000004001d000007320040009c00000e3c0000213d000700240020003d000000080200002900000005022002100000000702200029000000000032004b00000e3c0000213d0000002402100370000000000202043b000600000002001d000006b70020009c00000e3c0000213d0000004401100370000000000101043b000500000001001d000006b70010009c00000e3c0000213d0000000601000039000000000101041a000400000001001d00000733001001980000083a0000613d0000000801000039000000000101041a000300000001001d0000072f0100004100000000001004430000000001000414000006a20010009c000006a201008041000000c00110021000000730011001c70000800b020000391a801a7b0000040f000000010020019000000c570000613d000000000101043b000000030010006c00000c530000213d0000000c01000039000000000101041a000006b70210019800000df80000c13d0000075d01000041000000000010043f000007460100004100001a8200010430000006d10020009c000007e40000613d000006d20020009c000000900000c13d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000000000010043f0000000a01000039000000200010043f000000400200003900000000010000191a801a610000040f000000000101041a000000800010043f000007290100004100001a810001042e0000071f0020009c000009900000613d000007200020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d1a800f890000040f0000000601000039000000000201041a0000077a032001970000074d0020019800000000020000190000077b02006041000007e00000013d000006ef0020009c000008130000613d000006f00020009c000000900000c13d000000440030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000202043b000007320020009c00000e3c0000213d0000002304200039000000000034004b00000e3c0000813d0000000404200039000000000441034f000000000404043b000600000004001d000007320040009c00000e3c0000213d000500240020003d000000060200002900000005022002100000000502200029000000000032004b00000e3c0000213d0000002402100370000000000202043b000007320020009c00000e3c0000213d0000002304200039000000000034004b00000e3c0000813d0000000404200039000000000141034f000000000101043b000400000001001d000007320010009c00000e3c0000213d000300240020003d000000040100002900000005011002100000000301100029000000000031004b00000e3c0000213d000006a501000041000000000101041a0000000002000411000000000012004b0000094c0000c13d000000060000006b0000008c0000613d0000000002000019000000040020006c00000c8c0000813d0000000501200210000800000002001d0000000302100029000000050110002900000001011003670000000102200367000000000202043b000700000002001d000000000101043b000000000010043f0000000a01000039000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000000080200002900000e3c0000613d000000000101043b0000000703000029000000000031041b0000000102200039000000060020006c0000061b0000413d0000008c0000013d000007080020009c000008200000613d000007090020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d1a800f890000040f0000000601000039000000000201041a000007620220019700000763022001c7000000000021041b000000000100001900001a810001042e000006d70020009c0000083e0000613d000006d80020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d1a800f890000040f0000000601000039000000000201041a0000073f03200197000007330020019800000000020000190000074002006041000007e00000013d000007140020009c000009990000613d000007150020009c000000900000c13d0000000001000416000000000001004b00000e3c0000c13d000022b801000039000000800010043f000007290100004100001a810001042e0000006002100270000006a202200197000000000301034f0000001f0520018f000006a406200198000000400100043d0000000004610019000006710000613d000000000703034f0000000008010019000000007907043c0000000008980436000000000048004b0000066d0000c13d000000000005004b0000067e0000613d000000000363034f0000000305500210000000000604043300000000065601cf000000000656022f000000000303043b0000010005500089000000000353022f00000000035301cf000000000363019f00000000003404350000006002200210000006a20010009c000006a2010080410000004001100210000000000121019f00001a82000104300000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a00000060011002700000084b0000013d0000000001000416000000000001004b00000e3c0000c13d0000072f0100004100000000001004430000000001000414000006a20010009c000006a201008041000000c00110021000000730011001c70000800b020000391a801a7b0000040f000000010020019000000c570000613d000000000101043b000007490010009c000006a10000213d000006a501000041000000000101041a0000000002000411000000000012004b0000094c0000c13d0000000601000039000000000201041a0000074a0020019800000ae60000c13d0000074b022001970000074c022001c7000000000021041b000000000100001900001a810001042e0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a0000075700100198000008670000013d0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a0000074d00100198000008670000013d000000640030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000402100370000000000202043b000800000002001d0000072a0020009c00000e3c0000213d0000002402100370000000000202043b000700000002001d0000072a0020009c00000e3c0000213d0000004401100370000000000101043b000600000001001d0000072a0010009c00000e3c0000213d1a800f890000040f000000070100002900000060011002100000072b011001970000000502000039000000000302041a000006af03300197000000000131019f00000008011001af000000000012041b0000000601000039000000000201041a0000072c022001970000000603000029000007e00000013d0000000001000416000000000001004b00000e3c0000c13d000015b301000039000000800010043f000007290100004100001a810001042e000000440030008c00000e3c0000413d0000000402100370000000000202043b000800000002001d0000002402100370000000000202043b000007320020009c00000e3c0000213d0000002304200039000000000034004b00000e3c0000813d0000000404200039000000000141034f000000000101043b000700000001001d000007320010009c00000e3c0000213d000600240020003d000000070100002900000005011002100000000601100029000000000031004b00000e3c0000213d0000000601000039000000000101041a00000733001001980000083a0000613d000500000001001d0000000501000039000000000101041a0000072a0210019800000008012000b9000007070000613d00000000022100d9000000080020006c00000e5a0000c13d0000000002000416000000000021004b00000f090000c13d0000000001000411000006b701100197000400000001001d000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a0000073901100197000000080010002a00000e5a0000413d00000008021000290000000501000029000000b001100270000006a201100197000500000002001d000000000012004b00000dac0000a13d0000075201000041000000000010043f000007460100004100001a8200010430000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000800000001001d000006a20010009c00000e3c0000213d1a800f890000040f0000000701000039000000000201041a000006ae02200197000007df0000013d0000000001000416000000000001004b00000e3c0000c13d0000000501000039000000000101041a0000072a01100197000000800010043f000007290100004100001a810001042e0000000001000416000000000001004b00000e3c0000c13d0000000b01000039000007810000013d00000728010000410000000c0010043f0000000001000411000000000010043f0000000001000414000006a20010009c000006a201008041000000c0011002100000072e011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000001041b0000000001000414000006a20010009c000006a201008041000000c001100210000006a6011001c70000800d02000039000000020300003900000761040000410000098b0000013d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000006b70010009c00000e3c0000213d1a800f2a0000040f000000000101041a00000739011001970000079f0000013d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000800000001001d000006a20010009c00000e3c0000213d1a800f890000040f0000000801000029000000d0011002100000074f011001970000000602000039000000000302041a0000075003300197000007c00000013d0000000001000416000000000001004b00000e3c0000c13d000006b801000041000000000101041a000006b701100197000000800010043f000007290100004100001a810001042e000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000800000001001d000006b70010009c00000e3c0000213d1a800f890000040f0000000c01000039000007dd0000013d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000006b70010009c00000e3c0000213d1a800f2a0000040f000000000101041a000000a001100270000000400200043d0000000000120435000006a20020009c000006a20200804100000040012002100000073e011001c700001a810001042e0000000001000416000000000001004b00000e3c0000c13d0000000701000039000000000101041a0000084b0000013d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000201043b000000000002004b0000000001000039000000010100c039000800000002001d000000000012004b00000e3c0000c13d1a800f890000040f000000080000006b0000000001000019000007470100c0410000000602000039000000000302041a0000074803300197000000000113019f000000000012041b000000000100001900001a810001042e000000240030008c00000e3c0000413d0000000001000416000000000001004b00000e3c0000c13d1a800f890000040f00000004010000390000000101100367000000000101043b0000000302000039000000000012041b000000000100001900001a810001042e000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000800000001001d000006b70010009c00000e3c0000213d1a800f890000040f0000000b01000039000000000201041a000006c3022001970000000803000029000000000232019f000000000021041b000000000100001900001a810001042e000000240030008c00000e3c0000413d0000000401100370000000000101043b000800000001001d000006b70010009c00000e3c0000213d000006a501000041000000000101041a0000000002000411000000000012004b0000094c0000c13d00000728010000410000000c0010043f0000000801000029000000000010043f0000000001000414000006a20010009c000006a201008041000000c0011002100000072e011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000600000001001d000000000101041a000700000001001d0000072f0100004100000000001004430000000001000414000006a20010009c000006a201008041000000c00110021000000730011001c70000800b020000391a801a7b0000040f000000010020019000000c570000613d000000000101043b000000070010006c00000c860000a13d0000073101000041000000000010043f000006ba0100004100001a8200010430000000240030008c00000e3c0000413d0000000001000416000000000001004b00000e3c0000c13d1a800f890000040f00000004010000390000000101100367000000000101043b0000000802000039000000000012041b000000000100001900001a810001042e000000240030008c00000e3c0000413d0000000402100370000000000202043b000007320020009c00000e3c0000213d0000002304200039000000000034004b00000e3c0000813d0000000404200039000000000141034f000000000101043b000800000001001d000007320010009c00000e3c0000213d000700240020003d000000080100002900000005011002100000000701100029000000000031004b00000e3c0000213d0000000601000039000000000101041a000600000001001d000007330010019800000c420000c13d0000076801000041000000000010043f000007460100004100001a82000104300000000001000416000000000001004b00000e3c0000c13d0000000701000039000000000101041a00000020011002700000084b0000013d0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a000000d001100270000006a201100197000000800010043f000007290100004100001a810001042e0000000001000416000000000001004b00000e3c0000c13d0000000601000039000000000101041a0000077900100198000008670000013d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000006b70010009c00000e3c0000213d000000000010043f0000000901000039000000200010043f000000400200003900000000010000191a801a610000040f000000000101041a000000ff001001900000000001000039000000010100c039000000800010043f000007290100004100001a810001042e000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000201043b000000000002004b0000000001000039000000010100c039000800000002001d000000000012004b00000e3c0000c13d0000000001000411000006b701100197000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000700000001001d000000000101041a000600000001001d0000000801000029000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000770011001c70000800d020000390000000203000039000007710400004100000000050004111a801a760000040f000000010020019000000e3c0000613d000000080000006b00000000010000390000000101006039000000060300002900000772003001980000000002000039000000010200603900000000002101400000000001000019000007720100c0410000077302300197000000000121013f0000000703000029000000000203041a0000077402200197000000000121019f00000775011001c7000000000013041b00000001010000390000079f0000013d0000000001000416000000000001004b00000e3c0000c13d0000000103000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000000810000c13d000000800010043f000000000004004b00000a5c0000613d000000000030043f000000000001004b000009630000613d000006ab030000410000000004000019000000000503041a000000a002400039000000000052043500000001033000390000002004400039000000000014004b000008c30000413d00000a610000013d000000240030008c00000e3c0000413d0000000002000416000000000002004b00000e3c0000c13d0000000401100370000000000101043b000700000001001d000006b70010009c00000e3c0000213d0000000701000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a0000008001100270000006a201100197000600000001001d00000005011002100000003f021000390000075903200197000000400200043d000500000002001d0000000002230019000000000032004b00000000030000390000000103004039000007320020009c000001f80000213d0000000100300190000001f80000c13d000000400020043f0000000502000029000000060300002900000000063204360000001f0210018f000000000001004b000009030000613d0000000001160019000000000300003100000001033003670000000004060019000000003503043c0000000004540436000000000014004b000008ff0000c13d000000000002004b000000060000006b0000092a0000613d000800000000001d000400000006001d0000000701000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000050200002900000000020204330000000804000029000000000024004b00000c8c0000813d000000000101043b000000600110021000000003024002700000000001210019000000050240021000000004060000290000000003620019000000000101041a000000e00220018f000000000121022f000006a20110019700000000001304350000000104400039000800000004001d000000060040006c000009080000413d000000400100043d000000200200003900000000022104360000000503000029000000000303043300000000003204350000004002100039000000000003004b000009390000613d0000000004000019000000006506043400000000025204360000000104400039000000000034004b000009340000413d000000000212004900000c2f0000013d000000240030008c00000e3c0000413d0000000401100370000000000101043b000006b70010009c00000e3c0000213d000006a502000041000000000202041a0000000003000411000000000023004b0000094c0000c13d000000000001004b00000c890000c13d0000072d01000041000000000010043f000006ba0100004100001a82000104300000076901000041000000000010043f000006ba0100004100001a82000104300000000001000416000000000001004b00000e3c0000c13d000000000200041a000000010320019000000001012002700000007f0110618f0000001f0010008c00000000040000390000000104002039000000000442013f0000000100400190000000810000c13d000000800010043f000000000003004b00000a5c0000613d000000000000043f000000000001004b00000bb80000c13d000000800200003900000a610000013d00000728010000410000000c0010043f0000000001000411000000000010043f0000072f0100004100000000001004430000000001000414000006a20010009c000006a201008041000000c00110021000000730011001c70000800b020000391a801a7b0000040f000000010020019000000c570000613d000000000101043b000800000001001d0000000001000414000006a20010009c000006a201008041000000c0011002100000072e011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b0000000802000029000007760220009a000000000021041b0000000001000414000006a20010009c000006a201008041000000c001100210000006a6011001c70000800d020000390000000203000039000007770400004100000000050004111a801a760000040f00000001002001900000008c0000c13d00000e3c0000013d0000000001000416000000000001004b00000e3c0000c13d000006c001000041000000000101041a000000a001100270000000800010043f000007290100004100001a810001042e0000000001000416000000000001004b00000e3c0000c13d0000001201000039000000800010043f000007290100004100001a810001042e000000000002004b000009da0000c13d000007a701000041000000000010043f000006ba0100004100001a82000104300000000801000029000000f00000013d0000000601000039000000000101041a000007790010019800000a260000c13d0000000205000039000000000405041a000000010640019000000001024002700000007f0220618f0000001f0020008c00000000010000390000000101002039000000000114013f0000000100100190000000080a000029000000810000c13d000000000002004b00000aea0000c13d0000006001000039000000800900003900000c270000013d0000000801000029000000000010043f0000079501000041000000200010043f000000400200003900000000010000191a801a610000040f0000000602000029000006b702200198000000000301041a000006c303300197000000000223019f000000000021041b0000000001000039000000010100c0390000000804000029000000ff0240018f00000000012101cf000007ac022002df0000000803400270000007960330009a000000000403041a000000000224016f000000000112019f000000000013041b0000000701000029000000000010043f0000073e0100004100001a810001042e000800000003001d000700000005001d000600000001001d000000010140008a000400000001001d0000000101100210000000020200008a000500000004001d000006c20040009c00000000010280190000000502100210000000c00220018f00000003011002700000078b0110009a000000000101041a000000000121022f000006a201100197000000000010043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d0000000802000029000006b702200197000000000101043b000000000101041a000006b701100197000000000012004b00000b0d0000c13d0000000701000029000006b701100197000000000021004b000800000002001d00000bc20000c13d000000000020043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000700000001001d0000000601000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d0000000702000029000000000202041a0000079b0220009c00000cd00000813d000007a601000041000000000010043f000006ba0100004100001a82000104300000000801000029000000000010043f0000000a01000039000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000000000001004b00000b110000c13d0000078f01000041000000000010043f000007460100004100001a8200010430000006b901000041000000000010043f000006ba0100004100001a82000104300000000504000039000000000404041a0000072a0540019800000000041500a900000a470000613d00000000055400d9000000000015004b00000e5a0000c13d0000000005000416000000000054004b00000f090000c13d0000006004300270000006a204400197000000000014001a00000e5a0000413d0000000004140019000015b30040008c00000bb40000213d0000073c0330019700000060044002100000073d04400197000000000334019f000000000032041b1a800f7b0000040f000000000201001900000000010004111a80181e0000040f000000000100001900001a810001042e000007ad02200197000000a00020043f000000000001004b000000a0020000390000008002006039000000600220008a00000080010000391a800f3b0000040f000000400100043d000800000001001d00000080020000391a800f150000040f00000008020000290000000001210049000006a20010009c000006a2010080410000006001100210000006a20020009c000006a2020080410000004002200210000000000121019f00001a810001042e000006bb01000041000000000010043f0000000001000411000000200010043f0000000001000414000006a20010009c000006a201008041000000c001100210000006bc011001c7000800000002001d1a801a760000040f0000006003100270000006a203300197000000200030008c00000020030080390000001f0430018f000000200330019000000a8a0000613d000000000501034f0000000006000019000000005705043c0000000006760436000000000036004b00000a860000c13d000000000004004b00000a970000613d000000000131034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000130435000000000100043d000000010010008c00000000010000390000000101006039000000000112016f000000010010019000000ba70000613d000006be01000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c001100210000006bf011001c700000000020004101a801a7b0000040f0000006003100270000006a203300197000000200030008c000000200400003900000000040340190000001f0540018f0000002006400190000000200460003900000ab60000613d000000000701034f0000002008000039000000007907043c0000000008980436000000000048004b00000ab20000c13d000000000005004b00000ac30000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000001f0030008c00000000010000390000000101002039000000200300043d000006b7003001980000000003000039000000010300c039000000000131016f000000000112016f000000010010008c00000ad70000c13d0000000001000414000006a20010009c000006a201008041000000c001100210000006ba011001c700000008020000291a801a760000040f000000010020019000000e3c0000613d000006c001000041000000000201041a000006c102200197000006c2022001c7000000000021041b000006b801000041000000000201041a000006c30220019700000008022001af000000000021041b000000200100003900000100001004430000012000000443000006c40100004100001a810001042e0000075e01000041000000000010043f000007460100004100001a8200010430000000400100043d000000a003100039000000400030043f0000008003100039000000000003043500000000070300190000000900a0008c0000000a3aa0011a000000f808300210000000010370008a00000000090304330000079009900197000000000889019f00000791088001c7000000000083043500000aef0000213d00000000017100490000008101100039000000210770008a0000000000170435000000400100043d0000002009100039000000000006004b00000c090000613d000000000050043f000007600400004100000000050000190000000006950019000000000804041a000000000086043500000001044000390000002005500039000000000025004b00000b050000413d00000c0b0000013d0000079801000041000000000010043f000006ba0100004100001a82000104300000000b01000039000000000101041a000700000001001d0000000801000029000000000010043f0000000a01000039000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000000400300043d000000240230003900000000001204350000078d010000410000000000130435000000040130003900000008020000290000000000210435000006a20030009c000800000003001d000006a201000041000000000103401900000040011002100000000002000414000006a20020009c000006a202008041000000c002200210000000000112019f0000000702000029000006b7022001970000075b011001c71a801a7b0000040f00000060031002700000001f0430018f000006a405300197000006a203300197000000010020019000000c690000613d00000008090000290000000002590019000000000005004b00000b490000613d000000000601034f0000000007090019000000006806043c0000000007870436000000000027004b00000b450000c13d000000000004004b00000b560000613d000000000151034f0000000304400210000000000502043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001204350000001f01300039000006a3021001970000000001920019000000000021004b00000000020000390000000102004039000007320010009c000001f80000213d0000000100200190000001f80000c13d000000400010043f000000200030008c00000e3c0000413d00000000040900190000000002090433000007320020009c00000e3c0000213d0000000005040019000000000443001900000000025200190000001f03200039000000000043004b00000000050000190000078e050080410000078e033001970000078e06400197000000000763013f000000000063004b00000000030000190000078e030040410000078e0070009c000000000305c019000000000003004b00000e3c0000c13d0000000032020434000007320020009c000001f80000213d0000001f05200039000007ab055001970000003f05500039000007ab055001970000000005150019000007320050009c000001f80000213d000000400050043f00000000092104360000000005320019000000000045004b00000e3c0000213d000000000002004b00000b910000613d000000000400001900000000059400190000000006340019000000000606043300000000006504350000002004400039000000000024004b00000b8a0000413d0000000002920019000000000002043500000c270000013d0000000701000029000000280010043f0000000801000029000000140010043f0000074301000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000744011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000280000043f000000000101041a0000079f0000013d000006bd01000041000000000010043f000006ba0100004100001a82000104300000000604000039000000000504041a0000006006500270000006a206600197000000000026001a00000e5a0000413d0000000006260019000022b80060008c00000c580000a13d0000076601000041000000000010043f000007460100004100001a8200010430000006a8030000410000000004000019000000000503041a000000a002400039000000000052043500000001033000390000002004400039000000000014004b00000bba0000413d00000a610000013d000700000001001d000000280010043f000000140020043f0000079301000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000744011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000280000043f000000000101041a000000000001004b000000080200002900000a030000c13d00000005020000290000000101200210000000020110008a000006c20020009c000000020100808a0000000502100210000000c00220018f00000003011002700000078b0110009a000000000101041a000000000121022f000006a201100197000000000010043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000006b700100198000001cc0000613d0000000501000029000000000010043f0000079501000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000006b701100197000000070010006c000000080200002900000a030000613d0000079901000041000000000010043f000006ba0100004100001a8200010430000007ad04400197000000000049043500000000022900190000000004070433000000000004004b00000c170000613d000000000500001900000000062500190000000007350019000000000707043300000000007604350000002005500039000000000045004b00000c100000413d000000000224001900000000000204350000000002120049000000200320008a00000000003104350000001f02200039000007ab032001970000000002130019000000000032004b00000000030000390000000103004039000007320020009c000001f80000213d0000000100300190000001f80000c13d000000400020043f000000000201043300000000032900190000000000030435000000200110008a000000200300003900000000003104350000005f02200039000007ab02200197000006a20020009c000006a2020080410000006002200210000006a20010009c000006a2010080410000004001100210000000000112019f00001a810001042e000006a6011001c70000800902000039000000000400041100000000050000191a801a760000040f00000001002001900000008c0000c13d0000076d01000041000000000010043f000006ba0100004100001a82000104300000000801000039000000000101041a000500000001001d0000072f0100004100000000001004430000000001000414000006a20010009c000006a201008041000000c00110021000000730011001c70000800b020000391a801a7b0000040f000000010020019000000c570000613d000000000101043b000000050010006c00000c970000a13d0000076701000041000000000010043f000007460100004100001a8200010430000000000001042f0000073c0550019700000060066002100000073d06600197000000000556019f000000000054041b0000000004230049000006a204400197000006ae03300197000000000334019f000000000031041b00000000010200191a800f7b0000040f000000000201001900000008010000291a80181e0000040f000000000100001900001a810001042e000000400200043d0000000006520019000000000005004b00000c730000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000068004b00000c6f0000c13d000000000004004b00000c800000613d000000000151034f0000000304400210000000000506043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001604350000006001300210000006a20020009c000006a2020080410000004002200210000000000112019f00001a82000104300000000601000029000000000001041b00000008010000291a8018080000040f000000000100001900001a810001042e0000075301000041000000000010043f0000003201000039000000040010043f000007540100004100001a8200010430000000000013041b0000000801000029000000070200002900000006030000290000002a0000013d0000000001000411000000000010043f0000000901000039000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000000ff0010019000000f0d0000c13d0000000501000039000000000101041a00000060011002700000072a011001970000000002000416000000000021004b00000f090000c13d00000006010000290000006001100270000006a201100197000015b30010008c00000bb40000813d00000006020000290000073c0220019700000060011002100000072c0110009a0000073d01100197000000000121019f0000000602000039000000000012041b0000000001000411000000000010043f0000000901000039000000200010043f000000400200003900000000010000191a801a610000040f000000000301041a000007ad0230019700000001022001bf000000000021041b0000000301000039000000000301041a00000007010000290000000802000029000000000400041100000000050400191a80139b0000040f000000000100001900001a810001042e000000000301043b0000000701000029000000000021041b000000000103041a0000079c0110009a000300000003001d000000000013041b0000000503000029000000ff0130018f000000010210020f0000000801300270000007960110009a000000000301041a000000000023017000000cf30000613d000007aa02200167000000000223016f000000000021041b0000000501000029000000000010043f0000079501000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000201041a000006c302200197000000000021041b0000000801000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d0000000706000029000000000206041a0000079d0320019700000080022002700000079e0220009a000006a2042001970000008005400210000000000335019f000000000101043b000000000036041b000000040500002900000006035002100000000205500270000200000005001d0000079f055001970000078b0550009a000000000505041a000000c00330018f000400000003001d00000020033001bf000000000335022f00000060011002100000000304400270000000000414019f000000000404041a0000000502200210000000e00220018f000000000224022f0000000304300270000007a004400197000000000114019f0000000504300210000000e00440018f000000000501041a000000000645022f000000000626013f000006a20660019700000000044601cf000000000454013f000000000041041b0000000101200210000007a101100197000000010110008a0000000502100210000000e00220018f00000003011002700000078b0110009a000000000401041a000000000524022f000000000335013f000006a20330019700000000022301cf000000000242013f000000000021041b0000000303000029000000000203041a000007a20120009a000007a301100197000700000002001d0000079d02200197000000000121019f000000000013041b0000000601000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000070200002900000080032002700000008302200270000007a002200197000000000101043b0000006001100210000000000121019f000100000003001d0000000502300210000000e00220018f000000000301041a000000000423022f000000050440014f000006a20440019700000000022401cf000000000232013f000000000021041b0000000301000029000000000101041a0000006001100270000706a20010019c00000d840000c13d000006c001000041000000000201041a000006ae03200197000006a2022001970000000102200039000006a204200197000000000334019f000000000031041b00000060012002100000073d011001970000000303000029000000000203041a0000073c02200197000000000121019f000000000013041b000700000004001d000000000040043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000201041a000006c30220019700000006022001af000000000021041b000000070000006b00000e3c0000613d0000000101000029000000200110021000000007011001af00000002020000290000078b0220009a000000000302041a0000000404300250000000000114013f000007320110019700000004011001f0000000000131013f000000000012041b000007a401000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000770011001c70000800d020000390000000303000039000007a504000041000000080500002900000006060000291a801a760000040f0000000100200190000004080000c13d00000e3c0000013d000000000002004b000000000400001900000da60000613d0000002004500039000000000141034f000000000401043b0000000301200210000007aa0110027f000007aa01100167000000000414016f000000010120021000000df40000013d0000000401000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d00000005020000290000073902200197000000000101043b000000000301041a0000073a03300197000000000223019f000000000021041b0000000702000039000000000302041a0000002001300270000006a201100197000000080010002a00000e5a0000413d00000008041000290000000601000039000000000101041a000000d005100270000006a205500197000000000054004b00000e3e0000a13d0000075101000041000000000010043f000007460100004100001a82000104300000001f0530018f000006a406300198000000400200043d000000000462001900000e6b0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000dd80000c13d00000e6b0000013d000007600500004100000000070000190000000008470019000000000881034f000000000808043b000000000085041b00000001055000390000002007700039000000000067004b00000ddf0000413d000000000026004b00000df20000813d0000000306200210000000f80660018f000007aa0660027f000007aa066001670000000004470019000000000141034f000000000101043b000000000161016f000000000015041b00000001010000390000000104200210000000000114019f000000000013041b000000000100001900001a810001042e000000400400043d000300000004001d00000024014000390000073503000041000000000031043500000734010000410000000000140435000000040140003900000006030000290000000000310435000006a20040009c000006a201000041000000000104401900000040011002100000000003000414000006a20030009c000006a203008041000000c003300210000000000113019f0000075b011001c71a801a7b0000040f0000006003100270000006a203300197000000200030008c000000200400003900000000040340190000001f0640018f0000002007400190000000030b000029000000030570002900000e1d0000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b00000e190000c13d000000000006004b00000e2a0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000010020019000000e600000613d0000001f01400039000000600210018f0000000001b20019000000000021004b00000000020000390000000102004039000007320010009c000001f80000213d0000000100200190000001f80000c13d000000400010043f000000200030008c00000e3c0000413d00000000010b0433000006b70010009c00000ecf0000a13d000000000100001900001a8200010430000006c10330019700000020044002100000073b04400197000000000334019f000000000032041b0000006002100270000006a202200197000000080020002a00000e5a0000413d0000000802200029000015b30020008c00000bb40000213d0000073c0110019700000060022002100000073d02200197000000000112019f0000000602000039000000000012041b0000000401000039000000000401041a000000080100002900000006020000290000000703000029000000000500041100000000060500191a8015c70000040f000000000100001900001a810001042e0000075301000041000000000010043f0000001101000039000000040010043f000007540100004100001a82000104300000001f0530018f000006a406300198000000400200043d000000000462001900000e6b0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000e670000c13d000000000005004b00000c800000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000c800000013d000000000005004b000000000300001900000e7e0000613d000000000361034f000000000303043b0000000306500210000007aa0660027f000007aa06600167000000000363016f0000000105500210000000000353019f000000000030041b0000000103000039000000000603041a000000010060019000000001056002700000007f0550618f0000001f0050008c00000000070000390000000107002039000000000676013f0000000100600190000000810000c13d000000200050008c00000ea00000413d0000001f062000390000000506600270000006ac0660009a000000200020008c000006ab060040410000001f055000390000000505500270000006ac0550009a000000000056004b00000ea00000813d000000000006041b0000000106600039000000000056004b00000e9c0000413d0000001f0020008c00000ea70000a13d000007ab0620019800000eb50000c13d000006ab05000041000000000700001900000ebf0000013d000000000002004b000000000500001900000eac0000613d000000000141034f000000000501043b0000000301200210000007aa0110027f000007aa01100167000000000115016f0000000102200210000000000121019f000000000013041b000000000100001900001a810001042e000006ab0500004100000000070000190000000008470019000000000881034f000000000808043b000000000085041b00000001055000390000002007700039000000000067004b00000eb70000413d000000000026004b00000eca0000813d0000000306200210000000f80660018f000007aa0660027f000007aa066001670000000004470019000000000141034f000000000101043b000000000161016f000000000015041b0000000101200210000000000131019f000000000013041b000000000100001900001a810001042e0000000002000411000000000012004b00000f110000c13d0000000601000029000000000010043f0000000901000039000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000e3c0000613d000000000101043b000000000101041a000000ff0010019000000f0d0000c13d00000004010000290000072a011001970000000002000416000000000021004b00000f090000c13d00000004010000290000006001100270000006a201100197000015b20010008c00000bb40000213d00000004020000290000073c0220019700000060011002100000072c0110009a0000073d01100197000000000121019f0000000602000039000000000012041b0000000601000029000000000010043f0000000901000039000000200010043f000000400200003900000000010000191a801a610000040f000000000301041a000007ad0230019700000001022001bf000000000021041b0000000301000039000000000301041a00000007010000290000000802000029000000060400002900000005050000291a80139b0000040f000000000100001900001a810001042e0000076501000041000000000010043f000007460100004100001a82000104300000076401000041000000000010043f000007460100004100001a82000104300000075c01000041000000000010043f000007460100004100001a820001043000000020030000390000000004310436000000003202043400000000002404350000004001100039000000000002004b00000f240000613d000000000400001900000000051400190000000006430019000000000606043300000000006504350000002004400039000000000024004b00000f1d0000413d000000000312001900000000000304350000001f02200039000007ab022001970000000001210019000000000001042d000006b701100197000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000f390000613d000000000101043b000000000001042d000000000100001900001a82000104300000001f02200039000007ab022001970000000001120019000000000021004b00000000020000390000000102004039000007320010009c00000f470000213d000000010020019000000f470000c13d000000400010043f000000000001042d0000075301000041000000000010043f0000004101000039000000040010043f000007540100004100001a82000104300001000000000002000100000001001d000006b701100197000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000000f780000613d000000000101043b000000000101041a000007750010019800000f720000c13d0000076a010000410000000000100443000000010100002900000004001004430000000001000414000006a20010009c000006a201008041000000c0011002100000076b011001c700008002020000391a801a7b0000040f000000010020019000000f7a0000613d000000000101043b000000000001004b0000000001000039000000010100c039000000000001042d0000005801100270000000020110018f000000000001004b0000000001000039000000010100c039000000000001042d000000000100001900001a8200010430000000000001042f0000000002010019000007a4011000d1000000000002004b00000f820000613d00000000022100d9000007a40020009c00000f830000c13d000000000001042d0000075301000041000000000010043f0000001101000039000000040010043f000007540100004100001a8200010430000006a501000041000000000101041a0000000002000411000000000012004b00000f8f0000c13d000000000001042d0000076901000041000000000010043f000006ba0100004100001a8200010430000000280020043f000000140010043f0000079301000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000744011001c700008010020000391a801a7b0000040f000000010020019000000fa30000613d000000000101043b000000280000043f000000000001042d000000000100001900001a8200010430001700000000000200000000040100190000000601000039000000000101041a0000074a0010019800000fae0000c13d000007a41030012a000000000001004b000013840000c13d000700000003001d000300000002001d000b06b70020019c000013880000613d000100000004001d000006b701400197000800000001001d000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000013820000613d000000000101043b000600000001001d0000000b01000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000013820000613d000000000701043b000006b801000041000000000101041a000006b70010019800000007060000290000138c0000613d000000400900043d000007af0090009c0000000b050000290000000608000029000013900000813d0000018001900039000000400010043f0000016001900039001200000001001d00000000000104350000014001900039000e00000001001d00000000000104350000012001900039001400000001001d00000000000104350000010001900039001100000001001d0000000000010435000000e001900039001700000001001d0000000000010435000000c001900039001000000001001d0000000000010435000000a001900039000f00000001001d00000000000104350000008001900039000200000001001d00000000000104350000002001900039000a00000001001d0000000000010435000000000009043500000060049000390000004002900039000000000308041a0000008001300270000006a201100197001500000002001d0000000000120435000000000207041a0000008002200270000006a202200197000500000004001d0000000000240435000000a002300270000000000262004b000013960000413d000006b703300197000000a004200210000000000334019f000000000038041b000000000307041a000000a0043002700000000004640019000006b703300197001600000004001d000000a004400210000000000334019f000400000007001d000000000037041b000007a40220012a000000000121004b0000000001004019000900000009001d0000000000190435000000000050043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000000120f000029000013820000613d000000000101043b000000000101041a0000077500100198000010480000c13d0000076a010000410000000000100443000000030100002900000004001004430000000001000414000006a20010009c000006a201008041000000c0011002100000076b011001c700008002020000391a801a7b0000040f00000001002001900000139a0000613d000000000101043b0000000b050000290000000806000029000000120f000029000000000001004b0000104e0000c13d000000000056004b000010510000c13d0000000901000029000000000101043300000015020000290000000002020433000000000112004900000005020000290000000000120435000010530000013d0000005801100270000000020110018f0000000b050000290000000806000029000000000001004b0000103e0000613d0000000a010000290000000001010433000010590000013d000000050100002900000000010104330000001602000029000007a40220012a000000000112004b00000000010040190000000a02000029000000000012043500000009070000290000000002070433000000000021004b0000000008020019000000000801401900000015030000290000000003030433000000000438013f000000000038004b0000000004008019000000000043004b000011470000613d000000000434013f00000000024200490000000000270435000000000038004b000000000803801900000000018100490000000a030000290000000000130435000000000056004b000010740000c13d0000000504000029000000000304043300000000038300190000000000340435000011470000013d000000400100043d000000a00210003900000060030000390000000000320435000000800210003900000000005204350000004002100039000007b003000041000000000032043500000060021000390000000000620435000000c0021000390000000000820435001600000008001d0000000503800210000000e0041000390000000003340019000000400030043f0000002003100039000000000023043500000000004104350000000e020000290000000000120435000000000060043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000013820000613d000000000101043b000d00000001001d0000000b01000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000120f0000290000000100200190000013820000613d000000000401043b0000000401000029000000000101041a0000006001100270000006a205100198000010d40000c13d000006c001000041000000000201041a000006ae03200197000006a2022001970000000102200039000006a205200197000c00000005001d000000000335019f000000000031041b00000060012002100000073d011001970000000403000029000000000203041a0000073c02200197000000000121019f000000000013041b000000000050043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c70000801002000039001300000004001d1a801a7b0000040f0000000c050000290000001304000029000000120f0000290000000100200190000013820000613d000000000101043b000000000201041a000006c3022001970000000b022001af000000000021041b000000000005004b000013820000613d0000001701000029000000000051043500130060004002180000000d01000029000d00600010021800000005010000290000000008010433000c00160080002d000000010900003900000000040000190000000100400190000010e30000613d00000001088000390000000c0080006c000011300000613d00000015020000290000000001020433000000010110008a000000000012043500000003021002700000000d02200029000000000202041a0000000501100210000000e00110018f000000000112022f000000030280027000000013022000290000000503800210000000e00330018f000000000402041a000000000534022f000000000515013f000006a20550019700000000033501cf000000000343013f000000000032041b000000200280021000000017030000290000000003030433000006a203300197000000000323019f000006a202100197000000010420008a0000000605400210000000c00550018f00000002044002700000078b0440009a000000000604041a000000000756022f000000000337013f000007320330019700000000035301cf000000000363013f000000000034041b0000000e030000290000000003030433000000000403043300000000042404360000000000430435000000ff0110018f000000010310020f0000000801200270000007b1011001c7000000000501041a00000000003501700000000004090019000010de0000613d001600000008001d000007aa03300167000000000335016f000000000031041b000000000020043f0000079501000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000120f0000290000000100200190000013820000613d000000000101043b000000000201041a000006c302200197000000000021041b000000010900003900000000040900190000001608000029000010de0000013d00000005010000290000000c0200002900000000002104350000008001200210000007a3011001970000000403000029000000000203041a0000079d02200197000000000112019f000000000013041b0000000603000029000000000103041a0000079d01100197000000150200002900000000020204330000008002200210000007a302200197000000000121019f000000000013041b000000090100002900000000020104330000000a010000290000000001010433000006c003000041000000000403041a0000008005400270000006a20550019700000000051500190000000005250049000000020600002900000000005604350000008005500210000007a3055001970000079d06400197000000000565019f000000000053041b0000000001120019000000400200043d000000a00320003900000000001304350000000501100210000000c0052000390000000001150019000000400010043f00000040012000390000000000310435000000000152043600000000002f04350000006002400270000006a2022001970000001403000029000000000023043500000009020000290000000002020433000000000002004b000011eb0000613d0000000102000029000000600220021000000001022001bf00000000002104350000000801000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000120f0000290000000100200190000013820000613d000000090200002900000000020204330000001503000029000000000b03043300000000022b0049000000000101043b0000000f0300002900000000002304350000008002200210000007a3022001970000000604000029000000000304041a0000079d03300197000000000223019f000000000024041b001300600010021800000014010000290000000007010433000000010c0000390000000003000019000006a2017001970000000100300190000011950000613d0000000f02000029000000000202043300000000002b004b000011e30000613d000000010bb0008a0000000302b002700000001302200029000000000202041a0000000503b00210000000e00330018f000000000332022f000006a202300197000000010420008a0000000605400210000000c00550018f00000002044002700000078b0440009a000000000604041a000000000756022f000007320770019700000000055701cf000000000565013f000000000054041b00000000040f0433000000200540003900000000050504330000000806200210000000000565019f000000000604043300000000055604360000000000540435000000ff0530018f000007ac045002df0000000806200270000007b2076001c7000000000807041a000000000848016f000000000087041b0000000507100210000000e00770018f0000000308100270000007b3088001c7000000000908041a000000000a79022f00000000033a013f000006a20330019700000000037301cf000000000393013f000000000038041b0000000107100039000000010350020f000007b1016001c7000000000501041a000000000035017000000000030c00190000118e0000613d001500000007001d00160000000b001d000000000345016f000000000031041b000000000020043f0000079501000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000120f0000290000000100200190000013820000613d000000000101043b000000000201041a000006c302200197000000000021041b000000010c00003900000000030c0019000000160b00002900000015070000290000118e0000013d000000140200002900000000001204350000006001100210000006c002000041000000000302041a0000073c03300197000000000113019f000000000012041b0000000a010000290000000001010433000000000001004b000012f10000613d0000000301000029000000600110021000000000020f0433000000200220003900000000001204350000000b01000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000120f0000290000000100200190000013820000613d000000000801043b0000000407000029000000000307041a0000006001300270000006a204100198000012300000c13d001500000008001d000006c001000041000000000201041a000006ae03200197000006a2022001970000000102200039000006a204200197001600000004001d000000000334019f000000000031041b00000060012002100000073d01100197000000000207041a0000073c02200197000000000121019f000000000017041b000000000040043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000001604000029000000120f0000290000000100200190000013820000613d000000000101043b000000000201041a000006c3022001970000000b022001af000000000021041b000000000004004b000013820000613d0000000407000029000000000307041a000000150800002900000017010000290000000000410435000006c004000041000000000204041a000000a001200270000007a40110012a0000002002200270000006a202200197000000000012004b000000000200201900000001022021bf00000011050000290000000000250435000000050200002900000000020204330000000a0500002900000000050504330000000005250019000000100600002900000000005604350000079d033001970000008005500210000007a305500197000000000353019f000000000037041b000000010300008a000000000531013f000000ff0550018f00000060068002100000000807100270000007b2077001c7000000000404041a0000004004400270000006a2044001970000000009000019000012900000013d00000014090000290000000009090433000000000994013f000006a200900198000012970000613d0000000509400210000000e00990018f000007b40a400197000000030aa00270000007b30aa001c7000000000a0a041a00000000099a022f0000000104400039000006a204400197000006a209900197000000ff0a90018f000000010aa0020f000000080b900270000007b50bb0009a000000000c0b041a000000000aca019f0000000000ab041b000000030a200270000000000a6a0019000000050b200210000000e00bb0018f000000000c0a041a000000000dbc022f000000000d9d013f000006a20dd00197000000000bbd01cf000000000bcb013f0000000000ba041b000000170a000029000000000a0a0433000006a20aa00197000000200b200210000000000aba019f000000010b90008a000000060cb00210000000c00cc0018f000000020bb002700000078b0bb0009a000000000d0b041a000000000ecd022f000000000aae013f000007320aa00197000000000aca01cf000000000ada013f0000000000ab041b0000000809900210000000000a0f0433000000200ba00039000000000b0b043300000000099b019f000000000b0a043300000000099b043600000000009a0435000000010220003900000001090000390000000100900190000012540000613d00000010090000290000000009090433000000000092004b000012540000c13d000012e50000013d00000011090000290000000009090433000012ba0000013d0000000009c00089000000000c9c016f000007b609c000d1000000f809900270000000fc0990018f000007b70990021f000000f709900270000001e00990018f000000ff0090008c000012dc0000213d000000000d9c0231000000000c000019000007b80cd0c129000000030cc0c210000000f80cc0c18f000000080bb00210000007b90cc0021f000000f80cc00270000000000bcb019f000007ba0bb0009a00000000099b019f0000000000a9004b000000000a000039000000010a004039000000000019004b000000000b000039000000010b0020390000000000ab01a0000000000903c019000000000019004b000000000900201900000001099021bf000000010a900210000000020aa0008a000000050ba00210000000c00bb0018f000000030aa002700000078b0aa0009a000000000a0a041a000000000aba022f000006a200a00198000012de0000613d000000010a9000390000000809a00270000007b50b90009a00000000090b041a000000000939013f000000ff0ca0018f0000000009c9022f000000000cc901d10000129a0000c13d000000010bb0003900000000090b041a000000000939013f00000000007b004b000000000c000039000000010c00203900000000009c01a0000012cd0000613d00000000007b004b000000000c030019000000000c5c222f000000000c9c017000000000090300190000129a0000c13d000012b70000013d000000000c000019000012a90000013d000000010a90003900000000001a004b000000000a002019000000010aa021bf000000110b0000290000000000ab0435000012630000013d000006c001000041000000000201041a000007bb022001970000001103000029000000000303043300000020033002100000073b03300197000000000223019f0000004003400210000007bc03300197000000000232019f000000000021041b0000000e010000290000000001010433000000000001004b000013300000613d00000020011000390000000002010433001700000002001d000000640120008a000006a20010009c000006a2010080410000004001100210000000000202043300000005022002100000008402200039000006a20020009c000006a2020080410000006002200210000000000112019f000006b802000041000000000202041a0000000003000414000006a20030009c000006a203008041000000c003300210000000000131019f000006b7022001971a801a760000040f0000006003100270000006a204300197000000200040008c00000020040080390000001f0540018f0000001703000029000000800330008a000000200640019000000000046300190000131c0000613d000000000701034f0000000008030019000000007907043c0000000008980436000000000048004b000013180000c13d000000000005004b000013290000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f0000000000140435000007aa012001670000000002030433000000010020008c000000010110c1bf0000000100100190000000120f000029000013820000c13d00000000010f0433000000000001004b000013720000613d000006b802000041000000000202041a00000040011000390000000001010433000000200310008a00000020040000390000000000430435000000400410008a001700000004001d000007bd030000410000000000340435000000240310008a000006a20030009c000006a2030080410000004003300210000000000101043300000005011002100000004401100039000006a20010009c000006a2010080410000006001100210000000000131019f0000000003000414000006a20030009c000006a203008041000000c003300210000000000131019f000006b7022001971a801a760000040f00000017090000290000006003100270000006a203300197000000200030008c00000020030080390000001f0430018f000000200530019000000000035900190000135f0000613d000000000601034f0000000007090019000000006806043c0000000007870436000000000037004b0000135b0000c13d000000000004004b0000136c0000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000130435000007aa012001670000000002090433000000010020008c000000010110c1bf0000000100100190000013820000c13d0000000701000029000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000770011001c70000800d020000390000000303000039000007a50400004100000008050000290000000b060000291a801a760000040f0000000100200190000013820000613d000000000001042d000000000100001900001a8200010430000007ae01000041000000000010043f000007460100004100001a8200010430000007a801000041000000000010043f000006ba0100004100001a8200010430000007a701000041000000000010043f000006ba0100004100001a82000104300000075301000041000000000010043f0000004101000039000000040010043f000007540100004100001a8200010430000007a601000041000000000010043f000006ba0100004100001a8200010430000000000001042f000a000000000002000600000005001d000800000003001d000900000002001d000a00000001001d000000400100043d0000001402000039000000000221043600000060034002100000000000320435000007be0010009c000015b00000813d0000004003100039000000400030043f000006a20020009c000006a20200804100000040022002100000000001010433000006a20010009c000006a2010080410000006001100210000000000121019f0000000002000414000006a20020009c000006a202008041000000c002200210000000000112019f000006a6011001c700008010020000391a801a7b0000040f0000000100200190000015ae0000613d000000000101043b0000000902000029000000000002004b000013da0000613d00000005022002100009000a0020002d0000000a02000029000a00000002001d0000000102200367000000000202043b000000000021004b000000000300003900000020030020390000000000130435000000200130015f00000000002104350000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000015ae0000613d000000000101043b0000000a030000290000002003300039000000090030006c0000000002030019000013c20000413d000000080010006c000015b60000c13d0000000601000029000706b70010019c000015ba0000613d000006b801000041000000000101041a000006b700100198000015be0000613d0000000701000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000015ae0000613d000000400400043d000007c00040009c000015b00000213d000000000501043b000000c001400039000000400010043f000000a001400039000300000001001d00000000000104350000008001400039000400000001001d00000000000104350000006001400039000a00000001001d00000000000104350000002001400039000900000001001d00000000000104350000000000040435000000000105041a000006b702100197000000a001100270000007c10110009a000000a003100210000000000223019f000500000005001d000000000025041b000200000004001d0000004002400039000007a40110012a000800000002001d0000000000120435000006c001000041000000000201041a000000a003200270000007c10430009a000006b703200197000100000004001d000000a004400210000000000334019f000000000031041b0000079c0020009c000015c20000813d0000000701000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000015ae0000613d000000000101043b000000000101041a00000775001001980000143d0000c13d0000076a010000410000000000100443000000060100002900000004001004430000000001000414000006a20010009c000006a201008041000000c0011002100000076b011001c700008002020000391a801a7b0000040f0000000100200190000015c60000613d000000000101043b000000000001004b0000159e0000c13d000014410000013d0000005801100270000000020110018f000000000001004b0000159e0000c13d0000000701000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000020f000029000000030e0000290000000100200190000015ae0000613d000000080200002900000000020204330000000503000029000000000303041a0000008003300270000006a207300197000000000272004b0000000002004019000000000501043b000000040100002900000000002104350000159e0000a13d000000400100043d000000a00310003900000000002304350000000502200210000000c0041000390000000002240019000000400020043f00000040021000390000000000320435000000000241043600000000001e0435000000060100002900000060011002100000000000120435000000040100002900000000010104330000008001100210000006c006000041000000000206041a0000000001120019000007a3011001970000079d02200197000000000121019f000000000016041b000000080100002900000000010104330000008001100210000007a3011001970000000504000029000000000204041a0000079d03200197000000000113019f000000000014041b0000006001200270000006a204100198000014aa0000c13d000000000106041a000006ae02100197000006a2011001970000000101100039000006a204100197000400000004001d000000000224019f000000000026041b00000060011002100000073d011001970000000503000029000000000203041a0000073c02200197000000000121019f000000000013041b000000000040043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c70000801002000039000600000007001d000500000005001d1a801a7b0000040f0000000404000029000006c00600004100000005050000290000000607000029000000020f000029000000030e0000290000000100200190000015ae0000613d000000000101043b000000000201041a000006c30220019700000007022001af000000000021041b000000000004004b000015ae0000613d0000000101000029000007a40110012a0000000a020000290000000000420435000000000606041a0000006002600270000006a202200197000000090300002900000000002304350000002002600270000006a202200197000000000012004b000000000200201900000001022021bf00000000002f0435000000010200008a000000000321013f000000ff0330018f00000060045002100000000805100270000007b2055001c70000004006600270000006a2066001970000000008000019000014ff0000013d00000009080000290000000008080433000000000868013f000006a200800198000015060000613d0000000508600210000000e00880018f000007b4096001970000000309900270000007b3099001c7000000000909041a000000000889022f0000000106600039000006a206600197000006a208800197000000ff0980018f000000010990020f000000080a800270000007b50aa0009a000000000b0a041a0000000009b9019f00000000009a041b00000003097002700000000009490019000000050a700210000000e00aa0018f000000000b09041a000000000cab022f000000000c8c013f000006a20cc00197000000000aac01cf000000000aba013f0000000000a9041b0000000a090000290000000009090433000006a209900197000000200a7002100000000009a9019f000000010a80008a000000060ba00210000000c00bb0018f000000020aa002700000078b0aa0009a000000000c0a041a000000000dbc022f00000000099d013f00000732099001970000000009b901cf0000000009c9013f00000000009a041b000000080880021000000000090e0433000000200a900039000000000a0a043300000000088a019f000000000a09043300000000088a04360000000000890435000000010770003900000001080000390000000100800190000014c30000613d00000008080000290000000008080433000000000087004b000014c30000c13d000015520000013d00000000080f0433000015280000013d0000000008b00089000000000b8b016f000007b608b000d1000000f808800270000000fc0880018f000007b70880021f000000f708800270000001e00880018f000000ff0080008c0000154a0000213d000000000c8b0231000000000b000019000007b80bc0c129000000030bb0c210000000f80bb0c18f000000080aa00210000007b90bb0021f000000f80bb00270000000000aba019f000007ba0aa0009a00000000088a019f000000000098004b00000000090000390000000109004039000000000018004b000000000a000039000000010a00203900000000009a01a0000000000802c019000000000018004b000000000800201900000001088021bf0000000109800210000000020990008a000000050a900210000000c00aa0018f00000003099002700000078b0990009a000000000909041a0000000009a9022f000006a2009001980000154c0000613d00000001098000390000000808900270000007b50a80009a00000000080a041a000000000828013f000000ff0b90018f0000000008b8022f000000000bb801d1000015080000c13d000000010aa0003900000000080a041a000000000828013f00000000005a004b000000000b000039000000010b00203900000000008b01a00000153b0000613d00000000005a004b000000000b020019000000000b3b222f000000000b8b01700000000008020019000015080000c13d000015250000013d000000000b000019000015170000013d0000000109800039000000000019004b000000000900201900000001099021bf00000000009f0435000014d20000013d0000004001600210000007bc0110019700000000020f043300000020022002100000073b02200197000000000112019f000006c002000041000000000302041a000007bb03300197000000000131019f000000000012041b000006b801000041000000000201041a00000000010e0433000000400110003900000000010104330000002003000039000000200410008a0000000000340435000007bd03000041000000400410008a000a00000004001d0000000000340435000000240310008a000006a20030009c000006a2030080410000004003300210000000000101043300000005011002100000004401100039000006a20010009c000006a2010080410000006001100210000000000131019f0000000003000414000006a20030009c000006a203008041000000c003300210000000000131019f000006b7022001971a801a760000040f0000000a090000290000006003100270000006a203300197000000200030008c00000020030080390000001f0430018f000000200530019000000000035900190000158a0000613d000000000601034f0000000007090019000000006806043c0000000007870436000000000037004b000015860000c13d000000000004004b000015970000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000001090433000000010010008c00000000010000390000000101006039000000000112016f0000000100100190000015ae0000613d000007a401000041000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000770011001c70000800d020000390000000303000039000007a504000041000000000500001900000007060000291a801a760000040f0000000100200190000015ae0000613d000000000001042d000000000100001900001a82000104300000075301000041000000000010043f0000004101000039000000040010043f000007540100004100001a8200010430000007bf01000041000000000010043f000007460100004100001a8200010430000007a801000041000000000010043f000006ba0100004100001a8200010430000007a701000041000000000010043f000006ba0100004100001a8200010430000007c201000041000000000010043f000006ba0100004100001a8200010430000000000001042f000b000000000002000600000006001d000900000004001d000a00000003001d000b00000002001d000800000001001d000000400100043d0000001402000039000000000221043600000060035002100000000000320435000007be0010009c000017eb0000813d0000004003100039000000400030043f000006a20020009c000006a20200804100000040022002100000000001010433000006a20010009c000006a2010080410000006001100210000000000121019f0000000002000414000006a20020009c000006a202008041000000c002200210000000000112019f000006a6011001c700008010020000391a801a7b0000040f0000000100200190000017e90000613d000000000101043b0000000a02000029000000000002004b000016070000613d0000000502200210000a000b0020002d0000000b02000029000b00000002001d0000000102200367000000000202043b000000000021004b000000000300003900000020030020390000000000130435000000200130015f00000000002104350000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000017e90000613d000000000101043b0000000b0300002900000020033000390000000a0030006c0000000002030019000015ef0000413d000000090010006c000017f10000c13d0000000801000029000007a4021000d1000000000001004b000016100000613d00000000011200d9000007a40010009c000018010000c13d0000000601000029000806b70010019c000017f50000613d000700000002001d000006b801000041000000000101041a000006b700100198000017f90000613d0000000801000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000017e90000613d000000400400043d000007c00040009c000017eb0000213d000000000601043b000000c001400039000000400010043f000000a001400039000300000001001d00000000000104350000008001400039000400000001001d00000000000104350000006001400039000b00000001001d00000000000104350000002001400039000a00000001001d00000000000104350000000000040435000000000106041a000000a0021002700000000702200029000006b701100197000000a003200210000000000113019f000500000006001d000000000016041b000007a40120012a000200000004001d0000004002400039000900000002001d0000000000120435000006c001000041000000000201041a000006b703200197000000a0022002700000000706200029000000a004600210000000000334019f000000000031041b000007c30060009c00000000010000390000000101002039000000070020002a000017fd0000413d000000600260027000000000001201a0000017fd0000c13d000100000006001d0000000801000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000017e90000613d000000000101043b000000000101041a0000077500100198000016780000c13d0000076a010000410000000000100443000000060100002900000004001004430000000001000414000006a20010009c000006a201008041000000c0011002100000076b011001c700008002020000391a801a7b0000040f0000000100200190000018070000613d000000000101043b000000000001004b000017d90000c13d0000167c0000013d0000005801100270000000020110018f000000000001004b000017d90000c13d0000000801000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000020f000029000000030e0000290000000100200190000017e90000613d000000090200002900000000020204330000000503000029000000000303041a0000008003300270000006a207300197000000000272004b0000000002004019000000000501043b00000004010000290000000000210435000017d90000a13d000000400100043d000000a00310003900000000002304350000000502200210000000c0041000390000000002240019000000400020043f00000040021000390000000000320435000000000241043600000000001e0435000000060100002900000060011002100000000000120435000000040100002900000000010104330000008001100210000006c006000041000000000206041a0000000001120019000007a3011001970000079d02200197000000000121019f000000000016041b000000090100002900000000010104330000008001100210000007a3011001970000000504000029000000000204041a0000079d03200197000000000113019f000000000014041b0000006001200270000006a204100198000016e50000c13d000000000106041a000006ae02100197000006a2011001970000000101100039000006a204100197000400000004001d000000000224019f000000000026041b00000060011002100000073d011001970000000503000029000000000203041a0000073c02200197000000000121019f000000000013041b000000000040043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c70000801002000039000600000007001d000500000005001d1a801a7b0000040f0000000404000029000006c00600004100000005050000290000000607000029000000020f000029000000030e0000290000000100200190000017e90000613d000000000101043b000000000201041a000006c30220019700000008022001af000000000021041b000000000004004b000017e90000613d0000000101000029000007a40110012a0000000b020000290000000000420435000000000606041a0000006002600270000006a2022001970000000a0300002900000000002304350000002002600270000006a202200197000000000012004b000000000200201900000001022021bf00000000002f0435000000010200008a000000000321013f000000ff0330018f00000060045002100000000805100270000007b50550009a0000004006600270000006a20660019700000000080000190000173a0000013d0000000a080000290000000008080433000000000868013f000006a200800198000017410000613d0000000508600210000000e00880018f000007b4096001970000000309900270000007b3099001c7000000000909041a000000000889022f0000000106600039000006a206600197000006a208800197000000ff0980018f000000010990020f000000080a800270000007b50aa0009a000000000b0a041a0000000009b9019f00000000009a041b00000003097002700000000009490019000000050a700210000000e00aa0018f000000000b09041a000000000cab022f000000000c8c013f000006a20cc00197000000000aac01cf000000000aba013f0000000000a9041b0000000b090000290000000009090433000006a209900197000000200a7002100000000009a9019f000000010a80008a000000060ba00210000000c00bb0018f000000020aa002700000078b0aa0009a000000000c0a041a000000000dbc022f00000000099d013f00000732099001970000000009b901cf0000000009c9013f00000000009a041b000000080880021000000000090e0433000000200a900039000000000a0a043300000000088a019f000000000a09043300000000088a04360000000000890435000000010770003900000001080000390000000100800190000016fe0000613d00000009080000290000000008080433000000000087004b000016fe0000c13d0000178d0000013d00000000080f0433000017630000013d0000000008b00089000000000b8b016f000007b608b000d1000000f808800270000000fc0880018f000007b70880021f000000f708800270000001e00880018f000000ff0080008c000017850000213d000000000c8b0231000000000b000019000007b80bc0c129000000030bb0c210000000f80bb0c18f000000080aa00210000007b90bb0021f000000f80bb00270000000000aba019f000007ba0aa0009a00000000088a019f000000000098004b00000000090000390000000109004039000000000018004b000000000a000039000000010a00203900000000009a01a0000000000802c019000000000018004b000000000800201900000001088021bf0000000109800210000000020990008a000000050a900210000000c00aa0018f00000003099002700000078b0990009a000000000909041a0000000009a9022f000006a200900198000017870000613d00000001098000390000000808900270000007b50a80009a00000000080a041a000000000828013f000000ff0b90018f0000000008b8022f000000000bb801d1000017430000c13d000000010aa0003900000000080a041a000000000828013f00000000005a004b000000000b000039000000010b00203900000000008b01a0000017760000613d00000000005a004b000000000b020019000000000b3b222f000000000b8b01700000000008020019000017430000c13d000017600000013d000000000b000019000017520000013d0000000109800039000000000019004b000000000900201900000001099021bf00000000009f04350000170d0000013d0000004001600210000007bc0110019700000000020f043300000020022002100000073b02200197000000000112019f000006c002000041000000000302041a000007bb03300197000000000131019f000000000012041b000006b801000041000000000201041a00000000010e0433000000400110003900000000010104330000002003000039000000200410008a0000000000340435000007bd03000041000000400410008a000b00000004001d0000000000340435000000240310008a000006a20030009c000006a2030080410000004003300210000000000101043300000005011002100000004401100039000006a20010009c000006a2010080410000006001100210000000000131019f0000000003000414000006a20030009c000006a203008041000000c003300210000000000131019f000006b7022001971a801a760000040f0000000b090000290000006003100270000006a203300197000000200030008c00000020030080390000001f0430018f00000020053001900000000003590019000017c50000613d000000000601034f0000000007090019000000006806043c0000000007870436000000000037004b000017c10000c13d000000000004004b000017d20000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000001090433000000010010008c00000000010000390000000101006039000000000112016f0000000100100190000017e90000613d0000000701000029000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000770011001c70000800d020000390000000303000039000007a504000041000000000500001900000008060000291a801a760000040f0000000100200190000017e90000613d000000000001042d000000000100001900001a82000104300000075301000041000000000010043f0000004101000039000000040010043f000007540100004100001a8200010430000007bf01000041000000000010043f000007460100004100001a8200010430000007a801000041000000000010043f000006ba0100004100001a8200010430000007a701000041000000000010043f000006ba0100004100001a8200010430000007c201000041000000000010043f000006ba0100004100001a82000104300000075301000041000000000010043f0000001101000039000000040010043f000007540100004100001a8200010430000000000001042f0001000000000002000006a502000041000000000502041a0000000002000414000006b706100197000006a20020009c000006a202008041000000c001200210000006a6011001c70000800d020000390000000303000039000006a704000041000100000006001d1a801a760000040f00000001002001900000181c0000613d000006a5010000410000000102000029000000000021041b000000000001042d000000000100001900001a8200010430000b000000000002000700000002001d000600000001001d000806b70010019c000019fa0000613d000006b801000041000000000101041a000006b700100198000019fe0000613d0000000801000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000019f80000613d000000400400043d000007c40040009c00001a020000813d000000000601043b000000c001400039000000400010043f000000a001400039000300000001001d00000000000104350000008001400039000400000001001d00000000000104350000006001400039000b00000001001d00000000000104350000002001400039000a00000001001d00000000000104350000000000040435000000000106041a000000a0021002700000000702200029000006b701100197000000a003200210000000000113019f000500000006001d000000000016041b000007a40120012a000200000004001d0000004002400039000900000002001d0000000000120435000006c001000041000000000201041a000006b703200197000000a0022002700000000706200029000000a004600210000000000334019f000000000031041b000007c30060009c00000000010000390000000101002039000000070020002a00001a080000413d000000600260027000000000001201a000001a080000c13d000100000006001d0000000801000029000000000010043f0000073701000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f0000000100200190000019f80000613d000000000101043b000000000101041a0000077500100198000018870000c13d0000076a010000410000000000100443000000060100002900000004001004430000000001000414000006a20010009c000006a201008041000000c0011002100000076b011001c700008002020000391a801a7b0000040f000000010020019000001a0c0000613d000000000101043b000000000001004b000019e80000c13d0000188b0000013d0000005801100270000000020110018f000000000001004b000019e80000c13d0000000801000029000000000010043f0000075a01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000020f000029000000030e0000290000000100200190000019f80000613d000000090200002900000000020204330000000503000029000000000303041a0000008003300270000006a207300197000000000272004b0000000002004019000000000501043b00000004010000290000000000210435000019e80000a13d000000400100043d000000a00310003900000000002304350000000502200210000000c0041000390000000002240019000000400020043f00000040021000390000000000320435000000000241043600000000001e0435000000060100002900000060011002100000000000120435000000040100002900000000010104330000008001100210000006c006000041000000000206041a0000000001120019000007a3011001970000079d02200197000000000121019f000000000016041b000000090100002900000000010104330000008001100210000007a3011001970000000504000029000000000204041a0000079d03200197000000000113019f000000000014041b0000006001200270000006a204100198000018f40000c13d000000000106041a000006ae02100197000006a2011001970000000101100039000006a204100197000400000004001d000000000224019f000000000026041b00000060011002100000073d011001970000000503000029000000000203041a0000073c02200197000000000121019f000000000013041b000000000040043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c70000801002000039000600000007001d000500000005001d1a801a7b0000040f0000000404000029000006c00600004100000005050000290000000607000029000000020f000029000000030e0000290000000100200190000019f80000613d000000000101043b000000000201041a000006c30220019700000008022001af000000000021041b000000000004004b000019f80000613d0000000101000029000007a40110012a0000000b020000290000000000420435000000000206041a0000006003200270000006a2033001970000000a0400002900000000003404350000002003200270000006a203300197000000000013004b000000000300201900000001033021bf00000000003f0435000000010300008a000000000431013f000000ff0440018f00000060055002100000000806100270000007b50660009a0000004002200270000006a2022001970000000008000019000019490000013d0000000a080000290000000008080433000000000882013f000006a200800198000019500000613d0000000508200210000000e00880018f000007b4092001970000000309900270000007b3099001c7000000000909041a000000000889022f0000000102200039000006a202200197000006a208800197000000ff0980018f000000010990020f000000080a800270000007b50aa0009a000000000b0a041a0000000009b9019f00000000009a041b00000003097002700000000009590019000000050a700210000000e00aa0018f000000000b09041a000000000cab022f000000000c8c013f000006a20cc00197000000000aac01cf000000000aba013f0000000000a9041b0000000b090000290000000009090433000006a209900197000000200a7002100000000009a9019f000000010a80008a000000060ba00210000000c00bb0018f000000020aa002700000078b0aa0009a000000000c0a041a000000000dbc022f00000000099d013f00000732099001970000000009b901cf0000000009c9013f00000000009a041b000000080880021000000000090e0433000000200a900039000000000a0a043300000000088a019f000000000a09043300000000088a043600000000008904350000000107700039000000010800003900000001008001900000190d0000613d00000009080000290000000008080433000000000087004b0000190d0000c13d0000199c0000013d00000000080f0433000019720000013d0000000008b00089000000000b8b016f000007b608b000d1000000f808800270000000fc0880018f000007b70880021f000000f708800270000001e00880018f000000ff0080008c000019940000213d000000000c8b0231000000000b000019000007b80bc0c129000000030bb0c210000000f80bb0c18f000000080aa00210000007b90bb0021f000000f80bb00270000000000aba019f000007ba0aa0009a00000000088a019f000000000098004b00000000090000390000000109004039000000000018004b000000000a000039000000010a00203900000000009a01a0000000000803c019000000000018004b000000000800201900000001088021bf0000000109800210000000020990008a000000050a900210000000c00aa0018f00000003099002700000078b0990009a000000000909041a0000000009a9022f000006a200900198000019960000613d00000001098000390000000808900270000007b50a80009a00000000080a041a000000000838013f000000ff0b90018f0000000008b8022f000000000bb801d1000019520000c13d000000010aa0003900000000080a041a000000000838013f00000000006a004b000000000b000039000000010b00203900000000008b01a0000019850000613d00000000006a004b000000000b030019000000000b4b222f000000000b8b01700000000008030019000019520000c13d0000196f0000013d000000000b000019000019610000013d0000000109800039000000000019004b000000000900201900000001099021bf00000000009f04350000191c0000013d000006c001000041000000000301041a000007bb0330019700000000040f043300000020044002100000073b04400197000000000343019f0000004002200210000007bc02200197000000000223019f000000000021041b000006b801000041000000000201041a00000000010e0433000000400110003900000000010104330000002003000039000000200410008a0000000000340435000007bd03000041000000400410008a000b00000004001d0000000000340435000000240310008a000006a20030009c000006a2030080410000004003300210000000000101043300000005011002100000004401100039000006a20010009c000006a2010080410000006001100210000000000131019f0000000003000414000006a20030009c000006a203008041000000c003300210000000000131019f000006b7022001971a801a760000040f0000000b090000290000006003100270000006a203300197000000200030008c00000020030080390000001f0430018f00000020053001900000000003590019000019d40000613d000000000601034f0000000007090019000000006806043c0000000007870436000000000037004b000019d00000c13d000000000004004b000019e10000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000001090433000000010010008c00000000010000390000000101006039000000000112016f0000000100100190000019f80000613d0000000701000029000000000010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000770011001c70000800d020000390000000303000039000007a504000041000000000500001900000008060000291a801a760000040f0000000100200190000019f80000613d000000000001042d000000000100001900001a8200010430000007a801000041000000000010043f000006ba0100004100001a8200010430000007a701000041000000000010043f000006ba0100004100001a82000104300000075301000041000000000010043f0000004101000039000000040010043f000007540100004100001a8200010430000007c201000041000000000010043f000006ba0100004100001a8200010430000000000001042f0000000102100210000000020220008a000000020300008a000006c20010009c00000000020380190000000501200210000000c00110018f00000003022002700000078b0220009a000000000202041a000000000112022f000006a201100197000000000010043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000001a290000613d000000000101043b000000000101041a000006b701100197000000000001042d000000000100001900001a820001043000010000000000020000000102100210000000020320008a000000020200008a000100000001001d000006c20010009c00000000030280190000000502300210000000c00220018f00000003013002700000078b0110009a000000000101041a000000000121022f000006a201100197000000000010043f0000078c01000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000001a5a0000613d000000000101043b000000000101041a000006b70010019800001a5c0000613d0000000101000029000000000010043f0000079501000041000000200010043f0000000001000414000006a20010009c000006a201008041000000c00110021000000738011001c700008010020000391a801a7b0000040f000000010020019000001a5a0000613d000000000101043b000000000101041a000006b701100197000000000001042d000000000100001900001a82000104300000079a01000041000000000010043f000006ba0100004100001a8200010430000000000001042f000006a20010009c000006a2010080410000004001100210000006a20020009c000006a2020080410000006002200210000000000112019f0000000002000414000006a20020009c000006a202008041000000c002200210000000000112019f000006a6011001c700008010020000391a801a7b0000040f000000010020019000001a740000613d000000000101043b000000000001042d000000000100001900001a820001043000001a79002104210000000102000039000000000001042d0000000002000019000000000001042d00001a7e002104230000000102000039000000000001042d0000000002000019000000000001042d00001a800000043200001a810001042e00001a820001043000000000000000000100022b8090ded1d34eae01d54ad95ea5477f71b1c1cefc776bd9ecbe6e73d700000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392702000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563d6f21326ab749d5729fcba5677c79037b459436ab7bff709c9d06ce9f10c1a9d424541524953480000000000000000000000000000000000000000000000000eb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf64ef1d2ad89edf8c4d91132028e8195cdf30bb4b5053d4f8cd260341d4805f30a4255525200000000000000000000000000000000000000000000000000000008ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000c3663566a580000000000000c3663566a58000ffff0000000000000000ff00ff000000ffffffff0000000000000000000000000000000006db00000002000000000000000000000000000000c3663566a580000000000000000000000000000000000000000000000000000000000067991b20000000000000000000000000000000000000000000000000ffffffffffffff7b9c4d535bdea7cd8a978f128b93471df48c7dbab89d703809115bdc118c235bfd02000000000000000000000000000000000000a4000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000a20d6e21d0e525530900000000000000000000000000000000000000000000000000000000ead4d2e400000000000000000000000000000000000000040000001c0000000000000000000000000000000000000000000000000000000000000000000000000f4599e500000000000000000000000000000000000000240000001c000000000000000000000000000000000000000000000000000000000000000000000000d125259c0000000000000000000000000000000000000000000000008da5cb5b6cef16e600000000000000000000000000000000000000040000001800000000000000000000000000000000000000000000000000000000000000a20d6e21d0e5255308ffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff0000000000000000000000000000000000000000000000000000000100000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000002000000000000000000000000000000400000010000000000000000000000000000000000000000000000000000000000000000000000000039a84a7b0000000000000000000000000000000000000000000000000000000064f6e00a00000000000000000000000000000000000000000000000000000000a945bf7f00000000000000000000000000000000000000000000000000000000ed9ec88700000000000000000000000000000000000000000000000000000000f2fde38a00000000000000000000000000000000000000000000000000000000f8a7f8f600000000000000000000000000000000000000000000000000000000f8a7f8f700000000000000000000000000000000000000000000000000000000fa79014100000000000000000000000000000000000000000000000000000000fee81cf400000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000f490648200000000000000000000000000000000000000000000000000000000f04e283d00000000000000000000000000000000000000000000000000000000f04e283e00000000000000000000000000000000000000000000000000000000f0503e8000000000000000000000000000000000000000000000000000000000ed9ec88800000000000000000000000000000000000000000000000000000000ee03427d00000000000000000000000000000000000000000000000000000000c571de5e00000000000000000000000000000000000000000000000000000000e81e1c8200000000000000000000000000000000000000000000000000000000e81e1c8300000000000000000000000000000000000000000000000000000000ec0d755700000000000000000000000000000000000000000000000000000000c571de5f00000000000000000000000000000000000000000000000000000000dd62ed3e00000000000000000000000000000000000000000000000000000000b9d7d51000000000000000000000000000000000000000000000000000000000b9d7d51100000000000000000000000000000000000000000000000000000000bc63f02e00000000000000000000000000000000000000000000000000000000a945bf8000000000000000000000000000000000000000000000000000000000b8f7a665000000000000000000000000000000000000000000000000000000008ada6b0e0000000000000000000000000000000000000000000000000000000095d89b4000000000000000000000000000000000000000000000000000000000a2309ff700000000000000000000000000000000000000000000000000000000a2309ff800000000000000000000000000000000000000000000000000000000a488d91500000000000000000000000000000000000000000000000000000000a9059cbb0000000000000000000000000000000000000000000000000000000095d89b4100000000000000000000000000000000000000000000000000000000a0712d68000000000000000000000000000000000000000000000000000000008e0acd11000000000000000000000000000000000000000000000000000000008e0acd120000000000000000000000000000000000000000000000000000000090967a52000000000000000000000000000000000000000000000000000000008ada6b0f000000000000000000000000000000000000000000000000000000008da5cb5b0000000000000000000000000000000000000000000000000000000073ec4512000000000000000000000000000000000000000000000000000000007b9e1d5c000000000000000000000000000000000000000000000000000000007b9e1d5d000000000000000000000000000000000000000000000000000000007d2b00f90000000000000000000000000000000000000000000000000000000073ec4513000000000000000000000000000000000000000000000000000000007a8b39a10000000000000000000000000000000000000000000000000000000070a082300000000000000000000000000000000000000000000000000000000070a0823100000000000000000000000000000000000000000000000000000000715018a60000000000000000000000000000000000000000000000000000000064f6e00b000000000000000000000000000000000000000000000000000000006e6e39f300000000000000000000000000000000000000000000000000000000396248b80000000000000000000000000000000000000000000000000000000054d1f13c000000000000000000000000000000000000000000000000000000005a3f2671000000000000000000000000000000000000000000000000000000005d148e5b000000000000000000000000000000000000000000000000000000005d148e5c000000000000000000000000000000000000000000000000000000005e5f3ce4000000000000000000000000000000000000000000000000000000006338cb8a000000000000000000000000000000000000000000000000000000005a3f2672000000000000000000000000000000000000000000000000000000005a4462150000000000000000000000000000000000000000000000000000000056d3163c0000000000000000000000000000000000000000000000000000000056d3163d0000000000000000000000000000000000000000000000000000000059125e9b0000000000000000000000000000000000000000000000000000000054d1f13d0000000000000000000000000000000000000000000000000000000055f804b3000000000000000000000000000000000000000000000000000000004ef41efb00000000000000000000000000000000000000000000000000000000537924ee00000000000000000000000000000000000000000000000000000000537924ef0000000000000000000000000000000000000000000000000000000053df5c7c000000000000000000000000000000000000000000000000000000004ef41efc0000000000000000000000000000000000000000000000000000000052b8097d0000000000000000000000000000000000000000000000000000000044d19d2a0000000000000000000000000000000000000000000000000000000044d19d2b00000000000000000000000000000000000000000000000000000000453c231000000000000000000000000000000000000000000000000000000000396248b9000000000000000000000000000000000000000000000000000000003ccfd60b000000000000000000000000000000000000000000000000000000001b287051000000000000000000000000000000000000000000000000000000002a6a935c00000000000000000000000000000000000000000000000000000000313ce56600000000000000000000000000000000000000000000000000000000313ce5670000000000000000000000000000000000000000000000000000000032cb6b0c000000000000000000000000000000000000000000000000000000002a6a935d000000000000000000000000000000000000000000000000000000003006b5430000000000000000000000000000000000000000000000000000000025692961000000000000000000000000000000000000000000000000000000002569296200000000000000000000000000000000000000000000000000000000274e430b000000000000000000000000000000000000000000000000000000001b2870520000000000000000000000000000000000000000000000000000000023b872dd000000000000000000000000000000000000000000000000000000000f83fee00000000000000000000000000000000000000000000000000000000018160ddc0000000000000000000000000000000000000000000000000000000018160ddd000000000000000000000000000000000000000000000000000000001822c15a000000000000000000000000000000000000000000000000000000000f83fee100000000000000000000000000000000000000000000000000000000180434a30000000000000000000000000000000000000000000000000000000006fdde020000000000000000000000000000000000000000000000000000000006fdde0300000000000000000000000000000000000000000000000000000000095ea7b30000000000000000000000000000000000000000000000000000000004967dfc0000000000000000000000000000000000000000000000000000000006f47a1300000000000000000000000000000000000000000000000000000000389a75e100000000000000000000000000000000000000200000008000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000ffffffffffffffffffffffff000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000007448fbae02000000000000000000000000000000000000200000000c0000000000000000796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d955391320200000200000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000006f5e8818000000000000000000000000000000000000000000000000ffffffffffffffff000000000000000000000000000000ff000000000000000000000000000000005989265700000000000000000000000000000000000000000000000000000000c10dcfe266c1f71ef476efbd3223555750dc271e4115626b000000000000000000000000000000000000000000000000000000440000008000000000000000000000000000000000000000000000000000000000000000a20d6e21d0e52553130200000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000ffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff00000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000ffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff00000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000225e31d15943971f47ad3022f714fa00000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000a20d6e21d0e525530f0200000000000000000000000000000000000048000000000000000000000000201dc6f50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000001000000000000000000000000000000000000000000ffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000697997cf0000000000000000000000ff0000000000000000000000000000000000000000ffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff00000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000ff000000000000000000000000000000000093b8e3e5000000000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000ffff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffff13b8d87700000000000000000000000000000000000000000000000000000000d330f985000000000000000000000000000000000000000000000000000000004e487b71000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000ffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffff000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000ff000000000000000000000000000000000000000000000000000000000000ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003fffffffe00000000000000000000000000000000000000000000000a20d6e21d0e525531000000000000000000000000000000000000000440000000000000000000000009ccd6d760000000000000000000000000000000000000000000000000000000035a66b2c000000000000000000000000000000000000000000000000000000000f2e5b6c00000000000000000000000000000000000000000000000000000000bfa87805ed57dc1f0d489ce33be4c4577d74ccde357eeeee058a32c55c44a532405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acefa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92ffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff0000000000000000000000000001000000000000000000000000000000000000ddefae280000000000000000000000000000000000000000000000000000000000bfc92100000000000000000000000000000000000000000000000000000000d05cb60900000000000000000000000000000000000000000000000000000000415d063e00000000000000000000000000000000000000000000000000000000baf13b3f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082b429001806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b8302000002000000000000000000000000000000240000000000000000000000009cc7f708afc65944829bd487b90b72536b1951864fbfc14e125fc972a6507f3900000000000000000000000000000000000000000000000000000000b12d13eb000000000000ffffffff00000000000000000000000000000000000000000000ffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffff0200000000000000000000000000000000000020000000000000000000000000b5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039300000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000fe0000000000000000000000ffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffff0000000000000000000000000000000000000000010000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd5d00dbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d0000000000000000000000000000000000000000000000000000000013be252b00000000000000000000ff000000000000000000000000000000000000000000ffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffff00000000000000000000000000000100000000000000000000000000000000008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92500000000000000000000000000000000000000000000000000000000cb30b45f00000000000000000000000000000000000000000000000000000000e5eb36c700000000000000000000000000000000000000000000000000000000f6916ddd00000000000000000000000000000000000000000000000000000000f5b100ea00000000000000000000000000000000000000000000000000000000e5eb36c800000000000000000000000000000000000000000000000000000000cb30b46000000000000000000000000000000000000000000000000000000000d10b6e0c00000000000000000000000000000000000000000000000000000000e2c792810000000000000000000000000000000000000000000000000000000062fb246c0000000000000000000000000000000000000000000000000000000062fb246d00000000000000000000000000000000000000000000000000000000b7a94eb800000000000000000000000000000000000000000000000000000000c016aa520000000000000000000000000000000000000000000000000000000027ef5495000000000000000000000000000000000000000000000000000000002d8a746effffffffffffffffffffff5df291de2f1adaacee0000000000000000000000000000000000000000000000000000000000000000000000a20d6e21d0e525530a92cb829d00000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000079822ce20000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3000000000000000000000000000000000000000000000000000000000000000ceea21b6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a20d6e21d0e525530b00000000000000000000000000000000000000000000000000000000cfb3b9420000000000000000000000000000000000000000000000a20d6e21d0e525530cffffffffffffffffffffff5df291de2f1adaacf300000000000000000000000000000000000000000000000000000000000000000000000000000000ce5a776b00000000000000000000000000000000000000000000000000000000a11481000000000000000000000000000000000000000000000000000000000059c896be00000000000000000000000000000000000000000000000000000000ceea21b60000021e27c1806e59a400000000000000000000000000000000000000000000fffffde1d83e7f91a65c00000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000011fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000001fffffff00000000000000000000000000000000000000000000000000000001fffffffeffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000021e27c1806e59a40000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef00000000000000000000000000000000000000000000000000000000f4d678b80000000000000000000000000000000000000000000000000000000040739bf000000000000000000000000000000000000000000000000000000000ea553b34000000000000000000000000000000000000000000000000000000003c10b94effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00133255cc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffffe8000000000000000000000000000000000000000000000000000000000144027d30000000000000000000000a20d6e21d0e525530d0000000000000000000000000000000000000000000000a20d6e21d0e525530e0000000000000000000000000000000000000000000000a20d6e21d0e525531100000000000000000000000000000000000000000000000000000000000000000000000000000000fffffff8ffffffffffffffffffffff5df291de2f1adaacf2000000000000000000000000000000002aaaaaaaba69a69a6db6db6db2cb2cb2ce739ce73def7bdeffffffff00000000001412563212c14164235266736f7425221143267a4524367526767700000000000000000000000000000000000000000000000000000000d76453e0001f0d1e100c1d070f090b19131c1706010e11080a1a141802121b150316040500000000000000000000a20d6e21d0e525530e00000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff0000000000000000000000000000000000000000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000263c69d6000000000000000000000000000000000000000000000000ffffffffffffffc009bde33900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff3ffffffffffffffffffffffffffffffffffffffffffffffde1d83e7f91a65c000000000000000000000000000000000000000000000000000000000000e5cfe957000000000000000000000000000000000000021e27c17e5031e27f91a65bffff000000000000000000000000000000000000000000000000ffffffffffffff400000000000000000000000000000000000000000000000000000000000000000b6b9f6c07f8752f10bf5537d06f2250048de9daa4e815d4aeef6a69694084d01

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

db091fdcc3d3a885ebbbc283175a787c6d1cb5327dbeb07821a26cc954eab30d3fd1bbf5b45987ed09c22d7aed1d392a698611cb336c22c7be1419557523b8a0

-----Decoded View---------------
Arg [0] : allowlistRoot_ (bytes32): 0xdb091fdcc3d3a885ebbbc283175a787c6d1cb5327dbeb07821a26cc954eab30d
Arg [1] : fcfsRoot_ (bytes32): 0x3fd1bbf5b45987ed09c22d7aed1d392a698611cb336c22c7be1419557523b8a0

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : db091fdcc3d3a885ebbbc283175a787c6d1cb5327dbeb07821a26cc954eab30d
Arg [1] : 3fd1bbf5b45987ed09c22d7aed1d392a698611cb336c22c7be1419557523b8a0


Block Transaction 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
[ 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.